on dev help sign in
remove MapMaybes and Nulls
commitb719fca0ee15c2c1567483fcd5aa929f0b36a1b3 authorEitan Chatav <eitan.chatav@gmail.com> dateWed 11 Jul 2018, 23:02 (8 years ago) parentaa5c1f7
1 file changed−22
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs−22
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs−22
@@ -111,8 +111,6 @@ module Squeal.PostgreSQL.Schema
111111 , ConstructorsOf
112112 , ConstructorNameOf
113113 , ConstructorNamesOf
114− , MapMaybes (..)
115− , Nulls
116114 ) where
117115
118116import Control.DeepSeq
@@ -584,26 +582,6 @@ type family Rename alias0 alias1 xs where
584582 Rename alias0 alias1 ((alias0 ::: x0) ': xs) = (alias1 ::: x0) ': xs
585583 Rename alias0 alias1 (x ': xs) = x ': Rename alias0 alias1 xs
586584
587−-- | `MapMaybes` is used in the binary instances of composite types.
588−class MapMaybes xs where
589− type family Maybes (xs :: [Type]) = (mxs :: [Type]) | mxs -> xs
590− maybes :: NP Maybe xs -> NP I (Maybes xs)
591− unMaybes :: NP I (Maybes xs) -> NP Maybe xs
592−instance MapMaybes '[] where
593− type Maybes '[] = '[]
594− maybes Nil = Nil
595− unMaybes Nil = Nil
596−instance MapMaybes xs => MapMaybes (x ': xs) where
597− type Maybes (x ': xs) = Maybe x ': Maybes xs
598− maybes (x :* xs) = I x :* maybes xs
599− unMaybes (I mx :* xs) = mx :* unMaybes xs
600−
601−-- | `Nulls` is used to construct a `Squeal.Postgresql.Expression.row`
602−-- of a composite type.
603−type family Nulls tys where
604− Nulls '[] = '[]
605− Nulls (field ::: ty ': tys) = field ::: 'Null ty ': Nulls tys
606−
607585-- | Check if a `TableConstraint` involves a column
608586type family ConstraintInvolves column constraint where
609587 ConstraintInvolves column ('Check columns) = column `Elem` columns