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.

  1. boundedBounds :: Bounded a => Bounds a

    autodocodec Autodocodec.Codec

    No documentation available.

  2. boundedEnumCodec :: (Eq enum, Enum enum, Bounded enum) => (enum -> Text) -> JSONCodec enum

    autodocodec 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
    

  3. boundedIntegralBounds :: (Integral i, Bounded i) => Bounds Integer

    autodocodec Autodocodec.Codec

    NumberBounds for a bounded integral type. You can call this using TypeApplications: boundedIntegralBounds Word@

  4. boundedIntegralCodec :: (Integral i, Bounded i) => JSONCodec i

    autodocodec 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
    

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

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

  6. boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]

    relude Relude.Enum

    No documentation available.

  7. boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]

    relude Relude.Enum

    No documentation available.

  8. boundedTypeName :: Name

    deriving-compat Data.Deriving.Internal

    No documentation available.

  9. boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]

    protolude Protolude

    No documentation available.

  10. boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]

    protolude Protolude

    No documentation available.

Page 12 of many | Previous | Next