Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. data Enumeration (n :: Nat)

    pinch Pinch.Internal.Generic

    Data types that represent Thrift enums must have one constructor for each enum item accepting an Enumeration object tagged with the corresponding enum value.

    data Role = RoleUser (Enumeration 1) | RoleAdmin (Enumeration 2)
    deriving Generic
    instance Pinchable Role
    

  2. Enumeration :: Enumeration (n :: Nat)

    pinch Pinch.Internal.Generic

    No documentation available.

  3. data Enumeration a

    protobuf Data.ProtocolBuffers

    Enumeration fields use fromEnum and toEnum when encoding and decoding messages.

  4. newtype Enumeration a

    protobuf Data.ProtocolBuffers.Internal

    Enumeration fields use fromEnum and toEnum when encoding and decoding messages.

  5. Enumeration :: a -> Enumeration a

    protobuf Data.ProtocolBuffers.Internal

    No documentation available.

  6. data Enum8

    rainbow Rainbow.Types

    A simple enumeration for eight values. Represents eight colors.

  7. module Control.Enumerable

    This module provides the Enumerable class, which has a simple purpose: Provide any enumeration for any instance type. The prerequisite is that the enumeration data type is a sized functor (see Control.Sized) with the enumerated type as the type parameter. The general idea is that the size of a value is the number of constructor applications it contains. Because Sized functors often rely of memoization, sharing is important. Since class dictionaries are not always shared, a mechanism is added that guarantees optimal sharing (it never creates two separate instance members for the same type). This is why the type of enumerate is Shared f a instead of simply f a. The technicalities of this memoization are not important, but it means there are two modes for accessing an enumeration: local and global. The former means sharing is guaranteed within this value, but subsequent calls to local may recreate dictionaries. The latter guarantees optimal sharing even between calls. It also means the enumeration will never be garbage collected, so use with care in programs that run for extended periods of time and contains many (especially non-regular) types. Once a type has an instance, it can be enumerated in several ways (by instantiating global to different types). For instance global :: Count [Maybe Bool] would only count the number of lists of Maybe Bool of each size (using Control.Enumerable.Count). @global :: Values [Maybe Bool] would give the actual values for all sizes as lists. See FEAT for a more elaborate enumeration type that allows access to any value in the enumeration (given an index) in polynomial time, uniform selection from a given size etc. Instances can be constructed in three ways: 1: Manually by passing datatype a list where each element is an application of the constructor functions c0, c1 etc, so a data type like Maybe would have enumerate = datatype [c0 Nothing, c1 Just]. This assumes all field types of all constructors are enumerable (recursive constructors work fine). The functions passed to cX do not have to be constructors, but should be injective functions (if they are not injective the enumeration will contain duplicates). So "smart constructors" can be used, for instance the Rational datatype is defined by an injection from the natural numbers. 2: Automatically with Template Haskell (deriveEnumerable). A top level declaration like deriveEnumerable ''Maybe would derive an instance for the Maybe data type. 3: Manually using the operations of a sized functor (see Control.Sized) to build a Shareable f a value, then apply share to it. To use other instances of Enumerable use access.

  8. class Typeable a => Enumerable a

    size-based Control.Enumerable

    No documentation available.

  9. class Enum a => Enumerable a

    streamly Streamly.Internal.Data.Stream.IsStream

    Types that can be enumerated as a stream. The operations in this type class are equivalent to those in the Enum type class, except that these generate a stream instead of a list. Use the functions in Streamly.Internal.Data.Stream.Enumeration module to define new instances.

  10. class Enum a => Enumerable a

    streamly Streamly.Internal.Data.Stream.IsStream

    Types that can be enumerated as a stream. The operations in this type class are equivalent to those in the Enum type class, except that these generate a stream instead of a list. Use the functions in Streamly.Internal.Data.Stream.Enumeration module to define new instances.

Page 30 of many | Previous | Next