Hoogle Search

Within LTS Haskell 24.35 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. TcRnTagToEnumUnspecifiedResTy :: Type -> TcRnMessage

    ghc GHC.Tc.Errors.Types

    TcRnTagToEnumUnspecifiedResTy is an error that occurs when the 'tagToEnum#' function is not given a concrete result type. Example(s): foo :: forall a. a foo = tagToEnum# 0# Test cases: typecheckshould_failtcfail164

  2. type PhaseNum = Int

    ghc GHC.Types.Basic

    Phase Number

  3. diagnosticCodeNumber :: DiagnosticCode -> Natural

    ghc GHC.Types.Error

    the actual diagnostic code

  4. fromPersistValueEnum :: (Enum a, Bounded a) => PersistValue -> Either Text a

    persistent Database.Persist.Class.PersistEntity

    Convenience function for getting a free PersistField instance from a type with an Enum instance. This function also requires a Bounded instance to improve the reporting of errors. Example usage in combination with toPersistValueEnum:

    data SeverityLevel = Low | Medium | Critical | High
    deriving (Enum, Bounded)
    instance PersistField SeverityLevel where
    fromPersistValue = fromPersistValueEnum
    toPersistValue = toPersistValueEnum
    

  5. toPersistValueEnum :: Enum a => a -> PersistValue

    persistent Database.Persist.Class.PersistEntity

    Convenience function for getting a free PersistField instance from a type with an Enum instance. The function derivePersistField from the persistent-template package should generally be preferred. However, if you want to ensure that an ORDER BY clause that uses your field will order rows by the data constructor order, this is a better choice. Example usage in combination with fromPersistValueEnum:

    data SeverityLevel = Low | Medium | Critical | High
    deriving (Enum, Bounded)
    instance PersistField SeverityLevel where
    fromPersistValue = fromPersistValueEnum
    toPersistValue = toPersistValueEnum
    

  6. parseBoundedEnumOf :: (Bounded a, Enum a) => (a -> Text) -> Text -> Either Text a

    http-api-data Web.HttpApiData

    Parse values based on a precalculated mapping of their Text representation.

    >>> parseBoundedEnumOf toUrlPiece "true" :: Either Text Bool
    Right True
    
    For case insensitive parser see parseBoundedEnumOfI.

  7. parseBoundedEnumOfI :: (Bounded a, Enum a) => (a -> Text) -> Text -> Either Text a

    http-api-data Web.HttpApiData

    Case insensitive. Parse values case insensitively based on a precalculated mapping of their Text representations.

    >>> parseBoundedEnumOfI toUrlPiece "FALSE" :: Either Text Bool
    Right False
    
    For case sensitive parser see parseBoundedEnumOf.

  8. lookupBoundedEnumOf :: (Bounded a, Enum a, Eq b) => (a -> b) -> b -> Maybe a

    http-api-data Web.Internal.HttpApiData

    Lookup values based on a precalculated mapping of their representations.

  9. parseBoundedEnumOf :: (Bounded a, Enum a) => (a -> Text) -> Text -> Either Text a

    http-api-data Web.Internal.HttpApiData

    Parse values based on a precalculated mapping of their Text representation.

    >>> parseBoundedEnumOf toUrlPiece "true" :: Either Text Bool
    Right True
    
    For case insensitive parser see parseBoundedEnumOfI.

  10. parseBoundedEnumOfI :: (Bounded a, Enum a) => (a -> Text) -> Text -> Either Text a

    http-api-data Web.Internal.HttpApiData

    Case insensitive. Parse values case insensitively based on a precalculated mapping of their Text representations.

    >>> parseBoundedEnumOfI toUrlPiece "FALSE" :: Either Text Bool
    Right False
    
    For case sensitive parser see parseBoundedEnumOf.

Page 99 of many | Previous | Next