Skip to content

Instantly share code, notes, and snippets.

@khibino
Last active December 10, 2019 03:02
Show Gist options
  • Save khibino/59a2f7831ccec755bbb8 to your computer and use it in GitHub Desktop.
Save khibino/59a2f7831ccec755bbb8 to your computer and use it in GitHub Desktop.
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