on dev help sign in
LabelsFrom ~> LabelsPG
f5185c9Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+2−2
@@ -302,7 +302,7 @@ instance ToArray x ('NotNull ('PGfixarray n ty))
302instance
302instance
303 ( IsEnumType x
303 ( IsEnumType x
304 , HasDatatypeInfo x
304 , HasDatatypeInfo x
305− , LabelsFrom x ~ labels
305+ , LabelsPG x ~ labels
306 ) => ToParam (Enumerated x) ('PGenum labels) where
306 ) => ToParam (Enumerated x) ('PGenum labels) where
307 toParam =
307 toParam =
308 let
308 let
@@ -493,7 +493,7 @@ instance FromArray ('NotNull ('PGfixarray n ty)) y
493instance
493instance
494 ( IsEnumType y
494 ( IsEnumType y
495 , HasDatatypeInfo y
495 , HasDatatypeInfo y
496− , LabelsFrom y ~ labels
496+ , LabelsPG y ~ labels
497 ) => FromValue ('PGenum labels) (Enumerated y) where
497 ) => FromValue ('PGenum labels) (Enumerated y) where
498 fromValue =
498 fromValue =
499 let
499 let
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+2−2
@@ -857,14 +857,14 @@ createTypeEnum enum labels = UnsafeDefinition $
857createTypeEnumFrom
857createTypeEnumFrom
858 :: forall hask enum schema.
858 :: forall hask enum schema.
859 ( SOP.Generic hask
859 ( SOP.Generic hask
860− , SOP.All KnownSymbol (LabelsFrom hask)
860+ , SOP.All KnownSymbol (LabelsPG hask)
861 , KnownSymbol enum
861 , KnownSymbol enum
862 )
862 )
863 => Alias enum
863 => Alias enum
864 -- ^ name of the user defined enumerated type
864 -- ^ name of the user defined enumerated type
865 -> Definition schema (Create enum ('Typedef (PG (Enumerated hask))) schema)
865 -> Definition schema (Create enum ('Typedef (PG (Enumerated hask))) schema)
866createTypeEnumFrom enum = createTypeEnum enum
866createTypeEnumFrom enum = createTypeEnum enum
867− (SOP.hpure label :: NP PGlabel (LabelsFrom hask))
867+ (SOP.hpure label :: NP PGlabel (LabelsPG hask))
868
868
869{- | `createTypeComposite` creates a composite type. The composite type is
869{- | `createTypeComposite` creates a composite type. The composite type is
870specified by a list of attribute names and data types.
870specified by a list of attribute names and data types.
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+7−7
@@ -116,7 +116,7 @@ module Squeal.PostgreSQL.Schema
116 , Enumerated (..)
116 , Enumerated (..)
117 , NullPG
117 , NullPG
118 , TuplePG
118 , TuplePG
119− , LabelsFrom
119+ , LabelsPG
120 , RowPG
120 , RowPG
121 , RowOf
121 , RowOf
122 , FieldPG
122 , FieldPG
@@ -721,7 +721,7 @@ type instance PG (hask, hask, hask, hask, hask, hask, hask, hask, hask)
721type instance PG (hask, hask, hask, hask, hask, hask, hask, hask, hask, hask)
721type instance PG (hask, hask, hask, hask, hask, hask, hask, hask, hask, hask)
722 = 'PGfixarray 10 (NullPG hask)
722 = 'PGfixarray 10 (NullPG hask)
723type instance PG (Composite hask) = 'PGcomposite (RowPG hask)
723type instance PG (Composite hask) = 'PGcomposite (RowPG hask)
724−type instance PG (Enumerated hask) = 'PGenum (LabelsFrom hask)
724+type instance PG (Enumerated hask) = 'PGenum (LabelsPG hask)
725
725
726newtype Json hask = Json {getJson :: hask}
726newtype Json hask = Json {getJson :: hask}
727 deriving (Eq, Ord, Show, Read, GHC.Generic)
727 deriving (Eq, Ord, Show, Read, GHC.Generic)
@@ -732,17 +732,17 @@ newtype Composite record = Composite {getComposite :: record}
732newtype Enumerated enum = Enumerated {getEnumerated :: enum}
732newtype Enumerated enum = Enumerated {getEnumerated :: enum}
733 deriving (Eq, Ord, Show, Read, GHC.Generic)
733 deriving (Eq, Ord, Show, Read, GHC.Generic)
734
734
735−-- | The `LabelsFrom` type family calculates the constructors of a
735+-- | The `LabelsPG` type family calculates the constructors of a
736-- Haskell enum type.
736-- Haskell enum type.
737--
737--
738-- >>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
738-- >>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
739-- >>> instance Generic Schwarma
739-- >>> instance Generic Schwarma
740-- >>> instance HasDatatypeInfo Schwarma
740-- >>> instance HasDatatypeInfo Schwarma
741−-- >>> :kind! LabelsFrom Schwarma
741+-- >>> :kind! LabelsPG Schwarma
742−-- LabelsFrom Schwarma :: [Type.ConstructorName]
742+-- LabelsPG Schwarma :: [Type.ConstructorName]
743-- = '["Beef", "Lamb", "Chicken"]
743-- = '["Beef", "Lamb", "Chicken"]
744−type family LabelsFrom (hask :: Type) :: [Type.ConstructorName] where
744+type family LabelsPG (hask :: Type) :: [Type.ConstructorName] where
745− LabelsFrom hask =
745+ LabelsPG hask =
746 ConstructorNamesOf (ConstructorsOf (DatatypeInfoOf hask))
746 ConstructorNamesOf (ConstructorsOf (DatatypeInfoOf hask))
747
747
748type family RowPG (hask :: Type) :: RowType where
748type family RowPG (hask :: Type) :: RowType where