Last active
October 30, 2015 14:34
-
-
Save punund/f62cbe414d4f2cb15374 to your computer and use it in GitHub Desktop.
List monad in action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- монада это необязательно последовательное исполнение -} | |
import Control.Monad | |
newlist ∷ [(Int, Int)] | |
newlist = | |
do x <- [1..3] | |
y <- [11..12] | |
guard $ x + y > 13 | |
return (x, y) | |
-- newlist will be [(2,12),(3,11),(3,12)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment