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.

  1. HsEnumFrom :: HsExp -> HsExp

    haskell-src Language.Haskell.Syntax

    Unbounded arithmetic sequence, incrementing by 1.

  2. HsEnumFromThen :: HsExp -> HsExp -> HsExp

    haskell-src Language.Haskell.Syntax

    Unbounded arithmetic sequence, with first two elements given.

  3. HsEnumFromThenTo :: HsExp -> HsExp -> HsExp -> HsExp

    haskell-src Language.Haskell.Syntax

    Bounded arithmetic sequence, with first two elements given.

  4. HsEnumFromTo :: HsExp -> HsExp -> HsExp

    haskell-src Language.Haskell.Syntax

    Bounded arithmetic sequence, incrementing by 1.

  5. boundedEnumLaws :: (Bounded a, Enum a, Eq a, Show a) => Gen a -> Laws

    hedgehog-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.

  6. word16_to_enum :: Enum e => Word16 -> e

    hosc Sound.Osc.Coding.Convert

    Type-specialised toEnum of fromIntegral

  7. word8_to_enum :: Enum e => Word8 -> e

    hosc Sound.Osc.Coding.Convert

    Type-specialised toEnum of fromIntegral

  8. dbEnums :: DatabaseDefinitions -> [EnumType]

    hpqtypes-extras Database.PostgreSQL.PQTypes.Checks

    No documentation available.

  9. newtype SQLEnum a

    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)]
    

  10. SQLEnum :: a -> SQLEnum a

    hpqtypes-extras Database.PostgreSQL.PQTypes.Deriving

    No documentation available.

Page 177 of many | Previous | Next