Update example.

This commit is contained in:
Kei Hibino 2013-05-18 12:00:53 +09:00
parent 53e20120b2
commit ff1ce8f787

View File

@ -15,16 +15,16 @@ import Database.HDBC.Session (withConnectionIO)
um :: Relation (User, Maybe Membership)
um = relation $
[ u >*< m
| u <- inner user
, m <- outer membership
| u <- query user
, m <- queryMaybe membership
, () <- on $ just (u ! User.id') .=. m !? userId'
]
r0 :: Relation (Maybe User, Maybe Group)
r0 = relation $
[ (um' !? fst') >*< g
| um' <- outer um
, g <- outer group
| um' <- queryMaybe um
, g <- queryMaybe group
, () <- on $ flatten (um' !? snd') !? groupId' .=. g !? Group.id'
]