Preparing for a review of pattern synonyms

Dr. ERDI Gergo gergo at erdi.hu
Sun Dec 29 06:38:14 UTC 2013


On Mon, 9 Dec 2013, Simon Marlow wrote:

> I think pattern synonyms are great!  A couple of questions:
>
> * what will Haddock show for a pattern export?

I eventually ended up implementing the following syntax for Haddock 
output (code is at https://github.com/gergoerdi/ghc-haddock):

     pattern (Prov b) => P a b :: (Req a) => T a

e.g.
     pattern a :< (Seq a) :: Seq a
for
     pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)

or
     pattern Zero :: (Num a, Eq a) => a
for
     pattern Zero = 0

Bye,
 	Gergo


More information about the ghc-devs mailing list