lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
690 stars 72 forks source link

Support pattern synonyms #199

Closed mkaput closed 4 years ago

mkaput commented 5 years ago

As of 9d91523 Brittany crashes on pattern synonyms:

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}

module Main where

pattern Foo pk <- (Just pk)
tomjaguarpaw commented 5 years ago

I would like this too, please!

asheshambasta commented 5 years ago

I might be doing something really wrong; but it seems to me that is also removes pattern in import statements:

import           Data.Types                     ( PairData'(..)
                                                , pattern OnlineP
                                                )

Becomes:

import           Data.Types                     ( PairData'(..)
                                                , OnlineP
                                                )

Which is invalid. Adding --brittany-disable-next-binding anywhere before this import statement makes no difference.

tfausak commented 5 years ago

The pattern import thing has been fixed. See #204.

As for the original issue, this is enough to trigger the problem:

{-# LANGUAGE PatternSynonyms #-}
pattern Foo pk <- (Just pk)
runarorama commented 4 years ago

Any hints on where to look if I wanted to take a stab at fixing this issue?

andys8 commented 4 years ago

This fix was merged in march, but there was no release since then. Is there a plann to do a release @lspitzner ? :)