Export pap instead of unsafeCastProjection.

This commit is contained in:
Kei Hibino 2013-12-27 16:18:20 +09:00
parent 4a23ca4a40
commit 7e89988edc
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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