Skip to content

Code formatter for Haskell extending hindent & stylish-haskell

License

Notifications You must be signed in to change notification settings

miloszwasacz/haskell-formatter

Repository files navigation

Haskell formatter

VS Code formatter for Haskell extending hindent & stylish-haskell.

Requirements

This extension depends on hindent & stylish-haskell that you can install via stack:

stack install hindent
stack install stylish-haskell

or cabal:

cabal install hindent
cabal install stylish-haskell

Known Issues

Misidentifying = in guards

Example:

foo :: String -> String -> Double
foo a b
  | c == "Foo = 3" = 3.0
  | c == "BarBaz = 2" = 2.0
  where
    c = a ++ b

Workaround:

foo' :: String -> String -> Double
foo' a b
  | c == "Foo " ++ "=" ++ " 3" = 3.0
  | c == "BarBaz " ++ "=" ++ " 2" = 2.0
  where
    c = a ++ b

Release Notes

For detailed change list see CHANGELOG.

1.0.1

Minor bug fixes.

1.0.0

Initial release of Haskell Formatter.


Inspiration

This extension is based on stylish-hindent extension.