| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Foundation
Description
I tried to picture clusters of information As they moved through the computer What do they look like?
Alternative Prelude
Synopsis
- ($) :: (a -> b) -> a -> b
- ($!) :: (a -> b) -> a -> b
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- (.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- not :: Bool -> Bool
- otherwise :: Bool
- class Fstable a where
- type ProductFirst a
- fst :: a -> ProductFirst a
- class Sndable a where
- type ProductSecond a
- snd :: a -> ProductSecond a
- data Tuple2 a b = Tuple2 !a !b
- data Tuple3 a b c = Tuple3 !a !b !c
- data Tuple4 a b c d = Tuple4 !a !b !c !d
- class Thdable a where
- type ProductThird a
- thd :: a -> ProductThird a
- type family ProductFirst a
- type family ProductSecond a
- type family ProductThird a
- id :: forall (a :: k). Category cat => cat a a
- maybe :: b -> (a -> b) -> Maybe a -> b
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- flip :: (a -> b -> c) -> b -> a -> c
- const :: a -> b -> a
- error :: HasCallStack => String -> a
- putStr :: String -> IO ()
- putStrLn :: String -> IO ()
- getArgs :: IO [String]
- uncurry :: (a -> b -> c) -> (a, b) -> c
- curry :: ((a, b) -> c) -> a -> b -> c
- swap :: (a, b) -> (b, a)
- until :: (a -> Bool) -> (a -> a) -> a -> a
- asTypeOf :: a -> a -> a
- undefined :: HasCallStack => a
- seq :: a -> b -> b
- class NormalForm a
- deepseq :: NormalForm a => a -> b -> b
- force :: NormalForm a => a -> a
- class Show a
- show :: Show a => a -> String
- class Eq a => Ord a where
- class Eq a where
- class Bounded a where
- class Enum a where
- succ :: a -> a
- pred :: a -> a
- toEnum :: Int -> a
- fromEnum :: a -> Int
- enumFrom :: a -> [a]
- enumFromThen :: a -> a -> [a]
- enumFromTo :: a -> a -> [a]
- enumFromThenTo :: a -> a -> a -> [a]
- class Functor (f :: Type -> Type) where
- class Integral a where
- fromInteger :: Integer -> a
- class Fractional a where
- fromRational :: Rational -> a
- class HasNegation a where
- negate :: a -> a
- class (forall a. Functor (p a)) => Bifunctor (p :: Type -> Type -> Type) where
- class Functor f => Applicative (f :: Type -> Type) where
- class Applicative m => Monad (m :: Type -> Type) where
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- class IsString a where
- fromString :: String -> a
- class IsList l where
- class (Integral a, Eq a, Ord a) => IsIntegral a where
- class IsIntegral a => IsNatural a where
- class Signed a where
- class Additive a where
- class Subtractive a where
- type Difference a
- (-) :: a -> a -> Difference a
- class Multiplicative a where
- class (Additive a, Multiplicative a) => IDivisible a where
- class Multiplicative a => Divisible a where
- (/) :: a -> a -> a
- data Maybe a
- data Ordering
- data Bool
- data Char
- data Char7
- data IO a
- data Either a b
- data Int8
- data Int16
- data Int32
- data Int64
- data Word8
- data Word16
- data Word32
- data Word64
- data Word
- data Word128
- data Word256
- data Int
- data Integer
- data Natural
- type Rational = Ratio Integer
- data Float
- data Double
- newtype CountOf ty = CountOf Int
- newtype Offset ty = Offset Int
- toCount :: Int -> CountOf ty
- fromCount :: CountOf ty -> Int
- data UArray ty
- class Eq ty => PrimType ty
- data Array a
- data String
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- class Semigroup a
- class Semigroup a => Monoid a where
- (<>) :: Semigroup a => a -> a -> a
- class (IsList c, Item c ~ Element c) => Collection c where
- null :: c -> Bool
- length :: c -> CountOf (Element c)
- elem :: (Eq a, a ~ Element c) => Element c -> c -> Bool
- notElem :: (Eq a, a ~ Element c) => Element c -> c -> Bool
- maximum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c
- minimum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c
- any :: (Element c -> Bool) -> c -> Bool
- all :: (Element c -> Bool) -> c -> Bool
- and :: (Collection col, Element col ~ Bool) => col -> Bool
- or :: (Collection col, Element col ~ Bool) => col -> Bool
- class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where
- take :: CountOf (Element c) -> c -> c
- revTake :: CountOf (Element c) -> c -> c
- drop :: CountOf (Element c) -> c -> c
- revDrop :: CountOf (Element c) -> c -> c
- splitAt :: CountOf (Element c) -> c -> (c, c)
- revSplitAt :: CountOf (Element c) -> c -> (c, c)
- splitOn :: (Element c -> Bool) -> c -> [c]
- break :: (Element c -> Bool) -> c -> (c, c)
- breakEnd :: (Element c -> Bool) -> c -> (c, c)
- breakElem :: Element c -> c -> (c, c)
- takeWhile :: (Element c -> Bool) -> c -> c
- dropWhile :: (Element c -> Bool) -> c -> c
- intersperse :: Element c -> c -> c
- intercalate :: Element c -> c -> Element c
- span :: (Element c -> Bool) -> c -> (c, c)
- spanEnd :: (Element c -> Bool) -> c -> (c, c)
- filter :: (Element c -> Bool) -> c -> c
- partition :: (Element c -> Bool) -> c -> (c, c)
- reverse :: c -> c
- uncons :: c -> Maybe (Element c, c)
- unsnoc :: c -> Maybe (c, Element c)
- snoc :: c -> Element c -> c
- cons :: Element c -> c -> c
- find :: (Element c -> Bool) -> c -> Maybe (Element c)
- sortBy :: (Element c -> Element c -> Ordering) -> c -> c
- singleton :: Element c -> c
- head :: NonEmpty c -> Element c
- last :: NonEmpty c -> Element c
- tail :: NonEmpty c -> c
- init :: NonEmpty c -> c
- replicate :: CountOf (Element c) -> Element c -> c
- isPrefixOf :: c -> c -> Bool
- isSuffixOf :: c -> c -> Bool
- isInfixOf :: c -> c -> Bool
- stripPrefix :: c -> c -> Maybe c
- stripSuffix :: c -> c -> Maybe c
- data NonEmpty a
- nonEmpty :: Collection c => c -> Maybe (NonEmpty c)
- class Foldable collection where
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- catMaybes :: [Maybe a] -> [a]
- fromMaybe :: a -> Maybe a -> a
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- partitionEithers :: [Either a b] -> ([a], [b])
- lefts :: [Either a b] -> [a]
- rights :: [Either a b] -> [b]
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- (<|>) :: Alternative f => f a -> f a -> f a
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- class (Typeable e, Show e) => Exception e where
- toException :: e -> SomeException
- fromException :: SomeException -> Maybe e
- displayException :: e -> String
- backtraceDesired :: e -> Bool
- class Typeable (a :: k)
- data SomeException
- data IOException
- data Proxy (t :: k) = Proxy
- asProxyTypeOf :: a -> proxy a -> a
- data Partial a
- partial :: a -> Partial a
- data PartialError
- fromPartial :: Partial a -> a
- ifThenElse :: Bool -> a -> a -> a
- type LString = String
Standard
Operators
($) :: (a -> b) -> a -> b infixr 0 #
is the function application operator.($)
Applying to a function ($)f and an argument x gives the same result as applying f to x directly. The definition is akin to this:
($) :: (a -> b) -> a -> b ($) f x = f x
This is specialized from ida -> a to (a -> b) -> (a -> b) which by the associativity of (->)
is the same as (a -> b) -> a -> b.
On the face of it, this may appear pointless! But it's actually one of the most useful and important operators in Haskell.
The order of operations is very different between ($) and normal function application. Normal function application has precedence 10 - higher than any operator - and associates to the left. So these two definitions are equivalent:
expr = min 5 1 + 5 expr = ((min 5) 1) + 5
($) has precedence 0 (the lowest) and associates to the right, so these are equivalent:
expr = min 5 $ 1 + 5 expr = (min 5) (1 + 5)
Examples
A common use cases of ($) is to avoid parentheses in complex expressions.
For example, instead of using nested parentheses in the following Haskell function:
-- | Sum numbers in a string: strSum "100 5 -7" == 98 strSum ::String->IntstrSum s =sum(mapMaybereadMaybe(wordss))
we can deploy the function application operator:
-- | Sum numbers in a string: strSum "100 5 -7" == 98 strSum ::String->IntstrSum s =sum$mapMaybereadMaybe$wordss
($) is also used as a section (a partially applied operator), in order to indicate that we wish to apply some yet-unspecified function to a given value. For example, to apply the argument 5 to a list of functions:
applyFive :: [Int] applyFive = map ($ 5) [(+1), (2^)] >>> [6, 32]
Technical Remark (Representation Polymorphism)
($) is fully representation-polymorphic. This allows it to also be used with arguments of unlifted and even unboxed kinds, such as unboxed integers:
fastMod :: Int -> Int -> Int fastMod (I# x) (I# m) = I# $ remInt# x m
($!) :: (a -> b) -> a -> b infixr 0 #
Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.
(.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c infixr 9 #
morphism composition
Functions
Class of product types that have a first element
Associated Types
type ProductFirst a #
Methods
fst :: a -> ProductFirst a #
Instances
| Fstable (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple2 a b -> ProductFirst (Tuple2 a b) # | |||||
| Fstable (a, b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b) -> ProductFirst (a, b) # | |||||
| Fstable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple3 a b c -> ProductFirst (Tuple3 a b c) # | |||||
| Fstable (a, b, c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b, c) -> ProductFirst (a, b, c) # | |||||
| Fstable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple4 a b c d -> ProductFirst (Tuple4 a b c d) # | |||||
| Fstable (a, b, c, d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b, c, d) -> ProductFirst (a, b, c, d) # | |||||
Class of product types that have a second element
Associated Types
type ProductSecond a #
Methods
snd :: a -> ProductSecond a #
Instances
| Sndable (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple2 a b -> ProductSecond (Tuple2 a b) # | |||||
| Sndable (a, b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b) -> ProductSecond (a, b) # | |||||
| Sndable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple3 a b c -> ProductSecond (Tuple3 a b c) # | |||||
| Sndable (a, b, c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b, c) -> ProductSecond (a, b, c) # | |||||
| Sndable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple4 a b c d -> ProductSecond (Tuple4 a b c d) # | |||||
| Sndable (a, b, c, d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b, c, d) -> ProductSecond (a, b, c, d) # | |||||
Strict tuple (a,b)
Constructors
| Tuple2 !a !b |
Instances
| Nthable 1 (Tuple2 a b) # | |||||
| Nthable 2 (Tuple2 a b) # | |||||
| (NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple2 a b -> () # | |||||
| (Hashable a, Hashable b) => Hashable (Tuple2 a b) # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Fstable (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple2 a b -> ProductFirst (Tuple2 a b) # | |||||
| Sndable (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple2 a b -> ProductSecond (Tuple2 a b) # | |||||
| (Data a, Data b) => Data (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Tuple2 a b -> c (Tuple2 a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tuple2 a b) # toConstr :: Tuple2 a b -> Constr # dataTypeOf :: Tuple2 a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Tuple2 a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tuple2 a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple2 a b -> Tuple2 a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Tuple2 a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple2 a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) # | |||||
| Generic (Tuple2 a b) # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b) => Show (Tuple2 a b) # | |||||
| (Eq a, Eq b) => Eq (Tuple2 a b) # | |||||
| (Ord a, Ord b) => Ord (Tuple2 a b) # | |||||
| type NthTy 1 (Tuple2 a b) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple2 a b) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple2 a b) # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple2 a b) # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple2 a b) # | |||||
Defined in Foundation.Tuple type Rep (Tuple2 a b) = D1 ('MetaData "Tuple2" "Foundation.Tuple" "foundation-0.0.30-410Msgl8Y3yCAXq1zpEi0p" 'False) (C1 ('MetaCons "Tuple2" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) | |||||
Strict tuple (a,b,c)
Constructors
| Tuple3 !a !b !c |
Instances
| Nthable 1 (Tuple3 a b c) # | |||||
| Nthable 2 (Tuple3 a b c) # | |||||
| Nthable 3 (Tuple3 a b c) # | |||||
| (NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple3 a b c -> () # | |||||
| (Hashable a, Hashable b, Hashable c) => Hashable (Tuple3 a b c) # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Fstable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple3 a b c -> ProductFirst (Tuple3 a b c) # | |||||
| Sndable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple3 a b c -> ProductSecond (Tuple3 a b c) # | |||||
| Thdable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: Tuple3 a b c -> ProductThird (Tuple3 a b c) # | |||||
| (Data a, Data b, Data c) => Data (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Methods gfoldl :: (forall d b0. Data d => c0 (d -> b0) -> d -> c0 b0) -> (forall g. g -> c0 g) -> Tuple3 a b c -> c0 (Tuple3 a b c) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (Tuple3 a b c) # toConstr :: Tuple3 a b c -> Constr # dataTypeOf :: Tuple3 a b c -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (Tuple3 a b c)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (Tuple3 a b c)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple3 a b c -> Tuple3 a b c # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r # gmapQ :: (forall d. Data d => d -> u) -> Tuple3 a b c -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple3 a b c -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) # | |||||
| Generic (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b, Show c) => Show (Tuple3 a b c) # | |||||
| (Eq a, Eq b, Eq c) => Eq (Tuple3 a b c) # | |||||
| (Ord a, Ord b, Ord c) => Ord (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple | |||||
| type NthTy 1 (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 3 (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple | |||||
| type ProductThird (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple type Rep (Tuple3 a b c) = D1 ('MetaData "Tuple3" "Foundation.Tuple" "foundation-0.0.30-410Msgl8Y3yCAXq1zpEi0p" 'False) (C1 ('MetaCons "Tuple3" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 c)))) | |||||
Strict tuple (a,b,c,d)
Constructors
| Tuple4 !a !b !c !d |
Instances
| Nthable 1 (Tuple4 a b c d) # | |||||
| Nthable 2 (Tuple4 a b c d) # | |||||
| Nthable 3 (Tuple4 a b c d) # | |||||
| Nthable 4 (Tuple4 a b c d) # | |||||
| (NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple4 a b c d -> () # | |||||
| (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (Tuple4 a b c d) # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Fstable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: Tuple4 a b c d -> ProductFirst (Tuple4 a b c d) # | |||||
| Sndable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: Tuple4 a b c d -> ProductSecond (Tuple4 a b c d) # | |||||
| Thdable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: Tuple4 a b c d -> ProductThird (Tuple4 a b c d) # | |||||
| (Data a, Data b, Data c, Data d) => Data (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Methods gfoldl :: (forall d0 b0. Data d0 => c0 (d0 -> b0) -> d0 -> c0 b0) -> (forall g. g -> c0 g) -> Tuple4 a b c d -> c0 (Tuple4 a b c d) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (Tuple4 a b c d) # toConstr :: Tuple4 a b c d -> Constr # dataTypeOf :: Tuple4 a b c d -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (Tuple4 a b c d)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c0 (t d0 e)) -> Maybe (c0 (Tuple4 a b c d)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple4 a b c d -> Tuple4 a b c d # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Tuple4 a b c d -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Tuple4 a b c d -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Tuple4 a b c d -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Tuple4 a b c d -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) # | |||||
| Generic (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b, Show c, Show d) => Show (Tuple4 a b c d) # | |||||
| (Eq a, Eq b, Eq c, Eq d) => Eq (Tuple4 a b c d) # | |||||
| (Ord a, Ord b, Ord c, Ord d) => Ord (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Methods compare :: Tuple4 a b c d -> Tuple4 a b c d -> Ordering # (<) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (<=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (>) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (>=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # | |||||
| type NthTy 1 (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 3 (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 4 (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple | |||||
| type ProductThird (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple type Rep (Tuple4 a b c d) = D1 ('MetaData "Tuple4" "Foundation.Tuple" "foundation-0.0.30-410Msgl8Y3yCAXq1zpEi0p" 'False) (C1 ('MetaCons "Tuple4" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 c) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 d)))) | |||||
Class of product types that have a third element
Associated Types
type ProductThird a #
Methods
thd :: a -> ProductThird a #
Instances
| Thdable (Tuple3 a b c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: Tuple3 a b c -> ProductThird (Tuple3 a b c) # | |||||
| Thdable (a, b, c) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: (a, b, c) -> ProductThird (a, b, c) # | |||||
| Thdable (Tuple4 a b c d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: Tuple4 a b c d -> ProductThird (Tuple4 a b c d) # | |||||
| Thdable (a, b, c, d) # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: (a, b, c, d) -> ProductThird (a, b, c, d) # | |||||
type family ProductFirst a #
Instances
| type ProductFirst (Tuple2 a b) # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b) # | |
Defined in Foundation.Tuple type ProductFirst (a, b) = a | |
| type ProductFirst (Tuple3 a b c) # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b, c) # | |
Defined in Foundation.Tuple type ProductFirst (a, b, c) = a | |
| type ProductFirst (Tuple4 a b c d) # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b, c, d) # | |
Defined in Foundation.Tuple type ProductFirst (a, b, c, d) = a | |
type family ProductSecond a #
Instances
| type ProductSecond (Tuple2 a b) # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b) # | |
Defined in Foundation.Tuple type ProductSecond (a, b) = b | |
| type ProductSecond (Tuple3 a b c) # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b, c) # | |
Defined in Foundation.Tuple type ProductSecond (a, b, c) = b | |
| type ProductSecond (Tuple4 a b c d) # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b, c, d) # | |
Defined in Foundation.Tuple type ProductSecond (a, b, c, d) = b | |
type family ProductThird a #
Instances
| type ProductThird (Tuple3 a b c) # | |
Defined in Foundation.Tuple | |
| type ProductThird (a, b, c) # | |
Defined in Foundation.Tuple type ProductThird (a, b, c) = c | |
| type ProductThird (Tuple4 a b c d) # | |
Defined in Foundation.Tuple | |
| type ProductThird (a, b, c, d) # | |
Defined in Foundation.Tuple type ProductThird (a, b, c, d) = c | |
maybe :: b -> (a -> b) -> Maybe a -> b #
The maybe function takes a default value, a function, and a Maybe
value. If the Maybe value is Nothing, the function returns the
default value. Otherwise, it applies the function to the value inside
the Just and returns the result.
Examples
Basic usage:
>>>maybe False odd (Just 3)True
>>>maybe False odd NothingFalse
Read an integer from a string using readMaybe. If we succeed,
return twice the integer; that is, apply (*2) to it. If instead
we fail to parse an integer, return 0 by default:
>>>import GHC.Internal.Text.Read ( readMaybe )>>>maybe 0 (*2) (readMaybe "5")10>>>maybe 0 (*2) (readMaybe "")0
Apply show to a Maybe Int. If we have Just n, we want to show
the underlying Int n. But if we have Nothing, we return the
empty string instead of (for example) "Nothing":
>>>maybe "" show (Just 5)"5">>>maybe "" show Nothing""
either :: (a -> c) -> (b -> c) -> Either a b -> c #
Case analysis for the Either type.
If the value is , apply the first function to Left aa;
if it is , apply the second function to Right bb.
Examples
We create two values of type , one using the
Either String IntLeft constructor and another using the Right constructor. Then
we apply "either" the length function (if we have a String)
or the "times-two" function (if we have an Int):
>>>let s = Left "foo" :: Either String Int>>>let n = Right 3 :: Either String Int>>>either length (*2) s3>>>either length (*2) n6
flip :: (a -> b -> c) -> b -> a -> c #
takes its (first) two arguments in the reverse order of flip ff.
flip f x y = f y x
flip . flip = id
Examples
>>>flip (++) "hello" "world""worldhello"
>>>let (.>) = flip (.) in (+1) .> show $ 5"6"
const x y always evaluates to x, ignoring its second argument.
const x = \_ -> x
This function might seem useless at first glance, but it can be very useful in a higher order context.
Examples
>>>const 42 "hello"42
>>>map (const 42) [0..3][42,42,42,42]
error :: HasCallStack => String -> a #
stop execution and displays an error message
Returns a list of the program's command line arguments (not including the program name).
uncurry :: (a -> b -> c) -> (a, b) -> c #
uncurry converts a curried function to a function on pairs.
Examples
>>>uncurry (+) (1,2)3
>>>uncurry ($) (show, 1)"1"
>>>map (uncurry max) [(1,2), (3,4), (6,8)][2,4,8]
curry :: ((a, b) -> c) -> a -> b -> c #
Convert an uncurried function to a curried function.
Examples
>>>curry fst 1 21
until :: (a -> Bool) -> (a -> a) -> a -> a #
yields the result of applying until p ff until p holds.
undefined :: HasCallStack => a #
The value of is bottom if seq a ba is bottom, and
otherwise equal to b. In other words, it evaluates the first
argument a to weak head normal form (WHNF). seq is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression does
not guarantee that seq a ba will be evaluated before b.
The only guarantee given by seq is that the both a
and b will be evaluated before seq returns a value.
In particular, this means that b may be evaluated before
a. If you need to guarantee a specific order of evaluation,
you must use the function pseq from the "parallel" package.
class NormalForm a #
Data that can be fully evaluated in Normal Form
Minimal complete definition
Instances
deepseq :: NormalForm a => a -> b -> b #
force :: NormalForm a => a -> a #
Type classes
Conversion of values to readable Strings.
Derived instances of Show have the following properties, which
are compatible with derived instances of Read:
- The result of
showis a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used. - If the constructor is defined to be an infix operator, then
showsPrecwill produce infix applications of the constructor. - the representation will be enclosed in parentheses if the
precedence of the top-level constructor in
xis less thand(associativity is ignored). Thus, ifdis0then the result is never surrounded in parentheses; ifdis11it is always surrounded in parentheses, unless it is an atomic expression. - If the constructor is defined using record syntax, then
showwill produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a
the derived instance of Show is equivalent to
instance (Show a) => Show (Tree a) where
showsPrec d (Leaf m) = showParen (d > app_prec) $
showString "Leaf " . showsPrec (app_prec+1) m
where app_prec = 10
showsPrec d (u :^: v) = showParen (d > up_prec) $
showsPrec (up_prec+1) u .
showString " :^: " .
showsPrec (up_prec+1) v
where up_prec = 5Note that right-associativity of :^: is ignored. For example,
produces the stringshow(Leaf 1 :^: Leaf 2 :^: Leaf 3)"Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
Instances
show :: Show a => a -> String #
Use the Show class to create a String.
Note that this is not efficient, since an intermediate [Char] is going to be created before turning into a real String.
The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype whose
constituent types are in Ord. The declared order of the constructors in
the data declaration determines the ordering in derived Ord instances. The
Ordering datatype allows a single comparison to determine the precise
ordering of two objects.
Ord, as defined by the Haskell report, implements a total order and has the
following properties:
- Comparability
x <= y || y <= x=True- Transitivity
- if
x <= y && y <= z=True, thenx <= z=True - Reflexivity
x <= x=True- Antisymmetry
- if
x <= y && y <= x=True, thenx == y=True
The following operator interactions are expected to hold:
x >= y=y <= xx < y=x <= y && x /= yx > y=y < xx < y=compare x y == LTx > y=compare x y == GTx == y=compare x y == EQmin x y == if x <= y then x else y=Truemax x y == if x >= y then x else y=True
Note that (7.) and (8.) do not require min and max to return either of
their arguments. The result is merely required to equal one of the
arguments in terms of (==).
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.
Methods
compare :: a -> a -> Ordering #
(<) :: a -> a -> Bool infix 4 #
(<=) :: a -> a -> Bool infix 4 #
(>) :: a -> a -> Bool infix 4 #
Instances
| Ord ByteArray | Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions. Since: base-4.17.0.0 |
| Ord Encoding | |
Defined in Basement.String | |
| Ord UTF32_Invalid | |
Defined in Basement.String.Encoding.UTF32 Methods compare :: UTF32_Invalid -> UTF32_Invalid -> Ordering # (<) :: UTF32_Invalid -> UTF32_Invalid -> Bool # (<=) :: UTF32_Invalid -> UTF32_Invalid -> Bool # (>) :: UTF32_Invalid -> UTF32_Invalid -> Bool # (>=) :: UTF32_Invalid -> UTF32_Invalid -> Bool # | |
| Ord AsciiString | |
Defined in Basement.Types.AsciiString Methods compare :: AsciiString -> AsciiString -> Ordering # (<) :: AsciiString -> AsciiString -> Bool # (<=) :: AsciiString -> AsciiString -> Bool # (>) :: AsciiString -> AsciiString -> Bool # (>=) :: AsciiString -> AsciiString -> Bool # max :: AsciiString -> AsciiString -> AsciiString # min :: AsciiString -> AsciiString -> AsciiString # | |
| Ord Char7 | |
| Ord FileSize | |
Defined in Basement.Types.OffsetSize | |
| Ord Addr | |
| Ord Word128 | |
Defined in Basement.Types.Word128 | |
| Ord Word256 | |
Defined in Basement.Types.Word256 | |
| Ord String | |
| Ord Bitmap # | |
| Ord Escaping # | |
Defined in Foundation.Format.CSV.Types | |
| Ord IPv4 # | |
| Ord IPv6 # | |
| Ord Arch # | |
| Ord OS # | |
| Ord NanoSeconds # | |
Defined in Foundation.Time.Types Methods compare :: NanoSeconds -> NanoSeconds -> Ordering # (<) :: NanoSeconds -> NanoSeconds -> Bool # (<=) :: NanoSeconds -> NanoSeconds -> Bool # (>) :: NanoSeconds -> NanoSeconds -> Bool # (>=) :: NanoSeconds -> NanoSeconds -> Bool # max :: NanoSeconds -> NanoSeconds -> NanoSeconds # min :: NanoSeconds -> NanoSeconds -> NanoSeconds # | |
| Ord Seconds # | |
Defined in Foundation.Time.Types | |
| Ord UUID # | |
| Ord FilePath # | |
Defined in Foundation.VFS.FilePath | |
| Ord BigNat | |
| Ord Void | @since base-4.8.0.0 |
| Ord BlockReason | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync Methods compare :: BlockReason -> BlockReason -> Ordering # (<) :: BlockReason -> BlockReason -> Bool # (<=) :: BlockReason -> BlockReason -> Bool # (>) :: BlockReason -> BlockReason -> Bool # (>=) :: BlockReason -> BlockReason -> Bool # max :: BlockReason -> BlockReason -> BlockReason # min :: BlockReason -> BlockReason -> BlockReason # | |
| Ord ThreadId | @since base-4.2.0.0 |
Defined in GHC.Internal.Conc.Sync | |
| Ord ThreadStatus | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync Methods compare :: ThreadStatus -> ThreadStatus -> Ordering # (<) :: ThreadStatus -> ThreadStatus -> Bool # (<=) :: ThreadStatus -> ThreadStatus -> Bool # (>) :: ThreadStatus -> ThreadStatus -> Bool # (>=) :: ThreadStatus -> ThreadStatus -> Bool # max :: ThreadStatus -> ThreadStatus -> ThreadStatus # min :: ThreadStatus -> ThreadStatus -> ThreadStatus # | |
| Ord All | @since base-2.01 |
| Ord Any | @since base-2.01 |
| Ord SomeTypeRep | |
Defined in GHC.Internal.Data.Typeable.Internal Methods compare :: SomeTypeRep -> SomeTypeRep -> Ordering # (<) :: SomeTypeRep -> SomeTypeRep -> Bool # (<=) :: SomeTypeRep -> SomeTypeRep -> Bool # (>) :: SomeTypeRep -> SomeTypeRep -> Bool # (>=) :: SomeTypeRep -> SomeTypeRep -> Bool # max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep # min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep # | |
| Ord Version | @since base-2.01 |
Defined in GHC.Internal.Data.Version | |
| Ord ErrorCall | @since base-4.7.0.0 |
| Ord ArithException | @since base-3.0 |
Defined in GHC.Internal.Exception.Type Methods compare :: ArithException -> ArithException -> Ordering # (<) :: ArithException -> ArithException -> Bool # (<=) :: ArithException -> ArithException -> Bool # (>) :: ArithException -> ArithException -> Bool # (>=) :: ArithException -> ArithException -> Bool # max :: ArithException -> ArithException -> ArithException # min :: ArithException -> ArithException -> ArithException # | |
| Ord CBool | |
| Ord CChar | |
| Ord CClock | |
| Ord CDouble | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CFloat | |
| Ord CInt | |
| Ord CIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CLLong | |
| Ord CLong | |
| Ord CPtrdiff | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CSChar | |
| Ord CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods compare :: CSUSeconds -> CSUSeconds -> Ordering # (<) :: CSUSeconds -> CSUSeconds -> Bool # (<=) :: CSUSeconds -> CSUSeconds -> Bool # (>) :: CSUSeconds -> CSUSeconds -> Bool # (>=) :: CSUSeconds -> CSUSeconds -> Bool # max :: CSUSeconds -> CSUSeconds -> CSUSeconds # min :: CSUSeconds -> CSUSeconds -> CSUSeconds # | |
| Ord CShort | |
| Ord CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods compare :: CSigAtomic -> CSigAtomic -> Ordering # (<) :: CSigAtomic -> CSigAtomic -> Bool # (<=) :: CSigAtomic -> CSigAtomic -> Bool # (>) :: CSigAtomic -> CSigAtomic -> Bool # (>=) :: CSigAtomic -> CSigAtomic -> Bool # max :: CSigAtomic -> CSigAtomic -> CSigAtomic # min :: CSigAtomic -> CSigAtomic -> CSigAtomic # | |
| Ord CSize | |
| Ord CTime | |
| Ord CUChar | |
| Ord CUInt | |
| Ord CUIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CUIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CULLong | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CULong | |
| Ord CUSeconds | |
| Ord CUShort | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CWchar | |
| Ord Associativity | @since base-4.6.0.0 |
Defined in GHC.Internal.Generics Methods compare :: Associativity -> Associativity -> Ordering # (<) :: Associativity -> Associativity -> Bool # (<=) :: Associativity -> Associativity -> Bool # (>) :: Associativity -> Associativity -> Bool # (>=) :: Associativity -> Associativity -> Bool # max :: Associativity -> Associativity -> Associativity # min :: Associativity -> Associativity -> Associativity # | |
| Ord DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering # (<) :: DecidedStrictness -> DecidedStrictness -> Bool # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool # (>) :: DecidedStrictness -> DecidedStrictness -> Bool # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # | |
| Ord Fixity | @since base-4.6.0.0 |
| Ord SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: SourceStrictness -> SourceStrictness -> Ordering # (<) :: SourceStrictness -> SourceStrictness -> Bool # (<=) :: SourceStrictness -> SourceStrictness -> Bool # (>) :: SourceStrictness -> SourceStrictness -> Bool # (>=) :: SourceStrictness -> SourceStrictness -> Bool # max :: SourceStrictness -> SourceStrictness -> SourceStrictness # min :: SourceStrictness -> SourceStrictness -> SourceStrictness # | |
| Ord SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # | |
| Ord SeekMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Device | |
| Ord ArrayException | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering # (<) :: ArrayException -> ArrayException -> Bool # (<=) :: ArrayException -> ArrayException -> Bool # (>) :: ArrayException -> ArrayException -> Bool # (>=) :: ArrayException -> ArrayException -> Bool # max :: ArrayException -> ArrayException -> ArrayException # min :: ArrayException -> ArrayException -> ArrayException # | |
| Ord AsyncException | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering # (<) :: AsyncException -> AsyncException -> Bool # (<=) :: AsyncException -> AsyncException -> Bool # (>) :: AsyncException -> AsyncException -> Bool # (>=) :: AsyncException -> AsyncException -> Bool # max :: AsyncException -> AsyncException -> AsyncException # min :: AsyncException -> AsyncException -> AsyncException # | |
| Ord ExitCode | |
Defined in GHC.Internal.IO.Exception | |
| Ord BufferMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types Methods compare :: BufferMode -> BufferMode -> Ordering # (<) :: BufferMode -> BufferMode -> Bool # (<=) :: BufferMode -> BufferMode -> Bool # (>) :: BufferMode -> BufferMode -> Bool # (>=) :: BufferMode -> BufferMode -> Bool # max :: BufferMode -> BufferMode -> BufferMode # min :: BufferMode -> BufferMode -> BufferMode # | |
| Ord Newline | @since base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Ord NewlineMode | @since base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types Methods compare :: NewlineMode -> NewlineMode -> Ordering # (<) :: NewlineMode -> NewlineMode -> Bool # (<=) :: NewlineMode -> NewlineMode -> Bool # (>) :: NewlineMode -> NewlineMode -> Bool # (>=) :: NewlineMode -> NewlineMode -> Bool # max :: NewlineMode -> NewlineMode -> NewlineMode # min :: NewlineMode -> NewlineMode -> NewlineMode # | |
| Ord IOMode | @since base-4.2.0.0 |
| Ord Int16 | @since base-2.01 |
| Ord Int32 | @since base-2.01 |
| Ord Int64 | @since base-2.01 |
| Ord Int8 | @since base-2.01 |
| Ord CBlkCnt | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CBlkSize | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CCc | |
| Ord CClockId | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CDev | |
| Ord CFsBlkCnt | |
| Ord CFsFilCnt | |
| Ord CGid | |
| Ord CId | |
| Ord CIno | |
| Ord CKey | |
| Ord CMode | |
| Ord CNfds | |
| Ord CNlink | |
| Ord COff | |
| Ord CPid | |
| Ord CRLim | |
| Ord CSocklen | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CSpeed | |
| Ord CSsize | |
| Ord CTcflag | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CTimer | |
| Ord CUid | |
| Ord Fd | |
| Ord SomeNat | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeNats | |
| Ord GeneralCategory | @since base-2.01 |
Defined in GHC.Internal.Unicode Methods compare :: GeneralCategory -> GeneralCategory -> Ordering # (<) :: GeneralCategory -> GeneralCategory -> Bool # (<=) :: GeneralCategory -> GeneralCategory -> Bool # (>) :: GeneralCategory -> GeneralCategory -> Bool # (>=) :: GeneralCategory -> GeneralCategory -> Bool # max :: GeneralCategory -> GeneralCategory -> GeneralCategory # min :: GeneralCategory -> GeneralCategory -> GeneralCategory # | |
| Ord Word16 | @since base-2.01 |
| Ord Word32 | @since base-2.01 |
| Ord Word64 | @since base-2.01 |
| Ord Word8 | @since base-2.01 |
| Ord Ordering | |
Defined in GHC.Classes | |
| Ord TyCon | |
| Ord Integer | |
| Ord Natural | |
| Ord () | |
| Ord Bool | |
| Ord Char | |
| Ord Double | IEEE 754 IEEE 754-2008, section 5.11 requires that if at least one of arguments of
IEEE 754-2008, section 5.10 defines Thus, users must be extremely cautious when using Moving further, the behaviour of IEEE 754-2008 compliant |
| Ord Float | See |
| Ord Int | |
| Ord Word | |
| Ord a => Ord (First a) | Since: base-4.9.0.0 |
| Ord a => Ord (Last a) | Since: base-4.9.0.0 |
| Ord a => Ord (Max a) | Since: base-4.9.0.0 |
| Ord a => Ord (Min a) | Since: base-4.9.0.0 |
| Ord m => Ord (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # | |
| Ord (Bits n) | |
| (PrimType ty, Ord ty) => Ord (Block ty) | |
Defined in Basement.Block.Base | |
| Ord (Zn n) | |
| Ord (Zn64 n) | |
| Ord a => Ord (Array a) | |
| (ByteSwap a, Ord a) => Ord (BE a) | |
| (ByteSwap a, Ord a) => Ord (LE a) | |
| Ord (FinalPtr a) | |
| Ord (CountOf ty) | |
Defined in Basement.Types.OffsetSize | |
| Ord (Offset ty) | |
| (PrimType ty, Ord ty) => Ord (UArray ty) | |
| (PrimType ty, Ord ty) => Ord (ChunkedUArray ty) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods compare :: ChunkedUArray ty -> ChunkedUArray ty -> Ordering # (<) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (<=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (>) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (>=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # max :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty # min :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty # | |
| Ord a => Ord (DList a) # | |
Defined in Foundation.List.DList | |
| Ord a => Ord (NonEmpty a) | @since base-4.9.0.0 |
| Ord a => Ord (Identity a) | @since base-4.8.0.0 |
Defined in GHC.Internal.Data.Functor.Identity | |
| Ord a => Ord (First a) | @since base-2.01 |
Defined in GHC.Internal.Data.Monoid | |
| Ord a => Ord (Last a) | @since base-2.01 |
| Ord a => Ord (Dual a) | @since base-2.01 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord a => Ord (Product a) | @since base-2.01 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord a => Ord (Sum a) | @since base-2.01 |
| Ord (ForeignPtr a) | @since base-2.01 |
Defined in GHC.Internal.ForeignPtr Methods compare :: ForeignPtr a -> ForeignPtr a -> Ordering # (<) :: ForeignPtr a -> ForeignPtr a -> Bool # (<=) :: ForeignPtr a -> ForeignPtr a -> Bool # (>) :: ForeignPtr a -> ForeignPtr a -> Bool # (>=) :: ForeignPtr a -> ForeignPtr a -> Bool # max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a # min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a # | |
| Ord a => Ord (ZipList a) | @since base-4.7.0.0 |
| Ord p => Ord (Par1 p) | @since base-4.7.0.0 |
| Ord (FunPtr a) | |
Defined in GHC.Internal.Ptr | |
| Ord (Ptr a) | @since base-2.01 |
| Integral a => Ord (Ratio a) | @since base-2.0.1 |
| Ord (SNat n) | @since base-4.19.0.0 |
| Ord a => Ord (Maybe a) | @since base-2.01 |
| Ord a => Ord (Solo a) | |
| Ord a => Ord [a] | |
| Ord (Fixed a) | Since: base-2.1 |
| Ord a => Ord (Arg a b) | Since: base-4.9.0.0 |
| (PrimType a, Ord a) => Ord (BlockN n a) | |
Defined in Basement.Sized.Block | |
| Ord a => Ord (ListN n a) | |
| (Ord a, Ord b) => Ord (These a b) | |
| (Ord a, Ord b) => Ord (Tuple2 a b) # | |
| (Ord a, Ord b) => Ord (Either a b) | @since base-2.01 |
Defined in GHC.Internal.Data.Either | |
| Ord (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
| Ord (TypeRep a) | @since base-4.4.0.0 |
Defined in GHC.Internal.Data.Typeable.Internal | |
| Ord (U1 p) | @since base-4.7.0.0 |
| Ord (V1 p) | @since base-4.9.0.0 |
| (Ord a, Ord b) => Ord (a, b) | |
| (Ord a, Ord b, Ord c) => Ord (Tuple3 a b c) # | |
Defined in Foundation.Tuple | |
| Ord a => Ord (Const a b) | @since base-4.9.0.0 |
| Ord (f a) => Ord (Ap f a) | @since base-4.12.0.0 |
| Ord (f a) => Ord (Alt f a) | @since base-4.8.0.0 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| (Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) | @since base-4.18.0.0 |
Defined in GHC.Internal.Generics Methods compare :: Generically1 f a -> Generically1 f a -> Ordering # (<) :: Generically1 f a -> Generically1 f a -> Bool # (<=) :: Generically1 f a -> Generically1 f a -> Bool # (>) :: Generically1 f a -> Generically1 f a -> Bool # (>=) :: Generically1 f a -> Generically1 f a -> Bool # max :: Generically1 f a -> Generically1 f a -> Generically1 f a # min :: Generically1 f a -> Generically1 f a -> Generically1 f a # | |
| Ord (f p) => Ord (Rec1 f p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| Ord (URec (Ptr ()) p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # | |
| Ord (URec Char p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Ord (URec Double p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec Double p -> URec Double p -> Ordering # (<) :: URec Double p -> URec Double p -> Bool # (<=) :: URec Double p -> URec Double p -> Bool # (>) :: URec Double p -> URec Double p -> Bool # (>=) :: URec Double p -> URec Double p -> Bool # | |
| Ord (URec Float p) | |
Defined in GHC.Internal.Generics | |
| Ord (URec Int p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Ord (URec Word p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| (Ord a, Ord b, Ord c) => Ord (a, b, c) | |
| (Ord (f a), Ord (g a)) => Ord (Product f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Product Methods compare :: Product f g a -> Product f g a -> Ordering # (<) :: Product f g a -> Product f g a -> Bool # (<=) :: Product f g a -> Product f g a -> Bool # (>) :: Product f g a -> Product f g a -> Bool # (>=) :: Product f g a -> Product f g a -> Bool # | |
| (Ord (f a), Ord (g a)) => Ord (Sum f g a) | Since: base-4.18.0.0 |
| (Ord a, Ord b, Ord c, Ord d) => Ord (Tuple4 a b c d) # | |
Defined in Foundation.Tuple Methods compare :: Tuple4 a b c d -> Tuple4 a b c d -> Ordering # (<) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (<=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (>) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # (>=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool # | |
| (Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| (Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| Ord c => Ord (K1 i c p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) | |
Defined in GHC.Classes | |
| Ord (f (g a)) => Ord (Compose f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Compose Methods compare :: Compose f g a -> Compose f g a -> Ordering # (<) :: Compose f g a -> Compose f g a -> Bool # (<=) :: Compose f g a -> Compose f g a -> Bool # (>) :: Compose f g a -> Compose f g a -> Bool # (>=) :: Compose f g a -> Compose f g a -> Bool # | |
| Ord (f (g p)) => Ord ((f :.: g) p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| Ord (f p) => Ord (M1 i c f p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
| (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering # (<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering # (<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering # (<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering # (<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
The Eq class defines equality (==) and inequality (/=).
All the basic datatypes exported by the Prelude are instances of Eq,
and Eq may be derived for any datatype whose constituents are also
instances of Eq.
The Haskell Report defines no laws for Eq. However, instances are
encouraged to follow these properties:
Instances
| Eq ByteArray | Since: base-4.17.0.0 |
| Eq Timeout | |
| Eq PinnedStatus | |
Defined in Basement.Compat.Primitive | |
| Eq Endianness | |
Defined in Basement.Endianness | |
| Eq OutOfBoundOperation | |
Defined in Basement.Exception Methods (==) :: OutOfBoundOperation -> OutOfBoundOperation -> Bool # (/=) :: OutOfBoundOperation -> OutOfBoundOperation -> Bool # | |
| Eq RecastDestinationSize | |
Defined in Basement.Exception Methods (==) :: RecastDestinationSize -> RecastDestinationSize -> Bool # (/=) :: RecastDestinationSize -> RecastDestinationSize -> Bool # | |
| Eq RecastSourceSize | |
Defined in Basement.Exception Methods (==) :: RecastSourceSize -> RecastSourceSize -> Bool # (/=) :: RecastSourceSize -> RecastSourceSize -> Bool # | |
| Eq Encoding | |
| Eq ASCII7_Invalid | |
| Eq ISO_8859_1_Invalid | |
| Eq UTF16_Invalid | |
| Eq UTF32_Invalid | |
| Eq AsciiString | |
Defined in Basement.Types.AsciiString | |
| Eq Char7 | |
| Eq FileSize | |
| Eq Addr | |
| Eq Word128 | |
| Eq Word256 | |
| Eq String | |
| Eq CM | |
| Eq ValidationFailure | |
Defined in Basement.UTF8.Types Methods (==) :: ValidationFailure -> ValidationFailure -> Bool # (/=) :: ValidationFailure -> ValidationFailure -> Bool # | |
| Eq Bitmap # | |
| Eq CSV # | |
| Eq Escaping # | |
| Eq Field # | |
| Eq Row # | |
| Eq IPv4 # | |
| Eq IPv6 # | |
| Eq Sign # | |
| Eq And # | |
| Eq Condition # | |
| Eq PartialError # | |
Defined in Foundation.Partial | |
| Eq Arch # | |
| Eq OS # | |
| Eq NanoSeconds # | |
Defined in Foundation.Time.Types | |
| Eq Seconds # | |
| Eq UUID # | |
| Eq FileName # | |
| Eq FilePath # | |
| Eq Relativity # | |
Defined in Foundation.VFS.FilePath | |
| Eq BigNat | |
| Eq Void | @since base-4.8.0.0 |
| Eq BlockReason | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync | |
| Eq ThreadId | @since base-4.2.0.0 |
| Eq ThreadStatus | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync | |
| Eq Constr | Equality of constructors @since base-4.0.0.0 |
| Eq ConstrRep | @since base-4.0.0.0 |
| Eq DataRep | @since base-4.0.0.0 |
| Eq Fixity | @since base-4.0.0.0 |
| Eq All | @since base-2.01 |
| Eq Any | @since base-2.01 |
| Eq SomeTypeRep | |
Defined in GHC.Internal.Data.Typeable.Internal | |
| Eq Version | @since base-2.01 |
| Eq ErrorCall | @since base-4.7.0.0 |
| Eq ArithException | @since base-3.0 |
Defined in GHC.Internal.Exception.Type Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool # | |
| Eq Errno | @since base-2.01 |
| Eq CBool | |
| Eq CChar | |
| Eq CClock | |
| Eq CDouble | |
| Eq CFloat | |
| Eq CInt | |
| Eq CIntMax | |
| Eq CIntPtr | |
| Eq CLLong | |
| Eq CLong | |
| Eq CPtrdiff | |
| Eq CSChar | |
| Eq CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types | |
| Eq CShort | |
| Eq CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types | |
| Eq CSize | |
| Eq CTime | |
| Eq CUChar | |
| Eq CUInt | |
| Eq CUIntMax | |
| Eq CUIntPtr | |
| Eq CULLong | |
| Eq CULong | |
| Eq CUSeconds | |
| Eq CUShort | |
| Eq CWchar | |
| Eq Associativity | @since base-4.6.0.0 |
Defined in GHC.Internal.Generics Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
| Eq DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
| Eq Fixity | @since base-4.6.0.0 |
| Eq SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
| Eq SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
| Eq MaskingState | @since base-4.3.0.0 |
Defined in GHC.Internal.IO | |
| Eq IODeviceType | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Device | |
| Eq SeekMode | @since base-4.2.0.0 |
| Eq ArrayException | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool # | |
| Eq AsyncException | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool # | |
| Eq ExitCode | |
| Eq IOErrorType | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Eq IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Eq HandlePosn | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle | |
| Eq BufferMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Eq Handle | @since base-4.1.0.0 |
| Eq Newline | @since base-4.2.0.0 |
| Eq NewlineMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Eq IOMode | @since base-4.2.0.0 |
| Eq Int16 | @since base-2.01 |
| Eq Int32 | @since base-2.01 |
| Eq Int64 | @since base-2.01 |
| Eq Int8 | @since base-2.01 |
| Eq IoSubSystem | |
Defined in GHC.Internal.RTS.Flags | |
| Eq SrcLoc | @since base-4.9.0.0 |
| Eq CBlkCnt | |
| Eq CBlkSize | |
| Eq CCc | |
| Eq CClockId | |
| Eq CDev | |
| Eq CFsBlkCnt | |
| Eq CFsFilCnt | |
| Eq CGid | |
| Eq CId | |
| Eq CIno | |
| Eq CKey | |
| Eq CMode | |
| Eq CNfds | |
| Eq CNlink | |
| Eq COff | |
| Eq CPid | |
| Eq CRLim | |
| Eq CSocklen | |
| Eq CSpeed | |
| Eq CSsize | |
| Eq CTcflag | |
| Eq CTimer | |
| Eq CUid | |
| Eq Fd | |
| Eq SomeNat | @since base-4.7.0.0 |
| Eq GeneralCategory | @since base-2.01 |
Defined in GHC.Internal.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool # | |
| Eq Word16 | @since base-2.01 |
| Eq Word32 | @since base-2.01 |
| Eq Word64 | @since base-2.01 |
| Eq Word8 | @since base-2.01 |
| Eq Module | |
| Eq Ordering | |
| Eq TrName | |
| Eq TyCon | |
| Eq Integer | |
| Eq Natural | |
| Eq () | |
| Eq Bool | |
| Eq Char | |
| Eq Double | Note that due to the presence of
Also note that
|
| Eq Float | Note that due to the presence of
Also note that
|
| Eq Int | |
| Eq Word | |
| Eq (Chan a) | Since: base-4.4.0.0 |
| Eq (MutableByteArray s) | Since: base-4.17.0.0 |
Defined in Data.Array.Byte Methods (==) :: MutableByteArray s -> MutableByteArray s -> Bool # (/=) :: MutableByteArray s -> MutableByteArray s -> Bool # | |
| Eq a => Eq (Complex a) | Since: base-2.1 |
| Eq a => Eq (First a) | Since: base-4.9.0.0 |
| Eq a => Eq (Last a) | Since: base-4.9.0.0 |
| Eq a => Eq (Max a) | Since: base-4.9.0.0 |
| Eq a => Eq (Min a) | Since: base-4.9.0.0 |
| Eq m => Eq (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # | |
| Eq (Bits n) | |
| (PrimType ty, Eq ty) => Eq (Block ty) | |
| Eq (Zn n) | |
| Eq (Zn64 n) | |
| Eq a => Eq (Array a) | |
| Eq a => Eq (BE a) | |
| Eq a => Eq (LE a) | |
| Eq (FinalPtr a) | |
| Eq a => Eq (NonEmpty a) | |
| Eq (CountOf ty) | |
| Eq (Offset ty) | |
| (PrimType ty, Eq ty) => Eq (UArray ty) | |
| PrimType ty => Eq (ChunkedUArray ty) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods (==) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (/=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # | |
| Eq a => Eq (DList a) # | |
| Eq a => Eq (NonEmpty a) | @since base-4.9.0.0 |
| Eq (TVar a) | @since base-4.8.0.0 |
| Eq a => Eq (Identity a) | @since base-4.8.0.0 |
| Eq a => Eq (First a) | @since base-2.01 |
| Eq a => Eq (Last a) | @since base-2.01 |
| Eq a => Eq (Dual a) | @since base-2.01 |
| Eq a => Eq (Product a) | @since base-2.01 |
| Eq a => Eq (Sum a) | @since base-2.01 |
| Eq (ForeignPtr a) | @since base-2.01 |
Defined in GHC.Internal.ForeignPtr | |
| Eq a => Eq (ZipList a) | @since base-4.7.0.0 |
| Eq p => Eq (Par1 p) | @since base-4.7.0.0 |
| Eq (IORef a) | Pointer equality. @since base-4.0.0.0 |
| Eq (FunPtr a) | |
| Eq (Ptr a) | @since base-2.01 |
| Eq a => Eq (Ratio a) | @since base-2.01 |
| Eq (SNat n) | @since base-4.19.0.0 |
| Eq a => Eq (Maybe a) | @since base-2.01 |
| Eq a => Eq (Solo a) | |
| Eq a => Eq [a] | |
| Eq (Fixed a) | Since: base-2.1 |
| Eq a => Eq (Arg a b) | Since: base-4.9.0.0 |
| PrimType a => Eq (BlockN n a) | |
| Eq a => Eq (ListN n a) | |
| PrimType a => Eq (UVect n a) | |
| Eq a => Eq (Vect n a) | |
| (Eq a, Eq b) => Eq (These a b) | |
| (Eq a, Eq b) => Eq (Tuple2 a b) # | |
| (Eq a, Eq b) => Eq (Either a b) | @since base-2.01 |
| Eq (Proxy s) | @since base-4.7.0.0 |
| Eq (TypeRep a) | @since base-2.01 |
| Eq (U1 p) | @since base-4.9.0.0 |
| Eq (V1 p) | @since base-4.9.0.0 |
| (Eq a, Eq b) => Eq (a, b) | |
| (Eq a, Eq b, Eq c) => Eq (Tuple3 a b c) # | |
| Eq a => Eq (Const a b) | @since base-4.9.0.0 |
| Eq (f a) => Eq (Ap f a) | @since base-4.12.0.0 |
| Eq (f a) => Eq (Alt f a) | @since base-4.8.0.0 |
| Eq (OrderingI a b) | |
| (Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a) | @since base-4.18.0.0 |
Defined in GHC.Internal.Generics Methods (==) :: Generically1 f a -> Generically1 f a -> Bool # (/=) :: Generically1 f a -> Generically1 f a -> Bool # | |
| Eq (f p) => Eq (Rec1 f p) | @since base-4.7.0.0 |
| Eq (URec (Ptr ()) p) | @since base-4.9.0.0 |
| Eq (URec Char p) | @since base-4.9.0.0 |
| Eq (URec Double p) | @since base-4.9.0.0 |
| Eq (URec Float p) | |
| Eq (URec Int p) | @since base-4.9.0.0 |
| Eq (URec Word p) | @since base-4.9.0.0 |
| (Eq a, Eq b, Eq c) => Eq (a, b, c) | |
| (Eq (f a), Eq (g a)) => Eq (Product f g a) | Since: base-4.18.0.0 |
| (Eq (f a), Eq (g a)) => Eq (Sum f g a) | Since: base-4.18.0.0 |
| (Eq a, Eq b, Eq c, Eq d) => Eq (Tuple4 a b c d) # | |
| (Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | @since base-4.7.0.0 |
| (Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | @since base-4.7.0.0 |
| Eq c => Eq (K1 i c p) | @since base-4.7.0.0 |
| (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) | |
| Eq (f (g a)) => Eq (Compose f g a) | Since: base-4.18.0.0 |
| Eq (f (g p)) => Eq ((f :.: g) p) | @since base-4.7.0.0 |
| Eq (f p) => Eq (M1 i c f p) | @since base-4.7.0.0 |
| (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
The Bounded class is used to name the upper and lower limits of a
type. Ord is not a superclass of Bounded since types that are not
totally ordered may also have upper and lower bounds.
The Bounded class may be derived for any enumeration type;
minBound is the first constructor listed in the data declaration
and maxBound is the last.
Bounded may also be derived for single-constructor datatypes whose
constituent types are in Bounded.
Instances
Class Enum defines operations on sequentially ordered types.
The enumFrom... methods are used in Haskell's translation of
arithmetic sequences.
Instances of Enum may be derived for any enumeration type (types
whose constructors have no fields). The nullary constructors are
assumed to be numbered left-to-right by fromEnum from 0 through n-1.
See Chapter 10 of the Haskell Report for more details.
For any type that is an instance of class Bounded as well as Enum,
the following should hold:
- The calls
andsuccmaxBoundshould result in a runtime error.predminBound fromEnumandtoEnumshould give a runtime error if the result value is not representable in the result type. For example,is an error.toEnum7 ::BoolenumFromandenumFromThenshould be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound
enumFromThen x y = enumFromThenTo x y bound
where
bound | fromEnum y >= fromEnum x = maxBound
| otherwise = minBoundMethods
Successor of a value. For numeric types, succ adds 1.
Predecessor of a value. For numeric types, pred subtracts 1.
Convert from an Int.
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.
Used in Haskell's translation of [n..] with [n..] = enumFrom n,
a possible implementation being enumFrom n = n : enumFrom (succ n).
Examples
enumFrom 4 :: [Integer] = [4,5,6,7,...]
enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
with [n,n'..] = enumFromThen n n', a possible implementation being
enumFromThen n n' = n : n' : worker (f x) (f x n'),
worker s v = v : worker s (s v), x = fromEnum n' - fromEnum n and
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
Examples
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m] with
[n..m] = enumFromTo n m, a possible implementation being
enumFromTo n m
| n <= m = n : enumFromTo (succ n) m
| otherwise = []
Examples
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]
enumFromTo 42 1 :: [Integer] = []
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m] with
[n,n'..m] = enumFromThenTo n n' m, a possible implementation
being enumFromThenTo n n' m = worker (f x) (c x) n m,
x = fromEnum n' - fromEnum n, c x = bool (>=) ((x 0)
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
and
worker s c v m
| c v m = v : worker s c (s v) m
| otherwise = []
Examples
enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]
enumFromThenTo 6 8 2 :: [Int] = []
Instances
class Functor (f :: Type -> Type) where #
A type f is a Functor if it provides a function fmap which, given any types a and b
lets you apply any function from (a -> b) to turn an f a into an f b, preserving the
structure of f. Furthermore f needs to adhere to the following:
Note, that the second law follows from the free theorem of the type fmap and
the first law, so you need only check that the former condition holds.
See these articles by School of Haskell or
David Luposchainsky
for an explanation.
Minimal complete definition
Methods
fmap :: (a -> b) -> f a -> f b #
fmap is used to apply a function of type (a -> b) to a value of type f a,
where f is a functor, to produce a value of type f b.
Note that for any type constructor with more than one parameter (e.g., Either),
only the last type parameter can be modified with fmap (e.g., b in `Either a b`).
Some type constructors with two parameters or more have a instance that allows
both the last and the penultimate parameters to be mapped over.Bifunctor
Examples
Convert from a to a Maybe IntMaybe String
using show:
>>>fmap show NothingNothing>>>fmap show (Just 3)Just "3"
Convert from an to an
Either Int IntEither Int String using show:
>>>fmap show (Left 17)Left 17>>>fmap show (Right 17)Right "17"
Double each element of a list:
>>>fmap (*2) [1,2,3][2,4,6]
Apply even to the second element of a pair:
>>>fmap even (2,2)(2,True)
It may seem surprising that the function is only applied to the last element of the tuple
compared to the list example above which applies it to every element in the list.
To understand, remember that tuples are type constructors with multiple type parameters:
a tuple of 3 elements (a,b,c) can also be written (,,) a b c and its Functor instance
is defined for Functor ((,,) a b) (i.e., only the third parameter is free to be mapped over
with fmap).
It explains why fmap can be used with tuples containing values of different types as in the
following example:
>>>fmap even ("hello", 1.0, 4)("hello",1.0,True)
Instances
| Functor Complex | Since: base-4.9.0.0 |
| Functor First | Since: base-4.9.0.0 |
| Functor Last | Since: base-4.9.0.0 |
| Functor Max | Since: base-4.9.0.0 |
| Functor Min | Since: base-4.9.0.0 |
| Functor ArgDescr | Since: base-4.7.0.0 |
| Functor ArgOrder | Since: base-4.7.0.0 |
| Functor OptDescr | Since: base-4.7.0.0 |
| Functor Array | |
| Functor Gen # | |
| Functor Check # | |
| Functor DList # | |
| Functor Partial # | |
| Functor NonEmpty | @since base-4.9.0.0 |
| Functor STM | @since base-4.3.0.0 |
| Functor Identity | @since base-4.8.0.0 |
| Functor First | @since base-4.8.0.0 |
| Functor Last | @since base-4.8.0.0 |
| Functor Dual | @since base-4.8.0.0 |
| Functor Product | @since base-4.8.0.0 |
| Functor Sum | @since base-4.8.0.0 |
| Functor ZipList | @since base-2.01 |
| Functor Par1 | @since base-4.9.0.0 |
| Functor P | @since base-4.8.0.0 |
Defined in GHC.Internal.Text.ParserCombinators.ReadP | |
| Functor ReadP | @since base-2.01 |
| Functor IO | @since base-2.01 |
| Functor Maybe | @since base-2.01 |
| Functor Solo | @since base-4.15 |
| Functor [] | @since base-2.01 |
Defined in GHC.Internal.Base | |
| Monad m => Functor (WrappedMonad m) | Since: base-2.1 |
Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a # | |
| Functor (Arg a) | Since: base-4.9.0.0 |
| Functor (Vect n) | |
| Functor m => Functor (ResourceT m) # | |
| Functor (Parser input) # | |
| Functor (Result input) # | |
| Functor (MonadRandomState gen) # | |
Defined in Foundation.Random.DRG Methods fmap :: (a -> b) -> MonadRandomState gen a -> MonadRandomState gen b # (<$) :: a -> MonadRandomState gen b -> MonadRandomState gen a # | |
| Arrow a => Functor (ArrowMonad a) | @since base-4.6.0.0 |
Defined in GHC.Internal.Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 # | |
| Functor (Either a) | @since base-3.0 |
| Functor (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Functor (U1 :: Type -> Type) | @since base-4.9.0.0 |
| Functor (V1 :: Type -> Type) | @since base-4.9.0.0 |
| Functor (ST s) | @since base-2.01 |
| Functor ((,) a) | @since base-2.01 |
Defined in GHC.Internal.Base | |
| Arrow a => Functor (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| Monad m => Functor (Reader r m) | |
| Monad m => Functor (State s m) | |
| Monad m => Functor (ZipSink i m) # | |
| Functor m => Functor (ExceptT e m) # | |
| Functor m => Functor (ReaderT r m) # | |
| Functor m => Functor (StateT s m) # | |
| Functor m => Functor (Kleisli m a) | @since base-4.14.0.0 |
| Functor (Const m :: Type -> Type) | @since base-2.01 |
| Functor f => Functor (Ap f) | @since base-4.12.0.0 |
| Functor f => Functor (Alt f) | @since base-4.8.0.0 |
| (Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f) | @since base-4.17.0.0 |
Defined in GHC.Internal.Generics Methods fmap :: (a -> b) -> Generically1 f a -> Generically1 f b # (<$) :: a -> Generically1 f b -> Generically1 f a # | |
| Functor f => Functor (Rec1 f) | @since base-4.9.0.0 |
| Functor (URec (Ptr ()) :: Type -> Type) | @since base-4.9.0.0 |
| Functor (URec Char :: Type -> Type) | @since base-4.9.0.0 |
| Functor (URec Double :: Type -> Type) | @since base-4.9.0.0 |
| Functor (URec Float :: Type -> Type) | @since base-4.9.0.0 |
| Functor (URec Int :: Type -> Type) | @since base-4.9.0.0 |
| Functor (URec Word :: Type -> Type) | @since base-4.9.0.0 |
| Functor ((,,) a b) | @since base-4.14.0.0 |
Defined in GHC.Internal.Base | |
| (Functor f, Functor g) => Functor (Product f g) | Since: base-4.9.0.0 |
| (Functor f, Functor g) => Functor (Sum f g) | Since: base-4.9.0.0 |
| Functor (Conduit i o m) # | |
| (Functor f, Functor g) => Functor (f :*: g) | @since base-4.9.0.0 |
| (Functor f, Functor g) => Functor (f :+: g) | @since base-4.9.0.0 |
| Functor (K1 i c :: Type -> Type) | @since base-4.9.0.0 |
| Functor ((,,,) a b c) | @since base-4.14.0.0 |
Defined in GHC.Internal.Base | |
| Functor ((->) r) | @since base-2.01 |
Defined in GHC.Internal.Base | |
| (Functor f, Functor g) => Functor (Compose f g) | Since: base-4.9.0.0 |
| (Functor f, Functor g) => Functor (f :.: g) | @since base-4.9.0.0 |
| Functor f => Functor (M1 i c f) | @since base-4.9.0.0 |
| Functor ((,,,,) a b c d) | @since base-4.18.0.0 |
Defined in GHC.Internal.Base | |
| Monad state => Functor (Builder collection mutCollection step state err) | |
| Functor ((,,,,,) a b c d e) | @since base-4.18.0.0 |
Defined in GHC.Internal.Base | |
| Functor ((,,,,,,) a b c d e f) | @since base-4.18.0.0 |
Defined in GHC.Internal.Base | |
Integral Literal support
e.g. 123 :: Integer 123 :: Word8
Methods
fromInteger :: Integer -> a #
Instances
class Fractional a where #
Fractional Literal support
e.g. 1.2 :: Double 0.03 :: Float
Methods
fromRational :: Rational -> a #
Instances
| Fractional CDouble | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CDouble # | |
| Fractional CFloat | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CFloat # | |
| Fractional Rational | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Rational # | |
| Fractional Double | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Double # | |
| Fractional Float | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Float # | |
class HasNegation a where #
Negation support
e.g. -(f x)
Instances
class (forall a. Functor (p a)) => Bifunctor (p :: Type -> Type -> Type) where #
A bifunctor is a type constructor that takes
two type arguments and is a functor in both arguments. That
is, unlike with Functor, a type constructor such as Either
does not need to be partially applied for a Bifunctor
instance, and the methods in this class permit mapping
functions over the Left value or the Right value,
or both at the same time.
Formally, the class Bifunctor represents a bifunctor
from Hask -> Hask.
Intuitively it is a bifunctor where both the first and second arguments are covariant.
The class definition of a Bifunctor p uses the
QuantifiedConstraints
language extension to quantify over the first type
argument a in its context. The context requires that p a
must be a Functor for all a. In other words a partially
applied Bifunctor must be a Functor. This makes Functor a
superclass of Bifunctor such that a function with a
Bifunctor constraint may use fmap in its implementation.
Functor has been a quantified superclass of
Bifunctor since base-4.18.0.0.
You can define a Bifunctor by either defining bimap or by
defining both first and second. The second method must
agree with fmap:
second≡fmap
From this it follows that:
secondid≡id
If you supply bimap, you should ensure that:
bimapidid≡id
If you supply first and second, ensure:
firstid≡idsecondid≡id
If you supply both, you should also ensure:
bimapf g ≡firstf.secondg
These ensure by parametricity:
bimap(f.g) (h.i) ≡bimapf h.bimapg ifirst(f.g) ≡firstf.firstgsecond(f.g) ≡secondf.secondg
Since: base-4.8.0.0
Methods
bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #
Map over both arguments at the same time.
bimapf g ≡firstf.secondg
Examples
>>>bimap toUpper (+1) ('j', 3)('J',4)
>>>bimap toUpper (+1) (Left 'j')Left 'J'
>>>bimap toUpper (+1) (Right 3)Right 4
Instances
| Bifunctor Arg | Since: base-4.9.0.0 |
| Bifunctor Either | Since: base-4.8.0.0 |
| Bifunctor (,) | Class laws for tuples hold only up to laziness. Both
Since: base-4.8.0.0 |
| Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0 |
| Bifunctor ((,,) x1) | Since: base-4.8.0.0 |
| Bifunctor (K1 i :: Type -> Type -> Type) | Since: base-4.9.0.0 |
| Bifunctor ((,,,) x1 x2) | Since: base-4.8.0.0 |
| Bifunctor ((,,,,) x1 x2 x3) | Since: base-4.8.0.0 |
| Bifunctor ((,,,,,) x1 x2 x3 x4) | Since: base-4.8.0.0 |
| Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) | Since: base-4.8.0.0 |
class Functor f => Applicative (f :: Type -> Type) where #
A functor with application, providing operations to
A minimal complete definition must include implementations of pure
and of either <*> or liftA2. If it defines both, then they must behave
the same as their default definitions:
(<*>) =liftA2id
liftA2f x y = f<$>x<*>y
Further, any definition must satisfy the following:
- Identity
pureid<*>v = v- Composition
pure(.)<*>u<*>v<*>w = u<*>(v<*>w)- Homomorphism
puref<*>purex =pure(f x)- Interchange
u
<*>purey =pure($y)<*>u
The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:
As a consequence of these laws, the Functor instance for f will satisfy
It may be useful to note that supposing
forall x y. p (q x y) = f x . g y
it follows from the above that
liftA2p (liftA2q u v) =liftA2f u .liftA2g v
If f is also a Monad, it should satisfy
(which implies that pure and <*> satisfy the applicative functor laws).
Methods
Lift a value into the Structure.
Examples
>>>pure 1 :: Maybe IntJust 1
>>>pure 'z' :: [Char]"z"
>>>pure (pure ":D") :: Maybe [String]Just [":D"]
(<*>) :: f (a -> b) -> f a -> f b infixl 4 #
Sequential application.
A few functors support an implementation of <*> that is more
efficient than the default one.
Example
Used in combination with , (<$>) can be used to build a record.(<*>)
>>>data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
>>>produceFoo :: Applicative f => f Foo>>>produceBar :: Applicative f => f Bar>>>produceBaz :: Applicative f => f Baz
>>>mkState :: Applicative f => f MyState>>>mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
liftA2 :: (a -> b -> c) -> f a -> f b -> f c #
Lift a binary function to actions.
Some functors support an implementation of liftA2 that is more
efficient than the default one. In particular, if fmap is an
expensive operation, it is likely better to use liftA2 than to
fmap over the structure and then use <*>.
This became a typeclass method in 4.10.0.0. Prior to that, it was
a function defined in terms of <*> and fmap.
Example
>>>liftA2 (,) (Just 3) (Just 5)Just (3,5)
>>>liftA2 (+) [1, 2, 3] [4, 5, 6][5,6,7,6,7,8,7,8,9]
(*>) :: f a -> f b -> f b infixl 4 #
Sequence actions, discarding the value of the first argument.
Examples
If used in conjunction with the Applicative instance for Maybe,
you can chain Maybe computations, with a possible "early return"
in case of Nothing.
>>>Just 2 *> Just 3Just 3
>>>Nothing *> Just 3Nothing
Of course a more interesting use case would be to have effectful computations instead of just returning pure values.
>>>import Data.Char>>>import GHC.Internal.Text.ParserCombinators.ReadP>>>let p = string "my name is " *> munch1 isAlpha <* eof>>>readP_to_S p "my name is Simon"[("Simon","")]
(<*) :: f a -> f b -> f a infixl 4 #
Sequence actions, discarding the value of the second argument.
Instances
| Applicative Complex | Since: base-4.9.0.0 |
| Applicative First | Since: base-4.9.0.0 |
| Applicative Last | Since: base-4.9.0.0 |
| Applicative Max | Since: base-4.9.0.0 |
| Applicative Min | Since: base-4.9.0.0 |
| Applicative Gen # | |
| Applicative Check # | |
| Applicative DList # | |
| Applicative Partial # | |
| Applicative NonEmpty | @since base-4.9.0.0 |
| Applicative STM | @since base-4.8.0.0 |
| Applicative Identity | @since base-4.8.0.0 |
| Applicative First | @since base-4.8.0.0 |
| Applicative Last | @since base-4.8.0.0 |
| Applicative Dual | @since base-4.8.0.0 |
| Applicative Product | @since base-4.8.0.0 |
| Applicative Sum | @since base-4.8.0.0 |
| Applicative ZipList | f <$> ZipList xs1 <*> ... <*> ZipList xsN
= ZipList (zipWithN f xs1 ... xsN)where (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
= ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
= ZipList {getZipList = ["a5","b6b6","c7c7c7"]}@since base-2.01 |
| Applicative Par1 | @since base-4.9.0.0 |
| Applicative P | @since base-4.5.0.0 |
| Applicative ReadP | @since base-4.6.0.0 |
| Applicative IO | @since base-2.01 |
| Applicative Maybe | @since base-2.01 |
| Applicative Solo | @since base-4.15 |
| Applicative [] | @since base-2.01 |
| Monad m => Applicative (WrappedMonad m) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a # | |
| Applicative m => Applicative (ResourceT m) # | |
Defined in Foundation.Conduit.Internal | |
| ParserSource input => Applicative (Parser input) # | |
Defined in Foundation.Parser | |
| Applicative (MonadRandomState gen) # | |
Defined in Foundation.Random.DRG Methods pure :: a -> MonadRandomState gen a # (<*>) :: MonadRandomState gen (a -> b) -> MonadRandomState gen a -> MonadRandomState gen b # liftA2 :: (a -> b -> c) -> MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen c # (*>) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen b # (<*) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen a # | |
| Arrow a => Applicative (ArrowMonad a) | @since base-4.6.0.0 |
Defined in GHC.Internal.Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 # | |
| Applicative (Either e) | @since base-3.0 |
| Applicative (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Applicative (U1 :: Type -> Type) | @since base-4.9.0.0 |
| Applicative (ST s) | @since base-4.4.0.0 |
| Monoid a => Applicative ((,) a) | For tuples, the ("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)@since base-2.01 |
| Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| Monad m => Applicative (Reader r m) | |
Defined in Basement.Compat.MonadTrans | |
| Monad m => Applicative (State s m) | |
Defined in Basement.Compat.MonadTrans | |
| Monad m => Applicative (ZipSink i m) # | |
Defined in Foundation.Conduit.Internal | |
| Monad m => Applicative (ExceptT e m) # | |
Defined in Foundation.Monad.Except | |
| Applicative m => Applicative (ReaderT r m) # | |
Defined in Foundation.Monad.Reader | |
| (Applicative m, Monad m) => Applicative (StateT s m) # | |
Defined in Foundation.Monad.State | |
| Applicative m => Applicative (Kleisli m a) | @since base-4.14.0.0 |
Defined in GHC.Internal.Control.Arrow | |
| Monoid m => Applicative (Const m :: Type -> Type) | @since base-2.0.1 |
| Applicative f => Applicative (Ap f) | @since base-4.12.0.0 |
| Applicative f => Applicative (Alt f) | @since base-4.8.0.0 |
| (Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) | @since base-4.17.0.0 |
Defined in GHC.Internal.Generics Methods pure :: a -> Generically1 f a # (<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b # liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c # (*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b # (<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a # | |
| Applicative f => Applicative (Rec1 f) | @since base-4.9.0.0 |
| (Monoid a, Monoid b) => Applicative ((,,) a b) | @since base-4.14.0.0 |
| (Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
| Applicative (Conduit i o m) # | |
Defined in Foundation.Conduit.Internal Methods pure :: a -> Conduit i o m a # (<*>) :: Conduit i o m (a -> b) -> Conduit i o m a -> Conduit i o m b # liftA2 :: (a -> b -> c) -> Conduit i o m a -> Conduit i o m b -> Conduit i o m c # (*>) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m b # (<*) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m a # | |
| (Applicative f, Applicative g) => Applicative (f :*: g) | @since base-4.9.0.0 |
| Monoid c => Applicative (K1 i c :: Type -> Type) | @since base-4.12.0.0 |
| (Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) | @since base-4.14.0.0 |
Defined in GHC.Internal.Base | |
| Applicative ((->) r) | @since base-2.01 |
| (Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose | |
| (Applicative f, Applicative g) => Applicative (f :.: g) | @since base-4.9.0.0 |
| Applicative f => Applicative (M1 i c f) | @since base-4.9.0.0 |
| Monad state => Applicative (Builder collection mutCollection step state err) | |
Defined in Basement.MutableBuilder Methods pure :: a -> Builder collection mutCollection step state err a # (<*>) :: Builder collection mutCollection step state err (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b # liftA2 :: (a -> b -> c) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err c # (*>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b # (<*) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a # | |
class Applicative m => Monad (m :: Type -> Type) where #
The Monad class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad should satisfy the following:
- Left identity
returna>>=k = k a- Right identity
m>>=return= m- Associativity
m>>=(\x -> k x>>=h) = (m>>=k)>>=h
Furthermore, the Monad and Applicative operations should relate as follows:
The above laws imply:
and that pure and (<*>) satisfy the applicative functor laws.
The instances of Monad for List, Maybe and IO
defined in the Prelude satisfy these laws.
Minimal complete definition
Methods
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
'as ' can be understood as the >>= bsdo expression
do a <- as bs a
An alternative name for this function is 'bind', but some people may refer to it as 'flatMap', which results from it being equivialent to
\x f ->join(fmapf x) :: Monad m => m a -> (a -> m b) -> m b
which can be seen as mapping a value with
Monad m => m a -> m (m b) and then 'flattening' m (m b) to m b using join.
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
'as ' can be understood as the >> bsdo expression
do as bs
or in terms of as(>>=)
as >>= const bs
Inject a value into the monadic type.
This function should not be different from its default implementation
as pure. The justification for the existence of this function is
merely historic.
Instances
| Monad Complex | Since: base-4.9.0.0 |
| Monad First | Since: base-4.9.0.0 |
| Monad Last | Since: base-4.9.0.0 |
| Monad Max | Since: base-4.9.0.0 |
| Monad Min | Since: base-4.9.0.0 |
| Monad Gen # | |
| Monad Check # | |
| Monad DList # | |
| Monad Partial # | |
| Monad NonEmpty | @since base-4.9.0.0 |
| Monad STM | @since base-4.3.0.0 |
| Monad Identity | @since base-4.8.0.0 |
| Monad First | @since base-4.8.0.0 |
| Monad Last | @since base-4.8.0.0 |
| Monad Dual | @since base-4.8.0.0 |
| Monad Product | @since base-4.8.0.0 |
| Monad Sum | @since base-4.8.0.0 |
| Monad Par1 | @since base-4.9.0.0 |
| Monad P | @since base-2.01 |
| Monad ReadP | @since base-2.01 |
| Monad IO | @since base-2.01 |
| Monad Maybe | @since base-2.01 |
| Monad Solo | @since base-4.15 |
| Monad [] | @since base-2.01 |
| Monad m => Monad (WrappedMonad m) | Since: base-4.7.0.0 |
Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # | |
| Monad m => Monad (ResourceT m) # | |
| ParserSource input => Monad (Parser input) # | |
| Monad (MonadRandomState gen) # | |
Defined in Foundation.Random.DRG Methods (>>=) :: MonadRandomState gen a -> (a -> MonadRandomState gen b) -> MonadRandomState gen b # (>>) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen b # return :: a -> MonadRandomState gen a # | |
| ArrowApply a => Monad (ArrowMonad a) | @since base-2.01 |
Defined in GHC.Internal.Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # | |
| Monad (Either e) | @since base-4.4.0.0 |
| Monad (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Monad (U1 :: Type -> Type) | @since base-4.9.0.0 |
| Monad (ST s) | @since base-2.01 |
| Monoid a => Monad ((,) a) | @since base-4.9.0.0 |
| Monad m => Monad (Reader r m) | |
| Monad m => Monad (State r m) | |
| Monad m => Monad (ExceptT e m) # | |
| Monad m => Monad (ReaderT r m) # | |
| (Functor m, Monad m) => Monad (StateT s m) # | |
| Monad m => Monad (Kleisli m a) | @since base-4.14.0.0 |
| Monad f => Monad (Ap f) | @since base-4.12.0.0 |
| Monad f => Monad (Alt f) | @since base-4.8.0.0 |
| Monad f => Monad (Rec1 f) | @since base-4.9.0.0 |
| (Monoid a, Monoid b) => Monad ((,,) a b) | @since base-4.14.0.0 |
| (Monad f, Monad g) => Monad (Product f g) | Since: base-4.9.0.0 |
| Monad (Conduit i o m) # | |
| (Monad f, Monad g) => Monad (f :*: g) | @since base-4.9.0.0 |
| (Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c) | @since base-4.14.0.0 |
| Monad ((->) r) | @since base-2.01 |
| Monad f => Monad (M1 i c f) | @since base-4.9.0.0 |
| Monad state => Monad (Builder collection mutCollection step state err) | |
Defined in Basement.MutableBuilder Methods (>>=) :: Builder collection mutCollection step state err a -> (a -> Builder collection mutCollection step state err b) -> Builder collection mutCollection step state err b # (>>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b # return :: a -> Builder collection mutCollection step state err a # | |
(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #
Same as >>=, but with the arguments interchanged.
as >>= f == f =<< as
IsString is used in combination with the -XOverloadedStrings
language extension to convert the literals to different string types.
For example, if you use the text package, you can say
{-# LANGUAGE OverloadedStrings #-}
myText = "hello world" :: Text
Internally, the extension will convert this to the equivalent of
myText = fromString @Text ("hello world" :: String)
Note: You can use fromString in normal code as well,
but the usual performance/memory efficiency problems with String apply.
Methods
fromString :: String -> a #
Instances
| IsString AsciiString | |
Defined in Basement.Types.AsciiString Methods fromString :: String -> AsciiString # | |
| IsString String | |
Defined in Basement.UTF8.Base Methods fromString :: String -> String # | |
| IsString IPv4 # | |
Defined in Foundation.Network.IPv4 Methods fromString :: String -> IPv4 # | |
| IsString IPv6 # | |
Defined in Foundation.Network.IPv6 Methods fromString :: String -> IPv6 # | |
| IsString FileName # | |
Defined in Foundation.VFS.FilePath Methods fromString :: String -> FileName # | |
| IsString FilePath # | |
Defined in Foundation.VFS.FilePath Methods fromString :: String -> FilePath # | |
| IsString a => IsString (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.String Methods fromString :: String -> Identity a # | |
| a ~ Char => IsString [a] |
@since base-2.01 |
Defined in GHC.Internal.Data.String Methods fromString :: String -> [a] # | |
| IsString a => IsString (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.String Methods fromString :: String -> Const a b # | |
The IsList class and its methods are intended to be used in
conjunction with the OverloadedLists extension.
@since base-4.7.0.0
Methods
The fromList function constructs the structure l from the given
list of Item l
fromListN :: Int -> [Item l] -> l #
The fromListN function takes the input list's length and potentially
uses it to construct the structure l more efficiently compared to
fromList. If the given number does not equal to the input list's length
the behaviour of fromListN is not specified.
fromListN (length xs) xs == fromList xs
The toList function extracts a list of Item l from the structure l.
It should satisfy fromList . toList = id.
Instances
Numeric type classes
class (Integral a, Eq a, Ord a) => IsIntegral a where #
Number literals, convertible through the generic Integer type.
all number are Enum'erable, meaning that you can move to next element
Instances
| IsIntegral Word128 | |
Defined in Basement.Types.Word128 | |
| IsIntegral Word256 | |
Defined in Basement.Types.Word256 | |
| IsIntegral CBool | |
Defined in Basement.Numerical.Number | |
| IsIntegral CChar | |
Defined in Basement.Numerical.Number | |
| IsIntegral CInt | |
Defined in Basement.Numerical.Number | |
| IsIntegral CIntMax | |
Defined in Basement.Numerical.Number | |
| IsIntegral CIntPtr | |
Defined in Basement.Numerical.Number | |
| IsIntegral CLLong | |
Defined in Basement.Numerical.Number | |
| IsIntegral CLong | |
Defined in Basement.Numerical.Number | |
| IsIntegral CPtrdiff | |
Defined in Basement.Numerical.Number | |
| IsIntegral CSChar | |
Defined in Basement.Numerical.Number | |
| IsIntegral CShort | |
Defined in Basement.Numerical.Number | |
| IsIntegral CSigAtomic | |
Defined in Basement.Numerical.Number Methods toInteger :: CSigAtomic -> Integer # | |
| IsIntegral CSize | |
Defined in Basement.Numerical.Number | |
| IsIntegral CUChar | |
Defined in Basement.Numerical.Number | |
| IsIntegral CUInt | |
Defined in Basement.Numerical.Number | |
| IsIntegral CUIntMax | |
Defined in Basement.Numerical.Number | |
| IsIntegral CUIntPtr | |
Defined in Basement.Numerical.Number | |
| IsIntegral CULLong | |
Defined in Basement.Numerical.Number | |
| IsIntegral CULong | |
Defined in Basement.Numerical.Number | |
| IsIntegral CUShort | |
Defined in Basement.Numerical.Number | |
| IsIntegral CWchar | |
Defined in Basement.Numerical.Number | |
| IsIntegral Int16 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Int32 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Int64 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Int8 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Word16 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Word32 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Word64 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Word8 | |
Defined in Basement.Numerical.Number | |
| IsIntegral Integer | |
Defined in Basement.Numerical.Number | |
| IsIntegral Natural | |
Defined in Basement.Numerical.Number | |
| IsIntegral Int | |
Defined in Basement.Numerical.Number | |
| IsIntegral Word | |
Defined in Basement.Numerical.Number | |
| KnownNat n => IsIntegral (Zn n) | |
Defined in Basement.Bounded | |
| (KnownNat n, NatWithinBound Word64 n) => IsIntegral (Zn64 n) | |
Defined in Basement.Bounded | |
| IsIntegral (CountOf ty) | |
Defined in Basement.Types.OffsetSize | |
| IsIntegral (Offset ty) | |
Defined in Basement.Types.OffsetSize | |
class IsIntegral a => IsNatural a where #
Non Negative Number literals, convertible through the generic Natural type
Instances
| IsNatural Word128 | |
Defined in Basement.Types.Word128 | |
| IsNatural Word256 | |
Defined in Basement.Types.Word256 | |
| IsNatural CSize | |
Defined in Basement.Numerical.Number | |
| IsNatural CUChar | |
Defined in Basement.Numerical.Number | |
| IsNatural CUInt | |
Defined in Basement.Numerical.Number | |
| IsNatural CUIntMax | |
Defined in Basement.Numerical.Number | |
| IsNatural CUIntPtr | |
Defined in Basement.Numerical.Number | |
| IsNatural CULLong | |
Defined in Basement.Numerical.Number | |
| IsNatural CULong | |
Defined in Basement.Numerical.Number | |
| IsNatural CUShort | |
Defined in Basement.Numerical.Number | |
| IsNatural Word16 | |
Defined in Basement.Numerical.Number | |
| IsNatural Word32 | |
Defined in Basement.Numerical.Number | |
| IsNatural Word64 | |
Defined in Basement.Numerical.Number | |
| IsNatural Word8 | |
Defined in Basement.Numerical.Number | |
| IsNatural Natural | |
Defined in Basement.Numerical.Number | |
| IsNatural Word | |
Defined in Basement.Numerical.Number | |
| KnownNat n => IsNatural (Zn n) | |
Defined in Basement.Bounded | |
| (KnownNat n, NatWithinBound Word64 n) => IsNatural (Zn64 n) | |
Defined in Basement.Bounded | |
| IsNatural (CountOf ty) | |
Defined in Basement.Types.OffsetSize | |
| IsNatural (Offset ty) | |
Defined in Basement.Types.OffsetSize | |
types that have sign and can be made absolute
Represent class of things that can be added together, contains a neutral element and is commutative.
x + azero = x azero + x = x x + y = y + x
Methods
Instances
| Additive Word128 | |
| Additive Word256 | |
| Additive NanoSeconds # | |
Defined in Foundation.Time.Types Methods azero :: NanoSeconds # (+) :: NanoSeconds -> NanoSeconds -> NanoSeconds # scale :: IsNatural n => n -> NanoSeconds -> NanoSeconds # | |
| Additive Seconds # | |
| Additive CChar | |
| Additive CClock | |
| Additive CDouble | |
| Additive CFloat | |
| Additive CInt | |
| Additive CIntMax | |
| Additive CIntPtr | |
| Additive CLLong | |
| Additive CLong | |
| Additive CPtrdiff | |
| Additive CSChar | |
| Additive CSUSeconds | |
Defined in Basement.Numerical.Additive Methods azero :: CSUSeconds # (+) :: CSUSeconds -> CSUSeconds -> CSUSeconds # scale :: IsNatural n => n -> CSUSeconds -> CSUSeconds # | |
| Additive CShort | |
| Additive CSigAtomic | |
Defined in Basement.Numerical.Additive Methods azero :: CSigAtomic # (+) :: CSigAtomic -> CSigAtomic -> CSigAtomic # scale :: IsNatural n => n -> CSigAtomic -> CSigAtomic # | |
| Additive CSize | |
| Additive CTime | |
| Additive CUChar | |
| Additive CUInt | |
| Additive CUIntMax | |
| Additive CUIntPtr | |
| Additive CULLong | |
| Additive CULong | |
| Additive CUSeconds | |
| Additive CUShort | |
| Additive CWchar | |
| Additive Int16 | |
| Additive Int32 | |
| Additive Int64 | |
| Additive Int8 | |
| Additive Rational | |
| Additive COff | |
| Additive Word16 | |
| Additive Word32 | |
| Additive Word64 | |
| Additive Word8 | |
| Additive Integer | |
| Additive Natural | |
| Additive Double | |
| Additive Float | |
| Additive Int | |
| Additive Word | |
| SizeValid n => Additive (Bits n) | |
| KnownNat n => Additive (Zn n) | |
| (KnownNat n, NatWithinBound Word64 n) => Additive (Zn64 n) | |
| Additive (CountOf ty) | |
| Additive (Offset ty) | |
class Subtractive a where #
Represent class of things that can be subtracted.
Note that the result is not necessary of the same type as the operand depending on the actual type.
For example:
(-) :: Int -> Int -> Int (-) :: DateTime -> DateTime -> Seconds (-) :: Ptr a -> Ptr a -> PtrDiff (-) :: Natural -> Natural -> Maybe Natural
Associated Types
type Difference a #
Methods
(-) :: a -> a -> Difference a infixl 6 #
Instances
| Subtractive Word128 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word256 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CBool | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CChar | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CClock | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CDouble | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CFloat | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CInt | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CIntMax | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CIntPtr | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CLLong | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CLong | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CPtrdiff | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CSChar | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CSUSeconds | |||||
Defined in Basement.Numerical.Subtractive Associated Types
Methods (-) :: CSUSeconds -> CSUSeconds -> Difference CSUSeconds # | |||||
| Subtractive CShort | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CSigAtomic | |||||
Defined in Basement.Numerical.Subtractive Associated Types
Methods (-) :: CSigAtomic -> CSigAtomic -> Difference CSigAtomic # | |||||
| Subtractive CSize | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CTime | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUChar | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUInt | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUIntMax | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUIntPtr | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CULLong | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CULong | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUSeconds | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CUShort | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CWchar | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Int16 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Int32 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Int64 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Int8 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive COff | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word16 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word32 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word64 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word8 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Integer | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Natural | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Char | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Double | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Float | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Int | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive Word | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| SizeValid n => Subtractive (Bits n) | |||||
Defined in Basement.Bits Associated Types
| |||||
| KnownNat n => Subtractive (Zn n) | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| (KnownNat n, NatWithinBound Word64 n) => Subtractive (Zn64 n) | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
| Subtractive (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
class Multiplicative a where #
Represent class of things that can be multiplied together
x * midentity = x midentity * x = x
Methods
Identity element over multiplication
Multiplication of 2 elements that result in another element
(^) :: (IsNatural n, Enum n, IDivisible n) => a -> n -> a infixr 8 #
Raise to power, repeated multiplication e.g. > a ^ 2 = a * a > a ^ 10 = (a ^ 5) * (a ^ 5) .. (^) :: (IsNatural n) => a -> n -> a
Instances
| Multiplicative Word128 | |
| Multiplicative Word256 | |
| Multiplicative CChar | |
| Multiplicative CClock | |
| Multiplicative CDouble | |
| Multiplicative CFloat | |
| Multiplicative CInt | |
| Multiplicative CIntMax | |
| Multiplicative CIntPtr | |
| Multiplicative CLLong | |
| Multiplicative CLong | |
| Multiplicative CPtrdiff | |
| Multiplicative CSChar | |
| Multiplicative CSUSeconds | |
Defined in Basement.Numerical.Multiplicative Methods midentity :: CSUSeconds # (*) :: CSUSeconds -> CSUSeconds -> CSUSeconds # (^) :: (IsNatural n, Enum n, IDivisible n) => CSUSeconds -> n -> CSUSeconds # | |
| Multiplicative CShort | |
| Multiplicative CSigAtomic | |
Defined in Basement.Numerical.Multiplicative Methods midentity :: CSigAtomic # (*) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (^) :: (IsNatural n, Enum n, IDivisible n) => CSigAtomic -> n -> CSigAtomic # | |
| Multiplicative CSize | |
| Multiplicative CTime | |
| Multiplicative CUChar | |
| Multiplicative CUInt | |
| Multiplicative CUIntMax | |
| Multiplicative CUIntPtr | |
| Multiplicative CULLong | |
| Multiplicative CULong | |
| Multiplicative CUSeconds | |
| Multiplicative CUShort | |
| Multiplicative CWchar | |
| Multiplicative Int16 | |
| Multiplicative Int32 | |
| Multiplicative Int64 | |
| Multiplicative Int8 | |
| Multiplicative Rational | |
| Multiplicative COff | |
| Multiplicative Word16 | |
| Multiplicative Word32 | |
| Multiplicative Word64 | |
| Multiplicative Word8 | |
| Multiplicative Integer | |
| Multiplicative Natural | |
| Multiplicative Double | |
| Multiplicative Float | |
| Multiplicative Int | |
| Multiplicative Word | |
| SizeValid n => Multiplicative (Bits n) | |
class (Additive a, Multiplicative a) => IDivisible a where #
Represent types that supports an euclidian division
(x ‘div‘ y) * y + (x ‘mod‘ y) == x
Instances
| IDivisible Word128 | |
| IDivisible Word256 | |
| IDivisible CChar | |
| IDivisible CInt | |
| IDivisible CIntMax | |
| IDivisible CIntPtr | |
| IDivisible CLLong | |
| IDivisible CLong | |
| IDivisible CPtrdiff | |
| IDivisible CSChar | |
| IDivisible CShort | |
| IDivisible CSigAtomic | |
Defined in Basement.Numerical.Multiplicative Methods div :: CSigAtomic -> CSigAtomic -> CSigAtomic # mod :: CSigAtomic -> CSigAtomic -> CSigAtomic # divMod :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) # | |
| IDivisible CSize | |
| IDivisible CUChar | |
| IDivisible CUInt | |
| IDivisible CUIntMax | |
| IDivisible CUIntPtr | |
| IDivisible CULLong | |
| IDivisible CULong | |
| IDivisible CUShort | |
| IDivisible CWchar | |
| IDivisible Int16 | |
| IDivisible Int32 | |
| IDivisible Int64 | |
| IDivisible Int8 | |
| IDivisible Word16 | |
| IDivisible Word32 | |
| IDivisible Word64 | |
| IDivisible Word8 | |
| IDivisible Integer | |
| IDivisible Natural | |
| IDivisible Int | |
| IDivisible Word | |
| SizeValid n => IDivisible (Bits n) | |
class Multiplicative a => Divisible a where #
Support for division between same types
This is likely to change to represent specific mathematic divisions
Data types
The Maybe type encapsulates an optional value. A value of type
either contains a value of type Maybe aa (represented as ),
or it is empty (represented as Just aNothing). Using Maybe is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as error.
The Maybe type is also a monad. It is a simple kind of error
monad, where all errors are represented by Nothing. A richer
error monad can be built using the Either type.
Instances
| MonadZip Maybe | Since: base-4.8.0.0 | ||||
| Eq1 Maybe | Since: base-4.9.0.0 | ||||
| Ord1 Maybe | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes | |||||
| Read1 Maybe | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes | |||||
| Show1 Maybe | Since: base-4.9.0.0 | ||||
| MonadFailure Maybe | |||||
| Alternative Maybe | Picks the leftmost @since base-2.01 | ||||
| Applicative Maybe | @since base-2.01 | ||||
| Functor Maybe | @since base-2.01 | ||||
| Monad Maybe | @since base-2.01 | ||||
| MonadPlus Maybe | Picks the leftmost @since base-2.01 | ||||
| MonadFail Maybe | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Control.Monad.Fail | |||||
| MonadFix Maybe | @since base-2.01 | ||||
Defined in GHC.Internal.Control.Monad.Fix | |||||
| Foldable Maybe | @since base-2.01 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # | |||||
| Traversable Maybe | @since base-2.01 | ||||
| Generic1 Maybe | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| NormalForm a => NormalForm (Maybe a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Maybe a -> () # | |||||
| Arbitrary a => Arbitrary (Maybe a) # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField a => IsField (Maybe a) # | |||||
| Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner @since base-2.01 | ||||
| Semigroup a => Semigroup (Maybe a) | @since base-4.9.0.0 | ||||
| Data a => Data (Maybe a) | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) # toConstr :: Maybe a -> Constr # dataTypeOf :: Maybe a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) # gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # | |||||
| Generic (Maybe a) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| SingKind a => SingKind (Maybe a) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Read a => Read (Maybe a) | @since base-2.01 | ||||
| Show a => Show (Maybe a) | @since base-2.01 | ||||
| Eq a => Eq (Maybe a) | @since base-2.01 | ||||
| Ord a => Ord (Maybe a) | @since base-2.01 | ||||
| SingI ('Nothing :: Maybe a) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| From (Maybe a) (Either () a) | |||||
Defined in Basement.From | |||||
| SingI a2 => SingI ('Just a2 :: Maybe a1) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Failure Maybe | |||||
Defined in Basement.Monad | |||||
| type Rep1 Maybe | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type DemoteRep (Maybe a) | |||||
Defined in GHC.Internal.Generics | |||||
| type Rep (Maybe a) | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| data Sing (b :: Maybe a) | |||||
Instances
| Monoid Ordering | @since base-2.01 |
| Semigroup Ordering | @since base-4.9.0.0 |
| Data Ordering | @since base-4.0.0.0 |
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering # toConstr :: Ordering -> Constr # dataTypeOf :: Ordering -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) # gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # | |
| Bounded Ordering | @since base-2.01 |
| Enum Ordering | @since base-2.01 |
Defined in GHC.Internal.Enum | |
| Generic Ordering | |
Defined in GHC.Internal.Generics | |
| Read Ordering | @since base-2.01 |
| Show Ordering | @since base-2.01 |
| Eq Ordering | |
| Ord Ordering | |
Defined in GHC.Classes | |
| type Rep Ordering | @since base-4.6.0.0 |
Instances
| BitOps Bool | |||||
| FiniteBitsOps Bool | |||||
| NormalForm Bool | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Bool -> () # | |||||
| Arbitrary Bool # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsProperty Bool # | |||||
Defined in Foundation.Check.Property | |||||
| IsField Bool # | |||||
| Bits Bool | Interpret @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Bool -> Bool -> Bool # (.|.) :: Bool -> Bool -> Bool # complement :: Bool -> Bool # shift :: Bool -> Int -> Bool # rotate :: Bool -> Int -> Bool # setBit :: Bool -> Int -> Bool # clearBit :: Bool -> Int -> Bool # complementBit :: Bool -> Int -> Bool # testBit :: Bool -> Int -> Bool # bitSizeMaybe :: Bool -> Maybe Int # shiftL :: Bool -> Int -> Bool # unsafeShiftL :: Bool -> Int -> Bool # shiftR :: Bool -> Int -> Bool # unsafeShiftR :: Bool -> Int -> Bool # rotateL :: Bool -> Int -> Bool # | |||||
| FiniteBits Bool | @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Bool -> Int # countLeadingZeros :: Bool -> Int # countTrailingZeros :: Bool -> Int # | |||||
| Data Bool | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bool -> c Bool # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool # dataTypeOf :: Bool -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) # gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool # | |||||
| Bounded Bool | @since base-2.01 | ||||
| Enum Bool | @since base-2.01 | ||||
| Storable Bool | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Generic Bool | |||||
Defined in GHC.Internal.Generics | |||||
| SingKind Bool | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Read Bool | @since base-2.01 | ||||
| Show Bool | @since base-2.01 | ||||
| Eq Bool | |||||
| Ord Bool | |||||
| SingI 'False | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| SingI 'True | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| IsProperty (String, Bool) # | |||||
| type DemoteRep Bool | |||||
Defined in GHC.Internal.Generics | |||||
| type Rep Bool | @since base-4.6.0.0 | ||||
| data Sing (a :: Bool) | |||||
The character type Char represents Unicode codespace
and its elements are code points as in definitions
D9 and D10 of the Unicode Standard.
Character literals in Haskell are single-quoted: 'Q', 'Я' or 'Ω'.
To represent a single quote itself use '\'', and to represent a backslash
use '\\'. The full grammar can be found in the section 2.6 of the
Haskell 2010 Language Report.
To specify a character by its code point one can use decimal, hexadecimal
or octal notation: '\65', '\x41' and '\o101' are all alternative forms
of 'A'. The largest code point is '\x10ffff'.
There is a special escape syntax for ASCII control characters:
| Escape | Alternatives | Meaning |
|---|---|---|
'\NUL' | '\0' | null character |
'\SOH' | '\1' | start of heading |
'\STX' | '\2' | start of text |
'\ETX' | '\3' | end of text |
'\EOT' | '\4' | end of transmission |
'\ENQ' | '\5' | enquiry |
'\ACK' | '\6' | acknowledge |
'\BEL' | '\7', '\a' | bell (alert) |
'\BS' | '\8', '\b' | backspace |
'\HT' | '\9', '\t' | horizontal tab |
'\LF' | '\10', '\n' | line feed (new line) |
'\VT' | '\11', '\v' | vertical tab |
'\FF' | '\12', '\f' | form feed |
'\CR' | '\13', '\r' | carriage return |
'\SO' | '\14' | shift out |
'\SI' | '\15' | shift in |
'\DLE' | '\16' | data link escape |
'\DC1' | '\17' | device control 1 |
'\DC2' | '\18' | device control 2 |
'\DC3' | '\19' | device control 3 |
'\DC4' | '\20' | device control 4 |
'\NAK' | '\21' | negative acknowledge |
'\SYN' | '\22' | synchronous idle |
'\ETB' | '\23' | end of transmission block |
'\CAN' | '\24' | cancel |
'\EM' | '\25' | end of medium |
'\SUB' | '\26' | substitute |
'\ESC' | '\27' | escape |
'\FS' | '\28' | file separator |
'\GS' | '\29' | group separator |
'\RS' | '\30' | record separator |
'\US' | '\31' | unit separator |
'\SP' | '\32', ' ' | space |
'\DEL' | '\127' | delete |
Instances
| IsChar Char | Since: base-2.1 | ||||
| PrintfArg Char | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| NormalForm Char | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Char -> () # | |||||
| Subtractive Char | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Char | |||||
Defined in Basement.PrimType | |||||
| PrimType Char | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char -> CountOf Word8 # primShiftToBytes :: Proxy Char -> Int # primBaUIndex :: ByteArray# -> Offset Char -> Char # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () # primAddrIndex :: Addr# -> Offset Char -> Char # primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () # | |||||
| Arbitrary Char # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Char # | |||||
| StorableFixed Char # | |||||
| IsField Char # | |||||
| Data Char | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char # dataTypeOf :: Char -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) # gmapT :: (forall b. Data b => b -> b) -> Char -> Char # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char # | |||||
| Bounded Char | @since base-2.01 | ||||
| Enum Char | @since base-2.01 | ||||
| Storable Char | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Read Char | @since base-2.01 | ||||
| Show Char | @since base-2.01 | ||||
| Eq Char | |||||
| Ord Char | |||||
| Generic1 (URec Char :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| IsField [Char] # | |||||
| Foldable (UChar :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UChar m -> m # foldMap :: Monoid m => (a -> m) -> UChar a -> m # foldMap' :: Monoid m => (a -> m) -> UChar a -> m # foldr :: (a -> b -> b) -> b -> UChar a -> b # foldr' :: (a -> b -> b) -> b -> UChar a -> b # foldl :: (b -> a -> b) -> b -> UChar a -> b # foldl' :: (b -> a -> b) -> b -> UChar a -> b # foldr1 :: (a -> a -> a) -> UChar a -> a # foldl1 :: (a -> a -> a) -> UChar a -> a # elem :: Eq a => a -> UChar a -> Bool # maximum :: Ord a => UChar a -> a # minimum :: Ord a => UChar a -> a # | |||||
| Traversable (UChar :: Type -> Type) | @since base-4.9.0.0 | ||||
| Functor (URec Char :: Type -> Type) | @since base-4.9.0.0 | ||||
| Generic (URec Char p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Char p) | @since base-4.9.0.0 | ||||
| Eq (URec Char p) | @since base-4.9.0.0 | ||||
| Ord (URec Char p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type NatNumMaxBound Char | |||||
Defined in Basement.Nat | |||||
| type Difference Char | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Char | |||||
Defined in Basement.PrimType | |||||
| data URec Char (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
| type Compare (a :: Char) (b :: Char) | |||||
Defined in GHC.Internal.Data.Type.Ord | |||||
| type Rep1 (URec Char :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Char p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
ASCII value between 0x0 and 0x7f
Instances
| NormalForm Char7 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () # | |||||
| PrimType Char7 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char7 -> CountOf Word8 # primShiftToBytes :: Proxy Char7 -> Int # primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () # primAddrIndex :: Addr# -> Offset Char7 -> Char7 # primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () # | |||||
| Arbitrary Char7 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Show Char7 | |||||
| Eq Char7 | |||||
| Ord Char7 | |||||
| type NatNumMaxBound Char7 | |||||
Defined in Basement.Nat | |||||
| type PrimSize Char7 | |||||
Defined in Basement.PrimType | |||||
A value of type is a computation which, when performed,
does some I/O before returning a value of type IO aa.
There is really only one way to "perform" an I/O action: bind it to
Main.main in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the IO monad and called
at some point, directly or indirectly, from Main.main.
IO is a monad, so IO actions can be combined using either the do-notation
or the >> and >>= operations from the Monad
class.
Instances
| MonadIO IO | Since: base-4.9.0.0 | ||||||||
Defined in Control.Monad.IO.Class | |||||||||
| PrimMonad IO | |||||||||
Defined in Basement.Monad Associated Types
Methods primitive :: (State# (PrimState IO) -> (# State# (PrimState IO), a #)) -> IO a # primThrow :: Exception e => e -> IO a # unPrimMonad :: IO a -> State# (PrimState IO) -> (# State# (PrimState IO), a #) # primVarNew :: a -> IO (PrimVar IO a) # primVarRead :: PrimVar IO a -> IO a # primVarWrite :: PrimVar IO a -> a -> IO () # | |||||||||
| MonadBracket IO # | |||||||||
Defined in Foundation.Monad.Exception Methods generalBracket :: IO a -> (a -> b -> IO ignored1) -> (a -> SomeException -> IO ignored2) -> (a -> IO b) -> IO b # | |||||||||
| MonadCatch IO # | |||||||||
| MonadThrow IO # | |||||||||
Defined in Foundation.Monad.Exception | |||||||||
| MonadRandom IO # | |||||||||
Defined in Foundation.Random.Class Methods getRandomBytes :: CountOf Word8 -> IO (UArray Word8) # getRandomWord64 :: IO Word64 # getRandomF32 :: IO Float # getRandomF64 :: IO Double # | |||||||||
| Alternative IO | Takes the first non-throwing @since base-4.9.0.0 | ||||||||
| Applicative IO | @since base-2.01 | ||||||||
| Functor IO | @since base-2.01 | ||||||||
| Monad IO | @since base-2.01 | ||||||||
| MonadPlus IO | Takes the first non-throwing @since base-4.9.0.0 | ||||||||
| MonadFail IO | @since base-4.9.0.0 | ||||||||
Defined in GHC.Internal.Control.Monad.Fail | |||||||||
| MonadFix IO | @since base-2.01 | ||||||||
Defined in GHC.Internal.Control.Monad.Fix | |||||||||
| a ~ () => HPrintfType (IO a) | Since: base-4.7.0.0 | ||||||||
Defined in Text.Printf | |||||||||
| a ~ () => PrintfType (IO a) | Since: base-4.7.0.0 | ||||||||
Defined in Text.Printf | |||||||||
| Monoid a => Monoid (IO a) | @since base-4.9.0.0 | ||||||||
| Semigroup a => Semigroup (IO a) | @since base-4.10.0.0 | ||||||||
| type PrimState IO | |||||||||
Defined in Basement.Monad | |||||||||
| type PrimVar IO | |||||||||
Defined in Basement.Monad | |||||||||
The Either type represents values with two possibilities: a value of
type is either Either a b or Left a.Right b
The Either type is sometimes used to represent a value which is
either correct or an error; by convention, the Left constructor is
used to hold an error value and the Right constructor is used to
hold a correct value (mnemonic: "right" also means "correct").
Examples
The type is the type of values which can be either
a Either String IntString or an Int. The Left constructor can be used only on
Strings, and the Right constructor can be used only on Ints:
>>>let s = Left "foo" :: Either String Int>>>sLeft "foo">>>let n = Right 3 :: Either String Int>>>nRight 3>>>:type ss :: Either String Int>>>:type nn :: Either String Int
The fmap from our Functor instance will ignore Left values, but
will apply the supplied function to values contained in a Right:
>>>let s = Left "foo" :: Either String Int>>>let n = Right 3 :: Either String Int>>>fmap (*2) sLeft "foo">>>fmap (*2) nRight 6
The Monad instance for Either allows us to chain together multiple
actions which may fail, and fail overall if any of the individual
steps failed. First we'll write a function that can either parse an
Int from a Char, or fail.
>>>import Data.Char ( digitToInt, isDigit )>>>:{let parseEither :: Char -> Either String Int parseEither c | isDigit c = Right (digitToInt c) | otherwise = Left "parse error">>>:}
The following should work, since both '1' and '2' can be
parsed as Ints.
>>>:{let parseMultiple :: Either String Int parseMultiple = do x <- parseEither '1' y <- parseEither '2' return (x + y)>>>:}
>>>parseMultipleRight 3
But the following should fail overall, since the first operation where
we attempt to parse 'm' as an Int will fail:
>>>:{let parseMultiple :: Either String Int parseMultiple = do x <- parseEither 'm' y <- parseEither '2' return (x + y)>>>:}
>>>parseMultipleLeft "parse error"
Instances
| Bifoldable Either | Since: base-4.10.0.0 | ||||
| Bifoldable1 Either | |||||
Defined in Data.Bifoldable1 | |||||
| Bifunctor Either | Since: base-4.8.0.0 | ||||
| Bitraversable Either | Since: base-4.10.0.0 | ||||
Defined in Data.Bitraversable Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d) # | |||||
| Eq2 Either | Since: base-4.9.0.0 | ||||
| Ord2 Either | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes | |||||
| Read2 Either | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] # | |||||
| Show2 Either | Since: base-4.9.0.0 | ||||
| Generic1 (Either a :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Eq a => Eq1 (Either a) | Since: base-4.9.0.0 | ||||
| Ord a => Ord1 (Either a) | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes | |||||
| Read a => Read1 (Either a) | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] # | |||||
| Show a => Show1 (Either a) | Since: base-4.9.0.0 | ||||
| MonadFailure (Either a) | |||||
| Applicative (Either e) | @since base-3.0 | ||||
| Functor (Either a) | @since base-3.0 | ||||
| Monad (Either e) | @since base-4.4.0.0 | ||||
| MonadFix (Either e) | @since base-4.3.0.0 | ||||
Defined in GHC.Internal.Control.Monad.Fix | |||||
| Foldable (Either a) | @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # | |||||
| Traversable (Either a) | @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| From (Maybe a) (Either () a) | |||||
Defined in Basement.From | |||||
| (NormalForm l, NormalForm r) => NormalForm (Either l r) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Either l r -> () # | |||||
| (Arbitrary l, Arbitrary r) => Arbitrary (Either l r) # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Semigroup (Either a b) | @since base-4.9.0.0 | ||||
| (Data a, Data b) => Data (Either a b) | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Either a b -> c (Either a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) # toConstr :: Either a b -> Constr # dataTypeOf :: Either a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # | |||||
| Generic (Either a b) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| (Read a, Read b) => Read (Either a b) | @since base-3.0 | ||||
| (Show a, Show b) => Show (Either a b) | @since base-3.0 | ||||
| (Eq a, Eq b) => Eq (Either a b) | @since base-2.01 | ||||
| (Ord a, Ord b) => Ord (Either a b) | @since base-2.01 | ||||
Defined in GHC.Internal.Data.Either | |||||
| From (Either a b) (These a b) | |||||
Defined in Basement.From | |||||
| type Rep1 (Either a :: Type -> Type) | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Generics type Rep1 (Either a :: Type -> Type) = D1 ('MetaData "Either" "GHC.Internal.Data.Either" "ghc-internal" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |||||
| type Failure (Either a) | |||||
Defined in Basement.Monad | |||||
| type Rep (Either a b) | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Generics type Rep (Either a b) = D1 ('MetaData "Either" "GHC.Internal.Data.Either" "ghc-internal" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))) | |||||
Numbers
8-bit signed integer type
Instances
| PrintfArg Int8 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Int8 | |||||
| FiniteBitsOps Int8 | |||||
| HasNegation Int8 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Int8 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int8 # | |||||
| NormalForm Int8 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int8 -> () # | |||||
| Additive Int8 | |||||
| IDivisible Int8 | |||||
| Multiplicative Int8 | |||||
| IsIntegral Int8 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Int8 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Int8 | |||||
Defined in Basement.PrimType | |||||
| PrimType Int8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int8 -> CountOf Word8 # primShiftToBytes :: Proxy Int8 -> Int # primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () # primAddrIndex :: Addr# -> Offset Int8 -> Int8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () # | |||||
| Arbitrary Int8 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Int8 # | |||||
| StorableFixed Int8 # | |||||
| IsField Int8 # | |||||
| Hashable Int8 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Signed Int8 # | |||||
| Bits Int8 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int8 -> Int8 -> Int8 # (.|.) :: Int8 -> Int8 -> Int8 # complement :: Int8 -> Int8 # shift :: Int8 -> Int -> Int8 # rotate :: Int8 -> Int -> Int8 # setBit :: Int8 -> Int -> Int8 # clearBit :: Int8 -> Int -> Int8 # complementBit :: Int8 -> Int -> Int8 # testBit :: Int8 -> Int -> Bool # bitSizeMaybe :: Int8 -> Maybe Int # shiftL :: Int8 -> Int -> Int8 # unsafeShiftL :: Int8 -> Int -> Int8 # shiftR :: Int8 -> Int -> Int8 # unsafeShiftR :: Int8 -> Int -> Int8 # rotateL :: Int8 -> Int -> Int8 # | |||||
| FiniteBits Int8 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int8 -> Int # countLeadingZeros :: Int8 -> Int # countTrailingZeros :: Int8 -> Int # | |||||
| Data Int8 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int8 -> c Int8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int8 # dataTypeOf :: Int8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int8) # gmapT :: (forall b. Data b => b -> b) -> Int8 -> Int8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # | |||||
| Bounded Int8 | @since base-2.01 | ||||
| Enum Int8 | @since base-2.01 | ||||
| Storable Int8 | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Ix Int8 | @since base-2.01 | ||||
| Num Int8 | @since base-2.01 | ||||
| Read Int8 | @since base-2.01 | ||||
| Integral Int8 | @since base-2.01 | ||||
| Real Int8 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int8 -> Rational # | |||||
| Show Int8 | @since base-2.01 | ||||
| Eq Int8 | @since base-2.01 | ||||
| Ord Int8 | @since base-2.01 | ||||
| Cast Int8 Word8 | |||||
Defined in Basement.Cast | |||||
| Cast Word8 Int8 | |||||
Defined in Basement.Cast | |||||
| From Int8 Int16 | |||||
Defined in Basement.From | |||||
| From Int8 Int32 | |||||
Defined in Basement.From | |||||
| From Int8 Int64 | |||||
Defined in Basement.From | |||||
| From Int8 Int | |||||
Defined in Basement.From | |||||
| IntegralDownsize Int64 Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Int8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int16 # | |||||
| IntegralUpsize Int8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 # | |||||
| IntegralUpsize Int8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 # | |||||
| IntegralUpsize Int8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int # | |||||
| type NatNumMaxBound Int8 | |||||
Defined in Basement.Nat | |||||
| type Difference Int8 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Int8 | |||||
Defined in Basement.PrimType | |||||
16-bit signed integer type
Instances
| PrintfArg Int16 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Int16 | |||||
Defined in Basement.Bits | |||||
| FiniteBitsOps Int16 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int16 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Int16 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int16 # | |||||
| NormalForm Int16 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int16 -> () # | |||||
| Additive Int16 | |||||
| IDivisible Int16 | |||||
| Multiplicative Int16 | |||||
| IsIntegral Int16 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Int16 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Int16 | |||||
Defined in Basement.PrimType | |||||
| PrimType Int16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int16 -> CountOf Word8 # primShiftToBytes :: Proxy Int16 -> Int # primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () # primAddrIndex :: Addr# -> Offset Int16 -> Int16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () # | |||||
| Arbitrary Int16 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Int16 # | |||||
| StorableFixed Int16 # | |||||
| IsField Int16 # | |||||
| Hashable Int16 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Signed Int16 # | |||||
| Bits Int16 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int16 -> Int16 -> Int16 # (.|.) :: Int16 -> Int16 -> Int16 # xor :: Int16 -> Int16 -> Int16 # complement :: Int16 -> Int16 # shift :: Int16 -> Int -> Int16 # rotate :: Int16 -> Int -> Int16 # setBit :: Int16 -> Int -> Int16 # clearBit :: Int16 -> Int -> Int16 # complementBit :: Int16 -> Int -> Int16 # testBit :: Int16 -> Int -> Bool # bitSizeMaybe :: Int16 -> Maybe Int # shiftL :: Int16 -> Int -> Int16 # unsafeShiftL :: Int16 -> Int -> Int16 # shiftR :: Int16 -> Int -> Int16 # unsafeShiftR :: Int16 -> Int -> Int16 # rotateL :: Int16 -> Int -> Int16 # | |||||
| FiniteBits Int16 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int16 -> Int # countLeadingZeros :: Int16 -> Int # countTrailingZeros :: Int16 -> Int # | |||||
| Data Int16 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int16 -> c Int16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int16 # dataTypeOf :: Int16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int16) # gmapT :: (forall b. Data b => b -> b) -> Int16 -> Int16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # | |||||
| Bounded Int16 | @since base-2.01 | ||||
| Enum Int16 | @since base-2.01 | ||||
Defined in GHC.Internal.Int | |||||
| Storable Int16 | @since base-2.01 | ||||
| Ix Int16 | @since base-2.01 | ||||
| Num Int16 | @since base-2.01 | ||||
| Read Int16 | @since base-2.01 | ||||
| Integral Int16 | @since base-2.01 | ||||
| Real Int16 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int16 -> Rational # | |||||
| Show Int16 | @since base-2.01 | ||||
| Eq Int16 | @since base-2.01 | ||||
| Ord Int16 | @since base-2.01 | ||||
| Cast Int16 Word16 | |||||
Defined in Basement.Cast | |||||
| Cast Word16 Int16 | |||||
Defined in Basement.Cast | |||||
| From Int16 Int32 | |||||
Defined in Basement.From | |||||
| From Int16 Int64 | |||||
Defined in Basement.From | |||||
| From Int16 Int | |||||
Defined in Basement.From | |||||
| From Int8 Int16 | |||||
Defined in Basement.From | |||||
| From Word8 Int16 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Int64 Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Int16 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int32 # | |||||
| IntegralUpsize Int16 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int64 # | |||||
| IntegralUpsize Int16 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int # | |||||
| IntegralUpsize Int8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int16 # | |||||
| IntegralUpsize Word8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int16 # | |||||
| type NatNumMaxBound Int16 | |||||
Defined in Basement.Nat | |||||
| type Difference Int16 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Int16 | |||||
Defined in Basement.PrimType | |||||
32-bit signed integer type
Instances
| PrintfArg Int32 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Int32 | |||||
Defined in Basement.Bits | |||||
| FiniteBitsOps Int32 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int32 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Int32 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int32 # | |||||
| NormalForm Int32 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int32 -> () # | |||||
| Additive Int32 | |||||
| IDivisible Int32 | |||||
| Multiplicative Int32 | |||||
| IsIntegral Int32 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Int32 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Int32 | |||||
Defined in Basement.PrimType | |||||
| PrimType Int32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int32 -> CountOf Word8 # primShiftToBytes :: Proxy Int32 -> Int # primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () # primAddrIndex :: Addr# -> Offset Int32 -> Int32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () # | |||||
| Arbitrary Int32 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Int32 # | |||||
| StorableFixed Int32 # | |||||
| IsField Int32 # | |||||
| Hashable Int32 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Signed Int32 # | |||||
| Bits Int32 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int32 -> Int32 -> Int32 # (.|.) :: Int32 -> Int32 -> Int32 # xor :: Int32 -> Int32 -> Int32 # complement :: Int32 -> Int32 # shift :: Int32 -> Int -> Int32 # rotate :: Int32 -> Int -> Int32 # setBit :: Int32 -> Int -> Int32 # clearBit :: Int32 -> Int -> Int32 # complementBit :: Int32 -> Int -> Int32 # testBit :: Int32 -> Int -> Bool # bitSizeMaybe :: Int32 -> Maybe Int # shiftL :: Int32 -> Int -> Int32 # unsafeShiftL :: Int32 -> Int -> Int32 # shiftR :: Int32 -> Int -> Int32 # unsafeShiftR :: Int32 -> Int -> Int32 # rotateL :: Int32 -> Int -> Int32 # | |||||
| FiniteBits Int32 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int32 -> Int # countLeadingZeros :: Int32 -> Int # countTrailingZeros :: Int32 -> Int # | |||||
| Data Int32 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int32 -> c Int32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int32 # dataTypeOf :: Int32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int32) # gmapT :: (forall b. Data b => b -> b) -> Int32 -> Int32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # | |||||
| Bounded Int32 | @since base-2.01 | ||||
| Enum Int32 | @since base-2.01 | ||||
Defined in GHC.Internal.Int | |||||
| Storable Int32 | @since base-2.01 | ||||
| Ix Int32 | @since base-2.01 | ||||
| Num Int32 | @since base-2.01 | ||||
| Read Int32 | @since base-2.01 | ||||
| Integral Int32 | @since base-2.01 | ||||
| Real Int32 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int32 -> Rational # | |||||
| Show Int32 | @since base-2.01 | ||||
| Eq Int32 | @since base-2.01 | ||||
| Ord Int32 | @since base-2.01 | ||||
| Cast Int32 Word32 | |||||
Defined in Basement.Cast | |||||
| Cast Word32 Int32 | |||||
Defined in Basement.Cast | |||||
| From Int16 Int32 | |||||
Defined in Basement.From | |||||
| From Int32 Int64 | |||||
Defined in Basement.From | |||||
| From Int32 Int | |||||
Defined in Basement.From | |||||
| From Int8 Int32 | |||||
Defined in Basement.From | |||||
| From Word16 Int32 | |||||
Defined in Basement.From | |||||
| From Word8 Int32 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Int64 Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Int16 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int32 # | |||||
| IntegralUpsize Int32 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 # | |||||
| IntegralUpsize Int32 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int # | |||||
| IntegralUpsize Int8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 # | |||||
| IntegralUpsize Word8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 # | |||||
| type NatNumMaxBound Int32 | |||||
Defined in Basement.Nat | |||||
| type Difference Int32 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Int32 | |||||
Defined in Basement.PrimType | |||||
64-bit signed integer type
Instances
| PrintfArg Int64 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Int64 | |||||
Defined in Basement.Bits | |||||
| FiniteBitsOps Int64 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int64 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Int64 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int64 # | |||||
| NormalForm Int64 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int64 -> () # | |||||
| Additive Int64 | |||||
| IDivisible Int64 | |||||
| Multiplicative Int64 | |||||
| IsIntegral Int64 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Int64 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Int64 | |||||
Defined in Basement.PrimType | |||||
| PrimType Int64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int64 -> CountOf Word8 # primShiftToBytes :: Proxy Int64 -> Int # primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () # primAddrIndex :: Addr# -> Offset Int64 -> Int64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () # | |||||
| Arbitrary Int64 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Int64 # | |||||
| StorableFixed Int64 # | |||||
| IsField Int64 # | |||||
| Hashable Int64 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Signed Int64 # | |||||
| Bits Int64 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int64 -> Int64 -> Int64 # (.|.) :: Int64 -> Int64 -> Int64 # xor :: Int64 -> Int64 -> Int64 # complement :: Int64 -> Int64 # shift :: Int64 -> Int -> Int64 # rotate :: Int64 -> Int -> Int64 # setBit :: Int64 -> Int -> Int64 # clearBit :: Int64 -> Int -> Int64 # complementBit :: Int64 -> Int -> Int64 # testBit :: Int64 -> Int -> Bool # bitSizeMaybe :: Int64 -> Maybe Int # shiftL :: Int64 -> Int -> Int64 # unsafeShiftL :: Int64 -> Int -> Int64 # shiftR :: Int64 -> Int -> Int64 # unsafeShiftR :: Int64 -> Int -> Int64 # rotateL :: Int64 -> Int -> Int64 # | |||||
| FiniteBits Int64 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int64 -> Int # countLeadingZeros :: Int64 -> Int # countTrailingZeros :: Int64 -> Int # | |||||
| Data Int64 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int64 -> c Int64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int64 # dataTypeOf :: Int64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int64) # gmapT :: (forall b. Data b => b -> b) -> Int64 -> Int64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # | |||||
| Bounded Int64 | @since base-2.01 | ||||
| Enum Int64 | @since base-2.01 | ||||
Defined in GHC.Internal.Int | |||||
| Storable Int64 | @since base-2.01 | ||||
| Ix Int64 | @since base-2.01 | ||||
| Num Int64 | @since base-2.01 | ||||
| Read Int64 | @since base-2.01 | ||||
| Integral Int64 | @since base-2.01 | ||||
| Real Int64 | @since base-2.01 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int64 -> Rational # | |||||
| Show Int64 | @since base-2.01 | ||||
| Eq Int64 | @since base-2.01 | ||||
| Ord Int64 | @since base-2.01 | ||||
| Cast Int64 Word64 | |||||
Defined in Basement.Cast | |||||
| Cast Int64 Int | |||||
Defined in Basement.Cast | |||||
| Cast Int64 Word | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Int64 | |||||
Defined in Basement.Cast | |||||
| Cast Int Int64 | |||||
Defined in Basement.Cast | |||||
| Cast Word Int64 | |||||
Defined in Basement.Cast | |||||
| From Int16 Int64 | |||||
Defined in Basement.From | |||||
| From Int32 Int64 | |||||
Defined in Basement.From | |||||
| From Int8 Int64 | |||||
Defined in Basement.From | |||||
| From Word16 Int64 | |||||
Defined in Basement.From | |||||
| From Word32 Int64 | |||||
Defined in Basement.From | |||||
| From Word8 Int64 | |||||
Defined in Basement.From | |||||
| From Int Int64 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Int64 Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int64 Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int64 Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int64 Int | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Int16 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int64 # | |||||
| IntegralUpsize Int32 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 # | |||||
| IntegralUpsize Int8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 # | |||||
| IntegralUpsize Word8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 # | |||||
| IntegralUpsize Int Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 # | |||||
| type NatNumMaxBound Int64 | |||||
Defined in Basement.Nat | |||||
| type Difference Int64 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Int64 | |||||
Defined in Basement.PrimType | |||||
8-bit unsigned integer type
Instances
| PrintfArg Word8 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Word8 | |||||
Defined in Basement.Bits | |||||
| FiniteBitsOps Word8 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word8 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Word8 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word8 # | |||||
| NormalForm Word8 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word8 -> () # | |||||
| Additive Word8 | |||||
| IDivisible Word8 | |||||
| Multiplicative Word8 | |||||
| IsIntegral Word8 | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Word8 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Word8 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word8 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word8 -> CountOf Word8 # primShiftToBytes :: Proxy Word8 -> Int # primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () # primAddrIndex :: Addr# -> Offset Word8 -> Word8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () # | |||||
| Arbitrary Word8 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word8 # | |||||
| StorableFixed Word8 # | |||||
| IsField Word8 # | |||||
| Hashable Word8 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word8 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word8 -> Word8 -> Word8 # (.|.) :: Word8 -> Word8 -> Word8 # xor :: Word8 -> Word8 -> Word8 # complement :: Word8 -> Word8 # shift :: Word8 -> Int -> Word8 # rotate :: Word8 -> Int -> Word8 # setBit :: Word8 -> Int -> Word8 # clearBit :: Word8 -> Int -> Word8 # complementBit :: Word8 -> Int -> Word8 # testBit :: Word8 -> Int -> Bool # bitSizeMaybe :: Word8 -> Maybe Int # shiftL :: Word8 -> Int -> Word8 # unsafeShiftL :: Word8 -> Int -> Word8 # shiftR :: Word8 -> Int -> Word8 # unsafeShiftR :: Word8 -> Int -> Word8 # rotateL :: Word8 -> Int -> Word8 # | |||||
| FiniteBits Word8 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word8 -> Int # countLeadingZeros :: Word8 -> Int # countTrailingZeros :: Word8 -> Int # | |||||
| Data Word8 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word8 -> c Word8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word8 # dataTypeOf :: Word8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word8) # gmapT :: (forall b. Data b => b -> b) -> Word8 -> Word8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # | |||||
| Bounded Word8 | @since base-2.01 | ||||
| Enum Word8 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Storable Word8 | @since base-2.01 | ||||
| Ix Word8 | @since base-2.01 | ||||
| Num Word8 | @since base-2.01 | ||||
| Read Word8 | @since base-2.01 | ||||
| Integral Word8 | @since base-2.01 | ||||
| Real Word8 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word8 -> Rational # | |||||
| Show Word8 | @since base-2.01 | ||||
| Eq Word8 | @since base-2.01 | ||||
| Ord Word8 | @since base-2.01 | ||||
| Cast Int8 Word8 | |||||
Defined in Basement.Cast | |||||
| Cast Word8 Int8 | |||||
Defined in Basement.Cast | |||||
| From Word8 Word128 | |||||
Defined in Basement.From | |||||
| From Word8 Word256 | |||||
Defined in Basement.From | |||||
| From Word8 Int16 | |||||
Defined in Basement.From | |||||
| From Word8 Int32 | |||||
Defined in Basement.From | |||||
| From Word8 Int64 | |||||
Defined in Basement.From | |||||
| From Word8 Word16 | |||||
Defined in Basement.From | |||||
| From Word8 Word32 | |||||
Defined in Basement.From | |||||
| From Word8 Word64 | |||||
Defined in Basement.From | |||||
| From Word8 Int | |||||
Defined in Basement.From | |||||
| From Word8 Word | |||||
Defined in Basement.From | |||||
| IntegralDownsize Word16 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word32 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word64 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Word8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int16 # | |||||
| IntegralUpsize Word8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 # | |||||
| IntegralUpsize Word8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 # | |||||
| IntegralUpsize Word8 Word16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 # | |||||
| IntegralUpsize Word8 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 # | |||||
| IntegralUpsize Word8 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 # | |||||
| IntegralUpsize Word8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int # | |||||
| IntegralUpsize Word8 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word # | |||||
| From AsciiString (UArray Word8) | |||||
Defined in Basement.From Methods from :: AsciiString -> UArray Word8 # | |||||
| From String (UArray Word8) | |||||
| (KnownNat n, NatWithinBound Word8 n) => From (Zn n) Word8 | |||||
Defined in Basement.From | |||||
| (KnownNat n, NatWithinBound Word8 n) => From (Zn64 n) Word8 | |||||
Defined in Basement.From | |||||
| TryFrom (UArray Word8) String | |||||
| Cast (Block a) (Block Word8) | |||||
| type NatNumMaxBound Word8 | |||||
Defined in Basement.Nat | |||||
| type Difference Word8 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word8 | |||||
Defined in Basement.PrimType | |||||
16-bit unsigned integer type
Instances
| PrintfArg Word16 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Word16 | |||||
Defined in Basement.Bits Methods (.&.) :: Word16 -> Word16 -> Word16 # (.|.) :: Word16 -> Word16 -> Word16 # (.^.) :: Word16 -> Word16 -> Word16 # (.<<.) :: Word16 -> CountOf Bool -> Word16 # (.>>.) :: Word16 -> CountOf Bool -> Word16 # bit :: Offset Bool -> Word16 # isBitSet :: Word16 -> Offset Bool -> Bool # | |||||
| FiniteBitsOps Word16 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word16 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Word16 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word16 # | |||||
| ByteSwap Word16 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word16 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word16 -> () # | |||||
| Additive Word16 | |||||
| IDivisible Word16 | |||||
| Multiplicative Word16 | |||||
| IsIntegral Word16 | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Word16 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Word16 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word16 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word16 -> CountOf Word8 # primShiftToBytes :: Proxy Word16 -> Int # primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () # primAddrIndex :: Addr# -> Offset Word16 -> Word16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () # | |||||
| Arbitrary Word16 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word16 # | |||||
| StorableFixed Word16 # | |||||
| IsField Word16 # | |||||
| Hashable Word16 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word16 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word16 -> Word16 -> Word16 # (.|.) :: Word16 -> Word16 -> Word16 # xor :: Word16 -> Word16 -> Word16 # complement :: Word16 -> Word16 # shift :: Word16 -> Int -> Word16 # rotate :: Word16 -> Int -> Word16 # setBit :: Word16 -> Int -> Word16 # clearBit :: Word16 -> Int -> Word16 # complementBit :: Word16 -> Int -> Word16 # testBit :: Word16 -> Int -> Bool # bitSizeMaybe :: Word16 -> Maybe Int # shiftL :: Word16 -> Int -> Word16 # unsafeShiftL :: Word16 -> Int -> Word16 # shiftR :: Word16 -> Int -> Word16 # unsafeShiftR :: Word16 -> Int -> Word16 # rotateL :: Word16 -> Int -> Word16 # | |||||
| FiniteBits Word16 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word16 -> Int # countLeadingZeros :: Word16 -> Int # countTrailingZeros :: Word16 -> Int # | |||||
| Data Word16 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word16 -> c Word16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word16 # toConstr :: Word16 -> Constr # dataTypeOf :: Word16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word16) # gmapT :: (forall b. Data b => b -> b) -> Word16 -> Word16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # | |||||
| Bounded Word16 | @since base-2.01 | ||||
| Enum Word16 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Storable Word16 | @since base-2.01 | ||||
| Ix Word16 | @since base-2.01 | ||||
| Num Word16 | @since base-2.01 | ||||
| Read Word16 | @since base-2.01 | ||||
| Integral Word16 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word16 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word16 -> Rational # | |||||
| Show Word16 | @since base-2.01 | ||||
| Eq Word16 | @since base-2.01 | ||||
| Ord Word16 | @since base-2.01 | ||||
| Cast Int16 Word16 | |||||
Defined in Basement.Cast | |||||
| Cast Word16 Int16 | |||||
Defined in Basement.Cast | |||||
| From Word16 Word128 | |||||
Defined in Basement.From | |||||
| From Word16 Word256 | |||||
Defined in Basement.From | |||||
| From Word16 Int32 | |||||
Defined in Basement.From | |||||
| From Word16 Int64 | |||||
Defined in Basement.From | |||||
| From Word16 Word32 | |||||
Defined in Basement.From | |||||
| From Word16 Word64 | |||||
Defined in Basement.From | |||||
| From Word16 Int | |||||
Defined in Basement.From | |||||
| From Word16 Word | |||||
Defined in Basement.From | |||||
| From Word8 Word16 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Word16 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word32 Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word64 Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Word16 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word32 # | |||||
| IntegralUpsize Word16 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word64 # | |||||
| IntegralUpsize Word16 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word # | |||||
| IntegralUpsize Word8 Word16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 # | |||||
| Storable (BE Word16) # | |||||
| Storable (LE Word16) # | |||||
| StorableFixed (BE Word16) # | |||||
| StorableFixed (LE Word16) # | |||||
| (KnownNat n, NatWithinBound Word16 n) => From (Zn n) Word16 | |||||
Defined in Basement.From | |||||
| (KnownNat n, NatWithinBound Word16 n) => From (Zn64 n) Word16 | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound Word16 | |||||
Defined in Basement.Nat | |||||
| type Difference Word16 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word16 | |||||
Defined in Basement.PrimType | |||||
32-bit unsigned integer type
Instances
| PrintfArg Word32 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Word32 | |||||
Defined in Basement.Bits Methods (.&.) :: Word32 -> Word32 -> Word32 # (.|.) :: Word32 -> Word32 -> Word32 # (.^.) :: Word32 -> Word32 -> Word32 # (.<<.) :: Word32 -> CountOf Bool -> Word32 # (.>>.) :: Word32 -> CountOf Bool -> Word32 # bit :: Offset Bool -> Word32 # isBitSet :: Word32 -> Offset Bool -> Bool # | |||||
| FiniteBitsOps Word32 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word32 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Word32 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word32 # | |||||
| ByteSwap Word32 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word32 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word32 -> () # | |||||
| Additive Word32 | |||||
| IDivisible Word32 | |||||
| Multiplicative Word32 | |||||
| IsIntegral Word32 | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Word32 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Word32 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word32 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word32 -> CountOf Word8 # primShiftToBytes :: Proxy Word32 -> Int # primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () # primAddrIndex :: Addr# -> Offset Word32 -> Word32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () # | |||||
| Arbitrary Word32 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word32 # | |||||
| StorableFixed Word32 # | |||||
| IsField Word32 # | |||||
| Hashable Word32 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word32 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word32 -> Word32 -> Word32 # (.|.) :: Word32 -> Word32 -> Word32 # xor :: Word32 -> Word32 -> Word32 # complement :: Word32 -> Word32 # shift :: Word32 -> Int -> Word32 # rotate :: Word32 -> Int -> Word32 # setBit :: Word32 -> Int -> Word32 # clearBit :: Word32 -> Int -> Word32 # complementBit :: Word32 -> Int -> Word32 # testBit :: Word32 -> Int -> Bool # bitSizeMaybe :: Word32 -> Maybe Int # shiftL :: Word32 -> Int -> Word32 # unsafeShiftL :: Word32 -> Int -> Word32 # shiftR :: Word32 -> Int -> Word32 # unsafeShiftR :: Word32 -> Int -> Word32 # rotateL :: Word32 -> Int -> Word32 # | |||||
| FiniteBits Word32 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word32 -> Int # countLeadingZeros :: Word32 -> Int # countTrailingZeros :: Word32 -> Int # | |||||
| Data Word32 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word32 -> c Word32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word32 # toConstr :: Word32 -> Constr # dataTypeOf :: Word32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word32) # gmapT :: (forall b. Data b => b -> b) -> Word32 -> Word32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # | |||||
| Bounded Word32 | @since base-2.01 | ||||
| Enum Word32 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Storable Word32 | @since base-2.01 | ||||
| Ix Word32 | @since base-2.01 | ||||
| Num Word32 | @since base-2.01 | ||||
| Read Word32 | @since base-2.01 | ||||
| Integral Word32 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word32 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word32 -> Rational # | |||||
| Show Word32 | @since base-2.01 | ||||
| Eq Word32 | @since base-2.01 | ||||
| Ord Word32 | @since base-2.01 | ||||
| Cast Int32 Word32 | |||||
Defined in Basement.Cast | |||||
| Cast Word32 Int32 | |||||
Defined in Basement.Cast | |||||
| From Word16 Word32 | |||||
Defined in Basement.From | |||||
| From Word32 Word128 | |||||
Defined in Basement.From | |||||
| From Word32 Word256 | |||||
Defined in Basement.From | |||||
| From Word32 Int64 | |||||
Defined in Basement.From | |||||
| From Word32 Word64 | |||||
Defined in Basement.From | |||||
| From Word32 Int | |||||
Defined in Basement.From | |||||
| From Word32 Word | |||||
Defined in Basement.From | |||||
| From Word8 Word32 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Word32 Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word32 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word64 Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Word16 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word32 # | |||||
| IntegralUpsize Word32 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 # | |||||
| IntegralUpsize Word32 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word # | |||||
| IntegralUpsize Word8 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 # | |||||
| Storable (BE Word32) # | |||||
| Storable (LE Word32) # | |||||
| StorableFixed (BE Word32) # | |||||
| StorableFixed (LE Word32) # | |||||
| (KnownNat n, NatWithinBound Word32 n) => From (Zn n) Word32 | |||||
Defined in Basement.From | |||||
| (KnownNat n, NatWithinBound Word32 n) => From (Zn64 n) Word32 | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound Word32 | |||||
Defined in Basement.Nat | |||||
| type Difference Word32 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word32 | |||||
Defined in Basement.PrimType | |||||
64-bit unsigned integer type
Instances
| PrintfArg Word64 | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Word64 | |||||
Defined in Basement.Bits Methods (.&.) :: Word64 -> Word64 -> Word64 # (.|.) :: Word64 -> Word64 -> Word64 # (.^.) :: Word64 -> Word64 -> Word64 # (.<<.) :: Word64 -> CountOf Bool -> Word64 # (.>>.) :: Word64 -> CountOf Bool -> Word64 # bit :: Offset Bool -> Word64 # isBitSet :: Word64 -> Offset Bool -> Bool # | |||||
| FiniteBitsOps Word64 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word64 | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Word64 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word64 # | |||||
| ByteSwap Word64 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word64 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word64 -> () # | |||||
| Additive Word64 | |||||
| IDivisible Word64 | |||||
| Multiplicative Word64 | |||||
| IsIntegral Word64 | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Word64 | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Word64 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word64 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word64 -> CountOf Word8 # primShiftToBytes :: Proxy Word64 -> Int # primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () # primAddrIndex :: Addr# -> Offset Word64 -> Word64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () # | |||||
| Arbitrary Word64 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word64 # | |||||
| StorableFixed Word64 # | |||||
| IsField Word64 # | |||||
| Hashable Word64 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word64 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word64 -> Word64 -> Word64 # (.|.) :: Word64 -> Word64 -> Word64 # xor :: Word64 -> Word64 -> Word64 # complement :: Word64 -> Word64 # shift :: Word64 -> Int -> Word64 # rotate :: Word64 -> Int -> Word64 # setBit :: Word64 -> Int -> Word64 # clearBit :: Word64 -> Int -> Word64 # complementBit :: Word64 -> Int -> Word64 # testBit :: Word64 -> Int -> Bool # bitSizeMaybe :: Word64 -> Maybe Int # shiftL :: Word64 -> Int -> Word64 # unsafeShiftL :: Word64 -> Int -> Word64 # shiftR :: Word64 -> Int -> Word64 # unsafeShiftR :: Word64 -> Int -> Word64 # rotateL :: Word64 -> Int -> Word64 # | |||||
| FiniteBits Word64 | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word64 -> Int # countLeadingZeros :: Word64 -> Int # countTrailingZeros :: Word64 -> Int # | |||||
| Data Word64 | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word64 -> c Word64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word64 # toConstr :: Word64 -> Constr # dataTypeOf :: Word64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word64) # gmapT :: (forall b. Data b => b -> b) -> Word64 -> Word64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # | |||||
| Bounded Word64 | @since base-2.01 | ||||
| Enum Word64 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Storable Word64 | @since base-2.01 | ||||
| Ix Word64 | @since base-2.01 | ||||
| Num Word64 | @since base-2.01 | ||||
| Read Word64 | @since base-2.01 | ||||
| Integral Word64 | @since base-2.01 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word64 | @since base-2.01 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word64 -> Rational # | |||||
| Show Word64 | @since base-2.01 | ||||
| Eq Word64 | @since base-2.01 | ||||
| Ord Word64 | @since base-2.01 | ||||
| Cast Int64 Word64 | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Int64 | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Int | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Word | |||||
Defined in Basement.Cast | |||||
| Cast Int Word64 | |||||
Defined in Basement.Cast | |||||
| Cast Word Word64 | |||||
Defined in Basement.Cast | |||||
| From Word16 Word64 | |||||
Defined in Basement.From | |||||
| From Word32 Word64 | |||||
Defined in Basement.From | |||||
| From Word64 Word128 | |||||
Defined in Basement.From | |||||
| From Word64 Word256 | |||||
Defined in Basement.From | |||||
| From Word8 Word64 | |||||
Defined in Basement.From | |||||
| From Word Word64 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Word64 Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word64 Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word64 Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Word16 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word64 # | |||||
| IntegralUpsize Word32 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 # | |||||
| IntegralUpsize Word8 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 # | |||||
| IntegralUpsize Word Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 # | |||||
| Storable (BE Word64) # | |||||
| Storable (LE Word64) # | |||||
| StorableFixed (BE Word64) # | |||||
| StorableFixed (LE Word64) # | |||||
| (KnownNat n, NatWithinBound Word64 n) => From (Zn n) Word64 | |||||
Defined in Basement.From | |||||
| From (Zn64 n) Word64 | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound Word64 | |||||
Defined in Basement.Nat | |||||
| type Difference Word64 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word64 | |||||
Defined in Basement.PrimType | |||||
Instances
| PrintfArg Word | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| BitOps Word | |||||
| FiniteBitsOps Word | |||||
| HasNegation Word | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Word | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word # | |||||
| NormalForm Word | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word -> () # | |||||
| Additive Word | |||||
| IDivisible Word | |||||
| Multiplicative Word | |||||
| IsIntegral Word | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Word | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Word | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word | |||||
Defined in Basement.PrimType | |||||
| PrimType Word | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word -> CountOf Word8 # primShiftToBytes :: Proxy Word -> Int # primBaUIndex :: ByteArray# -> Offset Word -> Word # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () # primAddrIndex :: Addr# -> Offset Word -> Word # primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () # | |||||
| Arbitrary Word # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField Word # | |||||
| Bits Word | @since base-2.01 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # complement :: Word -> Word # shift :: Word -> Int -> Word # rotate :: Word -> Int -> Word # setBit :: Word -> Int -> Word # clearBit :: Word -> Int -> Word # complementBit :: Word -> Int -> Word # testBit :: Word -> Int -> Bool # bitSizeMaybe :: Word -> Maybe Int # shiftL :: Word -> Int -> Word # unsafeShiftL :: Word -> Int -> Word # shiftR :: Word -> Int -> Word # unsafeShiftR :: Word -> Int -> Word # rotateL :: Word -> Int -> Word # | |||||
| FiniteBits Word | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int # | |||||
| Data Word | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word # dataTypeOf :: Word -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) # gmapT :: (forall b. Data b => b -> b) -> Word -> Word # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # | |||||
| Bounded Word | @since base-2.01 | ||||
| Enum Word | @since base-2.01 | ||||
| Storable Word | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Num Word | @since base-2.01 | ||||
| Read Word | @since base-4.5.0.0 | ||||
| Integral Word | @since base-2.01 | ||||
| Real Word | @since base-2.01 | ||||
Defined in GHC.Internal.Real Methods toRational :: Word -> Rational # | |||||
| Show Word | @since base-2.01 | ||||
| Eq Word | |||||
| Ord Word | |||||
| Cast Int64 Word | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Word | |||||
Defined in Basement.Cast | |||||
| Cast Int Word | |||||
Defined in Basement.Cast | |||||
| Cast Word Int64 | |||||
Defined in Basement.Cast | |||||
| Cast Word Word64 | |||||
Defined in Basement.Cast | |||||
| Cast Word Int | |||||
Defined in Basement.Cast | |||||
| From Word16 Word | |||||
Defined in Basement.From | |||||
| From Word32 Word | |||||
Defined in Basement.From | |||||
| From Word8 Word | |||||
Defined in Basement.From | |||||
| From Word Word64 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Word Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Word Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Word16 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word # | |||||
| IntegralUpsize Word32 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word # | |||||
| IntegralUpsize Word8 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word # | |||||
| IntegralUpsize Word Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 # | |||||
| From Word (CountOf ty) | |||||
Defined in Basement.From | |||||
| From Word (Offset ty) | |||||
Defined in Basement.From | |||||
| Generic1 (URec Word :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UWord :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # | |||||
| Traversable (UWord :: Type -> Type) | @since base-4.9.0.0 | ||||
| From (CountOf ty) Word | |||||
Defined in Basement.From | |||||
| Functor (URec Word :: Type -> Type) | @since base-4.9.0.0 | ||||
| Generic (URec Word p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Word p) | @since base-4.9.0.0 | ||||
| Eq (URec Word p) | @since base-4.9.0.0 | ||||
| Ord (URec Word p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type NatNumMaxBound Word | |||||
Defined in Basement.Nat | |||||
| type Difference Word | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word | |||||
Defined in Basement.PrimType | |||||
| data URec Word (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
| type Rep1 (URec Word :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Word p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
128 bits Word
Instances
| BitOps Word128 | |||||
Defined in Basement.Bits Methods (.&.) :: Word128 -> Word128 -> Word128 # (.|.) :: Word128 -> Word128 -> Word128 # (.^.) :: Word128 -> Word128 -> Word128 # (.<<.) :: Word128 -> CountOf Bool -> Word128 # (.>>.) :: Word128 -> CountOf Bool -> Word128 # bit :: Offset Bool -> Word128 # isBitSet :: Word128 -> Offset Bool -> Bool # | |||||
| FiniteBitsOps Word128 | |||||
Defined in Basement.Bits Methods numberOfBits :: Word128 -> CountOf Bool # rotateL :: Word128 -> CountOf Bool -> Word128 # rotateR :: Word128 -> CountOf Bool -> Word128 # popCount :: Word128 -> CountOf Bool # bitFlip :: Word128 -> Word128 # countLeadingZeros :: Word128 -> CountOf Bool # countTrailingZeros :: Word128 -> CountOf Bool # | |||||
| HasNegation Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| Integral Word128 | |||||
Defined in Basement.Types.Word128 Methods fromInteger :: Integer -> Word128 # | |||||
| NormalForm Word128 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word128 -> () # | |||||
| Additive Word128 | |||||
| IDivisible Word128 | |||||
| Multiplicative Word128 | |||||
| IsIntegral Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| IsNatural Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| Subtractive Word128 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word128 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word128 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word128 -> CountOf Word8 # primShiftToBytes :: Proxy Word128 -> Int # primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () # primAddrIndex :: Addr# -> Offset Word128 -> Word128 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () # | |||||
| Arbitrary Word128 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word128 # | |||||
| StorableFixed Word128 # | |||||
| IsField Word128 # | |||||
| Hashable Word128 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word128 | |||||
Defined in Basement.Types.Word128 Methods (.&.) :: Word128 -> Word128 -> Word128 # (.|.) :: Word128 -> Word128 -> Word128 # xor :: Word128 -> Word128 -> Word128 # complement :: Word128 -> Word128 # shift :: Word128 -> Int -> Word128 # rotate :: Word128 -> Int -> Word128 # setBit :: Word128 -> Int -> Word128 # clearBit :: Word128 -> Int -> Word128 # complementBit :: Word128 -> Int -> Word128 # testBit :: Word128 -> Int -> Bool # bitSizeMaybe :: Word128 -> Maybe Int # shiftL :: Word128 -> Int -> Word128 # unsafeShiftL :: Word128 -> Int -> Word128 # shiftR :: Word128 -> Int -> Word128 # unsafeShiftR :: Word128 -> Int -> Word128 # rotateL :: Word128 -> Int -> Word128 # | |||||
| Bounded Word128 | |||||
| Enum Word128 | |||||
| Storable Word128 | |||||
| Num Word128 | |||||
| Show Word128 | |||||
| Eq Word128 | |||||
| Ord Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| From Word128 Word256 | |||||
Defined in Basement.From | |||||
| From Word16 Word128 | |||||
Defined in Basement.From | |||||
| From Word32 Word128 | |||||
Defined in Basement.From | |||||
| From Word64 Word128 | |||||
Defined in Basement.From | |||||
| From Word8 Word128 | |||||
Defined in Basement.From | |||||
| Storable (BE Word128) # | |||||
| Storable (LE Word128) # | |||||
| StorableFixed (BE Word128) # | |||||
| StorableFixed (LE Word128) # | |||||
| (KnownNat n, NatWithinBound Word128 n) => From (Zn n) Word128 | |||||
Defined in Basement.From | |||||
| From (Zn64 n) Word128 | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound Word128 | |||||
Defined in Basement.Nat | |||||
| type Difference Word128 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word128 | |||||
Defined in Basement.PrimType | |||||
256 bits Word
Instances
| BitOps Word256 | |||||
Defined in Basement.Bits Methods (.&.) :: Word256 -> Word256 -> Word256 # (.|.) :: Word256 -> Word256 -> Word256 # (.^.) :: Word256 -> Word256 -> Word256 # (.<<.) :: Word256 -> CountOf Bool -> Word256 # (.>>.) :: Word256 -> CountOf Bool -> Word256 # bit :: Offset Bool -> Word256 # isBitSet :: Word256 -> Offset Bool -> Bool # | |||||
| FiniteBitsOps Word256 | |||||
Defined in Basement.Bits Methods numberOfBits :: Word256 -> CountOf Bool # rotateL :: Word256 -> CountOf Bool -> Word256 # rotateR :: Word256 -> CountOf Bool -> Word256 # popCount :: Word256 -> CountOf Bool # bitFlip :: Word256 -> Word256 # countLeadingZeros :: Word256 -> CountOf Bool # countTrailingZeros :: Word256 -> CountOf Bool # | |||||
| HasNegation Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| Integral Word256 | |||||
Defined in Basement.Types.Word256 Methods fromInteger :: Integer -> Word256 # | |||||
| NormalForm Word256 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word256 -> () # | |||||
| Additive Word256 | |||||
| IDivisible Word256 | |||||
| Multiplicative Word256 | |||||
| IsIntegral Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| IsNatural Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| Subtractive Word256 | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Word256 | |||||
Defined in Basement.PrimType | |||||
| PrimType Word256 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word256 -> CountOf Word8 # primShiftToBytes :: Proxy Word256 -> Int # primBaUIndex :: ByteArray# -> Offset Word256 -> Word256 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> prim Word256 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> Word256 -> prim () # primAddrIndex :: Addr# -> Offset Word256 -> Word256 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word256 -> prim Word256 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word256 -> Word256 -> prim () # | |||||
| Arbitrary Word256 # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Word256 # | |||||
| StorableFixed Word256 # | |||||
| IsField Word256 # | |||||
| Hashable Word256 # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Word256 | |||||
Defined in Basement.Types.Word256 Methods (.&.) :: Word256 -> Word256 -> Word256 # (.|.) :: Word256 -> Word256 -> Word256 # xor :: Word256 -> Word256 -> Word256 # complement :: Word256 -> Word256 # shift :: Word256 -> Int -> Word256 # rotate :: Word256 -> Int -> Word256 # setBit :: Word256 -> Int -> Word256 # clearBit :: Word256 -> Int -> Word256 # complementBit :: Word256 -> Int -> Word256 # testBit :: Word256 -> Int -> Bool # bitSizeMaybe :: Word256 -> Maybe Int # shiftL :: Word256 -> Int -> Word256 # unsafeShiftL :: Word256 -> Int -> Word256 # shiftR :: Word256 -> Int -> Word256 # unsafeShiftR :: Word256 -> Int -> Word256 # rotateL :: Word256 -> Int -> Word256 # | |||||
| Bounded Word256 | |||||
| Enum Word256 | |||||
| Storable Word256 | |||||
| Num Word256 | |||||
| Show Word256 | |||||
| Eq Word256 | |||||
| Ord Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| From Word128 Word256 | |||||
Defined in Basement.From | |||||
| From Word16 Word256 | |||||
Defined in Basement.From | |||||
| From Word32 Word256 | |||||
Defined in Basement.From | |||||
| From Word64 Word256 | |||||
Defined in Basement.From | |||||
| From Word8 Word256 | |||||
Defined in Basement.From | |||||
| Storable (BE Word256) # | |||||
| Storable (LE Word256) # | |||||
| StorableFixed (BE Word256) # | |||||
| StorableFixed (LE Word256) # | |||||
| (KnownNat n, NatWithinBound Word256 n) => From (Zn n) Word256 | |||||
Defined in Basement.From | |||||
| From (Zn64 n) Word256 | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound Word256 | |||||
Defined in Basement.Nat type NatNumMaxBound Word256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935 | |||||
| type Difference Word256 | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Word256 | |||||
Defined in Basement.PrimType | |||||
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1].
The exact range for a given implementation can be determined by using
minBound and maxBound from the Bounded class.
Instances
| PrintfArg Int | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| HasNegation Int | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Int | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int # | |||||
| NormalForm Int | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int -> () # | |||||
| Additive Int | |||||
| IDivisible Int | |||||
| Multiplicative Int | |||||
| IsIntegral Int | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Int | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimMemoryComparable Int | |||||
Defined in Basement.PrimType | |||||
| PrimType Int | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int -> CountOf Word8 # primShiftToBytes :: Proxy Int -> Int # primBaUIndex :: ByteArray# -> Offset Int -> Int # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> prim Int # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> Int -> prim () # primAddrIndex :: Addr# -> Offset Int -> Int # primAddrRead :: PrimMonad prim => Addr# -> Offset Int -> prim Int # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int -> Int -> prim () # | |||||
| Arbitrary Int # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField Int # | |||||
| Signed Int # | |||||
| Bits Int | @since base-2.01 | ||||
Defined in GHC.Internal.Bits | |||||
| FiniteBits Int | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Int -> Int # countLeadingZeros :: Int -> Int # countTrailingZeros :: Int -> Int # | |||||
| Data Int | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int -> c Int # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int # dataTypeOf :: Int -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) # gmapT :: (forall b. Data b => b -> b) -> Int -> Int # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int # | |||||
| Bounded Int | @since base-2.01 | ||||
| Enum Int | @since base-2.01 | ||||
| Storable Int | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Num Int | @since base-2.01 | ||||
| Read Int | @since base-2.01 | ||||
| Integral Int | @since base-2.0.1 | ||||
| Real Int | @since base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Int -> Rational # | |||||
| Show Int | @since base-2.01 | ||||
| Eq Int | |||||
| Ord Int | |||||
| Cast Int64 Int | |||||
Defined in Basement.Cast | |||||
| Cast Word64 Int | |||||
Defined in Basement.Cast | |||||
| Cast Int Int64 | |||||
Defined in Basement.Cast | |||||
| Cast Int Word64 | |||||
Defined in Basement.Cast | |||||
| Cast Int Word | |||||
Defined in Basement.Cast | |||||
| Cast Word Int | |||||
Defined in Basement.Cast | |||||
| From Int16 Int | |||||
Defined in Basement.From | |||||
| From Int32 Int | |||||
Defined in Basement.From | |||||
| From Int8 Int | |||||
Defined in Basement.From | |||||
| From Word16 Int | |||||
Defined in Basement.From | |||||
| From Word32 Int | |||||
Defined in Basement.From | |||||
| From Word8 Int | |||||
Defined in Basement.From | |||||
| From Int Int64 | |||||
Defined in Basement.From | |||||
| IntegralDownsize Int64 Int | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Int Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralUpsize Int16 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int # | |||||
| IntegralUpsize Int32 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int # | |||||
| IntegralUpsize Int8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int # | |||||
| IntegralUpsize Word8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int # | |||||
| IntegralUpsize Int Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 # | |||||
| TryFrom Int (CountOf ty) | |||||
| TryFrom Int (Offset ty) | |||||
| Generic1 (URec Int :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UInt :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UInt m -> m # foldMap :: Monoid m => (a -> m) -> UInt a -> m # foldMap' :: Monoid m => (a -> m) -> UInt a -> m # foldr :: (a -> b -> b) -> b -> UInt a -> b # foldr' :: (a -> b -> b) -> b -> UInt a -> b # foldl :: (b -> a -> b) -> b -> UInt a -> b # foldl' :: (b -> a -> b) -> b -> UInt a -> b # foldr1 :: (a -> a -> a) -> UInt a -> a # foldl1 :: (a -> a -> a) -> UInt a -> a # elem :: Eq a => a -> UInt a -> Bool # maximum :: Ord a => UInt a -> a # | |||||
| Traversable (UInt :: Type -> Type) | @since base-4.9.0.0 | ||||
| From (CountOf ty) Int | |||||
Defined in Basement.From | |||||
| Functor (URec Int :: Type -> Type) | @since base-4.9.0.0 | ||||
| Generic (URec Int p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Int p) | @since base-4.9.0.0 | ||||
| Eq (URec Int p) | @since base-4.9.0.0 | ||||
| Ord (URec Int p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type NatNumMaxBound Int | |||||
Defined in Basement.Nat | |||||
| type Difference Int | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Int | |||||
Defined in Basement.PrimType | |||||
| data URec Int (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
| type Rep1 (URec Int :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Int p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
Arbitrary precision integers. In contrast with fixed-size integral types
such as Int, the Integer type represents the entire infinite range of
integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (i.e., fits into an Int), the IS constructor is
used. Otherwise IP and IN constructors are used to store a BigNat
representing the positive or the negative value magnitude, respectively.
Invariant: IP and IN are used iff the value does not fit in IS.
Instances
| PrintfArg Integer | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| Fractional Rational | |||||
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Rational # | |||||
| HasNegation Integer | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Integer | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Integer # | |||||
| NormalForm Integer | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Integer -> () # | |||||
| Additive Rational | |||||
| Additive Integer | |||||
| Divisible Rational | |||||
| IDivisible Integer | |||||
| Multiplicative Rational | |||||
| Multiplicative Integer | |||||
| IsIntegral Integer | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Integer | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Arbitrary Integer # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField Integer # | |||||
| Hashable Integer # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| IntegralRounding Rational # | |||||
| Signed Integer # | |||||
| Bits Integer | @since base-2.01 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # | |||||
| Data Integer | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer # toConstr :: Integer -> Constr # dataTypeOf :: Integer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # | |||||
| Enum Integer | @since base-2.01 | ||||
| Num Integer | @since base-2.01 | ||||
| Read Integer | @since base-2.01 | ||||
| Integral Integer | @since base-2.0.1 | ||||
Defined in GHC.Internal.Real | |||||
| Real Integer | @since base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Integer -> Rational # | |||||
| Show Integer | @since base-2.01 | ||||
| Eq Integer | |||||
| Ord Integer | |||||
| IsIntegral n => From n Integer | |||||
Defined in Basement.From | |||||
| IntegralDownsize Integer Int16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Int8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Integer Natural | |||||
Defined in Basement.IntegralConv | |||||
| IsIntegral a => IntegralUpsize a Integer | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: a -> Integer # | |||||
| type Difference Integer | |||||
Defined in Basement.Numerical.Subtractive | |||||
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS constructor
Instances
| PrintfArg Natural | Since: base-4.8.0.0 | ||||
Defined in Text.Printf | |||||
| Integral Natural | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Natural # | |||||
| NormalForm Natural | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Natural -> () # | |||||
| Additive Natural | |||||
| IDivisible Natural | |||||
| Multiplicative Natural | |||||
| IsIntegral Natural | |||||
Defined in Basement.Numerical.Number | |||||
| IsNatural Natural | |||||
Defined in Basement.Numerical.Number | |||||
| Subtractive Natural | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Arbitrary Natural # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField Natural # | |||||
| Hashable Natural # | |||||
Defined in Foundation.Hashing.Hashable | |||||
| Bits Natural | @since base-4.8.0 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Natural -> Natural -> Natural # (.|.) :: Natural -> Natural -> Natural # xor :: Natural -> Natural -> Natural # complement :: Natural -> Natural # shift :: Natural -> Int -> Natural # rotate :: Natural -> Int -> Natural # setBit :: Natural -> Int -> Natural # clearBit :: Natural -> Int -> Natural # complementBit :: Natural -> Int -> Natural # testBit :: Natural -> Int -> Bool # bitSizeMaybe :: Natural -> Maybe Int # shiftL :: Natural -> Int -> Natural # unsafeShiftL :: Natural -> Int -> Natural # shiftR :: Natural -> Int -> Natural # unsafeShiftR :: Natural -> Int -> Natural # rotateL :: Natural -> Int -> Natural # | |||||
| Data Natural | @since base-4.8.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural # toConstr :: Natural -> Constr # dataTypeOf :: Natural -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) # gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural # | |||||
| Enum Natural | @since base-4.8.0.0 | ||||
| Num Natural | Note that @since base-4.8.0.0 | ||||
| Read Natural | @since base-4.8.0.0 | ||||
| Integral Natural | @since base-4.8.0.0 | ||||
Defined in GHC.Internal.Real | |||||
| Real Natural | @since base-4.8.0.0 | ||||
Defined in GHC.Internal.Real Methods toRational :: Natural -> Rational # | |||||
| Show Natural | @since base-4.8.0.0 | ||||
| Eq Natural | |||||
| Ord Natural | |||||
| KnownNat n => HasResolution (n :: Nat) | For example, | ||||
Defined in Data.Fixed Methods resolution :: p n -> Integer # | |||||
| IsNatural n => From n Natural | |||||
Defined in Basement.From | |||||
| IntegralDownsize Integer Natural | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word16 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word32 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word64 | |||||
Defined in Basement.IntegralConv | |||||
| IntegralDownsize Natural Word8 | |||||
Defined in Basement.IntegralConv | |||||
| IsNatural a => IntegralUpsize a Natural | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: a -> Natural # | |||||
| TestCoercion SNat | @since base-4.18.0.0 | ||||
Defined in GHC.Internal.TypeNats | |||||
| TestEquality SNat | @since base-4.18.0.0 | ||||
Defined in GHC.Internal.TypeNats | |||||
| type Difference Natural | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type Compare (a :: Natural) (b :: Natural) | |||||
Defined in GHC.Internal.Data.Type.Ord | |||||
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Instances
| PrintfArg Float | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| Fractional Float | |||||
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Float # | |||||
| HasNegation Float | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Float | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Float # | |||||
| NormalForm Float | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Float -> () # | |||||
| Additive Float | |||||
| Divisible Float | |||||
| Multiplicative Float | |||||
| Subtractive Float | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimType Float | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Float -> CountOf Word8 # primShiftToBytes :: Proxy Float -> Int # primBaUIndex :: ByteArray# -> Offset Float -> Float # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () # primAddrIndex :: Addr# -> Offset Float -> Float # primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float # primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () # | |||||
| Arbitrary Float # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Float # | |||||
| StorableFixed Float # | |||||
| Trigonometry Float # | |||||
Defined in Foundation.Math.Trigonometry Methods | |||||
| IntegralRounding Float # | |||||
| Signed Float # | |||||
| FloatingPoint Float # | |||||
Defined in Foundation.Numerical.Floating | |||||
| Data Float | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float # dataTypeOf :: Float -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) # gmapT :: (forall b. Data b => b -> b) -> Float -> Float # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # | |||||
| Floating Float | @since base-2.01 | ||||
| RealFloat Float | @since base-2.01 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # | |||||
| Storable Float | @since base-2.01 | ||||
| Read Float | @since base-2.01 | ||||
| Eq Float | Note that due to the presence of
Also note that
| ||||
| Ord Float | See | ||||
| Generic1 (URec Float :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UFloat :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # | |||||
| Traversable (UFloat :: Type -> Type) | @since base-4.9.0.0 | ||||
| Functor (URec Float :: Type -> Type) | @since base-4.9.0.0 | ||||
| Generic (URec Float p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Float p) | |||||
| Eq (URec Float p) | |||||
| Ord (URec Float p) | |||||
Defined in GHC.Internal.Generics | |||||
| type Difference Float | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Float | |||||
Defined in Basement.PrimType | |||||
| data URec Float (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
| type Rep1 (URec Float :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Float p) | |||||
Defined in GHC.Internal.Generics | |||||
Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
Instances
| PrintfArg Double | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
| Fractional Double | |||||
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Double # | |||||
| HasNegation Double | |||||
Defined in Basement.Compat.NumLiteral | |||||
| Integral Double | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Double # | |||||
| NormalForm Double | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Double -> () # | |||||
| Additive Double | |||||
| Divisible Double | |||||
| Multiplicative Double | |||||
| Subtractive Double | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| PrimType Double | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Double -> CountOf Word8 # primShiftToBytes :: Proxy Double -> Int # primBaUIndex :: ByteArray# -> Offset Double -> Double # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () # primAddrIndex :: Addr# -> Offset Double -> Double # primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double # primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () # | |||||
| Arbitrary Double # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| Storable Double # | |||||
| StorableFixed Double # | |||||
| IsField Double # | |||||
| Trigonometry Double # | |||||
Defined in Foundation.Math.Trigonometry Methods | |||||
| IntegralRounding Double # | |||||
| Signed Double # | |||||
| FloatingPoint Double # | |||||
Defined in Foundation.Numerical.Floating | |||||
| Data Double | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double # toConstr :: Double -> Constr # dataTypeOf :: Double -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) # gmapT :: (forall b. Data b => b -> b) -> Double -> Double # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # | |||||
| Floating Double | @since base-2.01 | ||||
| RealFloat Double | @since base-2.01 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # | |||||
| Storable Double | @since base-2.01 | ||||
| Read Double | @since base-2.01 | ||||
| Eq Double | Note that due to the presence of
Also note that
| ||||
| Ord Double | IEEE 754 IEEE 754-2008, section 5.11 requires that if at least one of arguments of
IEEE 754-2008, section 5.10 defines Thus, users must be extremely cautious when using Moving further, the behaviour of IEEE 754-2008 compliant | ||||
| Generic1 (URec Double :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UDouble :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # | |||||
| Traversable (UDouble :: Type -> Type) | @since base-4.9.0.0 | ||||
| Functor (URec Double :: Type -> Type) | @since base-4.9.0.0 | ||||
| Generic (URec Double p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Double p) | @since base-4.9.0.0 | ||||
| Eq (URec Double p) | @since base-4.9.0.0 | ||||
| Ord (URec Double p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Methods compare :: URec Double p -> URec Double p -> Ordering # (<) :: URec Double p -> URec Double p -> Bool # (<=) :: URec Double p -> URec Double p -> Bool # (>) :: URec Double p -> URec Double p -> Bool # (>=) :: URec Double p -> URec Double p -> Bool # | |||||
| type Difference Double | |||||
Defined in Basement.Numerical.Subtractive | |||||
| type PrimSize Double | |||||
Defined in Basement.PrimType | |||||
| data URec Double (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
| type Rep1 (URec Double :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Double p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
CountOf of a data structure.
More specifically, it represents the number of elements of type ty that fit
into the data structure.
>>>length (fromList ['a', 'b', 'c', '🌟']) :: CountOf CharCountOf 4
Same caveats as Offset apply here.
Instances
| From Word (CountOf ty) | |||||
Defined in Basement.From | |||||
| TryFrom Int (CountOf ty) | |||||
| Integral (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> CountOf ty # | |||||
| NormalForm (CountOf a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: CountOf a -> () # | |||||
| Additive (CountOf ty) | |||||
| IsIntegral (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| IsNatural (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| Subtractive (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
| Arbitrary (CountOf ty) # | |||||
Defined in Foundation.Check.Arbitrary | |||||
| IsField (CountOf a) # | |||||
| Monoid (CountOf ty) | |||||
| Semigroup (CountOf ty) | |||||
| Enum (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods succ :: CountOf ty -> CountOf ty # pred :: CountOf ty -> CountOf ty # fromEnum :: CountOf ty -> Int # enumFrom :: CountOf ty -> [CountOf ty] # enumFromThen :: CountOf ty -> CountOf ty -> [CountOf ty] # enumFromTo :: CountOf ty -> CountOf ty -> [CountOf ty] # enumFromThenTo :: CountOf ty -> CountOf ty -> CountOf ty -> [CountOf ty] # | |||||
| Num (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| Show (CountOf ty) | |||||
| Eq (CountOf ty) | |||||
| Ord (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| From (CountOf ty) Int | |||||
Defined in Basement.From | |||||
| From (CountOf ty) Word | |||||
Defined in Basement.From | |||||
| type NatNumMaxBound (CountOf x) | |||||
Defined in Basement.Types.OffsetSize | |||||
| type Difference (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
Offset in a data structure consisting of elements of type ty.
Int is a terrible backing type which is hard to get away from, considering that GHC/Haskell are mostly using this for offset. Trying to bring some sanity by a lightweight wrapping.
Instances
| From Word (Offset ty) | |||||
Defined in Basement.From | |||||
| TryFrom Int (Offset ty) | |||||
| Integral (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> Offset ty # | |||||
| NormalForm (Offset a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Offset a -> () # | |||||
| Additive (Offset ty) | |||||
| IsIntegral (Offset ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| IsNatural (Offset ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| Subtractive (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
| IsField (Offset a) # | |||||
| Enum (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Methods succ :: Offset ty -> Offset ty # pred :: Offset ty -> Offset ty # fromEnum :: Offset ty -> Int # enumFrom :: Offset ty -> [Offset ty] # enumFromThen :: Offset ty -> Offset ty -> [Offset ty] # enumFromTo :: Offset ty -> Offset ty -> [Offset ty] # enumFromThenTo :: Offset ty -> Offset ty -> Offset ty -> [Offset ty] # | |||||
| Num (Offset ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| Show (Offset ty) | |||||
| Eq (Offset ty) | |||||
| Ord (Offset ty) | |||||
| type NatNumMaxBound (Offset x) | |||||
Defined in Basement.Types.OffsetSize | |||||
| type Difference (Offset ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
Collection types
An array of type built on top of GHC primitive.
The elements need to have fixed sized and the representation is a packed contiguous array in memory that can easily be passed to foreign interface
Instances
| From AsciiString (UArray Word8) | |||||||||
Defined in Basement.From Methods from :: AsciiString -> UArray Word8 # | |||||||||
| From String (UArray Word8) | |||||||||
| NormalForm (UArray ty) | |||||||||
Defined in Basement.UArray.Base Methods toNormalForm :: UArray ty -> () # | |||||||||
| PrimType ty => Buildable (UArray ty) # | |||||||||
Defined in Foundation.Collection.Buildable Associated Types
Methods append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element (UArray ty) -> Builder (UArray ty) (Mutable (UArray ty)) (Step (UArray ty)) prim err () # build :: PrimMonad prim => Int -> Builder (UArray ty) (Mutable (UArray ty)) (Step (UArray ty)) prim err () -> prim (Either err (UArray ty)) # | |||||||||
| PrimType ty => Collection (UArray ty) # | |||||||||
Defined in Foundation.Collection.Collection Methods length :: UArray ty -> CountOf (Element (UArray ty)) # elem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # notElem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # maximum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # minimum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # | |||||||||
| PrimType ty => Copy (UArray ty) # | |||||||||
Defined in Foundation.Collection.Copy | |||||||||
| PrimType ty => Fold1able (UArray ty) # | |||||||||
Defined in Foundation.Collection.Foldable | |||||||||
| PrimType ty => Foldable (UArray ty) # | |||||||||
| PrimType ty => IndexedCollection (UArray ty) # | |||||||||
| PrimType ty => InnerFunctor (UArray ty) # | |||||||||
| PrimType ty => Sequential (UArray ty) # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revTake :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # drop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revDrop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # splitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # revSplitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) # takeWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # dropWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # spanEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # reverse :: UArray ty -> UArray ty # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) # snoc :: UArray ty -> Element (UArray ty) -> UArray ty # cons :: Element (UArray ty) -> UArray ty -> UArray ty # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty # singleton :: Element (UArray ty) -> UArray ty # head :: NonEmpty (UArray ty) -> Element (UArray ty) # last :: NonEmpty (UArray ty) -> Element (UArray ty) # tail :: NonEmpty (UArray ty) -> UArray ty # init :: NonEmpty (UArray ty) -> UArray ty # replicate :: CountOf (Element (UArray ty)) -> Element (UArray ty) -> UArray ty # isPrefixOf :: UArray ty -> UArray ty -> Bool # isSuffixOf :: UArray ty -> UArray ty -> Bool # isInfixOf :: UArray ty -> UArray ty -> Bool # stripPrefix :: UArray ty -> UArray ty -> Maybe (UArray ty) # stripSuffix :: UArray ty -> UArray ty -> Maybe (UArray ty) # | |||||||||
| PrimType ty => Zippable (UArray ty) # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (UArray ty)) -> a -> b -> UArray ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (UArray ty)) -> a -> b -> c -> UArray ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (UArray ty)) -> a -> b -> c -> d -> UArray ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (UArray ty)) -> a -> b -> c -> d -> e -> UArray ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> UArray ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> g -> UArray ty # | |||||||||
| PrimType a => Hashable (UArray a) # | |||||||||
Defined in Foundation.Hashing.Hashable | |||||||||
| PrimType ty => Monoid (UArray ty) | |||||||||
| PrimType ty => Semigroup (UArray ty) | |||||||||
| Data ty => Data (UArray ty) | |||||||||
Defined in Basement.UArray.Base Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UArray ty -> c (UArray ty) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UArray ty) # toConstr :: UArray ty -> Constr # dataTypeOf :: UArray ty -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UArray ty)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UArray ty)) # gmapT :: (forall b. Data b => b -> b) -> UArray ty -> UArray ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r # gmapQ :: (forall d. Data d => d -> u) -> UArray ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UArray ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) # | |||||||||
| PrimType ty => IsList (UArray ty) | |||||||||
| (PrimType ty, Show ty) => Show (UArray ty) | |||||||||
| (PrimType ty, Eq ty) => Eq (UArray ty) | |||||||||
| (PrimType ty, Ord ty) => Ord (UArray ty) | |||||||||
| TryFrom (UArray Word8) String | |||||||||
| PrimType ty => From (Block ty) (UArray ty) | |||||||||
Defined in Basement.From | |||||||||
| PrimType ty => From (Array ty) (UArray ty) | |||||||||
Defined in Basement.From | |||||||||
| PrimType ty => From (UArray ty) (Block ty) | |||||||||
Defined in Basement.From | |||||||||
| PrimType ty => From (UArray ty) (Array ty) | |||||||||
Defined in Basement.From | |||||||||
| (NatWithinBound (CountOf ty) n, KnownNat n, PrimType ty) => TryFrom (UArray ty) (BlockN n ty) | |||||||||
| (NatWithinBound Int n, PrimType ty) => From (BlockN n ty) (UArray ty) | |||||||||
Defined in Basement.From | |||||||||
| type Mutable (UArray ty) # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step (UArray ty) # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element (UArray ty) # | |||||||||
Defined in Foundation.Collection.Element | |||||||||
| type Item (UArray ty) | |||||||||
Defined in Basement.UArray.Base | |||||||||
Represent the accessor for types that can be stored in the UArray and MUArray.
Types need to be a instance of storable and have fixed sized.
Minimal complete definition
primSizeInBytes, primShiftToBytes, primBaUIndex, primMbaURead, primMbaUWrite, primAddrIndex, primAddrRead, primAddrWrite
Instances
| PrimType Char7 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char7 -> CountOf Word8 # primShiftToBytes :: Proxy Char7 -> Int # primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () # primAddrIndex :: Addr# -> Offset Char7 -> Char7 # primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () # | |||||
| PrimType Word128 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word128 -> CountOf Word8 # primShiftToBytes :: Proxy Word128 -> Int # primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () # primAddrIndex :: Addr# -> Offset Word128 -> Word128 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () # | |||||
| PrimType Word256 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word256 -> CountOf Word8 # primShiftToBytes :: Proxy Word256 -> Int # primBaUIndex :: ByteArray# -> Offset Word256 -> Word256 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> prim Word256 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> Word256 -> prim () # primAddrIndex :: Addr# -> Offset Word256 -> Word256 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word256 -> prim Word256 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word256 -> Word256 -> prim () # | |||||
| PrimType NanoSeconds # | |||||
Defined in Foundation.Time.Types Associated Types
Methods primSizeInBytes :: Proxy NanoSeconds -> CountOf Word8 # primShiftToBytes :: Proxy NanoSeconds -> Int # primBaUIndex :: ByteArray# -> Offset NanoSeconds -> NanoSeconds # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> prim NanoSeconds # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> NanoSeconds -> prim () # primAddrIndex :: Addr# -> Offset NanoSeconds -> NanoSeconds # primAddrRead :: PrimMonad prim => Addr# -> Offset NanoSeconds -> prim NanoSeconds # primAddrWrite :: PrimMonad prim => Addr# -> Offset NanoSeconds -> NanoSeconds -> prim () # | |||||
| PrimType Seconds # | |||||
Defined in Foundation.Time.Types Associated Types
Methods primSizeInBytes :: Proxy Seconds -> CountOf Word8 # primShiftToBytes :: Proxy Seconds -> Int # primBaUIndex :: ByteArray# -> Offset Seconds -> Seconds # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> prim Seconds # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> Seconds -> prim () # primAddrIndex :: Addr# -> Offset Seconds -> Seconds # primAddrRead :: PrimMonad prim => Addr# -> Offset Seconds -> prim Seconds # primAddrWrite :: PrimMonad prim => Addr# -> Offset Seconds -> Seconds -> prim () # | |||||
| PrimType CChar | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy CChar -> CountOf Word8 # primShiftToBytes :: Proxy CChar -> Int # primBaUIndex :: ByteArray# -> Offset CChar -> CChar # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> prim CChar # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> CChar -> prim () # primAddrIndex :: Addr# -> Offset CChar -> CChar # primAddrRead :: PrimMonad prim => Addr# -> Offset CChar -> prim CChar # primAddrWrite :: PrimMonad prim => Addr# -> Offset CChar -> CChar -> prim () # | |||||
| PrimType CUChar | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy CUChar -> CountOf Word8 # primShiftToBytes :: Proxy CUChar -> Int # primBaUIndex :: ByteArray# -> Offset CUChar -> CUChar # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> prim CUChar # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> CUChar -> prim () # primAddrIndex :: Addr# -> Offset CUChar -> CUChar # primAddrRead :: PrimMonad prim => Addr# -> Offset CUChar -> prim CUChar # primAddrWrite :: PrimMonad prim => Addr# -> Offset CUChar -> CUChar -> prim () # | |||||
| PrimType Int16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int16 -> CountOf Word8 # primShiftToBytes :: Proxy Int16 -> Int # primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () # primAddrIndex :: Addr# -> Offset Int16 -> Int16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () # | |||||
| PrimType Int32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int32 -> CountOf Word8 # primShiftToBytes :: Proxy Int32 -> Int # primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () # primAddrIndex :: Addr# -> Offset Int32 -> Int32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () # | |||||
| PrimType Int64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int64 -> CountOf Word8 # primShiftToBytes :: Proxy Int64 -> Int # primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () # primAddrIndex :: Addr# -> Offset Int64 -> Int64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () # | |||||
| PrimType Int8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int8 -> CountOf Word8 # primShiftToBytes :: Proxy Int8 -> Int # primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () # primAddrIndex :: Addr# -> Offset Int8 -> Int8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () # | |||||
| PrimType Word16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word16 -> CountOf Word8 # primShiftToBytes :: Proxy Word16 -> Int # primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () # primAddrIndex :: Addr# -> Offset Word16 -> Word16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () # | |||||
| PrimType Word32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word32 -> CountOf Word8 # primShiftToBytes :: Proxy Word32 -> Int # primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () # primAddrIndex :: Addr# -> Offset Word32 -> Word32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () # | |||||
| PrimType Word64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word64 -> CountOf Word8 # primShiftToBytes :: Proxy Word64 -> Int # primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () # primAddrIndex :: Addr# -> Offset Word64 -> Word64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () # | |||||
| PrimType Word8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word8 -> CountOf Word8 # primShiftToBytes :: Proxy Word8 -> Int # primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () # primAddrIndex :: Addr# -> Offset Word8 -> Word8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () # | |||||
| PrimType Char | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char -> CountOf Word8 # primShiftToBytes :: Proxy Char -> Int # primBaUIndex :: ByteArray# -> Offset Char -> Char # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () # primAddrIndex :: Addr# -> Offset Char -> Char # primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () # | |||||
| PrimType Double | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Double -> CountOf Word8 # primShiftToBytes :: Proxy Double -> Int # primBaUIndex :: ByteArray# -> Offset Double -> Double # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () # primAddrIndex :: Addr# -> Offset Double -> Double # primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double # primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () # | |||||
| PrimType Float | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Float -> CountOf Word8 # primShiftToBytes :: Proxy Float -> Int # primBaUIndex :: ByteArray# -> Offset Float -> Float # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () # primAddrIndex :: Addr# -> Offset Float -> Float # primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float # primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () # | |||||
| PrimType Int | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int -> CountOf Word8 # primShiftToBytes :: Proxy Int -> Int # primBaUIndex :: ByteArray# -> Offset Int -> Int # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> prim Int # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> Int -> prim () # primAddrIndex :: Addr# -> Offset Int -> Int # primAddrRead :: PrimMonad prim => Addr# -> Offset Int -> prim Int # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int -> Int -> prim () # | |||||
| PrimType Word | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word -> CountOf Word8 # primShiftToBytes :: Proxy Word -> Int # primBaUIndex :: ByteArray# -> Offset Word -> Word # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () # primAddrIndex :: Addr# -> Offset Word -> Word # primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () # | |||||
| PrimType a => PrimType (BE a) | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy (BE a) -> CountOf Word8 # primShiftToBytes :: Proxy (BE a) -> Int # primBaUIndex :: ByteArray# -> Offset (BE a) -> BE a # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> prim (BE a) # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> BE a -> prim () # primAddrIndex :: Addr# -> Offset (BE a) -> BE a # primAddrRead :: PrimMonad prim => Addr# -> Offset (BE a) -> prim (BE a) # primAddrWrite :: PrimMonad prim => Addr# -> Offset (BE a) -> BE a -> prim () # | |||||
| PrimType a => PrimType (LE a) | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy (LE a) -> CountOf Word8 # primShiftToBytes :: Proxy (LE a) -> Int # primBaUIndex :: ByteArray# -> Offset (LE a) -> LE a # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> prim (LE a) # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> LE a -> prim () # primAddrIndex :: Addr# -> Offset (LE a) -> LE a # primAddrRead :: PrimMonad prim => Addr# -> Offset (LE a) -> prim (LE a) # primAddrWrite :: PrimMonad prim => Addr# -> Offset (LE a) -> LE a -> prim () # | |||||
Array of a
Instances
| Mappable Array # | |||||||||
Defined in Foundation.Collection.Mappable | |||||||||
| Functor Array | |||||||||
| NormalForm a => NormalForm (Array a) | |||||||||
Defined in Basement.BoxedArray Methods toNormalForm :: Array a -> () # | |||||||||
| Buildable (Array ty) # | |||||||||
Defined in Foundation.Collection.Buildable Associated Types
Methods append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element (Array ty) -> Builder (Array ty) (Mutable (Array ty)) (Step (Array ty)) prim err () # build :: PrimMonad prim => Int -> Builder (Array ty) (Mutable (Array ty)) (Step (Array ty)) prim err () -> prim (Either err (Array ty)) # | |||||||||
| Collection (Array ty) # | |||||||||
Defined in Foundation.Collection.Collection Methods length :: Array ty -> CountOf (Element (Array ty)) # elem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # notElem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # maximum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # minimum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # | |||||||||
| Copy (Array ty) # | |||||||||
Defined in Foundation.Collection.Copy | |||||||||
| Fold1able (Array ty) # | |||||||||
| Foldable (Array ty) # | |||||||||
| IndexedCollection (Array ty) # | |||||||||
| InnerFunctor (Array ty) # | |||||||||
| Sequential (Array ty) # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revTake :: CountOf (Element (Array ty)) -> Array ty -> Array ty # drop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revDrop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # splitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # revSplitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) # takeWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # dropWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # intersperse :: Element (Array ty) -> Array ty -> Array ty # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # spanEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # reverse :: Array ty -> Array ty # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) # snoc :: Array ty -> Element (Array ty) -> Array ty # cons :: Element (Array ty) -> Array ty -> Array ty # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty # singleton :: Element (Array ty) -> Array ty # head :: NonEmpty (Array ty) -> Element (Array ty) # last :: NonEmpty (Array ty) -> Element (Array ty) # tail :: NonEmpty (Array ty) -> Array ty # init :: NonEmpty (Array ty) -> Array ty # replicate :: CountOf (Element (Array ty)) -> Element (Array ty) -> Array ty # isPrefixOf :: Array ty -> Array ty -> Bool # isSuffixOf :: Array ty -> Array ty -> Bool # isInfixOf :: Array ty -> Array ty -> Bool # | |||||||||
| BoxedZippable (Array ty) # | |||||||||
Defined in Foundation.Collection.Zippable Methods zip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => a -> b -> Array ty # zip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => a -> b -> c -> Array ty # zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element (Array ty) ~ (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> Array ty # zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> Array ty # zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> Array ty # zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> Array ty # unzip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => Array ty -> (a, b) # unzip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => Array ty -> (a, b, c) # unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element (Array ty) ~ (Element a, Element b, Element c, Element d)) => Array ty -> (a, b, c, d) # unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e)) => Array ty -> (a, b, c, d, e) # unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => Array ty -> (a, b, c, d, e, f) # unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => Array ty -> (a, b, c, d, e, f, g) # | |||||||||
| Zippable (Array ty) # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (Array ty)) -> a -> b -> Array ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (Array ty)) -> a -> b -> c -> Array ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (Array ty)) -> a -> b -> c -> d -> Array ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (Array ty)) -> a -> b -> c -> d -> e -> Array ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> Array ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> g -> Array ty # | |||||||||
| Hashable a => Hashable (Array a) # | |||||||||
Defined in Foundation.Hashing.Hashable | |||||||||
| Monoid (Array a) | |||||||||
| Semigroup (Array a) | |||||||||
| Data ty => Data (Array ty) | |||||||||
Defined in Basement.BoxedArray Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Array ty -> c (Array ty) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Array ty) # toConstr :: Array ty -> Constr # dataTypeOf :: Array ty -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Array ty)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Array ty)) # gmapT :: (forall b. Data b => b -> b) -> Array ty -> Array ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r # gmapQ :: (forall d. Data d => d -> u) -> Array ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Array ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) # | |||||||||
| IsList (Array ty) | |||||||||
| Show a => Show (Array a) | |||||||||
| Eq a => Eq (Array a) | |||||||||
| Ord a => Ord (Array a) | |||||||||
| PrimType ty => From (Array ty) (Block ty) | |||||||||
Defined in Basement.From | |||||||||
| PrimType ty => From (Array ty) (UArray ty) | |||||||||
Defined in Basement.From | |||||||||
| PrimType ty => From (UArray ty) (Array ty) | |||||||||
Defined in Basement.From | |||||||||
| (NatWithinBound (CountOf ty) n, KnownNat n, PrimType ty) => TryFrom (Array ty) (BlockN n ty) | |||||||||
| (NatWithinBound Int n, PrimType ty) => From (BlockN n ty) (Array ty) | |||||||||
Defined in Basement.From | |||||||||
| type Mutable (Array ty) # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step (Array ty) # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element (Array ty) # | |||||||||
Defined in Foundation.Collection.Element | |||||||||
| type Item (Array ty) | |||||||||
Defined in Basement.BoxedArray | |||||||||
Opaque packed array of characters in the UTF8 encoding
Instances
| NormalForm String | |||||||||
Defined in Basement.UTF8.Base Methods toNormalForm :: String -> () # | |||||||||
| Arbitrary String # | |||||||||
Defined in Foundation.Check.Arbitrary | |||||||||
| Buildable String # | |||||||||
Defined in Foundation.Collection.Buildable Associated Types
| |||||||||
| Collection String # | |||||||||
Defined in Foundation.Collection.Collection Methods length :: String -> CountOf (Element String) # elem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # notElem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # maximum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # minimum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # | |||||||||
| Copy String # | |||||||||
Defined in Foundation.Collection.Copy | |||||||||
| IndexedCollection String # | |||||||||
| InnerFunctor String # | |||||||||
| Sequential String # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element String) -> String -> String # revTake :: CountOf (Element String) -> String -> String # drop :: CountOf (Element String) -> String -> String # revDrop :: CountOf (Element String) -> String -> String # splitAt :: CountOf (Element String) -> String -> (String, String) # revSplitAt :: CountOf (Element String) -> String -> (String, String) # splitOn :: (Element String -> Bool) -> String -> [String] # break :: (Element String -> Bool) -> String -> (String, String) # breakEnd :: (Element String -> Bool) -> String -> (String, String) # breakElem :: Element String -> String -> (String, String) # takeWhile :: (Element String -> Bool) -> String -> String # dropWhile :: (Element String -> Bool) -> String -> String # intersperse :: Element String -> String -> String # intercalate :: Element String -> String -> Element String # span :: (Element String -> Bool) -> String -> (String, String) # spanEnd :: (Element String -> Bool) -> String -> (String, String) # filter :: (Element String -> Bool) -> String -> String # partition :: (Element String -> Bool) -> String -> (String, String) # uncons :: String -> Maybe (Element String, String) # unsnoc :: String -> Maybe (String, Element String) # snoc :: String -> Element String -> String # cons :: Element String -> String -> String # find :: (Element String -> Bool) -> String -> Maybe (Element String) # sortBy :: (Element String -> Element String -> Ordering) -> String -> String # singleton :: Element String -> String # head :: NonEmpty String -> Element String # last :: NonEmpty String -> Element String # tail :: NonEmpty String -> String # init :: NonEmpty String -> String # replicate :: CountOf (Element String) -> Element String -> String # isPrefixOf :: String -> String -> Bool # isSuffixOf :: String -> String -> Bool # isInfixOf :: String -> String -> Bool # | |||||||||
| Zippable String # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element String) -> a -> b -> String # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element String) -> a -> b -> c -> String # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element String) -> a -> b -> c -> d -> String # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element String) -> a -> b -> c -> d -> e -> String # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element String) -> a -> b -> c -> d -> e -> f -> String # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element String) -> a -> b -> c -> d -> e -> f -> g -> String # | |||||||||
| IsField String # | |||||||||
| Hashable String # | |||||||||
Defined in Foundation.Hashing.Hashable | |||||||||
| ParserSource String # | |||||||||
Defined in Foundation.Parser Methods nullChunk :: String -> Chunk String -> Bool # appendChunk :: String -> Chunk String -> String # subChunk :: String -> Offset (Element String) -> CountOf (Element String) -> Chunk String # spanChunk :: String -> Offset (Element String) -> (Element String -> Bool) -> (Chunk String, Offset (Element String)) # | |||||||||
| Monoid String | |||||||||
| Semigroup String | |||||||||
| Data String | |||||||||
Defined in Basement.UTF8.Base Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> String -> c String # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c String # toConstr :: String -> Constr # dataTypeOf :: String -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c String) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c String) # gmapT :: (forall b. Data b => b -> b) -> String -> String # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> String -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> String -> r # gmapQ :: (forall d. Data d => d -> u) -> String -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> String -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> String -> m String # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> String -> m String # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> String -> m String # | |||||||||
| IsString String | |||||||||
Defined in Basement.UTF8.Base Methods fromString :: String -> String # | |||||||||
| IsList String | |||||||||
| Show String | |||||||||
| Eq String | |||||||||
| Ord String | |||||||||
| From AsciiString String | |||||||||
Defined in Basement.From Methods from :: AsciiString -> String # | |||||||||
| From String (UArray Word8) | |||||||||
| Show (ParseError String) # | |||||||||
Defined in Foundation.Parser | |||||||||
| TryFrom (UArray Word8) String | |||||||||
| IsProperty (String, Bool) # | |||||||||
| type Mutable String # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step String # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element String # | |||||||||
Defined in Foundation.Collection.Element | |||||||||
| type Chunk String # | |||||||||
Defined in Foundation.Parser | |||||||||
| type Item String | |||||||||
Defined in Basement.UTF8.Base | |||||||||
Numeric functions
(^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 #
raise a number to an integral power
fromIntegral :: (Integral a, Num b) => a -> b #
General coercion from Integral types.
WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.
realToFrac :: (Real a, Fractional b) => a -> b #
General coercion to Fractional types.
WARNING: This function goes through the Rational type, which does not have values for NaN for example.
This means it does not round-trip.
For Double it also behaves differently with or without -O0:
Prelude> realToFrac nan -- With -O0 -Infinity Prelude> realToFrac nan NaN
Monoids
The class of semigroups (types with an associative binary operation).
Instances should satisfy the following:
You can alternatively define sconcat instead of (<>), in which case the
laws are:
@since base-4.9.0.0
Instances
| Semigroup ByteArray | Since: base-4.17.0.0 |
| Semigroup Builder | |
| Semigroup Builder | |
| Semigroup AsciiString | |
Defined in Basement.Types.AsciiString Methods (<>) :: AsciiString -> AsciiString -> AsciiString # sconcat :: NonEmpty AsciiString -> AsciiString # stimes :: Integral b => b -> AsciiString -> AsciiString # | |
| Semigroup String | |
| Semigroup Bitmap # | |
| Semigroup CSV # | |
| Semigroup Row # | |
| Semigroup FileName # | |
| Semigroup Void | @since base-4.9.0.0 |
| Semigroup All | @since base-4.9.0.0 |
| Semigroup Any | @since base-4.9.0.0 |
| Semigroup Ordering | @since base-4.9.0.0 |
| Semigroup () | @since base-4.9.0.0 |
| Semigroup (FromMaybe b) | |
| Semigroup a => Semigroup (JoinWith a) | |
| Semigroup (NonEmptyDList a) | |
| Semigroup (Comparison a) |
(<>) :: Comparison a -> Comparison a -> Comparison a Comparison cmp <> Comparison cmp' = Comparison a a' -> cmp a a' <> cmp a a' |
Defined in Data.Functor.Contravariant Methods (<>) :: Comparison a -> Comparison a -> Comparison a # sconcat :: NonEmpty (Comparison a) -> Comparison a # stimes :: Integral b => b -> Comparison a -> Comparison a # | |
| Semigroup (Equivalence a) |
(<>) :: Equivalence a -> Equivalence a -> Equivalence a Equivalence equiv <> Equivalence equiv' = Equivalence a b -> equiv a b && equiv' a b |
Defined in Data.Functor.Contravariant Methods (<>) :: Equivalence a -> Equivalence a -> Equivalence a # sconcat :: NonEmpty (Equivalence a) -> Equivalence a # stimes :: Integral b => b -> Equivalence a -> Equivalence a # | |
| Semigroup (Predicate a) |
(<>) :: Predicate a -> Predicate a -> Predicate a Predicate pred <> Predicate pred' = Predicate a -> pred a && pred' a |
| Semigroup (First a) | Since: base-4.9.0.0 |
| Semigroup (Last a) | Since: base-4.9.0.0 |
| Ord a => Semigroup (Max a) | Since: base-4.9.0.0 |
| Ord a => Semigroup (Min a) | Since: base-4.9.0.0 |
| Monoid m => Semigroup (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods (<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # sconcat :: NonEmpty (WrappedMonoid m) -> WrappedMonoid m # stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m # | |
| PrimType ty => Semigroup (Block ty) | |
| Semigroup (Array a) | |
| Semigroup (CountOf ty) | |
| PrimType ty => Semigroup (UArray ty) | |
| Semigroup (ChunkedUArray a) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods (<>) :: ChunkedUArray a -> ChunkedUArray a -> ChunkedUArray a # sconcat :: NonEmpty (ChunkedUArray a) -> ChunkedUArray a # stimes :: Integral b => b -> ChunkedUArray a -> ChunkedUArray a # | |
| Semigroup (DList a) # | |
| Semigroup (NonEmpty a) | @since base-4.9.0.0 |
| Semigroup a => Semigroup (STM a) | @since base-4.17.0.0 |
| Semigroup a => Semigroup (Identity a) | @since base-4.9.0.0 |
| Semigroup (First a) | @since base-4.9.0.0 |
| Semigroup (Last a) | @since base-4.9.0.0 |
| Semigroup a => Semigroup (Dual a) | @since base-4.9.0.0 |
| Semigroup (Endo a) | @since base-4.9.0.0 |
| Num a => Semigroup (Product a) | @since base-4.9.0.0 |
| Num a => Semigroup (Sum a) | @since base-4.9.0.0 |
| (Generic a, Semigroup (Rep a ())) => Semigroup (Generically a) | @since base-4.17.0.0 |
Defined in GHC.Internal.Generics Methods (<>) :: Generically a -> Generically a -> Generically a # sconcat :: NonEmpty (Generically a) -> Generically a # stimes :: Integral b => b -> Generically a -> Generically a # | |
| Semigroup p => Semigroup (Par1 p) | @since base-4.12.0.0 |
| Semigroup a => Semigroup (IO a) | @since base-4.10.0.0 |
| Semigroup a => Semigroup (Maybe a) | @since base-4.9.0.0 |
| Semigroup a => Semigroup (Solo a) | @since base-4.15 |
| Semigroup [a] | @since base-4.9.0.0 |
| Semigroup a => Semigroup (Op a b) |
(<>) :: Op a b -> Op a b -> Op a b Op f <> Op g = Op a -> f a <> g a |
| Semigroup (Either a b) | @since base-4.9.0.0 |
| Semigroup (Proxy s) | @since base-4.9.0.0 |
| Semigroup (U1 p) | @since base-4.12.0.0 |
| Semigroup (V1 p) | @since base-4.12.0.0 |
| Semigroup a => Semigroup (ST s a) | @since base-4.11.0.0 |
| (Semigroup a, Semigroup b) => Semigroup (a, b) | @since base-4.9.0.0 |
| Semigroup b => Semigroup (a -> b) | @since base-4.9.0.0 |
| Semigroup a => Semigroup (Const a b) | @since base-4.9.0.0 |
| (Applicative f, Semigroup a) => Semigroup (Ap f a) | @since base-4.12.0.0 |
| Alternative f => Semigroup (Alt f a) | @since base-4.9.0.0 |
| Semigroup (f p) => Semigroup (Rec1 f p) | @since base-4.12.0.0 |
| (Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) | @since base-4.9.0.0 |
| (Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a) | Since: base-4.16.0.0 |
| (Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p) | @since base-4.12.0.0 |
| Semigroup c => Semigroup (K1 i c p) | @since base-4.12.0.0 |
| (Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) | @since base-4.9.0.0 |
| Semigroup (f (g a)) => Semigroup (Compose f g a) | Since: base-4.16.0.0 |
| Semigroup (f (g p)) => Semigroup ((f :.: g) p) | @since base-4.12.0.0 |
| Semigroup (f p) => Semigroup (M1 i c f p) | @since base-4.12.0.0 |
| (Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) | @since base-4.9.0.0 |
class Semigroup a => Monoid a where #
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:
- Right identity
x<>mempty= x- Left identity
mempty<>x = x- Associativity
x(<>(y<>z) = (x<>y)<>zSemigrouplaw)- Concatenation
mconcat=foldr(<>)mempty
You can alternatively define mconcat instead of mempty, in which case the
laws are:
- Unit
mconcat(purex) = x- Multiplication
mconcat(joinxss) =mconcat(fmapmconcatxss)- Subclass
mconcat(toListxs) =sconcatxs
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtypes and make those instances
of Monoid, e.g. Sum and Product.
NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.
Methods
Identity of mappend
Examples
>>>"Hello world" <> mempty"Hello world"
>>>mempty <> [1, 2, 3][1,2,3]
An associative operation
NOTE: This method is redundant and has the default
implementation since base-4.11.0.0.
Should it be implemented manually, since mappend = (<>)mappend is a synonym for
(<>), it is expected that the two functions are defined the same
way. In a future GHC release mappend will be removed from Monoid.
Fold a list using the monoid.
For most types, the default definition for mconcat will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
>>>mconcat ["Hello", " ", "Haskell", "!"]"Hello Haskell!"
Instances
| Monoid ByteArray | Since: base-4.17.0.0 |
| Monoid Builder | |
| Monoid Builder | |
| Monoid AsciiString | |
Defined in Basement.Types.AsciiString Methods mempty :: AsciiString # mappend :: AsciiString -> AsciiString -> AsciiString # mconcat :: [AsciiString] -> AsciiString # | |
| Monoid String | |
| Monoid Bitmap # | |
| Monoid CSV # | |
| Monoid Row # | |
| Monoid FileName # | |
| Monoid All | @since base-2.01 |
| Monoid Any | @since base-2.01 |
| Monoid Ordering | @since base-2.01 |
| Monoid () | @since base-2.01 |
| Monoid (Comparison a) |
mempty :: Comparison a mempty = Comparison _ _ -> EQ |
Defined in Data.Functor.Contravariant Methods mempty :: Comparison a # mappend :: Comparison a -> Comparison a -> Comparison a # mconcat :: [Comparison a] -> Comparison a # | |
| Monoid (Equivalence a) |
mempty :: Equivalence a mempty = Equivalence _ _ -> True |
Defined in Data.Functor.Contravariant Methods mempty :: Equivalence a # mappend :: Equivalence a -> Equivalence a -> Equivalence a # mconcat :: [Equivalence a] -> Equivalence a # | |
| Monoid (Predicate a) |
mempty :: Predicate a mempty = _ -> True |
| (Ord a, Bounded a) => Monoid (Max a) | Since: base-4.9.0.0 |
| (Ord a, Bounded a) => Monoid (Min a) | Since: base-4.9.0.0 |
| Monoid m => Monoid (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m # | |
| PrimType ty => Monoid (Block ty) | |
| Monoid (Array a) | |
| Monoid (CountOf ty) | |
| PrimType ty => Monoid (UArray ty) | |
| Monoid (ChunkedUArray a) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods mempty :: ChunkedUArray a # mappend :: ChunkedUArray a -> ChunkedUArray a -> ChunkedUArray a # mconcat :: [ChunkedUArray a] -> ChunkedUArray a # | |
| Monoid (DList a) # | |
| Monoid a => Monoid (STM a) | @since base-4.17.0.0 |
| Monoid a => Monoid (Identity a) | @since base-4.9.0.0 |
| Monoid (First a) | @since base-2.01 |
| Monoid (Last a) | @since base-2.01 |
| Monoid a => Monoid (Dual a) | @since base-2.01 |
| Monoid (Endo a) | @since base-2.01 |
| Num a => Monoid (Product a) | @since base-2.01 |
| Num a => Monoid (Sum a) | @since base-2.01 |
| (Generic a, Monoid (Rep a ())) => Monoid (Generically a) | @since base-4.17.0.0 |
Defined in GHC.Internal.Generics Methods mempty :: Generically a # mappend :: Generically a -> Generically a -> Generically a # mconcat :: [Generically a] -> Generically a # | |
| Monoid p => Monoid (Par1 p) | @since base-4.12.0.0 |
| Monoid a => Monoid (IO a) | @since base-4.9.0.0 |
| Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner @since base-2.01 |
| Monoid a => Monoid (Solo a) | @since base-4.15 |
| Monoid [a] | @since base-2.01 |
| Monoid a => Monoid (Op a b) |
mempty :: Op a b mempty = Op _ -> mempty |
| Monoid (Proxy s) | @since base-4.7.0.0 |
| Monoid (U1 p) | @since base-4.12.0.0 |
| Monoid a => Monoid (ST s a) | @since base-4.11.0.0 |
| (Monoid a, Monoid b) => Monoid (a, b) | @since base-2.01 |
| Monoid b => Monoid (a -> b) | @since base-2.01 |
| Monoid a => Monoid (Const a b) | @since base-4.9.0.0 |
| (Applicative f, Monoid a) => Monoid (Ap f a) | @since base-4.12.0.0 |
| Alternative f => Monoid (Alt f a) | @since base-4.8.0.0 |
| Monoid (f p) => Monoid (Rec1 f p) | @since base-4.12.0.0 |
| (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | @since base-2.01 |
| (Monoid (f a), Monoid (g a)) => Monoid (Product f g a) | Since: base-4.16.0.0 |
| (Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) | @since base-4.12.0.0 |
| Monoid c => Monoid (K1 i c p) | @since base-4.12.0.0 |
| (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | @since base-2.01 |
| Monoid (f (g a)) => Monoid (Compose f g a) | Since: base-4.16.0.0 |
| Monoid (f (g p)) => Monoid ((f :.: g) p) | @since base-4.12.0.0 |
| Monoid (f p) => Monoid (M1 i c f p) | @since base-4.12.0.0 |
| (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | @since base-2.01 |
(<>) :: Semigroup a => a -> a -> a infixr 6 #
An associative operation.
Examples
>>>[1,2,3] <> [4,5,6][1,2,3,4,5,6]
>>>Just [1, 2, 3] <> Just [4, 5, 6]Just [1,2,3,4,5,6]
>>>putStr "Hello, " <> putStrLn "World!"Hello, World!
Collection
class (IsList c, Item c ~ Element c) => Collection c where #
A set of methods for ordered colection
Methods
Check if a collection is empty
length :: c -> CountOf (Element c) #
Length of a collection (number of Element c)
elem :: (Eq a, a ~ Element c) => Element c -> c -> Bool #
Check if a collection contains a specific element
This is the inverse of notElem.
notElem :: (Eq a, a ~ Element c) => Element c -> c -> Bool #
Check if a collection does *not* contain a specific element
This is the inverse of elem.
maximum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c #
Get the maximum element of a collection
minimum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c #
Get the minimum element of a collection
any :: (Element c -> Bool) -> c -> Bool #
Determine is any elements of the collection satisfy the predicate
all :: (Element c -> Bool) -> c -> Bool #
Determine is all elements of the collection satisfy the predicate
Instances
| Collection AsciiString # | |
Defined in Foundation.Collection.Collection Methods null :: AsciiString -> Bool # length :: AsciiString -> CountOf (Element AsciiString) # elem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool # notElem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool # maximum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString # minimum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString # any :: (Element AsciiString -> Bool) -> AsciiString -> Bool # all :: (Element AsciiString -> Bool) -> AsciiString -> Bool # | |
| Collection String # | |
Defined in Foundation.Collection.Collection Methods length :: String -> CountOf (Element String) # elem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # notElem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # maximum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # minimum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # | |
| Collection Bitmap # | |
Defined in Foundation.Array.Bitmap Methods length :: Bitmap -> CountOf (Element Bitmap) # elem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool # notElem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool # maximum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap # minimum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap # | |
| Collection CSV # | |
Defined in Foundation.Format.CSV.Types Methods length :: CSV -> CountOf (Element CSV) # elem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool # notElem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool # maximum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV # minimum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV # | |
| Collection Row # | |
Defined in Foundation.Format.CSV.Types Methods length :: Row -> CountOf (Element Row) # elem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool # notElem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool # maximum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row # minimum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row # | |
| PrimType ty => Collection (Block ty) # | |
Defined in Foundation.Collection.Collection Methods length :: Block ty -> CountOf (Element (Block ty)) # elem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool # notElem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool # maximum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) # minimum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) # | |
| Collection (Array ty) # | |
Defined in Foundation.Collection.Collection Methods length :: Array ty -> CountOf (Element (Array ty)) # elem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # notElem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # maximum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # minimum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # | |
| Collection c => Collection (NonEmpty c) # | |
Defined in Foundation.Collection.Collection Methods length :: NonEmpty c -> CountOf (Element (NonEmpty c)) # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # | |
| PrimType ty => Collection (UArray ty) # | |
Defined in Foundation.Collection.Collection Methods length :: UArray ty -> CountOf (Element (UArray ty)) # elem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # notElem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # maximum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # minimum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # | |
| PrimType ty => Collection (ChunkedUArray ty) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods null :: ChunkedUArray ty -> Bool # length :: ChunkedUArray ty -> CountOf (Element (ChunkedUArray ty)) # elem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # notElem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # maximum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # minimum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # any :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool # all :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool # | |
| Collection (DList a) # | |
Defined in Foundation.List.DList Methods length :: DList a -> CountOf (Element (DList a)) # elem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool # notElem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool # maximum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) # minimum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) # | |
| Collection [a] # | |
Defined in Foundation.Collection.Collection Methods length :: [a] -> CountOf (Element [a]) # elem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool # notElem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool # maximum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] # minimum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] # | |
and :: (Collection col, Element col ~ Bool) => col -> Bool #
Return True if all the elements in the collection are True
or :: (Collection col, Element col ~ Bool) => col -> Bool #
Return True if at least one element in the collection is True
class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where #
A set of methods for ordered colection
Minimal complete definition
(take, drop | splitAt), (revTake, revDrop | revSplitAt), splitOn, (break | span), (breakEnd | spanEnd), intersperse, filter, reverse, uncons, unsnoc, snoc, cons, find, sortBy, singleton, replicate
Methods
take :: CountOf (Element c) -> c -> c #
Take the first @n elements of a collection
revTake :: CountOf (Element c) -> c -> c #
Take the last @n elements of a collection
drop :: CountOf (Element c) -> c -> c #
Drop the first @n elements of a collection
revDrop :: CountOf (Element c) -> c -> c #
Drop the last @n elements of a collection
splitAt :: CountOf (Element c) -> c -> (c, c) #
Split the collection at the @n'th elements
revSplitAt :: CountOf (Element c) -> c -> (c, c) #
Split the collection at the @n'th elements from the end
splitOn :: (Element c -> Bool) -> c -> [c] #
Split on a specific elements returning a list of colletion
break :: (Element c -> Bool) -> c -> (c, c) #
Split a collection when the predicate return true
breakEnd :: (Element c -> Bool) -> c -> (c, c) #
Split a collection when the predicate return true starting from the end of the collection
breakElem :: Element c -> c -> (c, c) #
Split a collection at the given element
takeWhile :: (Element c -> Bool) -> c -> c #
Return the longest prefix in the collection that satisfy the predicate
dropWhile :: (Element c -> Bool) -> c -> c #
Return the longest prefix in the collection that satisfy the predicate
intersperse :: Element c -> c -> c #
The intersperse function takes an element and a list and
`intersperses' that element between the elements of the list.
For example,
intersperse ',' "abcde" == "a,b,c,d,e"
intercalate :: Element c -> c -> Element c #
intercalate xs xss is equivalent to (.
It inserts the list mconcat (intersperse xs xss))xs in between the lists in xss and concatenates the
result.
span :: (Element c -> Bool) -> c -> (c, c) #
Split a collection while the predicate return true
spanEnd :: (Element c -> Bool) -> c -> (c, c) #
Split a collection while the predicate return true starting from the end of the collection
filter :: (Element c -> Bool) -> c -> c #
Filter all the elements that satisfy the predicate
partition :: (Element c -> Bool) -> c -> (c, c) #
Partition the elements that satisfy the predicate and those that don't
Reverse a collection
uncons :: c -> Maybe (Element c, c) #
Decompose a collection into its first element and the remaining collection. If the collection is empty, returns Nothing.
unsnoc :: c -> Maybe (c, Element c) #
Decompose a collection into a collection without its last element, and the last element If the collection is empty, returns Nothing.
Prepend an element to an ordered collection
Append an element to an ordered collection
find :: (Element c -> Bool) -> c -> Maybe (Element c) #
Find an element in an ordered collection
sortBy :: (Element c -> Element c -> Ordering) -> c -> c #
Sort an ordered collection using the specified order function
Create a collection with a single element
head :: NonEmpty c -> Element c #
get the first element of a non-empty collection
last :: NonEmpty c -> Element c #
get the last element of a non-empty collection
Extract the elements after the first element of a non-empty collection.
Extract the elements before the last element of a non-empty collection.
replicate :: CountOf (Element c) -> Element c -> c #
Create a collection where the element in parameter is repeated N time
isPrefixOf :: c -> c -> Bool #
Takes two collections and returns True iff the first collection is a prefix of the second.
default isPrefixOf :: Eq c => c -> c -> Bool #
isSuffixOf :: c -> c -> Bool #
Takes two collections and returns True iff the first collection is a suffix of the second.
default isSuffixOf :: Eq c => c -> c -> Bool #
Takes two collections and returns True iff the first collection is an infix of the second.
stripPrefix :: c -> c -> Maybe c #
Try to strip a prefix from a collection
stripSuffix :: c -> c -> Maybe c #
Try to strip a suffix from a collection
Instances
| Sequential AsciiString # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # revTake :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # drop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # revDrop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # splitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) # revSplitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) # splitOn :: (Element AsciiString -> Bool) -> AsciiString -> [AsciiString] # break :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # breakEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # breakElem :: Element AsciiString -> AsciiString -> (AsciiString, AsciiString) # takeWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # dropWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # intersperse :: Element AsciiString -> AsciiString -> AsciiString # intercalate :: Element AsciiString -> AsciiString -> Element AsciiString # span :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # spanEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # filter :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # partition :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # reverse :: AsciiString -> AsciiString # uncons :: AsciiString -> Maybe (Element AsciiString, AsciiString) # unsnoc :: AsciiString -> Maybe (AsciiString, Element AsciiString) # snoc :: AsciiString -> Element AsciiString -> AsciiString # cons :: Element AsciiString -> AsciiString -> AsciiString # find :: (Element AsciiString -> Bool) -> AsciiString -> Maybe (Element AsciiString) # sortBy :: (Element AsciiString -> Element AsciiString -> Ordering) -> AsciiString -> AsciiString # singleton :: Element AsciiString -> AsciiString # head :: NonEmpty AsciiString -> Element AsciiString # last :: NonEmpty AsciiString -> Element AsciiString # tail :: NonEmpty AsciiString -> AsciiString # init :: NonEmpty AsciiString -> AsciiString # replicate :: CountOf (Element AsciiString) -> Element AsciiString -> AsciiString # isPrefixOf :: AsciiString -> AsciiString -> Bool # isSuffixOf :: AsciiString -> AsciiString -> Bool # isInfixOf :: AsciiString -> AsciiString -> Bool # stripPrefix :: AsciiString -> AsciiString -> Maybe AsciiString # stripSuffix :: AsciiString -> AsciiString -> Maybe AsciiString # | |
| Sequential String # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element String) -> String -> String # revTake :: CountOf (Element String) -> String -> String # drop :: CountOf (Element String) -> String -> String # revDrop :: CountOf (Element String) -> String -> String # splitAt :: CountOf (Element String) -> String -> (String, String) # revSplitAt :: CountOf (Element String) -> String -> (String, String) # splitOn :: (Element String -> Bool) -> String -> [String] # break :: (Element String -> Bool) -> String -> (String, String) # breakEnd :: (Element String -> Bool) -> String -> (String, String) # breakElem :: Element String -> String -> (String, String) # takeWhile :: (Element String -> Bool) -> String -> String # dropWhile :: (Element String -> Bool) -> String -> String # intersperse :: Element String -> String -> String # intercalate :: Element String -> String -> Element String # span :: (Element String -> Bool) -> String -> (String, String) # spanEnd :: (Element String -> Bool) -> String -> (String, String) # filter :: (Element String -> Bool) -> String -> String # partition :: (Element String -> Bool) -> String -> (String, String) # uncons :: String -> Maybe (Element String, String) # unsnoc :: String -> Maybe (String, Element String) # snoc :: String -> Element String -> String # cons :: Element String -> String -> String # find :: (Element String -> Bool) -> String -> Maybe (Element String) # sortBy :: (Element String -> Element String -> Ordering) -> String -> String # singleton :: Element String -> String # head :: NonEmpty String -> Element String # last :: NonEmpty String -> Element String # tail :: NonEmpty String -> String # init :: NonEmpty String -> String # replicate :: CountOf (Element String) -> Element String -> String # isPrefixOf :: String -> String -> Bool # isSuffixOf :: String -> String -> Bool # isInfixOf :: String -> String -> Bool # | |
| Sequential Bitmap # | |
Defined in Foundation.Array.Bitmap Methods take :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # revTake :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # drop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # revDrop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # splitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) # revSplitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) # splitOn :: (Element Bitmap -> Bool) -> Bitmap -> [Bitmap] # break :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # breakEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # breakElem :: Element Bitmap -> Bitmap -> (Bitmap, Bitmap) # takeWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # dropWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # intersperse :: Element Bitmap -> Bitmap -> Bitmap # intercalate :: Element Bitmap -> Bitmap -> Element Bitmap # span :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # spanEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # filter :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # partition :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # uncons :: Bitmap -> Maybe (Element Bitmap, Bitmap) # unsnoc :: Bitmap -> Maybe (Bitmap, Element Bitmap) # snoc :: Bitmap -> Element Bitmap -> Bitmap # cons :: Element Bitmap -> Bitmap -> Bitmap # find :: (Element Bitmap -> Bool) -> Bitmap -> Maybe (Element Bitmap) # sortBy :: (Element Bitmap -> Element Bitmap -> Ordering) -> Bitmap -> Bitmap # singleton :: Element Bitmap -> Bitmap # head :: NonEmpty Bitmap -> Element Bitmap # last :: NonEmpty Bitmap -> Element Bitmap # tail :: NonEmpty Bitmap -> Bitmap # init :: NonEmpty Bitmap -> Bitmap # replicate :: CountOf (Element Bitmap) -> Element Bitmap -> Bitmap # isPrefixOf :: Bitmap -> Bitmap -> Bool # isSuffixOf :: Bitmap -> Bitmap -> Bool # isInfixOf :: Bitmap -> Bitmap -> Bool # | |
| Sequential CSV # | |
Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element CSV) -> CSV -> CSV # revTake :: CountOf (Element CSV) -> CSV -> CSV # drop :: CountOf (Element CSV) -> CSV -> CSV # revDrop :: CountOf (Element CSV) -> CSV -> CSV # splitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) # revSplitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) # splitOn :: (Element CSV -> Bool) -> CSV -> [CSV] # break :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # breakEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # breakElem :: Element CSV -> CSV -> (CSV, CSV) # takeWhile :: (Element CSV -> Bool) -> CSV -> CSV # dropWhile :: (Element CSV -> Bool) -> CSV -> CSV # intersperse :: Element CSV -> CSV -> CSV # intercalate :: Element CSV -> CSV -> Element CSV # span :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # spanEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # filter :: (Element CSV -> Bool) -> CSV -> CSV # partition :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # uncons :: CSV -> Maybe (Element CSV, CSV) # unsnoc :: CSV -> Maybe (CSV, Element CSV) # snoc :: CSV -> Element CSV -> CSV # cons :: Element CSV -> CSV -> CSV # find :: (Element CSV -> Bool) -> CSV -> Maybe (Element CSV) # sortBy :: (Element CSV -> Element CSV -> Ordering) -> CSV -> CSV # singleton :: Element CSV -> CSV # head :: NonEmpty CSV -> Element CSV # last :: NonEmpty CSV -> Element CSV # replicate :: CountOf (Element CSV) -> Element CSV -> CSV # isPrefixOf :: CSV -> CSV -> Bool # isSuffixOf :: CSV -> CSV -> Bool # isInfixOf :: CSV -> CSV -> Bool # | |
| Sequential Row # | |
Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element Row) -> Row -> Row # revTake :: CountOf (Element Row) -> Row -> Row # drop :: CountOf (Element Row) -> Row -> Row # revDrop :: CountOf (Element Row) -> Row -> Row # splitAt :: CountOf (Element Row) -> Row -> (Row, Row) # revSplitAt :: CountOf (Element Row) -> Row -> (Row, Row) # splitOn :: (Element Row -> Bool) -> Row -> [Row] # break :: (Element Row -> Bool) -> Row -> (Row, Row) # breakEnd :: (Element Row -> Bool) -> Row -> (Row, Row) # breakElem :: Element Row -> Row -> (Row, Row) # takeWhile :: (Element Row -> Bool) -> Row -> Row # dropWhile :: (Element Row -> Bool) -> Row -> Row # intersperse :: Element Row -> Row -> Row # intercalate :: Element Row -> Row -> Element Row # span :: (Element Row -> Bool) -> Row -> (Row, Row) # spanEnd :: (Element Row -> Bool) -> Row -> (Row, Row) # filter :: (Element Row -> Bool) -> Row -> Row # partition :: (Element Row -> Bool) -> Row -> (Row, Row) # uncons :: Row -> Maybe (Element Row, Row) # unsnoc :: Row -> Maybe (Row, Element Row) # snoc :: Row -> Element Row -> Row # cons :: Element Row -> Row -> Row # find :: (Element Row -> Bool) -> Row -> Maybe (Element Row) # sortBy :: (Element Row -> Element Row -> Ordering) -> Row -> Row # singleton :: Element Row -> Row # head :: NonEmpty Row -> Element Row # last :: NonEmpty Row -> Element Row # replicate :: CountOf (Element Row) -> Element Row -> Row # isPrefixOf :: Row -> Row -> Bool # isSuffixOf :: Row -> Row -> Bool # isInfixOf :: Row -> Row -> Bool # | |
| PrimType ty => Sequential (Block ty) # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Block ty)) -> Block ty -> Block ty # revTake :: CountOf (Element (Block ty)) -> Block ty -> Block ty # drop :: CountOf (Element (Block ty)) -> Block ty -> Block ty # revDrop :: CountOf (Element (Block ty)) -> Block ty -> Block ty # splitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) # revSplitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) # splitOn :: (Element (Block ty) -> Bool) -> Block ty -> [Block ty] # break :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # breakEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # breakElem :: Element (Block ty) -> Block ty -> (Block ty, Block ty) # takeWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # dropWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # intersperse :: Element (Block ty) -> Block ty -> Block ty # intercalate :: Element (Block ty) -> Block ty -> Element (Block ty) # span :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # spanEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # filter :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # partition :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # reverse :: Block ty -> Block ty # uncons :: Block ty -> Maybe (Element (Block ty), Block ty) # unsnoc :: Block ty -> Maybe (Block ty, Element (Block ty)) # snoc :: Block ty -> Element (Block ty) -> Block ty # cons :: Element (Block ty) -> Block ty -> Block ty # find :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Element (Block ty)) # sortBy :: (Element (Block ty) -> Element (Block ty) -> Ordering) -> Block ty -> Block ty # singleton :: Element (Block ty) -> Block ty # head :: NonEmpty (Block ty) -> Element (Block ty) # last :: NonEmpty (Block ty) -> Element (Block ty) # tail :: NonEmpty (Block ty) -> Block ty # init :: NonEmpty (Block ty) -> Block ty # replicate :: CountOf (Element (Block ty)) -> Element (Block ty) -> Block ty # isPrefixOf :: Block ty -> Block ty -> Bool # isSuffixOf :: Block ty -> Block ty -> Bool # isInfixOf :: Block ty -> Block ty -> Bool # | |
| Sequential (Array ty) # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revTake :: CountOf (Element (Array ty)) -> Array ty -> Array ty # drop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revDrop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # splitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # revSplitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) # takeWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # dropWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # intersperse :: Element (Array ty) -> Array ty -> Array ty # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # spanEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # reverse :: Array ty -> Array ty # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) # snoc :: Array ty -> Element (Array ty) -> Array ty # cons :: Element (Array ty) -> Array ty -> Array ty # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty # singleton :: Element (Array ty) -> Array ty # head :: NonEmpty (Array ty) -> Element (Array ty) # last :: NonEmpty (Array ty) -> Element (Array ty) # tail :: NonEmpty (Array ty) -> Array ty # init :: NonEmpty (Array ty) -> Array ty # replicate :: CountOf (Element (Array ty)) -> Element (Array ty) -> Array ty # isPrefixOf :: Array ty -> Array ty -> Bool # isSuffixOf :: Array ty -> Array ty -> Bool # isInfixOf :: Array ty -> Array ty -> Bool # | |
| PrimType ty => Sequential (UArray ty) # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revTake :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # drop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revDrop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # splitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # revSplitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) # takeWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # dropWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # spanEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # reverse :: UArray ty -> UArray ty # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) # snoc :: UArray ty -> Element (UArray ty) -> UArray ty # cons :: Element (UArray ty) -> UArray ty -> UArray ty # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty # singleton :: Element (UArray ty) -> UArray ty # head :: NonEmpty (UArray ty) -> Element (UArray ty) # last :: NonEmpty (UArray ty) -> Element (UArray ty) # tail :: NonEmpty (UArray ty) -> UArray ty # init :: NonEmpty (UArray ty) -> UArray ty # replicate :: CountOf (Element (UArray ty)) -> Element (UArray ty) -> UArray ty # isPrefixOf :: UArray ty -> UArray ty -> Bool # isSuffixOf :: UArray ty -> UArray ty -> Bool # isInfixOf :: UArray ty -> UArray ty -> Bool # stripPrefix :: UArray ty -> UArray ty -> Maybe (UArray ty) # stripSuffix :: UArray ty -> UArray ty -> Maybe (UArray ty) # | |
| PrimType ty => Sequential (ChunkedUArray ty) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods take :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # revTake :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # drop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # revDrop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # splitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # revSplitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # splitOn :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> [ChunkedUArray ty] # break :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # breakEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # breakElem :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # takeWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # dropWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # intersperse :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # intercalate :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> Element (ChunkedUArray ty) # span :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # spanEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # filter :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # partition :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # reverse :: ChunkedUArray ty -> ChunkedUArray ty # uncons :: ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty), ChunkedUArray ty) # unsnoc :: ChunkedUArray ty -> Maybe (ChunkedUArray ty, Element (ChunkedUArray ty)) # snoc :: ChunkedUArray ty -> Element (ChunkedUArray ty) -> ChunkedUArray ty # cons :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # find :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty)) # sortBy :: (Element (ChunkedUArray ty) -> Element (ChunkedUArray ty) -> Ordering) -> ChunkedUArray ty -> ChunkedUArray ty # singleton :: Element (ChunkedUArray ty) -> ChunkedUArray ty # head :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # last :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # tail :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # init :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # replicate :: CountOf (Element (ChunkedUArray ty)) -> Element (ChunkedUArray ty) -> ChunkedUArray ty # isPrefixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # isSuffixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # isInfixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # stripPrefix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) # stripSuffix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) # | |
| Sequential (DList a) # | |
Defined in Foundation.List.DList Methods take :: CountOf (Element (DList a)) -> DList a -> DList a # revTake :: CountOf (Element (DList a)) -> DList a -> DList a # drop :: CountOf (Element (DList a)) -> DList a -> DList a # revDrop :: CountOf (Element (DList a)) -> DList a -> DList a # splitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) # revSplitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) # splitOn :: (Element (DList a) -> Bool) -> DList a -> [DList a] # break :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # breakEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # breakElem :: Element (DList a) -> DList a -> (DList a, DList a) # takeWhile :: (Element (DList a) -> Bool) -> DList a -> DList a # dropWhile :: (Element (DList a) -> Bool) -> DList a -> DList a # intersperse :: Element (DList a) -> DList a -> DList a # intercalate :: Element (DList a) -> DList a -> Element (DList a) # span :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # spanEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # filter :: (Element (DList a) -> Bool) -> DList a -> DList a # partition :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # reverse :: DList a -> DList a # uncons :: DList a -> Maybe (Element (DList a), DList a) # unsnoc :: DList a -> Maybe (DList a, Element (DList a)) # snoc :: DList a -> Element (DList a) -> DList a # cons :: Element (DList a) -> DList a -> DList a # find :: (Element (DList a) -> Bool) -> DList a -> Maybe (Element (DList a)) # sortBy :: (Element (DList a) -> Element (DList a) -> Ordering) -> DList a -> DList a # singleton :: Element (DList a) -> DList a # head :: NonEmpty (DList a) -> Element (DList a) # last :: NonEmpty (DList a) -> Element (DList a) # tail :: NonEmpty (DList a) -> DList a # init :: NonEmpty (DList a) -> DList a # replicate :: CountOf (Element (DList a)) -> Element (DList a) -> DList a # isPrefixOf :: DList a -> DList a -> Bool # isSuffixOf :: DList a -> DList a -> Bool # isInfixOf :: DList a -> DList a -> Bool # | |
| Sequential [a] # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element [a]) -> [a] -> [a] # revTake :: CountOf (Element [a]) -> [a] -> [a] # drop :: CountOf (Element [a]) -> [a] -> [a] # revDrop :: CountOf (Element [a]) -> [a] -> [a] # splitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) # revSplitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) # splitOn :: (Element [a] -> Bool) -> [a] -> [[a]] # break :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # breakEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # breakElem :: Element [a] -> [a] -> ([a], [a]) # takeWhile :: (Element [a] -> Bool) -> [a] -> [a] # dropWhile :: (Element [a] -> Bool) -> [a] -> [a] # intersperse :: Element [a] -> [a] -> [a] # intercalate :: Element [a] -> [a] -> Element [a] # span :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # spanEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # filter :: (Element [a] -> Bool) -> [a] -> [a] # partition :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # uncons :: [a] -> Maybe (Element [a], [a]) # unsnoc :: [a] -> Maybe ([a], Element [a]) # snoc :: [a] -> Element [a] -> [a] # cons :: Element [a] -> [a] -> [a] # find :: (Element [a] -> Bool) -> [a] -> Maybe (Element [a]) # sortBy :: (Element [a] -> Element [a] -> Ordering) -> [a] -> [a] # singleton :: Element [a] -> [a] # head :: NonEmpty [a] -> Element [a] # last :: NonEmpty [a] -> Element [a] # replicate :: CountOf (Element [a]) -> Element [a] -> [a] # isPrefixOf :: [a] -> [a] -> Bool # isSuffixOf :: [a] -> [a] -> Bool # isInfixOf :: [a] -> [a] -> Bool # stripPrefix :: [a] -> [a] -> Maybe [a] # stripSuffix :: [a] -> [a] -> Maybe [a] # | |
NonEmpty property for any Collection
Instances
| Collection c => Collection (NonEmpty c) # | |
Defined in Foundation.Collection.Collection Methods length :: NonEmpty c -> CountOf (Element (NonEmpty c)) # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # | |
| IsList c => IsList (NonEmpty c) | |
| Show a => Show (NonEmpty a) | |
| Eq a => Eq (NonEmpty a) | |
| type Element (NonEmpty a) # | |
Defined in Foundation.Collection.Element | |
| type Item (NonEmpty c) | |
Defined in Basement.NonEmpty | |
nonEmpty :: Collection c => c -> Maybe (NonEmpty c) #
Smart constructor to create a NonEmpty collection
If the collection is empty, then Nothing is returned Otherwise, the collection is wrapped in the NonEmpty property
Folds
class Foldable collection where #
Give the ability to fold a collection on itself
Methods
foldl' :: (a -> Element collection -> a) -> a -> collection -> a #
Left-associative fold of a structure.
In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.
Note that Foundation only provides foldl', a strict version of foldl because
the lazy version is seldom useful.
Left-associative fold of a structure with strict application of the operator.
foldr :: (Element collection -> a -> a) -> a -> collection -> a #
Right-associative fold of a structure.
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
foldr' :: (Element collection -> a -> a) -> a -> collection -> a #
Right-associative fold of a structure, but with strict application of the operator.
Instances
| Foldable Bitmap # | |
| PrimType ty => Foldable (Block ty) # | |
| Foldable (Array ty) # | |
| PrimType ty => Foldable (UArray ty) # | |
| PrimType ty => Foldable (ChunkedUArray ty) # | |
Defined in Foundation.Array.Chunked.Unboxed Methods foldl' :: (a -> Element (ChunkedUArray ty) -> a) -> a -> ChunkedUArray ty -> a # foldr :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a # foldr' :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a # | |
| Foldable (DList a) # | |
| Foldable [a] # | |
| PrimType ty => Foldable (BlockN n ty) # | |
| Foldable (ListN n a) # | |
Maybe
mapMaybe :: (a -> Maybe b) -> [a] -> [b] #
The mapMaybe function is a version of map which can throw
out elements. In particular, the functional argument returns
something of type . If this is Maybe bNothing, no element
is added on to the result list. If it is , then Just bb is
included in the result list.
Examples
Using is a shortcut for mapMaybe f x
in most cases:catMaybes $ map f x
>>>import GHC.Internal.Text.Read ( readMaybe )>>>let readMaybeInt = readMaybe :: String -> Maybe Int>>>mapMaybe readMaybeInt ["1", "Foo", "3"][1,3]>>>catMaybes $ map readMaybeInt ["1", "Foo", "3"][1,3]
If we map the Just constructor, the entire list should be returned:
>>>mapMaybe Just [1,2,3][1,2,3]
catMaybes :: [Maybe a] -> [a] #
The catMaybes function takes a list of Maybes and returns
a list of all the Just values.
Examples
Basic usage:
>>>catMaybes [Just 1, Nothing, Just 3][1,3]
When constructing a list of Maybe values, catMaybes can be used
to return all of the "success" results (if the list is the result
of a map, then mapMaybe would be more appropriate):
>>>import GHC.Internal.Text.Read ( readMaybe )>>>[readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][Just 1,Nothing,Just 3]>>>catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][1,3]
fromMaybe :: a -> Maybe a -> a #
The fromMaybe function takes a default value and a Maybe
value. If the Maybe is Nothing, it returns the default value;
otherwise, it returns the value contained in the Maybe.
Examples
Basic usage:
>>>fromMaybe "" (Just "Hello, World!")"Hello, World!"
>>>fromMaybe "" Nothing""
Read an integer from a string using readMaybe. If we fail to
parse an integer, we want to return 0 by default:
>>>import GHC.Internal.Text.Read ( readMaybe )>>>fromMaybe 0 (readMaybe "5")5>>>fromMaybe 0 (readMaybe "")0
listToMaybe :: [a] -> Maybe a #
The listToMaybe function returns Nothing on an empty list
or where Just aa is the first element of the list.
Examples
Basic usage:
>>>listToMaybe []Nothing
>>>listToMaybe [9]Just 9
>>>listToMaybe [1,2,3]Just 1
Composing maybeToList with listToMaybe should be the identity
on singleton/empty lists:
>>>maybeToList $ listToMaybe [5][5]>>>maybeToList $ listToMaybe [][]
But not on lists with more than one element:
>>>maybeToList $ listToMaybe [1,2,3][1]
maybeToList :: Maybe a -> [a] #
The maybeToList function returns an empty list when given
Nothing or a singleton list when given Just.
Examples
Basic usage:
>>>maybeToList (Just 7)[7]
>>>maybeToList Nothing[]
One can use maybeToList to avoid pattern matching when combined
with a function that (safely) works on lists:
>>>import GHC.Internal.Text.Read ( readMaybe )>>>sum $ maybeToList (readMaybe "3")3>>>sum $ maybeToList (readMaybe "")0
Either
partitionEithers :: [Either a b] -> ([a], [b]) #
Partitions a list of Either into two lists.
All the Left elements are extracted, in order, to the first
component of the output. Similarly the Right elements are extracted
to the second component of the output.
Examples
Basic usage:
>>>let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]>>>partitionEithers list(["foo","bar","baz"],[3,7])
The pair returned by should be the same
pair as partitionEithers x(:lefts x, rights x)
>>>let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]>>>partitionEithers list == (lefts list, rights list)True
Function
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 #
runs the binary function on b u x yb on the results of applying
unary function u to two arguments x and y. From the opposite
perspective, it transforms two inputs and combines the outputs.
(op `on` f) x y = f x `op` f y
Examples
>>>sortBy (compare `on` length) [[0, 1, 2], [0, 1], [], [0]][[],[0],[0,1],[0,1,2]]
>>>((+) `on` length) [1, 2, 3] [-1]4
>>>((,) `on` (*2)) 2 3(4,6)
Algebraic properties
Applicative
(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #
An infix synonym for fmap.
The name of this operator is an allusion to $.
Note the similarities between their types:
($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b
Whereas $ is function application, <$> is function
application lifted over a Functor.
Examples
Convert from a to a Maybe Int using Maybe
Stringshow:
>>>show <$> NothingNothing
>>>show <$> Just 3Just "3"
Convert from an to an
Either Int IntEither IntString using show:
>>>show <$> Left 17Left 17
>>>show <$> Right 17Right "17"
Double each element of a list:
>>>(*2) <$> [1,2,3][2,4,6]
Apply even to the second element of a pair:
>>>even <$> (2,2)(2,True)
(<|>) :: Alternative f => f a -> f a -> f a infixl 3 #
An associative binary operation
Monad
Exceptions
class (Typeable e, Show e) => Exception e where #
Any type that you wish to throw or catch as an exception must be an
instance of the Exception class. The simplest case is a new exception
type directly below the root:
data MyException = ThisException | ThatException
deriving Show
instance Exception MyExceptionThe default method definitions in the Exception class do what we need
in this case. You can now throw and catch ThisException and
ThatException as exceptions:
*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException
In more complicated examples, you may wish to define a whole hierarchy of exceptions:
---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler
data SomeCompilerException = forall e . Exception e => SomeCompilerException e
instance Show SomeCompilerException where
show (SomeCompilerException e) = show e
instance Exception SomeCompilerException
compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException
compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
SomeCompilerException a <- fromException x
cast a
---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler
data SomeFrontendException = forall e . Exception e => SomeFrontendException e
instance Show SomeFrontendException where
show (SomeFrontendException e) = show e
instance Exception SomeFrontendException where
toException = compilerExceptionToException
fromException = compilerExceptionFromException
frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException
frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
SomeFrontendException a <- fromException x
cast a
---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception
data MismatchedParentheses = MismatchedParentheses
deriving Show
instance Exception MismatchedParentheses where
toException = frontendExceptionToException
fromException = frontendExceptionFromExceptionWe can now catch a MismatchedParentheses exception as
MismatchedParentheses, SomeFrontendException or
SomeCompilerException, but not other types, e.g. IOException:
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses
Minimal complete definition
Nothing
Methods
toException :: e -> SomeException #
toException should produce a SomeException with no attached ExceptionContext.
fromException :: SomeException -> Maybe e #
displayException :: e -> String #
Render this exception value in a human-friendly manner.
Default implementation: .show
@since base-4.8.0.0
backtraceDesired :: e -> Bool #
Instances
| Exception Timeout | Since: base-4.7.0.0 |
Defined in System.Timeout Methods toException :: Timeout -> SomeException # fromException :: SomeException -> Maybe Timeout # displayException :: Timeout -> String # backtraceDesired :: Timeout -> Bool # | |
| Exception InvalidRecast | |
Defined in Basement.Exception Methods toException :: InvalidRecast -> SomeException # fromException :: SomeException -> Maybe InvalidRecast # displayException :: InvalidRecast -> String # backtraceDesired :: InvalidRecast -> Bool # | |
| Exception NonEmptyCollectionIsEmpty | |
Defined in Basement.Exception | |
| Exception OutOfBound | |
Defined in Basement.Exception Methods toException :: OutOfBound -> SomeException # fromException :: SomeException -> Maybe OutOfBound # displayException :: OutOfBound -> String # backtraceDesired :: OutOfBound -> Bool # | |
| Exception ASCII7_Invalid | |
Defined in Basement.String.Encoding.ASCII7 Methods toException :: ASCII7_Invalid -> SomeException # fromException :: SomeException -> Maybe ASCII7_Invalid # displayException :: ASCII7_Invalid -> String # backtraceDesired :: ASCII7_Invalid -> Bool # | |
| Exception ISO_8859_1_Invalid | |
Defined in Basement.String.Encoding.ISO_8859_1 Methods toException :: ISO_8859_1_Invalid -> SomeException # fromException :: SomeException -> Maybe ISO_8859_1_Invalid # displayException :: ISO_8859_1_Invalid -> String # backtraceDesired :: ISO_8859_1_Invalid -> Bool # | |
| Exception UTF16_Invalid | |
Defined in Basement.String.Encoding.UTF16 Methods toException :: UTF16_Invalid -> SomeException # fromException :: SomeException -> Maybe UTF16_Invalid # displayException :: UTF16_Invalid -> String # backtraceDesired :: UTF16_Invalid -> Bool # | |
| Exception UTF32_Invalid | |
Defined in Basement.String.Encoding.UTF32 Methods toException :: UTF32_Invalid -> SomeException # fromException :: SomeException -> Maybe UTF32_Invalid # displayException :: UTF32_Invalid -> String # backtraceDesired :: UTF32_Invalid -> Bool # | |
| Exception ValidationFailure | |
Defined in Basement.UTF8.Types Methods toException :: ValidationFailure -> SomeException # fromException :: SomeException -> Maybe ValidationFailure # | |
| Exception PartialError # | |
Defined in Foundation.Partial Methods toException :: PartialError -> SomeException # fromException :: SomeException -> Maybe PartialError # displayException :: PartialError -> String # backtraceDesired :: PartialError -> Bool # | |
| Exception Void | @since base-4.8.0.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String # backtraceDesired :: Void -> Bool # | |
| Exception NestedAtomically | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: NestedAtomically -> SomeException # fromException :: SomeException -> Maybe NestedAtomically # | |
| Exception NoMatchingContinuationPrompt | @since base-4.18 |
Defined in GHC.Internal.Control.Exception.Base | |
| Exception NoMethodError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: NoMethodError -> SomeException # fromException :: SomeException -> Maybe NoMethodError # displayException :: NoMethodError -> String # backtraceDesired :: NoMethodError -> Bool # | |
| Exception NonTermination | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: NonTermination -> SomeException # fromException :: SomeException -> Maybe NonTermination # displayException :: NonTermination -> String # backtraceDesired :: NonTermination -> Bool # | |
| Exception PatternMatchFail | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException # fromException :: SomeException -> Maybe PatternMatchFail # | |
| Exception RecConError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecConError -> SomeException # fromException :: SomeException -> Maybe RecConError # displayException :: RecConError -> String # backtraceDesired :: RecConError -> Bool # | |
| Exception RecSelError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecSelError -> SomeException # fromException :: SomeException -> Maybe RecSelError # displayException :: RecSelError -> String # backtraceDesired :: RecSelError -> Bool # | |
| Exception RecUpdError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecUpdError -> SomeException # fromException :: SomeException -> Maybe RecUpdError # displayException :: RecUpdError -> String # backtraceDesired :: RecUpdError -> Bool # | |
| Exception TypeError | @since base-4.9.0.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: TypeError -> SomeException # fromException :: SomeException -> Maybe TypeError # displayException :: TypeError -> String # backtraceDesired :: TypeError -> Bool # | |
| Exception ErrorCall | @since base-4.0.0.0 |
Defined in GHC.Internal.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String # backtraceDesired :: ErrorCall -> Bool # | |
| Exception ArithException | @since base-4.0.0.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String # backtraceDesired :: ArithException -> Bool # | |
| Exception SomeException | This drops any attached @since base-3.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # backtraceDesired :: SomeException -> Bool # | |
| Exception AllocationLimitExceeded | @since base-4.8.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Exception ArrayException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String # backtraceDesired :: ArrayException -> Bool # | |
| Exception AssertionFailed | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String # backtraceDesired :: AssertionFailed -> Bool # | |
| Exception AsyncException | @since base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String # backtraceDesired :: AsyncException -> Bool # | |
| Exception BlockedIndefinitelyOnMVar | @since base-4.1.0.0 |
| Exception BlockedIndefinitelyOnSTM | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Exception CompactionFailed | @since base-4.10.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # | |
| Exception Deadlock | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String # backtraceDesired :: Deadlock -> Bool # | |
| Exception ExitCode | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String # backtraceDesired :: ExitCode -> Bool # | |
| Exception FixIOException | @since base-4.11.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: FixIOException -> SomeException # fromException :: SomeException -> Maybe FixIOException # displayException :: FixIOException -> String # backtraceDesired :: FixIOException -> Bool # | |
| Exception IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String # backtraceDesired :: IOException -> Bool # | |
| Exception SomeAsyncException | @since base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # | |
| (Typeable input, Show input) => Exception (ParseError input) # | |
Defined in Foundation.Parser Methods toException :: ParseError input -> SomeException # fromException :: SomeException -> Maybe (ParseError input) # displayException :: ParseError input -> String # backtraceDesired :: ParseError input -> Bool # | |
| Exception a => Exception (ExceptionWithContext a) | |
Defined in GHC.Internal.Exception.Type Methods toException :: ExceptionWithContext a -> SomeException # fromException :: SomeException -> Maybe (ExceptionWithContext a) # displayException :: ExceptionWithContext a -> String # backtraceDesired :: ExceptionWithContext a -> Bool # | |
| Exception e => Exception (NoBacktrace e) | |
Defined in GHC.Internal.Exception.Type Methods toException :: NoBacktrace e -> SomeException # fromException :: SomeException -> Maybe (NoBacktrace e) # displayException :: NoBacktrace e -> String # backtraceDesired :: NoBacktrace e -> Bool # | |
The class Typeable allows a concrete representation of a type to
be calculated.
Minimal complete definition
typeRep#
data SomeException #
The SomeException type is the root of the exception type hierarchy.
When an exception of type e is thrown, behind the scenes it is
encapsulated in a SomeException.
Instances
| Exception SomeException | This drops any attached @since base-3.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # backtraceDesired :: SomeException -> Bool # | |
| Show SomeException | Since: ghc-internal-3.0 |
Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS # | |
data IOException #
Exceptions that occur in the IO monad.
An IOException records a more specific error type, a descriptive
string and maybe the handle that was used when the error was
flagged.
Instances
| Exception IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String # backtraceDesired :: IOException -> Bool # | |
| Show IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS # | |
| Eq IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
Proxy
Proxy is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically, is a safer alternative to the
Proxy :: Proxy a idiom.undefined :: a
>>>Proxy :: Proxy (Void, Int -> Int)Proxy
Proxy can even hold types of higher kinds,
>>>Proxy :: Proxy EitherProxy
>>>Proxy :: Proxy FunctorProxy
>>>Proxy :: Proxy complicatedStructureProxy
Constructors
| Proxy |
Instances
| Generic1 (Proxy :: k -> Type) | |
Defined in GHC.Internal.Generics | |
| MonadZip (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Show1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Contravariant (Proxy :: Type -> Type) | |
| Alternative (Proxy :: Type -> Type) | @since base-4.9.0.0 |
| Applicative (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Functor (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Monad (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| MonadPlus (Proxy :: Type -> Type) | @since base-4.9.0.0 |
| Foldable (Proxy :: Type -> Type) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
| Traversable (Proxy :: Type -> Type) | @since base-4.7.0.0 |
| Monoid (Proxy s) | @since base-4.7.0.0 |
| Semigroup (Proxy s) | @since base-4.9.0.0 |
| Data t => Data (Proxy t) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # | |
| Bounded (Proxy t) | @since base-4.7.0.0 |
| Enum (Proxy s) | @since base-4.7.0.0 |
| Generic (Proxy t) | |
Defined in GHC.Internal.Generics | |
| Ix (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
| Read (Proxy t) | @since base-4.7.0.0 |
| Show (Proxy s) | @since base-4.7.0.0 |
| Eq (Proxy s) | @since base-4.7.0.0 |
| Ord (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
| type Rep1 (Proxy :: k -> Type) | @since base-4.6.0.0 |
| type Rep (Proxy t) | @since base-4.6.0.0 |
asProxyTypeOf :: a -> proxy a -> a #
asProxyTypeOf is a type-restricted version of const.
It is usually used as an infix operator, and its typing forces its first
argument (which is usually overloaded) to have the same type as the tag
of the second.
>>>import GHC.Internal.Word>>>:type asProxyTypeOf 123 (Proxy :: Proxy Word8)asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8
Note the lower-case proxy in the definition. This allows any type
constructor with just one argument to be passed to the function, for example
we could also write
>>>import GHC.Internal.Word>>>:type asProxyTypeOf 123 (Just (undefined :: Word8))asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8
Partial
Create a value that is partial. this can only be
unwrap using the fromPartial function
data PartialError #
An error related to the evaluation of a Partial value that failed.
it contains the name of the function and the reason for failure
Instances
| Exception PartialError # | |
Defined in Foundation.Partial Methods toException :: PartialError -> SomeException # fromException :: SomeException -> Maybe PartialError # displayException :: PartialError -> String # backtraceDesired :: PartialError -> Bool # | |
| Show PartialError # | |
Defined in Foundation.Partial Methods showsPrec :: Int -> PartialError -> ShowS # show :: PartialError -> String # showList :: [PartialError] -> ShowS # | |
| Eq PartialError # | |
Defined in Foundation.Partial | |
fromPartial :: Partial a -> a #
Dewrap a possible partial value
ifThenElse :: Bool -> a -> a -> a #
for support of if .. then .. else