tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

ASTs differ when type family result is declared using `=` #420

Closed alexpeits closed 5 years ago

alexpeits commented 5 years ago

Ormolu can format this:

{-# LANGUAGE TypeFamilies #-}
type family TF a b :: result where
  TF a b = Int

but not this:

{-# LANGUAGE TypeFamilies #-}
type family TF a b = result where
  TF a b = Int

Both are accepted by ghc (e.g. loading them in ghci). The syntax doesn't make a difference but it's required for usage with TypeFamilyDependencies.

Command run: ormolu -d <filename>

Output:

warnings:

parse result:
  comment stream:

AST of input and AST of formatted code differ.
  at TF.hs:2:20-27
Please, consider reporting the bug.
mrkkrp commented 5 years ago

This is now fixed.

alexpeits commented 5 years ago

That was quick, thanks!