module Database.Relational.Query.Pi (
Pi, pfmap, pap, pzero, (<.>), (<?.>), (<?.?>),
id', fst', snd'
) where
import qualified Control.Category as Category
import Database.Record
(PersistableWidth, persistableWidth, PersistableRecordWidth)
import Database.Record.Persistable
(runPersistableRecordWidth)
import Database.Relational.Query.Pi.Unsafe
(Pi, pfmap, pap, pzero, (<.>), (<?.>), (<?.?>), definePi)
id' :: Pi a a
id' = Category.id
fst' :: PersistableWidth a => Pi (a, b) a
fst' = definePi 0
snd'' :: PersistableWidth b => PersistableRecordWidth a -> Pi (a, b) b
snd'' wa = definePi (runPersistableRecordWidth wa)
snd' :: (PersistableWidth a, PersistableWidth b) => Pi (a, b) b
snd' = snd'' persistableWidth