[Haskell-cafe] What's this pattern called?

Daniel Schüssler anotheraddress at gmx.de
Thu Oct 22 07:29:31 EDT 2009


Hi,

On Thursday 22 October 2009 09:47:32 Martijn van Steenbergen wrote:
> Bonjour café,
> 
> > data ExprF r
> >   =  Add  r  r
> >
> >   |  Sub  r  r
> >   |  Mul  r  r
> >   |  Div  r  r
> >   |  Num  Int
> 
> This is a well-known pattern that for example allows nice notation of
> morphisms. But what is it called? 
> ...


The multirec package calls this the "pattern functor" (more accurately, it 
generates a sum-of-products-like higher order functor whose fixed point is 
isomorphic to your family of types, and calls that the pattern functor).


--
Greetings, 
Daniel 


More information about the Haskell-Cafe mailing list