Re: Pattern synonyms and GADTs in GHC 8.0.1

2016-05-26 Thread Emil Axelsson
Aha, that's because `:t` operates on expressions, and when a pattern synonym is used as an expression the required and provided contexts are merged into one. Makes sense. / Emil Den 2016-05-26 kl. 20:59, skrev Emil Axelsson: However, it seems that `:t` gives the wrong type: *Main> :t AddP

Re: Pattern synonyms and GADTs in GHC 8.0.1

2016-05-26 Thread Emil Axelsson
Ah, excellent! Thank you! However, it seems that `:t` gives the wrong type: *Main> :t AddP AddP :: (Num a, Eq a) => Exp a -> Exp a -> Exp a This type is reported whether or not I include the (correct) signature for `AddP`. `:i` is correct though: *Main> :i AddP pattern AddP :: () =>

RE: Pattern synonyms and GADTs in GHC 8.0.1

2016-05-26 Thread Simon Peyton Jones
GHC 8.0 swaps the order of provided vs required contexts in a pattern synonym signature. (7.10 was advertised as experimental). Thus: pattern AddP :: () => (Num a, Eq a) => Exp a -> Exp a -> Exp a Then it's fine Simon | -Original Message- | From: Glasgow-haskell-users [mailto:glas