[Haskell-cafe] What's this pattern called?
ekmett at gmail.com
Fri Oct 23 02:00:35 EDT 2009
I've often seen it referred to as the base functor for a recursive data
type. You can then fix that functor in interesting ways i.e. with (Fix,
Free, Cofree) and having the explicit base functor allows you to define
general purpose recursion schemes over the data type. All of that extra
machinery relies on your recursive data type being implemented as a functor
with an explicit fixpoint, so base 'functor' seems quite appropriate.
On Thu, Oct 22, 2009 at 3:47 AM, Martijn van Steenbergen <
martijn at van.steenbergen.nl> 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? I've heard fixed-point view, open
> datatypes and some others, but I'm curious where this pattern comes up in
> literature and what it is called there.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe