mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-12 12:09:08 +03:00
Add piMaybeFlatten.
This commit is contained in:
parent
3db40de6c7
commit
28b0987ea8
@ -4,6 +4,8 @@
|
||||
|
||||
module Database.Relational.Query.ProjectableExtended (
|
||||
ProjectableFlattenMaybe (flatten),
|
||||
|
||||
piMaybeFlatten,
|
||||
|
||||
(!), (!?), (!??),
|
||||
|
||||
@ -36,10 +38,14 @@ p ! pi' = project $ Projection.pi p pi'
|
||||
=> Projection (Maybe a) -> Pi a b -> p (Maybe b)
|
||||
p !? pi' = project $ Projection.piMaybe p pi'
|
||||
|
||||
(!??) :: (PersistableWidth b, Projectable p, ProjectableMaybe p,
|
||||
ProjectableFlattenMaybe c (Maybe a))
|
||||
=> Projection c -> Pi a b -> p (Maybe b)
|
||||
p !?? pi' = project $ Projection.piMaybe (flatten p) pi'
|
||||
piMaybeFlatten :: (PersistableWidth b, ProjectableFlattenMaybe c (Maybe a))
|
||||
=> Projection c -> Pi a b -> Projection (Maybe b)
|
||||
piMaybeFlatten = Projection.piMaybe . flatten
|
||||
|
||||
(!??) :: (PersistableWidth b, ProjectableFlattenMaybe c (Maybe a),
|
||||
Projectable p, ProjectableMaybe p)
|
||||
=> Projection c -> Pi a b -> p (Maybe b)
|
||||
p !?? pi' = project $ piMaybeFlatten p pi'
|
||||
|
||||
class ProjectableGeneralizedZip a b c where
|
||||
generalizedZip :: ProjectableZip p => p a -> p b -> p c
|
||||
|
Loading…
Reference in New Issue
Block a user