stylish-haskell
stylish-haskell copied to clipboard
Parse error with TypeFamilyDependencies
Given the following module using TypeFamilyDependencies
21:21 $ cat src/Bug.hs
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module Bug where
type family F a = b | b -> a where
F A = B
data A = A
data B = B
GHC compiles just fine
✔ /tmp/stylish
21:21 $ stack exec ghc src/Bug.hs
[1 of 1] Compiling Bug ( src/Bug.hs, src/Bug.o )
but stylish-haskell complains
✔ /tmp/stylish
21:21 $ stack exec stylish-haskell src/Bug.hs
Language.Haskell.Stylish.Parse.parseModule: could not parse src/Bug.hs: ParseFailed (SrcLoc "<unknown>.hs" 6 17) "Parse error: ="
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module Bug where
type family F a = b | b -> a where
F A = B
data A = A
data B = B