Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
boundedBounds :: Bounded a => Bounds aautodocodec Autodocodec.Codec No documentation available.
boundedEnumCodec :: (Eq enum, Enum enum, Bounded enum) => (enum -> Text) -> JSONCodec enumautodocodec Autodocodec.Codec A codec for a Bounded Enum that uses the provided function to have the values correspond to literal Text values.
Example usage
>>> data Fruit = Apple | Orange deriving (Show, Eq, Enum, Bounded) >>> :{ let c = boundedEnumCodec $ \case Apple -> "foo" Orange -> "bar" :}
>>> toJSONVia c Apple String "foo" >>> JSON.parseMaybe (parseJSONVia c) (String "bar") :: Maybe Fruit Just Orange
boundedIntegralBounds :: (Integral i, Bounded i) => Bounds Integerautodocodec Autodocodec.Codec NumberBounds for a bounded integral type. You can call this using TypeApplications: boundedIntegralBounds Word@
boundedIntegralCodec :: (Integral i, Bounded i) => JSONCodec iautodocodec Autodocodec.Codec A codec for bounded integers like Int, Int8, and Word. This codec will not have a name, and it will use the boundedNumberBounds to add number bounds.
>>> let c = boundedIntegralCodec :: JSONCodec Int8 >>> toJSONVia c 5 Number 5.0 >>> JSON.parseMaybe (parseJSONVia c) (Number 100) Just 100 >>> JSON.parseMaybe (parseJSONVia c) (Number 200) Nothing
boundedEnumLaws :: (Enum a, Bounded a, Eq a, Arbitrary a, Show a) => Proxy a -> Lawsquickcheck-classes-base Test.QuickCheck.Classes.Base Tests the same properties as enumLaws except that it requires the type to have a Bounded instance. These tests avoid taking the successor of the maximum element or the predecessor of the minimal element.
boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]relude Relude.Enum No documentation available.
boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]relude Relude.Enum No documentation available.
-
deriving-compat Data.Deriving.Internal No documentation available.
boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]protolude Protolude No documentation available.
boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]protolude Protolude No documentation available.