on dev help sign in
add back old type fams
commit932d956eca437df2a66b99d8df11496db7e7bbe2 authorEitan Chatav <eitan.chatav@gmail.com> dateFri 24 Aug 2018, 01:15 (8 years ago) parentb53969c
1 file changed+6−5
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+6−5
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+6−5
@@ -115,9 +115,10 @@ module Squeal.PostgreSQL.Schema
115115 , Jsonb (..)
116116 , Composite (..)
117117 , Enumerated (..)
118− -- , EnumFrom
118+ , NullPG
119+ , EnumFrom
119120 , LabelsFrom
120− -- , CompositeFrom
121+ , CompositeFrom
121122 , PGFieldsFrom
122123 , RowOf
123124 , PGFieldOf
@@ -749,8 +750,8 @@ newtype Enumerated enum = Enumerated {getEnumerated :: enum}
749750-- >>> :kind! EnumFrom Schwarma
750751-- EnumFrom Schwarma :: PGType
751752-- = 'PGenum '["Beef", "Lamb", "Chicken"]
752−-- type family EnumFrom (hask :: Type) :: PGType where
753−-- EnumFrom hask = 'PGenum (LabelsFrom hask)
753+type family EnumFrom (hask :: Type) :: PGType where
754+ EnumFrom hask = PG (Enumerated hask)
754755
755756-- | The `LabelsFrom` type family calculates the constructors of a
756757-- Haskell enum type.
@@ -777,7 +778,7 @@ type family LabelsFrom (hask :: Type) :: [Type.ConstructorName] where
777778-- CompositeFrom Row :: PGType
778779-- = 'PGcomposite '["a" ::: 'Null 'PGint2, "b" ::: 'Null 'PGtimestamp]
779780type family CompositeFrom (hask :: Type) :: PGType where
780− CompositeFrom hask = 'PGcomposite (PGFieldsFrom hask)
781+ CompositeFrom hask = PG (Composite hask)
781782
782783type family PGFieldsFrom (hask :: Type) :: RowType where
783784 PGFieldsFrom hask = RowOf (RecordCodeOf hask)