Last active
December 10, 2019 03:02
-
-
Save khibino/59a2f7831ccec755bbb8 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
import Data.Int (Int32) | |
import Database.Record.Instances () | |
import Database.Relational.Query | |
hello :: Relation () (Int32, String) | |
hello = relation $ return (value 0 >< value "Hello") | |
world :: Relation () (Int32, String) | |
world = relation $ return (value 0 >< value "World!") | |
helloWorld :: Relation () ((Int32, String), (Int32, String)) | |
helloWorld = relation $ do | |
h <- query hello | |
w <- query world | |
on $ h ! fst' .=. w ! fst' | |
return $ h >< w | |
main :: IO () | |
main = print helloWorld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment