Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
haskell-src Language.Haskell.Syntax Unbounded arithmetic sequence, incrementing by 1.
HsEnumFromThen :: HsExp -> HsExp -> HsExphaskell-src Language.Haskell.Syntax Unbounded arithmetic sequence, with first two elements given.
HsEnumFromThenTo :: HsExp -> HsExp -> HsExp -> HsExphaskell-src Language.Haskell.Syntax Bounded arithmetic sequence, with first two elements given.
HsEnumFromTo :: HsExp -> HsExp -> HsExphaskell-src Language.Haskell.Syntax Bounded arithmetic sequence, incrementing by 1.
boundedEnumLaws :: (Bounded a, Enum a, Eq a, Show a) => Gen a -> Lawshedgehog-classes Hedgehog.Classes Tests the same laws as enumLaws, but uses the Bounded constraint to ensure that succ and pred behave as though they are total. This should always be preferred if your type has a Bounded instance.
word16_to_enum :: Enum e => Word16 -> ehosc Sound.Osc.Coding.Convert Type-specialised toEnum of fromIntegral
word8_to_enum :: Enum e => Word8 -> ehosc Sound.Osc.Coding.Convert Type-specialised toEnum of fromIntegral
dbEnums :: DatabaseDefinitions -> [EnumType]hpqtypes-extras Database.PostgreSQL.PQTypes.Checks No documentation available.
-
hpqtypes-extras Database.PostgreSQL.PQTypes.Deriving Helper newtype to be used with deriving via to derive (PQFormat, ToSQL, FromSQL) instances for enums, given an instance of EnumEncoding. Hint: non-trivial Enum instances can be derived using the 'generic-data' package!
>>> :{ data Colours = Blue | Black | Red | Mauve | Orange deriving (Eq, Show, Enum, Bounded) instance EnumEncoding Colours where type EnumBase Colours = Int16 encodeEnum = \case Blue -> 1 Black -> 7 Red -> 2 Mauve -> 6 Orange -> 3 :}Note: To get SQL-specific instances use DerivingVia:data Colours = ... ... deriving (PQFormat, ToSQL, FromSQL) via SQLEnum Colours
>>> isInjective (encodeEnum @Colours) True
>>> decodeEnum @Colours 7 Right Black
>>> decodeEnum @Colours 42 Left [(1,3),(6,7)]
-
hpqtypes-extras Database.PostgreSQL.PQTypes.Deriving No documentation available.