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.

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

  2. shownBoundedEnumCodec :: (Show enum, Eq enum, Enum enum, Bounded enum) => JSONCodec enum

    autodocodec Autodocodec.Codec

    A codec for a Bounded Enum that uses its Show instance to have the values correspond to literal Text values.

    Example usage

    >>> data Fruit = Apple | Orange deriving (Show, Eq, Enum, Bounded)
    
    >>> let c = shownBoundedEnumCodec
    
    >>> toJSONVia c Apple
    String "Apple"
    
    >>> JSON.parseMaybe (parseJSONVia c) (String "Orange") :: Maybe Fruit
    Just Orange
    

  3. toEnum :: Enum a => Int -> a

    rio RIO.Partial

    Convert from an Int.

  4. fromEnum :: Enum a => a -> Int

    rio RIO.Prelude

    Convert to an Int. It is implementation-dependent what fromEnum returns when applied to a value that is too large to fit in an Int.

  5. linenumber :: XmlSource s => Integer -> s -> LString

    xml Text.XML.Light.Lexer

    No documentation available.

  6. fromEnum :: Enum a => a -> Int

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  7. toEnum :: Enum a => Int -> a

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  8. isScEnum :: Schema -> Bool

    hxt Text.XML.HXT.Arrow.Pickle.Schema

    No documentation available.

  9. scEnum :: [String] -> Schema

    hxt Text.XML.HXT.Arrow.Pickle.Schema

    No documentation available.

  10. normalizeNumber :: String -> String

    hxt Text.XML.HXT.DOM.Util

    Removes leading / trailing whitespaces and leading zeros

Page 106 of many | Previous | Next