Pattern synonyms and GADTs in GHC 8.0.1

Emil Axelsson emax at chalmers.se
Thu May 26 19:21:17 UTC 2016


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
>    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 :: () => (Num a, Eq a) => Exp a -> Exp a -> Exp a
>
> / Emil


More information about the Glasgow-haskell-users mailing list