mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-15 14:53:28 +03:00
Export pap instead of unsafeCastProjection.
This commit is contained in:
parent
4a23ca4a40
commit
7e89988edc
@ -535,7 +535,7 @@ instance ProjectableFunctor (Projection c) where
|
||||
|
||||
-- | Compose record type 'Projection' using applicative style.
|
||||
instance ProjectableApplicative (Projection c) where
|
||||
pf |*| pa = Projection.unsafeCastProjection $ pf >< pa
|
||||
(|*|) = Projection.pap
|
||||
|
||||
-- | Compose seed of projection path 'Pi' which has record result type.
|
||||
instance ProjectableFunctor (Pi a) where
|
||||
|
@ -28,11 +28,11 @@ module Database.Relational.Query.Projection (
|
||||
|
||||
pi, piMaybe, piMaybe',
|
||||
|
||||
flattenMaybe, just, unsafeCastProjection,
|
||||
flattenMaybe, just,
|
||||
|
||||
unsafeToAggregated, unsafeToFlat,
|
||||
|
||||
pfmap,
|
||||
pfmap, pap,
|
||||
|
||||
-- * List Projection
|
||||
ListProjection, list, unsafeListProjectionFromSubQuery,
|
||||
@ -138,10 +138,6 @@ flattenMaybe = unsafeCast
|
||||
just :: Projection c r -> Projection c (Maybe r)
|
||||
just = unsafeCast
|
||||
|
||||
-- | Unsafely cast projection result type.
|
||||
unsafeCastProjection :: Projection c r -> Projection c r'
|
||||
unsafeCastProjection = unsafeCast
|
||||
|
||||
unsafeChangeContext :: Projection c r -> Projection c' r
|
||||
unsafeChangeContext = typedProjection . untypeProjection
|
||||
|
||||
@ -158,6 +154,10 @@ pfmap :: ProductConstructor (a -> b)
|
||||
=> (a -> b) -> Projection c a -> Projection c b
|
||||
_ `pfmap` p = unsafeCast p
|
||||
|
||||
-- | Projectable ap of 'Projection' type.
|
||||
pap :: Projection c (a -> b) -> Projection c a -> Projection c b
|
||||
pf `pap` pa = fromUnits $ units pf ++ units pa
|
||||
|
||||
-- | Projection type for row list.
|
||||
data ListProjection p t = List [p t]
|
||||
| Sub SubQuery
|
||||
|
Loading…
Reference in New Issue
Block a user