mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-12 12:09:08 +03:00
Update example.
This commit is contained in:
parent
53e20120b2
commit
ff1ce8f787
@ -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'
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user