Hoogle Search
Within LTS Haskell 24.36 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
DerivErrMustBeEnumType :: TyCon -> DeriveInstanceErrReasonghc GHC.Tc.Errors.Types The given TyCon must be an enumeration. See Note [Enumeration types] in GHC.Core.TyCon
TcRnNegativeNumTypeLiteral :: HsTyLit GhcPs -> TcRnMessageghc GHC.Tc.Errors.Types TcRnNegativeNumTypeLiteral is an error that occurs whenever a type-level number literal is negative. type Neg = -1 Test cases: th/T8412 typecheckshould_failT8306
TcRnTagToEnumMissingValArg :: TcRnMessageghc GHC.Tc.Errors.Types TcRnTagToEnumMissingValArg is an error that occurs when the 'tagToEnum#' function is not applied to a single value argument. Example(s): tagToEnum# 1 2 Test cases: None
TcRnTagToEnumResTyNotAnEnum :: Type -> TcRnMessageghc GHC.Tc.Errors.Types TcRnTagToEnumResTyNotAnEnum is an error that occurs when the 'tagToEnum#' function is given a result type that is not an enumeration type. Example(s): foo :: Int -- not an enumeration TyCon foo = tagToEnum# 0# Test cases: typecheckshould_failtcfail164
TcRnTagToEnumResTyTypeData :: Type -> TcRnMessageghc GHC.Tc.Errors.Types TcRnTagToEnumResTyTypeData is an error that occurs when the 'tagToEnum#' function is given a result type that is headed by a type data type, as the data constructors of a type data do not exist at the term level. Example(s): type data Letter = A | B | C foo :: Letter foo = tagToEnum# 0# Test cases: type-datashould_failTDTagToEnum.hs
TcRnTagToEnumUnspecifiedResTy :: Type -> TcRnMessageghc 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
-
ghc GHC.Types.Basic Phase Number
diagnosticCodeNumber :: DiagnosticCode -> Naturalghc GHC.Types.Error the actual diagnostic code
fromPersistValueEnum :: (Enum a, Bounded a) => PersistValue -> Either Text apersistent 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
toPersistValueEnum :: Enum a => a -> PersistValuepersistent 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