[Haskell-cafe] What is this applicative functor?
simon.jakobi at googlemail.com
Wed Feb 1 18:13:43 UTC 2017
that's a very interesting type, thanks for sharing it!
Please note that in the rendering of the package description at
http://hackage.haskell.org/package/successors, the <*> is slightly
2017-02-01 18:39 GMT+01:00 Joachim Breitner <mail at joachim-breitner.de>:
> Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner:
>> David wrote:
>> > How about this?
>> > hd (OneStep x xs) = x
>> > instance Monad OneStep where
>> > OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys)
>> > where
>> > 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
>> monad laws?
> Just did, all looks fine:
> Uploaded to http://hackage.haskell.org/package/successors in case
> someone wants to play with it.
> 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
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
More information about the Haskell-Cafe