Last active
June 17, 2022 08:17
-
-
Save cblp/3c806584e5303369e4d904a0c7bf2d03 to your computer and use it in GitHub Desktop.
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
{-# LANGUAGE MonadComprehensions #-} | |
{-# LANGUAGE OverloadedLists #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Data.Set (Set, singleton) | |
import GHC.Exts | |
import Prelude | |
xs :: Set Int | |
xs = [3, 15] | |
ys :: Set Int | |
ys = [9, 20] | |
zs :: Set Int | |
zs = [x + y | x <- xs, y <- ys] | |
where | |
return = singleton | |
s >>= f = foldMap f s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment