Skip to content

Instantly share code, notes, and snippets.

@punund
Last active October 30, 2015 14:34
List monad in action
{- монада это необязательно последовательное исполнение -}
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