cdepillabout / pretty-simple

pretty-printer for Haskell data types that have a Show instance
https://hackage.haskell.org/package/pretty-simple
BSD 3-Clause "New" or "Revised" License
243 stars 29 forks source link

Parsing data constructors with quotes #63

Closed georgefst closed 4 years ago

georgefst commented 4 years ago
data Tree' a = Leaf' a | Node' (Tree' a) (Tree' a) deriving Show

t1 :: Tree' Int
t1 = Node' (Leaf' 1) (Leaf' 2)

pPrint t1 produces Node' (Leaf' 1, with the colouring also messed up.

This is rather a shame, as using T' for a structure similar to T is a pretty common haskell idiom.

cdepillabout commented 4 years ago

@georgefst Thanks for creating this issue.

I'd be happy to merge in a PR fixing this if you wanted to take a shot at it.

Or, if you wanted to run a git bisect and figure out where this was introduced, it might help someone else figure out how this can be fixed.

Without actually looking into it at all, my guess is that this was introduced by https://github.com/cdepillabout/pretty-simple/pull/57. (ping @sjakobi just in case)

georgefst commented 4 years ago

Just checked and it works correctly with the 3.1.1.0 release, so that looks very likely.

I may look into this on the weekend, but I've got quite a backlog at the moment.