| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Haskell.Stylish.Step.Imports
Synopsis
- data Options = Options {}
- defaultOptions :: Options
- data ImportAlign
- data ListAlign
- data LongListAlign
- data EmptyListAlign
- data ListPadding
- data GroupRule = GroupRule {}
- step :: Maybe Int -> Options -> Step
- printImport :: Bool -> IE GhcPs -> P ()
- parsePattern :: String -> Either String Pattern
- unsafeParsePattern :: String -> Pattern
Documentation
Constructors
| Options | |
Fields
| |
data ImportAlign #
Instances
| Show ImportAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods showsPrec :: Int -> ImportAlign -> ShowS # show :: ImportAlign -> String # showList :: [ImportAlign] -> ShowS # | |
| Eq ImportAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports | |
Constructors
| NewLine | |
| WithModuleName | |
| WithAlias | |
| AfterAlias | |
| Repeat |
data LongListAlign #
Constructors
| Inline | |
| InlineWithBreak | |
| InlineToMultiline | |
| Multiline |
Instances
| Show LongListAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods showsPrec :: Int -> LongListAlign -> ShowS # show :: LongListAlign -> String # showList :: [LongListAlign] -> ShowS # | |
| Eq LongListAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods (==) :: LongListAlign -> LongListAlign -> Bool # (/=) :: LongListAlign -> LongListAlign -> Bool # | |
data EmptyListAlign #
Constructors
| Inherit | |
| RightAfter |
Instances
| Show EmptyListAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods showsPrec :: Int -> EmptyListAlign -> ShowS # show :: EmptyListAlign -> String # showList :: [EmptyListAlign] -> ShowS # | |
| Eq EmptyListAlign # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods (==) :: EmptyListAlign -> EmptyListAlign -> Bool # (/=) :: EmptyListAlign -> EmptyListAlign -> Bool # | |
data ListPadding #
Constructors
| LPConstant Int | |
| LPModuleName |
Instances
| Show ListPadding # | |
Defined in Language.Haskell.Stylish.Step.Imports Methods showsPrec :: Int -> ListPadding -> ShowS # show :: ListPadding -> String # showList :: [ListPadding] -> ShowS # | |
| Eq ListPadding # | |
Defined in Language.Haskell.Stylish.Step.Imports | |
A rule for grouping imports that specifies which module names belong in a group and (optionally) how to break them up into sub-groups.
See the documentation for the group_rules setting in data/stylish-haskell.yaml for more details.
Constructors
| GroupRule | |
parsePattern :: String -> Either String Pattern #
Parse a string into a compiled regular expression (Pattern).
Returns a human-readable parse error message if the string is not valid regex syntax.
>>>parsePattern "^([^.]+)"Right "^([^.]+)"
>>>parsePattern "("Left "\"(\" (line 1, column 2):\nunexpected end of input\nexpecting empty () or anchor ^ or $ or an atom"
unsafeParsePattern :: String -> Pattern #
Parse a string into a regular expression, raising a runtime exception if the string is not valid regex syntax.
>>>unsafeParsePattern "^([^.]+)""^([^.]+)"
>>>unsafeParsePattern "(""*** Exception: "(" (line 1, column 2): unexpected end of input expecting empty () or anchor ^ or $ or an atom