Concrete syntax for pattern synonym type signatures

Dr. ERDI Gergo gergo at erdi.hu
Sun Nov 9 07:56:24 UTC 2014


On Tue, 4 Nov 2014, Simon Peyton Jones wrote:

>  pattern P :: forall tvs. (match-provided ; match-required) => tau
>
> The "; match-required" part is optional, and the "match-provided" part might be empty.  So P1 and P2 would look like this:
>
>  pattern P1 :: forall a. (; Num a) => b -> (a,b)
>  pattern P2 :: forall a. (; Num a, Ord a) => a -> a

Doesn't the ';' look a bit like something that could be incidentially 
introduced by some layout-aware syntax rule? Wouldn't, e.g., '|' be more 
explicit as a separator?

example:

pattern P :: forall tvs. (Eq b | Num a, Eq a) => b -> T a



More information about the ghc-devs mailing list