haskell / haskell/stylish-haskell

Parse error with TypeFamilyDependencies

Open
#188 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
1k
Forks
153
PR merge metrics
No merged PRs in 30d

Description

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 ".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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.