[Haskell-beginners] Alternative

Imants Cekusins imantc at gmail.com
Wed Dec 28 13:08:22 UTC 2016


> how is it possible to (<|>) results in:

 .. sequence + asum did it:

do
            lm2 <- sequence m1
            asum lm2 `shouldBe` (Just 1)
            where m1 = [pure Nothing, pure (Just 1), pure (Just 2), pure
Nothing]::[IO (Maybe Int)]
‚Äč

thank you Oliver. good tip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20161228/f4ba477c/attachment.html>


More information about the Beginners mailing list