haskell-relational-record/doc/slide/haskell-hackathon-201412/arr.hs
2014-12-21 16:16:54 +09:00

19 lines
441 B
Haskell

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Arrows #-}
import Control.Arrow
import ArrowQuery
import Person (Person, person)
import Birthday (Birthday, birthday)
import qualified Person
import qualified Birthday
personAndJoinA :: QuerySimple () (Projection Flat (Person, Birthday))
personAndJoinA = proc () -> do
p <- query -< person
b <- query -< birthday
wheres -< p ! Person.name' .=. b ! Birthday.name'
returnA -< p >< b