Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

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

  1. enum :: Enum a => Iso' Int a

    lens Control.Lens.Combinators

    This isomorphism can be used to convert to or from an instance of Enum.

    >>> LT^.from enum
    0
    
    >>> 97^.enum :: Char
    'a'
    
    Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

  2. enum :: Enum a => Iso' Int a

    lens Control.Lens.Iso

    This isomorphism can be used to convert to or from an instance of Enum.

    >>> LT^.from enum
    0
    
    >>> 97^.enum :: Char
    'a'
    
    Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

  3. enum :: (MonadGen m, Enum a) => a -> a -> m a

    hedgehog Hedgehog.Gen

    Generates an element from an enumeration. This generator shrinks towards the first argument. For example:

    enum 'a' 'z' :: Gen Char
    

  4. enum :: (MonadGen m, Enum a) => a -> a -> m a

    hedgehog Hedgehog.Internal.Gen

    Generates an element from an enumeration. This generator shrinks towards the first argument. For example:

    enum 'a' 'z' :: Gen Char
    

  5. enum :: Data val => [val] -> val

    cmdargs System.Console.CmdArgs.Implicit

    Flag: "I want several different flags to set this one field to different values." This annotation takes a type which is an enumeration, and provides multiple separate flags to set the field to each value. The first element in the list is used as the value of the field.

    data State = On | Off deriving Data
    data Mode = Mode {state :: State}
    cmdArgs $ Mode {state = enum [On &= help "Turn on",Off &= help "Turn off"]}
    --on   Turn on
    --off  Turn off
    
    This annotation can be used to allow multiple flags within a field:
    data Mode = Mode {state :: [State]}
    cmdArgs $ Mode {state = enum [[] &= ignore, [On] &= help "Turn on", [Off] &= help "Turn off"]}
    
    Now --on --off would produce Mode [On,Off].

  6. enum :: Enum a => Iso' Int a

    diagrams-lib Diagrams.Prelude

    This isomorphism can be used to convert to or from an instance of Enum.

    >>> LT^.from enum
    0
    
    >>> 97^.enum :: Char
    'a'
    
    Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

  7. enum :: String -> Name -> [Name] -> [(String, Integer)] -> DecsQ

    c-enum Foreign.C.Enum

    Write like the following.

    enum "Foo" ''Int [''Show, ''Read, ''Eq] [
    ("FooError", - 1),
    ("FooZero", 0),
    ("FooOne", 1),
    ("FooTwo", 2) ]
    
    Then you get like the following.
    newtype Foo = Foo Int deriving Eq
    
    pattern FooError :: Int -> Foo
    pattern FooError <- Foo (- 1) where
    FooError = Foo (- 1)
    
    pattern FooZero :: Int -> Foo
    ...
    
    
    instance Show Foo where
    showsPrec = ...
    
    instance Read Foo where
    readPrec = ...
    
    And you can read and show like the following.
    > Foo $ - 1
    FooError
    > FooTwo
    FooTwo
    > Foo 3
    Foo 3
    > read "Foo (- 1)" :: Foo
    FooError
    > read "FooOne" :: Foo
    FooOne
    

  8. enum :: GType

    glib System.Glib.GTypeConstants

    No documentation available.

  9. enum :: forall (m :: Type -> Type) . TypeName -> ResolverValue m

    morpheus-graphql-app Data.Morpheus.App.NamedResolvers

    No documentation available.

  10. enum :: (Text -> Maybe a) -> Value a

    postgresql-binary PostgreSQL.Binary.Decoding

    Given a partial mapping from text to value, produces a decoder of that value.

Page 10 of many | Previous | Next