Created
November 30, 2012 14:52
-
-
Save metametaclass/4176214 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
| module Main where | |
| import Control.Monad(join) | |
| table = [(1, "a", "b"), | |
| (0, "c", "d"), | |
| (2, "e", "f")] | |
| query = do (x,y,z) <- table | |
| join $ if x<1 then return [x] | |
| else return [x, -x] | |
| query1 = do | |
| (x,y,z) <- table | |
| if x<1 then [x] else [x, -x] | |
| main = do print query | |
| print query1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment