(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,
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 =
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