Fwd: Alternative: you can fool many people some time, and some people many time, but...

Hi guys, I'm playing with the mysterious "some" and "many" from Control.Applicative. If I try: many $ Just 1 It just loops, I understand why: http://stackoverflow.com/questions/18108608/what-are-alterna tives-some-and-many-useful-for It seems that some and many are normally used in a context where something is consumed, and can be depleted, so the loop ends. But why doesn't this terminates? take 3 $ many $ Just 1 It's a recursive call, but the construction of the result should be lazy... -- ===================================== Corentin Dupont CREATE-NET OpenIoT Research Area - Senior Researcher Via alla Cascata 56/D - 38123 Povo, Trento - Italy e-mail: corentin.dupont@create-net.org Skype: corentin.dupont1 www.create-net.org ====================================== -- ===================================== Corentin Dupont CREATE-NET OpenIoT Research Area - Senior Researcher Via alla Cascata 56/D - 38123 Povo, Trento - Italy e-mail: corentin.dupont@create-net.org Skype: corentin.dupont1 www.create-net.org ======================================

Yes, sorry I meant: take 3 <$> (many $ Just 1)
On Fri, Sep 30, 2016 at 9:31 PM, Albert Y. C. Lai
On 2016-09-29 03:49 PM, Corentin Dupont wrote:
But why doesn't this terminates?
take 3 $ many $ Just 1
That looks like a type error rather than non-termination.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (2)
-
Albert Y. C. Lai
-
Corentin Dupont