on dev help sign in
LabelsFrom ~> LabelsPG
commitf5185c933f43dfcfe6575cc7cc605841eb286f84 authorEitan Chatav <eitan.chatav@gmail.com> dateFri 31 Aug 2018, 17:32 (8 years ago) parentebe887d
3 files changed+11−11
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+2−2 squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+2−2 squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+7−7
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+2−2
@@ -302,7 +302,7 @@ instance ToArray x ('NotNull ('PGfixarray n ty))
302302instance
303303 ( IsEnumType x
304304 , HasDatatypeInfo x
305− , LabelsFrom x ~ labels
305+ , LabelsPG x ~ labels
306306 ) => ToParam (Enumerated x) ('PGenum labels) where
307307 toParam =
308308 let
@@ -493,7 +493,7 @@ instance FromArray ('NotNull ('PGfixarray n ty)) y
493493instance
494494 ( IsEnumType y
495495 , HasDatatypeInfo y
496− , LabelsFrom y ~ labels
496+ , LabelsPG y ~ labels
497497 ) => FromValue ('PGenum labels) (Enumerated y) where
498498 fromValue =
499499 let
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+2−2
@@ -857,14 +857,14 @@ createTypeEnum enum labels = UnsafeDefinition $
857857createTypeEnumFrom
858858 :: forall hask enum schema.
859859 ( SOP.Generic hask
860− , SOP.All KnownSymbol (LabelsFrom hask)
860+ , SOP.All KnownSymbol (LabelsPG hask)
861861 , KnownSymbol enum
862862 )
863863 => Alias enum
864864 -- ^ name of the user defined enumerated type
865865 -> Definition schema (Create enum ('Typedef (PG (Enumerated hask))) schema)
866866createTypeEnumFrom enum = createTypeEnum enum
867− (SOP.hpure label :: NP PGlabel (LabelsFrom hask))
867+ (SOP.hpure label :: NP PGlabel (LabelsPG hask))
868868
869869{- | `createTypeComposite` creates a composite type. The composite type is
870870specified 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
116116 , Enumerated (..)
117117 , NullPG
118118 , TuplePG
119− , LabelsFrom
119+ , LabelsPG
120120 , RowPG
121121 , RowOf
122122 , FieldPG
@@ -721,7 +721,7 @@ type instance PG (hask, hask, hask, hask, hask, hask, hask, hask, hask)
721721type instance PG (hask, hask, hask, hask, hask, hask, hask, hask, hask, hask)
722722 = 'PGfixarray 10 (NullPG hask)
723723type 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)
725725
726726newtype Json hask = Json {getJson :: hask}
727727 deriving (Eq, Ord, Show, Read, GHC.Generic)
@@ -732,17 +732,17 @@ newtype Composite record = Composite {getComposite :: record}
732732newtype Enumerated enum = Enumerated {getEnumerated :: enum}
733733 deriving (Eq, Ord, Show, Read, GHC.Generic)
734734
735−-- | The `LabelsFrom` type family calculates the constructors of a
735+-- | The `LabelsPG` type family calculates the constructors of a
736736-- Haskell enum type.
737737--
738738-- >>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
739739-- >>> instance Generic Schwarma
740740-- >>> instance HasDatatypeInfo Schwarma
741−-- >>> :kind! LabelsFrom Schwarma
742−-- LabelsFrom Schwarma :: [Type.ConstructorName]
741+-- >>> :kind! LabelsPG Schwarma
742+-- LabelsPG Schwarma :: [Type.ConstructorName]
743743-- = '["Beef", "Lamb", "Chicken"]
744−type family LabelsFrom (hask :: Type) :: [Type.ConstructorName] where
745− LabelsFrom hask =
744+type family LabelsPG (hask :: Type) :: [Type.ConstructorName] where
745+ LabelsPG hask =
746746 ConstructorNamesOf (ConstructorsOf (DatatypeInfoOf hask))
747747
748748type family RowPG (hask :: Type) :: RowType where