[Haskell-cafe] Re: deconstruction of the list/backtracking applicative functor?

2008-03-24 Thread apfelmus
(Sorry for the late reply) Conal Elliott wrote: Is there a known deconstruction of the list/backtracking applicative functor (AF)? If I decompose the list type into pieces (Maybe, product, composition), I think I can see where the ZipList AF comes from, but not the list/backtracking AF. So,

Re: [Haskell-cafe] Re: deconstruction of the list/backtracking applicative functor?

2008-03-24 Thread Conal Elliott
Thanks for the reply. Here's the decomposition I had in mind. Start with type List a = Maybe (a, List a) Rewrite a bit type List a = Maybe (Id a, List a) Then make the type *constructor* pairing explicit type List a = Maybe ((Id :*: List) a) where newtype (f :*: g) a =

[Haskell-cafe] Re: deconstruction of the list/backtracking applicative functor?

2008-03-24 Thread apfelmus
Conal Elliott wrote: Thanks for the reply. Here's the decomposition I had in mind. Start with type List a = Maybe (a, List a) Rewrite a bit type List a = Maybe (Id a, List a) Then make the type *constructor* pairing explicit type List a = Maybe ((Id :*: List) a) where