stylish-haskell-0.14.4.0: Haskell code prettifier
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Haskell.Stylish.Step.Imports

Synopsis

Documentation

data ImportAlign Source #

Constructors

Global 
File 
Group 
None 

data GroupRule Source #

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 

Fields

  • match :: Pattern

    The pattern that determines whether a rule applies to a module name.

  • subGroup :: Maybe Pattern

    An optional pattern for breaking the group up into smaller sub-groups.

parsePattern :: String -> Either String Pattern Source #

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 Source #

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