[Haskell-cafe] What is this applicative functor?
mail at joachim-breitner.de
Wed Feb 1 15:33:53 UTC 2017
> How about this?
> hd (OneStep x xs) = x
> instance Monad OneStep where
> OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys)
> OneStep y ys = f x
> Not sure if it’s good for anything, but it seems valid and consistent
> based on a preliminary investigation.
Yes, this looks reasonable. Did you happen to already work through the
Am Mittwoch, den 01.02.2017, 09:34 +0200 schrieb Oleg Grenrus:
> These instances are quite similar to
well spotted. It is indeed the same idea, with my Succs (or OneStep or
whatever name is most appropriate) modeling only one step, and the tree
modeling, well, a whole tree.
Also thanks for pointing out disorder-jack, that looks like a nice
Joachim “nomeata” Breitner
mail at joachim-breitner.de • https://www.joachim-breitner.de/
XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: This is a digitally signed message part
More information about the Haskell-Cafe