| 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 Source #
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 Source #
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 Source #
morphism composition
Functions
class Fstable a where Source #
Class of product types that have a first element
Associated Types
type ProductFirst a Source #
Methods
fst :: a -> ProductFirst a Source #
Instances
| Fstable (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Fstable (a, b) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b) -> ProductFirst (a, b) Source # | |||||
| Fstable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Fstable (a, b, c) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b, c) -> ProductFirst (a, b, c) Source # | |||||
| Fstable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Fstable (a, b, c, d) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods fst :: (a, b, c, d) -> ProductFirst (a, b, c, d) Source # | |||||
class Sndable a where Source #
Class of product types that have a second element
Associated Types
type ProductSecond a Source #
Methods
snd :: a -> ProductSecond a Source #
Instances
| Sndable (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (a, b) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b) -> ProductSecond (a, b) Source # | |||||
| Sndable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (a, b, c) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b, c) -> ProductSecond (a, b, c) Source # | |||||
| Sndable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (a, b, c, d) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods snd :: (a, b, c, d) -> ProductSecond (a, b, c, d) Source # | |||||
Strict tuple (a,b)
Constructors
| Tuple2 !a !b |
Instances
| Nthable 1 (Tuple2 a b) Source # | |||||
| Nthable 2 (Tuple2 a b) Source # | |||||
| (NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple2 a b -> () Source # | |||||
| (Hashable a, Hashable b) => Hashable (Tuple2 a b) Source # | |||||
| Fstable (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Data a, Data b) => Data (Tuple2 a b) Source # | |||||
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) Source # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tuple2 a b) Source # toConstr :: Tuple2 a b -> Constr Source # dataTypeOf :: Tuple2 a b -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Tuple2 a b)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tuple2 a b)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple2 a b -> Tuple2 a b Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Tuple2 a b -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple2 a b -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) Source # | |||||
| Generic (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b) => Show (Tuple2 a b) Source # | |||||
| (Eq a, Eq b) => Eq (Tuple2 a b) Source # | |||||
| (Ord a, Ord b) => Ord (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple Methods compare :: Tuple2 a b -> Tuple2 a b -> Ordering Source # (<) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (<=) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (>) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (>=) :: Tuple2 a b -> Tuple2 a b -> Bool Source # | |||||
| type NthTy 1 (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple2 a b) Source # | |||||
Defined in Foundation.Tuple type Rep (Tuple2 a b) = D1 ('MetaData "Tuple2" "Foundation.Tuple" "foundation-0.0.30-JgS4dsHmMPhFcmItevGLIX" '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) Source # | |||||
| Nthable 2 (Tuple3 a b c) Source # | |||||
| Nthable 3 (Tuple3 a b c) Source # | |||||
| (NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple3 a b c -> () Source # | |||||
| (Hashable a, Hashable b, Hashable c) => Hashable (Tuple3 a b c) Source # | |||||
| Fstable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Thdable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Data a, Data b, Data c) => Data (Tuple3 a b c) Source # | |||||
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) Source # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (Tuple3 a b c) Source # toConstr :: Tuple3 a b c -> Constr Source # dataTypeOf :: Tuple3 a b c -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (Tuple3 a b c)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (Tuple3 a b c)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple3 a b c -> Tuple3 a b c Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Tuple3 a b c -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple3 a b c -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) Source # | |||||
| Generic (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b, Show c) => Show (Tuple3 a b c) Source # | |||||
| (Eq a, Eq b, Eq c) => Eq (Tuple3 a b c) Source # | |||||
| (Ord a, Ord b, Ord c) => Ord (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Methods compare :: Tuple3 a b c -> Tuple3 a b c -> Ordering Source # (<) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (<=) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (>) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (>=) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # max :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c Source # min :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c Source # | |||||
| type NthTy 1 (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 3 (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple | |||||
| type ProductThird (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple type Rep (Tuple3 a b c) = D1 ('MetaData "Tuple3" "Foundation.Tuple" "foundation-0.0.30-JgS4dsHmMPhFcmItevGLIX" '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) Source # | |||||
| Nthable 2 (Tuple4 a b c d) Source # | |||||
| Nthable 3 (Tuple4 a b c d) Source # | |||||
| Nthable 4 (Tuple4 a b c d) Source # | |||||
| (NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Methods toNormalForm :: Tuple4 a b c d -> () Source # | |||||
| (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (Tuple4 a b c d) Source # | |||||
| Fstable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Sndable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Thdable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Data a, Data b, Data c, Data d) => Data (Tuple4 a b c d) Source # | |||||
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) Source # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (Tuple4 a b c d) Source # toConstr :: Tuple4 a b c d -> Constr Source # dataTypeOf :: Tuple4 a b c d -> DataType Source # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (Tuple4 a b c d)) Source # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c0 (t d0 e)) -> Maybe (c0 (Tuple4 a b c d)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tuple4 a b c d -> Tuple4 a b c d Source # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Tuple4 a b c d -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> Tuple4 a b c d -> r Source # gmapQ :: (forall d0. Data d0 => d0 -> u) -> Tuple4 a b c d -> [u] Source # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> Tuple4 a b c d -> u Source # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) Source # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) Source # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> Tuple4 a b c d -> m (Tuple4 a b c d) Source # | |||||
| Generic (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| (Show a, Show b, Show c, Show d) => Show (Tuple4 a b c d) Source # | |||||
| (Eq a, Eq b, Eq c, Eq d) => Eq (Tuple4 a b c d) Source # | |||||
| (Ord a, Ord b, Ord c, Ord d) => Ord (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Methods compare :: Tuple4 a b c d -> Tuple4 a b c d -> Ordering Source # (<) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (<=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (>) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (>=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # max :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d Source # min :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d Source # | |||||
| type NthTy 1 (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 2 (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 3 (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type NthTy 4 (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple.Nth | |||||
| type ProductFirst (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple | |||||
| type ProductSecond (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple | |||||
| type ProductThird (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple | |||||
| type Rep (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple type Rep (Tuple4 a b c d) = D1 ('MetaData "Tuple4" "Foundation.Tuple" "foundation-0.0.30-JgS4dsHmMPhFcmItevGLIX" '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 Thdable a where Source #
Class of product types that have a third element
Associated Types
type ProductThird a Source #
Methods
thd :: a -> ProductThird a Source #
Instances
| Thdable (Tuple3 a b c) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Thdable (a, b, c) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: (a, b, c) -> ProductThird (a, b, c) Source # | |||||
| Thdable (Tuple4 a b c d) Source # | |||||
Defined in Foundation.Tuple Associated Types
| |||||
| Thdable (a, b, c, d) Source # | |||||
Defined in Foundation.Tuple Associated Types
Methods thd :: (a, b, c, d) -> ProductThird (a, b, c, d) Source # | |||||
type family ProductFirst a Source #
Instances
| type ProductFirst (Tuple2 a b) Source # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b) Source # | |
Defined in Foundation.Tuple type ProductFirst (a, b) = a | |
| type ProductFirst (Tuple3 a b c) Source # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b, c) Source # | |
Defined in Foundation.Tuple type ProductFirst (a, b, c) = a | |
| type ProductFirst (Tuple4 a b c d) Source # | |
Defined in Foundation.Tuple | |
| type ProductFirst (a, b, c, d) Source # | |
Defined in Foundation.Tuple type ProductFirst (a, b, c, d) = a | |
type family ProductSecond a Source #
Instances
| type ProductSecond (Tuple2 a b) Source # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b) Source # | |
Defined in Foundation.Tuple type ProductSecond (a, b) = b | |
| type ProductSecond (Tuple3 a b c) Source # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b, c) Source # | |
Defined in Foundation.Tuple type ProductSecond (a, b, c) = b | |
| type ProductSecond (Tuple4 a b c d) Source # | |
Defined in Foundation.Tuple | |
| type ProductSecond (a, b, c, d) Source # | |
Defined in Foundation.Tuple type ProductSecond (a, b, c, d) = b | |
type family ProductThird a Source #
Instances
| type ProductThird (Tuple3 a b c) Source # | |
Defined in Foundation.Tuple | |
| type ProductThird (a, b, c) Source # | |
Defined in Foundation.Tuple type ProductThird (a, b, c) = c | |
| type ProductThird (Tuple4 a b c d) Source # | |
Defined in Foundation.Tuple | |
| type ProductThird (a, b, c, d) Source # | |
Defined in Foundation.Tuple type ProductThird (a, b, c, d) = c | |
maybe :: b -> (a -> b) -> Maybe a -> b Source #
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 Source #
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 Source #
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 Source #
stop execution and displays an error message
getArgs :: IO [String] Source #
Returns a list of the program's command line arguments (not including the program name).
uncurry :: (a -> b -> c) -> (a, b) -> c Source #
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 Source #
Convert an uncurried function to a curried function.
Examples
>>>curry fst 1 21
until :: (a -> Bool) -> (a -> a) -> a -> a Source #
yields the result of applying until p ff until p holds.
undefined :: HasCallStack => a Source #
seq :: a -> b -> b infixr 0 Source #
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 Source #
Data that can be fully evaluated in Normal Form
Minimal complete definition
Instances
deepseq :: NormalForm a => a -> b -> b Source #
force :: NormalForm a => a -> a Source #
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 ByteArray | Since: base-4.17.0.0 |
| Show Timeout | Since: base-4.0 |
| Show Endianness | |
Defined in Basement.Endianness | |
| Show InvalidRecast | |
Defined in Basement.Exception | |
| Show NonEmptyCollectionIsEmpty | |
Defined in Basement.Exception | |
| Show OutOfBound | |
Defined in Basement.Exception | |
| Show OutOfBoundOperation | |
Defined in Basement.Exception | |
| Show RecastDestinationSize | |
Defined in Basement.Exception | |
| Show RecastSourceSize | |
Defined in Basement.Exception | |
| Show Encoding | |
| Show ASCII7_Invalid | |
| Show ISO_8859_1_Invalid | |
| Show UTF16_Invalid | |
| Show UTF32_Invalid | |
| Show AsciiString | |
Defined in Basement.Types.AsciiString | |
| Show Char7 | |
| Show FileSize | |
| Show Word128 | |
| Show Word256 | |
| Show String | |
| Show ValidationFailure | |
Defined in Basement.UTF8.Types | |
| Show Bitmap Source # | |
| Show CSV Source # | |
| Show Escaping Source # | |
| Show Field Source # | |
| Show Row Source # | |
| Show IPv4 Source # | |
| Show IPv6 Source # | |
| Show And Source # | |
| Show Condition Source # | |
| Show PartialError Source # | |
Defined in Foundation.Partial | |
| Show Arch Source # | |
| Show OS Source # | |
| Show NanoSeconds Source # | |
Defined in Foundation.Time.Types | |
| Show Seconds Source # | |
| Show UUID Source # | |
| Show FileName Source # | |
| Show FilePath Source # | |
| Show Relativity Source # | |
Defined in Foundation.VFS.FilePath | |
| Show Void | Since: base-4.8.0.0 |
| Show BlockReason | Since: base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync | |
| Show ThreadId | Since: base-4.2.0.0 |
| Show ThreadStatus | Since: base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync | |
| Show NestedAtomically | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show NoMatchingContinuationPrompt | Since: base-4.18 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show NoMethodError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show NonTermination | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show PatternMatchFail | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show RecConError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show RecSelError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show RecUpdError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base | |
| Show TypeError | Since: base-4.9.0.0 |
| Show Constr | Since: base-4.0.0.0 |
| Show ConstrRep | Since: base-4.0.0.0 |
| Show DataRep | Since: base-4.0.0.0 |
| Show DataType | Since: base-4.0.0.0 |
| Show Fixity | Since: base-4.0.0.0 |
| Show All | Since: base-2.1 |
| Show Any | Since: base-2.1 |
| Show SomeTypeRep | Since: base-4.10.0.0 |
Defined in GHC.Internal.Data.Typeable.Internal | |
| Show Version | Since: base-2.1 |
| Show ErrorCall | Since: base-4.0.0.0 |
| Show ArithException | Since: base-4.0.0.0 |
Defined in GHC.Internal.Exception.Type | |
| Show SomeException | Since: ghc-internal-3.0 |
Defined in GHC.Internal.Exception.Type | |
| Show CBool | |
| Show CChar | |
| Show CClock | |
| Show CDouble | |
| Show CFloat | |
| Show CInt | |
| Show CIntMax | |
| Show CIntPtr | |
| Show CLLong | |
| Show CLong | |
| Show CPtrdiff | |
| Show CSChar | |
| Show CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types | |
| Show CShort | |
| Show CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types | |
| Show CSize | |
| Show CTime | |
| Show CUChar | |
| Show CUInt | |
| Show CUIntMax | |
| Show CUIntPtr | |
| Show CULLong | |
| Show CULong | |
| Show CUSeconds | |
| Show CUShort | |
| Show CWchar | |
| Show Associativity | Since: base-4.6.0.0 |
Defined in GHC.Internal.Generics | |
| Show DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Show Fixity | Since: base-4.6.0.0 |
| Show SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Show SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Show MaskingState | Since: base-4.3.0.0 |
Defined in GHC.Internal.IO | |
| Show SeekMode | Since: base-4.2.0.0 |
| Show AllocationLimitExceeded | Since: base-4.7.1.0 |
Defined in GHC.Internal.IO.Exception | |
| Show ArrayException | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show AssertionFailed | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show AsyncException | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show BlockedIndefinitelyOnMVar | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show BlockedIndefinitelyOnSTM | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show CompactionFailed | Since: base-4.10.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show Deadlock | Since: base-4.1.0.0 |
| Show ExitCode | |
| Show FixIOException | Since: base-4.11.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show IOErrorType | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show IOException | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show SomeAsyncException | Since: base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception | |
| Show FD | Since: base-4.1.0.0 |
| Show HandlePosn | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle | |
| Show BufferMode | Since: base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Show Handle | Since: base-4.1.0.0 |
| Show HandleType | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Show Newline | Since: base-4.3.0.0 |
| Show NewlineMode | Since: base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types | |
| Show IOMode | Since: base-4.2.0.0 |
| Show Int16 | Since: base-2.1 |
| Show Int32 | Since: base-2.1 |
| Show Int64 | Since: base-2.1 |
| Show Int8 | Since: base-2.1 |
| Show CCFlags | Since: base-4.8.0.0 |
| Show ConcFlags | Since: base-4.8.0.0 |
| Show DebugFlags | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show DoCostCentres | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show DoHeapProfile | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show DoTrace | Since: base-4.8.0.0 |
| Show GCFlags | Since: base-4.8.0.0 |
| Show GiveGCStats | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show HpcFlags | Since: base-4.20.0.0 |
| Show IoSubSystem | |
Defined in GHC.Internal.RTS.Flags | |
| Show MiscFlags | Since: base-4.8.0.0 |
| Show ParFlags | Since: base-4.8.0.0 |
| Show ProfFlags | Since: base-4.8.0.0 |
| Show RTSFlags | Since: base-4.8.0.0 |
| Show TickyFlags | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show TraceFlags | Since: base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags | |
| Show FractionalExponentBase | |
Defined in GHC.Internal.Real | |
| Show CallStack | Since: base-4.9.0.0 |
| Show SrcLoc | Since: base-4.9.0.0 |
| Show GCDetails | Since: base-4.10.0.0 |
| Show RTSStats | Since: base-4.10.0.0 |
| Show CBlkCnt | |
| Show CBlkSize | |
| Show CCc | |
| Show CClockId | |
| Show CDev | |
| Show CFsBlkCnt | |
| Show CFsFilCnt | |
| Show CGid | |
| Show CId | |
| Show CIno | |
| Show CKey | |
| Show CMode | |
| Show CNfds | |
| Show CNlink | |
| Show COff | |
| Show CPid | |
| Show CRLim | |
| Show CSocklen | |
| Show CSpeed | |
| Show CSsize | |
| Show CTcflag | |
| Show CTimer | |
| Show CUid | |
| Show Fd | |
| Show SomeNat | Since: base-4.7.0.0 |
| Show GeneralCategory | Since: base-2.1 |
Defined in GHC.Internal.Unicode | |
| Show Word16 | Since: base-2.1 |
| Show Word32 | Since: base-2.1 |
| Show Word64 | Since: base-2.1 |
| Show Word8 | Since: base-2.1 |
| Show KindRep | |
| Show Module | Since: base-4.9.0.0 |
| Show Ordering | Since: base-2.1 |
| Show TrName | Since: base-4.9.0.0 |
| Show TyCon | Since: base-2.1 |
| Show TypeLitSort | Since: base-4.11.0.0 |
Defined in GHC.Internal.Show | |
| Show Integer | Since: base-2.1 |
| Show Natural | Since: base-4.8.0.0 |
| Show () | Since: base-2.1 |
| Show Bool | Since: base-2.1 |
| Show Char | Since: base-2.1 |
| Show Double | Since: base-2.1 |
| Show Float | Since: base-2.1 |
| Show Int | Since: base-2.1 |
| Show Levity | Since: base-4.15.0.0 |
| Show RuntimeRep | Since: base-4.11.0.0 |
Defined in GHC.Internal.Show | |
| Show VecCount | Since: base-4.11.0.0 |
| Show VecElem | Since: base-4.11.0.0 |
| Show Word | Since: base-2.1 |
| Show a => Show (Complex a) | Since: base-2.1 |
| Show a => Show (First a) | Since: base-4.9.0.0 |
| Show a => Show (Last a) | Since: base-4.9.0.0 |
| Show a => Show (Max a) | Since: base-4.9.0.0 |
| Show a => Show (Min a) | Since: base-4.9.0.0 |
| Show m => Show (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
| Show (Bits n) | |
| (PrimType ty, Show ty) => Show (Block ty) | |
| Show (Zn n) | |
| Show (Zn64 n) | |
| Show a => Show (Array a) | |
| Show a => Show (BE a) | |
| Show a => Show (LE a) | |
| Show (FinalPtr a) | |
| Show a => Show (NonEmpty a) | |
| Show (CountOf ty) | |
| Show (Offset ty) | |
| (PrimType ty, Show ty) => Show (UArray ty) | |
| (PrimType ty, Show ty) => Show (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed | |
| Show a => Show (DList a) Source # | |
| Show (ParseError String) Source # | |
Defined in Foundation.Parser | |
| Show input => Show (ParseError input) Source # | |
Defined in Foundation.Parser | |
| Show a => Show (NonEmpty a) | Since: base-4.11.0.0 |
| Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Show a => Show (First a) | Since: base-2.1 |
| Show a => Show (Last a) | Since: base-2.1 |
| Show a => Show (Dual a) | Since: base-2.1 |
| Show a => Show (Product a) | Since: base-2.1 |
| Show a => Show (Sum a) | Since: base-2.1 |
| Show a => Show (ExceptionWithContext a) | |
Defined in GHC.Internal.Exception.Type | |
| Show e => Show (NoBacktrace e) | |
Defined in GHC.Internal.Exception.Type | |
| Show (ForeignPtr a) | Since: base-2.1 |
Defined in GHC.Internal.ForeignPtr | |
| Show a => Show (ZipList a) | Since: base-4.7.0.0 |
| Show p => Show (Par1 p) | Since: base-4.7.0.0 |
| Show (FunPtr a) | Since: base-2.1 |
| Show (Ptr a) | Since: base-2.1 |
| Show a => Show (Ratio a) | Since: base-2.0.1 |
| Show (SNat n) | Since: base-4.18.0.0 |
| Show a => Show (Maybe a) | Since: base-2.1 |
| Show a => Show (Solo a) | Since: base-4.15 |
| Show a => Show [a] | Since: base-2.1 |
| HasResolution a => Show (Fixed a) | Since: base-2.1 |
| (Show a, Show b) => Show (Arg a b) | Since: base-4.9.0.0 |
| (PrimType a, Show a) => Show (BlockN n a) | |
| Show a => Show (ListN n a) | |
| (PrimType a, Show a) => Show (UVect n a) | |
| Show a => Show (Vect n a) | |
| (Show a, Show b) => Show (These a b) | |
| (Show k, Show input) => Show (Result input k) Source # | |
| (Show a, Show b) => Show (Tuple2 a b) Source # | |
| (Show a, Show b) => Show (Either a b) | Since: base-3.0 |
| Show (Proxy s) | Since: base-4.7.0.0 |
| Show (TypeRep a) | |
| Show (U1 p) | Since: base-4.9.0.0 |
| Show (V1 p) | Since: base-4.9.0.0 |
| Show (ST s a) | Since: base-2.1 |
| (Show a, Show b) => Show (a, b) | Since: base-2.1 |
| (Show a, Show b, Show c) => Show (Tuple3 a b c) Source # | |
| Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Show (f a) => Show (Ap f a) | Since: base-4.12.0.0 |
| Show (f a) => Show (Alt f a) | Since: base-4.8.0.0 |
| Show (OrderingI a b) | |
| Show (f p) => Show (Rec1 f p) | Since: base-4.7.0.0 |
| Show (URec Char p) | Since: base-4.9.0.0 |
| Show (URec Double p) | Since: base-4.9.0.0 |
| Show (URec Float p) | |
| Show (URec Int p) | Since: base-4.9.0.0 |
| Show (URec Word p) | Since: base-4.9.0.0 |
| (Show a, Show b, Show c) => Show (a, b, c) | Since: base-2.1 |
| (Show (f a), Show (g a)) => Show (Product f g a) | Since: base-4.18.0.0 |
| (Show (f a), Show (g a)) => Show (Sum f g a) | Since: base-4.18.0.0 |
| (Show a, Show b, Show c, Show d) => Show (Tuple4 a b c d) Source # | |
| (Show (f p), Show (g p)) => Show ((f :*: g) p) | Since: base-4.7.0.0 |
| (Show (f p), Show (g p)) => Show ((f :+: g) p) | Since: base-4.7.0.0 |
| Show c => Show (K1 i c p) | Since: base-4.7.0.0 |
| (Show a, Show b, Show c, Show d) => Show (a, b, c, d) | Since: base-2.1 |
| Show (f (g a)) => Show (Compose f g a) | Since: base-4.18.0.0 |
| Show (f (g p)) => Show ((f :.: g) p) | Since: base-4.7.0.0 |
| Show (f p) => Show (M1 i c f p) | Since: base-4.7.0.0 |
| (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | Since: base-2.1 |
| (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | Since: base-2.1 |
show :: Show a => a -> String Source #
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.
class Eq a => Ord a where Source #
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 Source #
(<) :: a -> a -> Bool infix 4 Source #
(<=) :: a -> a -> Bool infix 4 Source #
(>) :: a -> a -> Bool infix 4 Source #
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 |
Defined in Data.Array.Byte | |
| Ord Encoding | |
Defined in Basement.String | |
| Ord UTF32_Invalid | |
Defined in Basement.String.Encoding.UTF32 Methods compare :: UTF32_Invalid -> UTF32_Invalid -> Ordering Source # (<) :: UTF32_Invalid -> UTF32_Invalid -> Bool Source # (<=) :: UTF32_Invalid -> UTF32_Invalid -> Bool Source # (>) :: UTF32_Invalid -> UTF32_Invalid -> Bool Source # (>=) :: UTF32_Invalid -> UTF32_Invalid -> Bool Source # max :: UTF32_Invalid -> UTF32_Invalid -> UTF32_Invalid Source # min :: UTF32_Invalid -> UTF32_Invalid -> UTF32_Invalid Source # | |
| Ord AsciiString | |
Defined in Basement.Types.AsciiString Methods compare :: AsciiString -> AsciiString -> Ordering Source # (<) :: AsciiString -> AsciiString -> Bool Source # (<=) :: AsciiString -> AsciiString -> Bool Source # (>) :: AsciiString -> AsciiString -> Bool Source # (>=) :: AsciiString -> AsciiString -> Bool Source # max :: AsciiString -> AsciiString -> AsciiString Source # min :: AsciiString -> AsciiString -> AsciiString Source # | |
| Ord Char7 | |
Defined in Basement.Types.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 Source # | |
| Ord Escaping Source # | |
Defined in Foundation.Format.CSV.Types | |
| Ord IPv4 Source # | |
Defined in Foundation.Network.IPv4 | |
| Ord IPv6 Source # | |
Defined in Foundation.Network.IPv6 | |
| Ord Arch Source # | |
Defined in Foundation.System.Info | |
| Ord OS Source # | |
| Ord NanoSeconds Source # | |
Defined in Foundation.Time.Types Methods compare :: NanoSeconds -> NanoSeconds -> Ordering Source # (<) :: NanoSeconds -> NanoSeconds -> Bool Source # (<=) :: NanoSeconds -> NanoSeconds -> Bool Source # (>) :: NanoSeconds -> NanoSeconds -> Bool Source # (>=) :: NanoSeconds -> NanoSeconds -> Bool Source # max :: NanoSeconds -> NanoSeconds -> NanoSeconds Source # min :: NanoSeconds -> NanoSeconds -> NanoSeconds Source # | |
| Ord Seconds Source # | |
Defined in Foundation.Time.Types | |
| Ord UUID Source # | |
| Ord FilePath Source # | |
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 Source # (<) :: BlockReason -> BlockReason -> Bool Source # (<=) :: BlockReason -> BlockReason -> Bool Source # (>) :: BlockReason -> BlockReason -> Bool Source # (>=) :: BlockReason -> BlockReason -> Bool Source # max :: BlockReason -> BlockReason -> BlockReason Source # min :: BlockReason -> BlockReason -> BlockReason Source # | |
| 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 Source # (<) :: ThreadStatus -> ThreadStatus -> Bool Source # (<=) :: ThreadStatus -> ThreadStatus -> Bool Source # (>) :: ThreadStatus -> ThreadStatus -> Bool Source # (>=) :: ThreadStatus -> ThreadStatus -> Bool Source # max :: ThreadStatus -> ThreadStatus -> ThreadStatus Source # min :: ThreadStatus -> ThreadStatus -> ThreadStatus Source # | |
| Ord All | Since: base-2.1 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord Any | Since: base-2.1 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord SomeTypeRep | |
Defined in GHC.Internal.Data.Typeable.Internal Methods compare :: SomeTypeRep -> SomeTypeRep -> Ordering Source # (<) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (<=) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (>) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (>=) :: SomeTypeRep -> SomeTypeRep -> Bool Source # max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source # min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source # | |
| Ord Version | Since: base-2.1 |
Defined in GHC.Internal.Data.Version | |
| Ord ErrorCall | Since: base-4.7.0.0 |
Defined in GHC.Internal.Exception | |
| Ord ArithException | Since: base-3.0 |
Defined in GHC.Internal.Exception.Type Methods compare :: ArithException -> ArithException -> Ordering Source # (<) :: ArithException -> ArithException -> Bool Source # (<=) :: ArithException -> ArithException -> Bool Source # (>) :: ArithException -> ArithException -> Bool Source # (>=) :: ArithException -> ArithException -> Bool Source # max :: ArithException -> ArithException -> ArithException Source # min :: ArithException -> ArithException -> ArithException Source # | |
| Ord CBool | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CChar | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CClock | |
| Ord CDouble | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CFloat | |
| Ord CInt | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CLLong | |
| Ord CLong | |
Defined in GHC.Internal.Foreign.C.Types | |
| 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 Source # (<) :: CSUSeconds -> CSUSeconds -> Bool Source # (<=) :: CSUSeconds -> CSUSeconds -> Bool Source # (>) :: CSUSeconds -> CSUSeconds -> Bool Source # (>=) :: CSUSeconds -> CSUSeconds -> Bool Source # max :: CSUSeconds -> CSUSeconds -> CSUSeconds Source # min :: CSUSeconds -> CSUSeconds -> CSUSeconds Source # | |
| Ord CShort | |
| Ord CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods compare :: CSigAtomic -> CSigAtomic -> Ordering Source # (<) :: CSigAtomic -> CSigAtomic -> Bool Source # (<=) :: CSigAtomic -> CSigAtomic -> Bool Source # (>) :: CSigAtomic -> CSigAtomic -> Bool Source # (>=) :: CSigAtomic -> CSigAtomic -> Bool Source # max :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # min :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # | |
| Ord CSize | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CTime | |
Defined in GHC.Internal.Foreign.C.Types | |
| Ord CUChar | |
| Ord CUInt | |
Defined in GHC.Internal.Foreign.C.Types | |
| 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 | |
Defined in GHC.Internal.Foreign.C.Types | |
| 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 Source # (<) :: Associativity -> Associativity -> Bool Source # (<=) :: Associativity -> Associativity -> Bool Source # (>) :: Associativity -> Associativity -> Bool Source # (>=) :: Associativity -> Associativity -> Bool Source # max :: Associativity -> Associativity -> Associativity Source # min :: Associativity -> Associativity -> Associativity Source # | |
| Ord DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering Source # (<) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (>) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool Source # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source # | |
| 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 Source # (<) :: SourceStrictness -> SourceStrictness -> Bool Source # (<=) :: SourceStrictness -> SourceStrictness -> Bool Source # (>) :: SourceStrictness -> SourceStrictness -> Bool Source # (>=) :: SourceStrictness -> SourceStrictness -> Bool Source # max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source # min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source # | |
| Ord SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source # | |
| 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 Source # (<) :: ArrayException -> ArrayException -> Bool Source # (<=) :: ArrayException -> ArrayException -> Bool Source # (>) :: ArrayException -> ArrayException -> Bool Source # (>=) :: ArrayException -> ArrayException -> Bool Source # max :: ArrayException -> ArrayException -> ArrayException Source # min :: ArrayException -> ArrayException -> ArrayException Source # | |
| Ord AsyncException | Since: base-4.2.0.0 |
Defined in GHC.Internal.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering Source # (<) :: AsyncException -> AsyncException -> Bool Source # (<=) :: AsyncException -> AsyncException -> Bool Source # (>) :: AsyncException -> AsyncException -> Bool Source # (>=) :: AsyncException -> AsyncException -> Bool Source # max :: AsyncException -> AsyncException -> AsyncException Source # min :: AsyncException -> AsyncException -> AsyncException Source # | |
| 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 Source # (<) :: BufferMode -> BufferMode -> Bool Source # (<=) :: BufferMode -> BufferMode -> Bool Source # (>) :: BufferMode -> BufferMode -> Bool Source # (>=) :: BufferMode -> BufferMode -> Bool Source # max :: BufferMode -> BufferMode -> BufferMode Source # min :: BufferMode -> BufferMode -> BufferMode Source # | |
| 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 Source # (<) :: NewlineMode -> NewlineMode -> Bool Source # (<=) :: NewlineMode -> NewlineMode -> Bool Source # (>) :: NewlineMode -> NewlineMode -> Bool Source # (>=) :: NewlineMode -> NewlineMode -> Bool Source # max :: NewlineMode -> NewlineMode -> NewlineMode Source # min :: NewlineMode -> NewlineMode -> NewlineMode Source # | |
| Ord IOMode | Since: base-4.2.0.0 |
| Ord Int16 | Since: base-2.1 |
Defined in GHC.Internal.Int | |
| Ord Int32 | Since: base-2.1 |
Defined in GHC.Internal.Int | |
| Ord Int64 | Since: base-2.1 |
Defined in GHC.Internal.Int | |
| Ord Int8 | Since: base-2.1 |
| 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 | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CFsBlkCnt | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CFsFilCnt | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CGid | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CId | |
| Ord CIno | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CKey | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CMode | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CNfds | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CNlink | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord COff | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CPid | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CRLim | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CSocklen | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CSpeed | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CSsize | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CTcflag | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CTimer | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord CUid | |
Defined in GHC.Internal.System.Posix.Types | |
| Ord Fd | |
| Ord SomeNat | Since: base-4.7.0.0 |
Defined in GHC.Internal.TypeNats | |
| Ord GeneralCategory | Since: base-2.1 |
Defined in GHC.Internal.Unicode Methods compare :: GeneralCategory -> GeneralCategory -> Ordering Source # (<) :: GeneralCategory -> GeneralCategory -> Bool Source # (<=) :: GeneralCategory -> GeneralCategory -> Bool Source # (>) :: GeneralCategory -> GeneralCategory -> Bool Source # (>=) :: GeneralCategory -> GeneralCategory -> Bool Source # max :: GeneralCategory -> GeneralCategory -> GeneralCategory Source # min :: GeneralCategory -> GeneralCategory -> GeneralCategory Source # | |
| Ord Word16 | Since: base-2.1 |
| Ord Word32 | Since: base-2.1 |
| Ord Word64 | Since: base-2.1 |
| Ord Word8 | Since: base-2.1 |
Defined in GHC.Internal.Word | |
| Ord Ordering | |
Defined in GHC.Classes | |
| Ord TyCon | |
Defined in GHC.Classes | |
| 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 |
Defined in GHC.Classes | |
| 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 |
Defined in Data.Semigroup | |
| Ord a => Ord (Min a) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
| Ord m => Ord (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering Source # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source # | |
| 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) | |
Defined in Basement.BoxedArray | |
| (ByteSwap a, Ord a) => Ord (BE a) | |
Defined in Basement.Endianness | |
| (ByteSwap a, Ord a) => Ord (LE a) | |
Defined in Basement.Endianness | |
| Ord (FinalPtr a) | |
Defined in Basement.FinalPtr Methods compare :: FinalPtr a -> FinalPtr a -> Ordering Source # (<) :: FinalPtr a -> FinalPtr a -> Bool Source # (<=) :: FinalPtr a -> FinalPtr a -> Bool Source # (>) :: FinalPtr a -> FinalPtr a -> Bool Source # (>=) :: FinalPtr a -> FinalPtr a -> Bool Source # | |
| Ord (CountOf ty) | |
Defined in Basement.Types.OffsetSize Methods compare :: CountOf ty -> CountOf ty -> Ordering Source # (<) :: CountOf ty -> CountOf ty -> Bool Source # (<=) :: CountOf ty -> CountOf ty -> Bool Source # (>) :: CountOf ty -> CountOf ty -> Bool Source # (>=) :: CountOf ty -> CountOf ty -> Bool Source # | |
| Ord (Offset ty) | |
Defined in Basement.Types.OffsetSize | |
| (PrimType ty, Ord ty) => Ord (UArray ty) | |
Defined in Basement.UArray.Base | |
| (PrimType ty, Ord ty) => Ord (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods compare :: ChunkedUArray ty -> ChunkedUArray ty -> Ordering Source # (<) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # (<=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # (>) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # (>=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # max :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty Source # min :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty Source # | |
| Ord a => Ord (DList a) Source # | |
Defined in Foundation.List.DList | |
| Ord a => Ord (NonEmpty a) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Base Methods compare :: NonEmpty a -> NonEmpty a -> Ordering Source # (<) :: NonEmpty a -> NonEmpty a -> Bool Source # (<=) :: NonEmpty a -> NonEmpty a -> Bool Source # (>) :: NonEmpty a -> NonEmpty a -> Bool Source # (>=) :: NonEmpty a -> NonEmpty a -> Bool Source # | |
| Ord a => Ord (Identity a) | Since: base-4.8.0.0 |
Defined in GHC.Internal.Data.Functor.Identity Methods compare :: Identity a -> Identity a -> Ordering Source # (<) :: Identity a -> Identity a -> Bool Source # (<=) :: Identity a -> Identity a -> Bool Source # (>) :: Identity a -> Identity a -> Bool Source # (>=) :: Identity a -> Identity a -> Bool Source # | |
| Ord a => Ord (First a) | Since: base-2.1 |
Defined in GHC.Internal.Data.Monoid | |
| Ord a => Ord (Last a) | Since: base-2.1 |
| Ord a => Ord (Dual a) | Since: base-2.1 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord a => Ord (Product a) | Since: base-2.1 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord a => Ord (Sum a) | Since: base-2.1 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| Ord (ForeignPtr a) | Since: base-2.1 |
Defined in GHC.Internal.ForeignPtr Methods compare :: ForeignPtr a -> ForeignPtr a -> Ordering Source # (<) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (<=) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (>) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (>=) :: ForeignPtr a -> ForeignPtr a -> Bool Source # max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source # min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source # | |
| Ord a => Ord (ZipList a) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Functor.ZipList | |
| 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.1 |
Defined in GHC.Internal.Ptr | |
| Integral a => Ord (Ratio a) | Since: base-2.0.1 |
Defined in GHC.Internal.Real | |
| Ord (SNat n) | Since: base-4.19.0.0 |
| Ord a => Ord (Maybe a) | Since: base-2.1 |
Defined in GHC.Internal.Maybe | |
| 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 Methods compare :: BlockN n a -> BlockN n a -> Ordering Source # (<) :: BlockN n a -> BlockN n a -> Bool Source # (<=) :: BlockN n a -> BlockN n a -> Bool Source # (>) :: BlockN n a -> BlockN n a -> Bool Source # (>=) :: BlockN n a -> BlockN n a -> Bool Source # | |
| Ord a => Ord (ListN n a) | |
Defined in Basement.Sized.List | |
| (Ord a, Ord b) => Ord (These a b) | |
Defined in Basement.These | |
| (Ord a, Ord b) => Ord (Tuple2 a b) Source # | |
Defined in Foundation.Tuple Methods compare :: Tuple2 a b -> Tuple2 a b -> Ordering Source # (<) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (<=) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (>) :: Tuple2 a b -> Tuple2 a b -> Bool Source # (>=) :: Tuple2 a b -> Tuple2 a b -> Bool Source # | |
| (Ord a, Ord b) => Ord (Either a b) | Since: base-2.1 |
Defined in GHC.Internal.Data.Either Methods compare :: Either a b -> Either a b -> Ordering Source # (<) :: Either a b -> Either a b -> Bool Source # (<=) :: Either a b -> Either a b -> Bool Source # (>) :: Either a b -> Either a b -> Bool Source # (>=) :: Either a b -> Either a b -> Bool Source # | |
| 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 |
Defined in GHC.Internal.Generics | |
| Ord (V1 p) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| (Ord a, Ord b) => Ord (a, b) | |
| (Ord a, Ord b, Ord c) => Ord (Tuple3 a b c) Source # | |
Defined in Foundation.Tuple Methods compare :: Tuple3 a b c -> Tuple3 a b c -> Ordering Source # (<) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (<=) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (>) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # (>=) :: Tuple3 a b c -> Tuple3 a b c -> Bool Source # max :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c Source # min :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c Source # | |
| Ord a => Ord (Const a b) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const | |
| 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 Source # (<) :: Generically1 f a -> Generically1 f a -> Bool Source # (<=) :: Generically1 f a -> Generically1 f a -> Bool Source # (>) :: Generically1 f a -> Generically1 f a -> Bool Source # (>=) :: Generically1 f a -> Generically1 f a -> Bool Source # max :: Generically1 f a -> Generically1 f a -> Generically1 f a Source # min :: Generically1 f a -> Generically1 f a -> Generically1 f a Source # | |
| 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 Source # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source # | |
| Ord (URec Char p) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec Char p -> URec Char p -> Ordering Source # (<) :: URec Char p -> URec Char p -> Bool Source # (<=) :: URec Char p -> URec Char p -> Bool Source # (>) :: URec Char p -> URec Char p -> Bool Source # (>=) :: URec Char p -> URec Char p -> Bool Source # | |
| Ord (URec Double p) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec Double p -> URec Double p -> Ordering Source # (<) :: URec Double p -> URec Double p -> Bool Source # (<=) :: URec Double p -> URec Double p -> Bool Source # (>) :: URec Double p -> URec Double p -> Bool Source # (>=) :: URec Double p -> URec Double p -> Bool Source # max :: URec Double p -> URec Double p -> URec Double p Source # min :: URec Double p -> URec Double p -> URec Double p Source # | |
| Ord (URec Float p) | |
Defined in GHC.Internal.Generics Methods compare :: URec Float p -> URec Float p -> Ordering Source # (<) :: URec Float p -> URec Float p -> Bool Source # (<=) :: URec Float p -> URec Float p -> Bool Source # (>) :: URec Float p -> URec Float p -> Bool Source # (>=) :: URec Float p -> URec Float p -> Bool Source # max :: URec Float p -> URec Float p -> URec Float p Source # min :: URec Float p -> URec Float p -> URec Float p Source # | |
| Ord (URec Int p) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec Int p -> URec Int p -> Ordering Source # (<) :: URec Int p -> URec Int p -> Bool Source # (<=) :: URec Int p -> URec Int p -> Bool Source # (>) :: URec Int p -> URec Int p -> Bool Source # (>=) :: URec Int p -> URec Int p -> Bool Source # | |
| Ord (URec Word p) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods compare :: URec Word p -> URec Word p -> Ordering Source # (<) :: URec Word p -> URec Word p -> Bool Source # (<=) :: URec Word p -> URec Word p -> Bool Source # (>) :: URec Word p -> URec Word p -> Bool Source # (>=) :: URec Word p -> URec Word p -> Bool Source # | |
| (Ord a, Ord b, Ord c) => Ord (a, b, c) | |
Defined in GHC.Classes | |
| (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 Source # (<) :: Product f g a -> Product f g a -> Bool Source # (<=) :: Product f g a -> Product f g a -> Bool Source # (>) :: Product f g a -> Product f g a -> Bool Source # (>=) :: Product f g a -> Product f g a -> Bool Source # max :: Product f g a -> Product f g a -> Product f g a Source # min :: Product f g a -> Product f g a -> Product f g a Source # | |
| (Ord (f a), Ord (g a)) => Ord (Sum f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Sum | |
| (Ord a, Ord b, Ord c, Ord d) => Ord (Tuple4 a b c d) Source # | |
Defined in Foundation.Tuple Methods compare :: Tuple4 a b c d -> Tuple4 a b c d -> Ordering Source # (<) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (<=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (>) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # (>=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool Source # max :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d Source # min :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d Source # | |
| (Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Generics Methods compare :: (f :*: g) p -> (f :*: g) p -> Ordering Source # (<) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (<=) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (>) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (>=) :: (f :*: g) p -> (f :*: g) p -> Bool Source # | |
| (Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Generics Methods compare :: (f :+: g) p -> (f :+: g) p -> Ordering Source # (<) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (<=) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (>) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (>=) :: (f :+: g) p -> (f :+: g) p -> Bool Source # | |
| 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 Methods compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering Source # (<) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (>) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source # min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source # | |
| 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 Source # (<) :: Compose f g a -> Compose f g a -> Bool Source # (<=) :: Compose f g a -> Compose f g a -> Bool Source # (>) :: Compose f g a -> Compose f g a -> Bool Source # (>=) :: Compose f g a -> Compose f g a -> Bool Source # max :: Compose f g a -> Compose f g a -> Compose f g a Source # min :: Compose f g a -> Compose f g a -> Compose f g a Source # | |
| Ord (f (g p)) => Ord ((f :.: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Generics Methods compare :: (f :.: g) p -> (f :.: g) p -> Ordering Source # (<) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (<=) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (>) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (>=) :: (f :.: g) p -> (f :.: g) p -> Bool Source # | |
| Ord (f p) => Ord (M1 i c f p) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Generics Methods compare :: M1 i c f p -> M1 i c f p -> Ordering Source # (<) :: M1 i c f p -> M1 i c f p -> Bool Source # (<=) :: M1 i c f p -> M1 i c f p -> Bool Source # (>) :: M1 i c f p -> M1 i c f p -> Bool Source # (>=) :: M1 i c f p -> M1 i c f p -> Bool Source # | |
| (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 Source # (<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source # min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source # min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source # min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source # | |
| (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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source # | |
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
class Bounded a where Source #
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] Source #
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] Source #
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] Source #
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 Source #
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 Source #
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 Source # | |
| Functor Check Source # | |
| Functor DList Source # | |
| Functor Partial Source # | |
| 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.1 |
| Functor Par1 | Since: base-4.9.0.0 |
| Functor P | Since: base-4.8.0.0 |
| Functor ReadP | Since: base-2.1 |
| Functor IO | Since: base-2.1 |
| Functor Maybe | Since: base-2.1 |
| Functor Solo | Since: base-4.15 |
| Functor [] | Since: base-2.1 |
| Monad m => Functor (WrappedMonad m) | Since: base-2.1 |
Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a Source # | |
| Functor (Arg a) | Since: base-4.9.0.0 |
| Functor (Vect n) | |
| Functor m => Functor (ResourceT m) Source # | |
| Functor (Parser input) Source # | |
| Functor (Result input) Source # | |
| Functor (MonadRandomState gen) Source # | |
Defined in Foundation.Random.DRG Methods fmap :: (a -> b) -> MonadRandomState gen a -> MonadRandomState gen b Source # (<$) :: a -> MonadRandomState gen b -> MonadRandomState gen a Source # | |
| 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 Source # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 Source # | |
| 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.1 |
| Functor ((,) a) | Since: base-2.1 |
| 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 Source # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source # | |
| Monad m => Functor (Reader r m) | |
| Monad m => Functor (State s m) | |
| Monad m => Functor (ZipSink i m) Source # | |
| Functor m => Functor (ExceptT e m) Source # | |
| Functor m => Functor (ReaderT r m) Source # | |
| Functor m => Functor (StateT s m) Source # | |
| Functor m => Functor (Kleisli m a) | Since: base-4.14.0.0 |
| Functor (Const m :: Type -> Type) | Since: base-2.1 |
| 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 Source # (<$) :: a -> Generically1 f b -> Generically1 f a Source # | |
| 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 |
| (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) Source # | |
| (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 |
| Functor ((->) r) | Since: base-2.1 |
| (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 |
| Monad state => Functor (Builder collection mutCollection step state err) | |
| Functor ((,,,,,) a b c d e) | Since: base-4.18.0.0 |
| Functor ((,,,,,,) a b c d e f) | Since: base-4.18.0.0 |
class Integral a where Source #
Integral Literal support
e.g. 123 :: Integer 123 :: Word8
Methods
fromInteger :: Integer -> a Source #
Instances
class Fractional a where Source #
Fractional Literal support
e.g. 1.2 :: Double 0.03 :: Float
Methods
fromRational :: Rational -> a Source #
Instances
| Fractional CDouble | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CDouble Source # | |
| Fractional CFloat | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CFloat Source # | |
| Fractional Rational | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Rational Source # | |
| Fractional Double | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Double Source # | |
| Fractional Float | |
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Float Source # | |
class HasNegation a where Source #
Negation support
e.g. -(f x)
Instances
class (forall a. Functor (p a)) => Bifunctor (p :: Type -> Type -> Type) where Source #
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 Source #
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 |
Defined in Data.Bifunctor | |
class Functor f => Applicative (f :: Type -> Type) where Source #
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 Source #
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 Source #
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 Source #
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 Source #
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 Source # | |
| Applicative Check Source # | |
| Applicative DList Source # | |
| Applicative Partial Source # | |
Defined in Foundation.Partial | |
| Applicative NonEmpty | Since: base-4.9.0.0 |
Defined in GHC.Internal.Base | |
| Applicative STM | Since: base-4.8.0.0 |
| Applicative Identity | Since: base-4.8.0.0 |
Defined in GHC.Internal.Data.Functor.Identity | |
| 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 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
| 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.1 |
Defined in GHC.Internal.Functor.ZipList | |
| Applicative Par1 | Since: base-4.9.0.0 |
| Applicative P | Since: base-4.5.0.0 |
| Applicative ReadP | Since: base-4.6.0.0 |
Defined in GHC.Internal.Text.ParserCombinators.ReadP | |
| Applicative IO | Since: base-2.1 |
| Applicative Maybe | Since: base-2.1 |
| Applicative Solo | Since: base-4.15 |
| Applicative [] | Since: base-2.1 |
| Monad m => Applicative (WrappedMonad m) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a Source # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source # | |
| Applicative m => Applicative (ResourceT m) Source # | |
Defined in Foundation.Conduit.Internal Methods pure :: a -> ResourceT m a Source # (<*>) :: ResourceT m (a -> b) -> ResourceT m a -> ResourceT m b Source # liftA2 :: (a -> b -> c) -> ResourceT m a -> ResourceT m b -> ResourceT m c Source # (*>) :: ResourceT m a -> ResourceT m b -> ResourceT m b Source # (<*) :: ResourceT m a -> ResourceT m b -> ResourceT m a Source # | |
| ParserSource input => Applicative (Parser input) Source # | |
Defined in Foundation.Parser Methods pure :: a -> Parser input a Source # (<*>) :: Parser input (a -> b) -> Parser input a -> Parser input b Source # liftA2 :: (a -> b -> c) -> Parser input a -> Parser input b -> Parser input c Source # (*>) :: Parser input a -> Parser input b -> Parser input b Source # (<*) :: Parser input a -> Parser input b -> Parser input a Source # | |
| Applicative (MonadRandomState gen) Source # | |
Defined in Foundation.Random.DRG Methods pure :: a -> MonadRandomState gen a Source # (<*>) :: MonadRandomState gen (a -> b) -> MonadRandomState gen a -> MonadRandomState gen b Source # liftA2 :: (a -> b -> c) -> MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen c Source # (*>) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen b Source # (<*) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen a Source # | |
| Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0 |
Defined in GHC.Internal.Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 Source # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source # | |
| Applicative (Either e) | Since: base-3.0 |
Defined in GHC.Internal.Data.Either | |
| 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.1 |
| Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 Source # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source # | |
| Monad m => Applicative (Reader r m) | |
Defined in Basement.Compat.MonadTrans Methods pure :: a -> Reader r m a Source # (<*>) :: Reader r m (a -> b) -> Reader r m a -> Reader r m b Source # liftA2 :: (a -> b -> c) -> Reader r m a -> Reader r m b -> Reader r m c Source # (*>) :: Reader r m a -> Reader r m b -> Reader r m b Source # (<*) :: Reader r m a -> Reader r m b -> Reader r m a Source # | |
| Monad m => Applicative (State s m) | |
Defined in Basement.Compat.MonadTrans | |
| Monad m => Applicative (ZipSink i m) Source # | |
Defined in Foundation.Conduit.Internal Methods pure :: a -> ZipSink i m a Source # (<*>) :: ZipSink i m (a -> b) -> ZipSink i m a -> ZipSink i m b Source # liftA2 :: (a -> b -> c) -> ZipSink i m a -> ZipSink i m b -> ZipSink i m c Source # (*>) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m b Source # (<*) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m a Source # | |
| Monad m => Applicative (ExceptT e m) Source # | |
Defined in Foundation.Monad.Except Methods pure :: a -> ExceptT e m a Source # (<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b Source # liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c Source # (*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b Source # (<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a Source # | |
| Applicative m => Applicative (ReaderT r m) Source # | |
Defined in Foundation.Monad.Reader Methods pure :: a -> ReaderT r m a Source # (<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b Source # liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c Source # (*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b Source # (<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a Source # | |
| (Applicative m, Monad m) => Applicative (StateT s m) Source # | |
Defined in Foundation.Monad.State Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source # | |
| Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0 |
Defined in GHC.Internal.Control.Arrow Methods pure :: a0 -> Kleisli m a a0 Source # (<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source # liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c Source # (*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source # (<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0 Source # | |
| Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1 |
Defined in GHC.Internal.Data.Functor.Const | |
| 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 Source # (<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source # liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source # (*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source # (<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source # | |
| Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0 |
| (Monoid a, Monoid b) => Applicative ((,,) a b) | Since: base-4.14.0.0 |
Defined in GHC.Internal.Base | |
| (Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product Methods pure :: a -> Product f g a Source # (<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b Source # liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source # (*>) :: Product f g a -> Product f g b -> Product f g b Source # (<*) :: Product f g a -> Product f g b -> Product f g a Source # | |
| Applicative (Conduit i o m) Source # | |
Defined in Foundation.Conduit.Internal Methods pure :: a -> Conduit i o m a Source # (<*>) :: Conduit i o m (a -> b) -> Conduit i o m a -> Conduit i o m b Source # liftA2 :: (a -> b -> c) -> Conduit i o m a -> Conduit i o m b -> Conduit i o m c Source # (*>) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m b Source # (<*) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m a Source # | |
| (Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| 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 Methods pure :: a0 -> (a, b, c, a0) Source # (<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source # liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) Source # (*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source # (<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) Source # | |
| Applicative ((->) r) | Since: base-2.1 |
| (Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a Source # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source # (*>) :: Compose f g a -> Compose f g b -> Compose f g b Source # (<*) :: Compose f g a -> Compose f g b -> Compose f g a Source # | |
| (Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
| Monad state => Applicative (Builder collection mutCollection step state err) | |
Defined in Basement.MutableBuilder Methods pure :: a -> Builder collection mutCollection step state err a Source # (<*>) :: Builder collection mutCollection step state err (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b Source # 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 Source # (*>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b Source # (<*) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a Source # | |
class Applicative m => Monad (m :: Type -> Type) where Source #
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 Source #
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 Source #
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 Source # | |
| Monad Check Source # | |
| Monad DList Source # | |
| Monad Partial Source # | |
| 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.1 |
| Monad ReadP | Since: base-2.1 |
| Monad IO | Since: base-2.1 |
| Monad Maybe | Since: base-2.1 |
| Monad Solo | Since: base-4.15 |
| Monad [] | Since: base-2.1 |
| 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 Source # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source # return :: a -> WrappedMonad m a Source # | |
| Monad m => Monad (ResourceT m) Source # | |
| ParserSource input => Monad (Parser input) Source # | |
| Monad (MonadRandomState gen) Source # | |
Defined in Foundation.Random.DRG Methods (>>=) :: MonadRandomState gen a -> (a -> MonadRandomState gen b) -> MonadRandomState gen b Source # (>>) :: MonadRandomState gen a -> MonadRandomState gen b -> MonadRandomState gen b Source # return :: a -> MonadRandomState gen a Source # | |
| ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b Source # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source # return :: a0 -> ArrowMonad a a0 Source # | |
| 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.1 |
| 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) Source # | |
| Monad m => Monad (ReaderT r m) Source # | |
| (Functor m, Monad m) => Monad (StateT s m) Source # | |
| 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) Source # | |
| (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.1 |
| 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 Source # (>>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b Source # return :: a -> Builder collection mutCollection step state err a Source # | |
(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 Source #
Same as >>=, but with the arguments interchanged.
as >>= f == f =<< as
class IsString a where Source #
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 Source #
Instances
The IsList class and its methods are intended to be used in
conjunction with the OverloadedLists extension.
Since: base-4.7.0.0
Associated Types
The Item type function returns the type of items of the structure
l.
Methods
fromList :: [Item l] -> l Source #
The fromList function constructs the structure l from the given
list of Item l
fromListN :: Int -> [Item l] -> l Source #
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
toList :: l -> [Item l] Source #
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 Source #
Number literals, convertible through the generic Integer type.
all number are Enum'erable, meaning that you can move to next element
Instances
| IsIntegral Word128 | |
| IsIntegral Word256 | |
| IsIntegral CBool | |
| IsIntegral CChar | |
| IsIntegral CInt | |
| IsIntegral CIntMax | |
| IsIntegral CIntPtr | |
| IsIntegral CLLong | |
| IsIntegral CLong | |
| IsIntegral CPtrdiff | |
| IsIntegral CSChar | |
| IsIntegral CShort | |
| IsIntegral CSigAtomic | |
Defined in Basement.Numerical.Number Methods toInteger :: CSigAtomic -> Integer Source # | |
| IsIntegral CSize | |
| IsIntegral CUChar | |
| IsIntegral CUInt | |
| IsIntegral CUIntMax | |
| IsIntegral CUIntPtr | |
| IsIntegral CULLong | |
| IsIntegral CULong | |
| IsIntegral CUShort | |
| IsIntegral CWchar | |
| IsIntegral Int16 | |
| IsIntegral Int32 | |
| IsIntegral Int64 | |
| IsIntegral Int8 | |
| IsIntegral Word16 | |
| IsIntegral Word32 | |
| IsIntegral Word64 | |
| IsIntegral Word8 | |
| IsIntegral Integer | |
| IsIntegral Natural | |
| IsIntegral Int | |
| IsIntegral Word | |
| KnownNat n => IsIntegral (Zn n) | |
| (KnownNat n, NatWithinBound Word64 n) => IsIntegral (Zn64 n) | |
| IsIntegral (CountOf ty) | |
| IsIntegral (Offset ty) | |
class IsIntegral a => IsNatural a where Source #
Non Negative Number literals, convertible through the generic Natural type
Instances
| IsNatural Word128 | |
| IsNatural Word256 | |
| IsNatural CSize | |
| IsNatural CUChar | |
| IsNatural CUInt | |
| IsNatural CUIntMax | |
| IsNatural CUIntPtr | |
| IsNatural CULLong | |
| IsNatural CULong | |
| IsNatural CUShort | |
| IsNatural Word16 | |
| IsNatural Word32 | |
| IsNatural Word64 | |
| IsNatural Word8 | |
| IsNatural Natural | |
| IsNatural Word | |
| KnownNat n => IsNatural (Zn n) | |
| (KnownNat n, NatWithinBound Word64 n) => IsNatural (Zn64 n) | |
| IsNatural (CountOf ty) | |
| IsNatural (Offset ty) | |
types that have sign and can be made absolute
class Additive a where Source #
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
Instances
| Additive Word128 | |
| Additive Word256 | |
| Additive NanoSeconds Source # | |
Defined in Foundation.Time.Types Methods azero :: NanoSeconds Source # (+) :: NanoSeconds -> NanoSeconds -> NanoSeconds Source # scale :: IsNatural n => n -> NanoSeconds -> NanoSeconds Source # | |
| Additive Seconds Source # | |
| 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 Source # (+) :: CSUSeconds -> CSUSeconds -> CSUSeconds Source # scale :: IsNatural n => n -> CSUSeconds -> CSUSeconds Source # | |
| Additive CShort | |
| Additive CSigAtomic | |
Defined in Basement.Numerical.Additive Methods azero :: CSigAtomic Source # (+) :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # scale :: IsNatural n => n -> CSigAtomic -> CSigAtomic Source # | |
| 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 Source #
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 Source #
Methods
(-) :: a -> a -> Difference a infixl 6 Source #
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 Source # | |||||
| Subtractive CShort | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Subtractive CSigAtomic | |||||
Defined in Basement.Numerical.Subtractive Associated Types
Methods (-) :: CSigAtomic -> CSigAtomic -> Difference CSigAtomic Source # | |||||
| 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 Source #
Represent class of things that can be multiplied together
x * midentity = x midentity * x = x
Methods
Identity element over multiplication
(*) :: a -> a -> a infixl 7 Source #
Multiplication of 2 elements that result in another element
(^) :: (IsNatural n, Enum n, IDivisible n) => a -> n -> a infixr 8 Source #
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 Source # (*) :: CSUSeconds -> CSUSeconds -> CSUSeconds Source # (^) :: (IsNatural n, Enum n, IDivisible n) => CSUSeconds -> n -> CSUSeconds Source # | |
| Multiplicative CShort | |
| Multiplicative CSigAtomic | |
Defined in Basement.Numerical.Multiplicative Methods midentity :: CSigAtomic Source # (*) :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # (^) :: (IsNatural n, Enum n, IDivisible n) => CSigAtomic -> n -> CSigAtomic Source # | |
| 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 Source #
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 Source # mod :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # divMod :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) Source # | |
| 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 Source #
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 Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] Source # | |||||
| Show1 Maybe | Since: base-4.9.0.0 | ||||
| MonadFailure Maybe | |||||
| Alternative Maybe | Picks the leftmost Since: base-2.1 | ||||
| Applicative Maybe | Since: base-2.1 | ||||
| Functor Maybe | Since: base-2.1 | ||||
| Monad Maybe | Since: base-2.1 | ||||
| MonadPlus Maybe | Picks the leftmost Since: base-2.1 | ||||
| MonadFail Maybe | Since: base-4.9.0.0 | ||||
| MonadFix Maybe | Since: base-2.1 | ||||
| Foldable Maybe | Since: base-2.1 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Maybe m -> m Source # foldMap :: Monoid m => (a -> m) -> Maybe a -> m Source # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m Source # foldr :: (a -> b -> b) -> b -> Maybe a -> b Source # foldr' :: (a -> b -> b) -> b -> Maybe a -> b Source # foldl :: (b -> a -> b) -> b -> Maybe a -> b Source # foldl' :: (b -> a -> b) -> b -> Maybe a -> b Source # foldr1 :: (a -> a -> a) -> Maybe a -> a Source # foldl1 :: (a -> a -> a) -> Maybe a -> a Source # toList :: Maybe a -> [a] Source # null :: Maybe a -> Bool Source # length :: Maybe a -> Int Source # elem :: Eq a => a -> Maybe a -> Bool Source # maximum :: Ord a => Maybe a -> a Source # minimum :: Ord a => Maybe a -> a Source # | |||||
| Traversable Maybe | Since: base-2.1 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| Generic1 Maybe | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| NormalForm a => NormalForm (Maybe a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Maybe a -> () Source # | |||||
| Arbitrary a => Arbitrary (Maybe a) Source # | |||||
| IsField a => IsField (Maybe a) Source # | |||||
| Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner Since: base-2.1 | ||||
| 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) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) Source # toConstr :: Maybe a -> Constr Source # dataTypeOf :: Maybe a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) Source # gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source # | |||||
| 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.1 | ||||
| Show a => Show (Maybe a) | Since: base-2.1 | ||||
| Eq a => Eq (Maybe a) | Since: base-2.1 | ||||
| Ord a => Ord (Maybe a) | Since: base-2.1 | ||||
Defined in GHC.Internal.Maybe | |||||
| SingI ('Nothing :: Maybe a) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| From (Maybe a) (Either () a) | |||||
| 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.1 |
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering Source # toConstr :: Ordering -> Constr Source # dataTypeOf :: Ordering -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) Source # gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source # | |
| Bounded Ordering | Since: base-2.1 |
| Enum Ordering | Since: base-2.1 |
Defined in GHC.Internal.Enum Methods succ :: Ordering -> Ordering Source # pred :: Ordering -> Ordering Source # toEnum :: Int -> Ordering Source # fromEnum :: Ordering -> Int Source # enumFrom :: Ordering -> [Ordering] Source # enumFromThen :: Ordering -> Ordering -> [Ordering] Source # enumFromTo :: Ordering -> Ordering -> [Ordering] Source # enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] Source # | |
| Generic Ordering | |
Defined in GHC.Internal.Generics | |
| Read Ordering | Since: base-2.1 |
| Show Ordering | Since: base-2.1 |
| Eq Ordering | |
| Ord Ordering | |
Defined in GHC.Classes | |
| type Rep Ordering | Since: base-4.6.0.0 |
Instances
| BitOps Bool | |||||
Defined in Basement.Bits Methods (.&.) :: Bool -> Bool -> Bool Source # (.|.) :: Bool -> Bool -> Bool Source # (.^.) :: Bool -> Bool -> Bool Source # (.<<.) :: Bool -> CountOf Bool -> Bool Source # (.>>.) :: Bool -> CountOf Bool -> Bool Source # bit :: Offset Bool -> Bool Source # isBitSet :: Bool -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Bool | |||||
| NormalForm Bool | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Bool -> () Source # | |||||
| Arbitrary Bool Source # | |||||
| IsProperty Bool Source # | |||||
| IsField Bool Source # | |||||
| Bits Bool | Interpret Since: base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Bool -> Bool -> Bool Source # (.|.) :: Bool -> Bool -> Bool Source # xor :: Bool -> Bool -> Bool Source # complement :: Bool -> Bool Source # shift :: Bool -> Int -> Bool Source # rotate :: Bool -> Int -> Bool Source # setBit :: Bool -> Int -> Bool Source # clearBit :: Bool -> Int -> Bool Source # complementBit :: Bool -> Int -> Bool Source # testBit :: Bool -> Int -> Bool Source # bitSizeMaybe :: Bool -> Maybe Int Source # bitSize :: Bool -> Int Source # isSigned :: Bool -> Bool Source # shiftL :: Bool -> Int -> Bool Source # unsafeShiftL :: Bool -> Int -> Bool Source # shiftR :: Bool -> Int -> Bool Source # unsafeShiftR :: Bool -> Int -> Bool Source # rotateL :: Bool -> Int -> Bool Source # | |||||
| FiniteBits Bool | Since: base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Bool -> Int Source # countLeadingZeros :: Bool -> Int Source # countTrailingZeros :: Bool -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool Source # toConstr :: Bool -> Constr Source # dataTypeOf :: Bool -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) Source # gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source # | |||||
| Bounded Bool | Since: base-2.1 | ||||
| Enum Bool | Since: base-2.1 | ||||
| Storable Bool | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Bool -> Int Source # alignment :: Bool -> Int Source # peekElemOff :: Ptr Bool -> Int -> IO Bool Source # pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Bool Source # pokeByteOff :: Ptr b -> Int -> Bool -> IO () Source # | |||||
| 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.1 | ||||
| Show Bool | Since: base-2.1 | ||||
| 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) Source # | |||||
| 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 -> () Source # | |||||
| 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 Source # primShiftToBytes :: Proxy Char -> Int Source # primBaUIndex :: ByteArray# -> Offset Char -> Char Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () Source # primAddrIndex :: Addr# -> Offset Char -> Char Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () Source # | |||||
| Arbitrary Char Source # | |||||
| Storable Char Source # | |||||
| StorableFixed Char Source # | |||||
| IsField Char Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char Source # toConstr :: Char -> Constr Source # dataTypeOf :: Char -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) Source # gmapT :: (forall b. Data b => b -> b) -> Char -> Char Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source # | |||||
| Bounded Char | Since: base-2.1 | ||||
| Enum Char | Since: base-2.1 | ||||
| Storable Char | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Char -> Int Source # alignment :: Char -> Int Source # peekElemOff :: Ptr Char -> Int -> IO Char Source # pokeElemOff :: Ptr Char -> Int -> Char -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Char Source # pokeByteOff :: Ptr b -> Int -> Char -> IO () Source # | |||||
| Read Char | Since: base-2.1 | ||||
| Show Char | Since: base-2.1 | ||||
| Eq Char | |||||
| Ord Char | |||||
| Generic1 (URec Char :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| IsField [Char] Source # | |||||
| Foldable (UChar :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UChar m -> m Source # foldMap :: Monoid m => (a -> m) -> UChar a -> m Source # foldMap' :: Monoid m => (a -> m) -> UChar a -> m Source # foldr :: (a -> b -> b) -> b -> UChar a -> b Source # foldr' :: (a -> b -> b) -> b -> UChar a -> b Source # foldl :: (b -> a -> b) -> b -> UChar a -> b Source # foldl' :: (b -> a -> b) -> b -> UChar a -> b Source # foldr1 :: (a -> a -> a) -> UChar a -> a Source # foldl1 :: (a -> a -> a) -> UChar a -> a Source # toList :: UChar a -> [a] Source # null :: UChar a -> Bool Source # length :: UChar a -> Int Source # elem :: Eq a => a -> UChar a -> Bool Source # maximum :: Ord a => UChar a -> a Source # minimum :: Ord a => UChar a -> a Source # | |||||
| Traversable (UChar :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| 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 Methods compare :: URec Char p -> URec Char p -> Ordering Source # (<) :: URec Char p -> URec Char p -> Bool Source # (<=) :: URec Char p -> URec Char p -> Bool Source # (>) :: URec Char p -> URec Char p -> Bool Source # (>=) :: URec Char p -> URec Char p -> Bool Source # | |||||
| 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 -> () Source # | |||||
| PrimType Char7 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char7 -> CountOf Word8 Source # primShiftToBytes :: Proxy Char7 -> Int Source # primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () Source # primAddrIndex :: Addr# -> Offset Char7 -> Char7 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () Source # | |||||
| Arbitrary Char7 Source # | |||||
| Show Char7 | |||||
| Eq Char7 | |||||
| Ord Char7 | |||||
Defined in Basement.Types.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 | ||||||||
| PrimMonad IO | |||||||||
Defined in Basement.Monad Associated Types
Methods primitive :: (State# (PrimState IO) -> (# State# (PrimState IO), a #)) -> IO a Source # primThrow :: Exception e => e -> IO a Source # unPrimMonad :: IO a -> State# (PrimState IO) -> (# State# (PrimState IO), a #) Source # primVarNew :: a -> IO (PrimVar IO a) Source # | |||||||||
| MonadBracket IO Source # | |||||||||
Defined in Foundation.Monad.Exception Methods generalBracket :: IO a -> (a -> b -> IO ignored1) -> (a -> SomeException -> IO ignored2) -> (a -> IO b) -> IO b Source # | |||||||||
| MonadCatch IO Source # | |||||||||
| MonadThrow IO Source # | |||||||||
| MonadRandom IO Source # | |||||||||
Defined in Foundation.Random.Class | |||||||||
| Alternative IO | Takes the first non-throwing Since: base-4.9.0.0 | ||||||||
| Applicative IO | Since: base-2.1 | ||||||||
| Functor IO | Since: base-2.1 | ||||||||
| Monad IO | Since: base-2.1 | ||||||||
| MonadPlus IO | Takes the first non-throwing Since: base-4.9.0.0 | ||||||||
| MonadFail IO | Since: base-4.9.0.0 | ||||||||
| MonadFix IO | Since: base-2.1 | ||||||||
| 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 | ||||
Defined in Data.Bifoldable | |||||
| Bifoldable1 Either | |||||
| 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) Source # | |||||
| 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) Source # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] Source # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) Source # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] Source # | |||||
| Show2 Either | Since: base-4.9.0.0 | ||||
Defined in Data.Functor.Classes | |||||
| 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) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] Source # | |||||
| Show a => Show1 (Either a) | Since: base-4.9.0.0 | ||||
| MonadFailure (Either a) | |||||
| Applicative (Either e) | Since: base-3.0 | ||||
Defined in GHC.Internal.Data.Either | |||||
| 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 | ||||
| Foldable (Either a) | Since: base-4.7.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Either a m -> m Source # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source # foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m Source # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source # toList :: Either a a0 -> [a0] Source # null :: Either a a0 -> Bool Source # length :: Either a a0 -> Int Source # elem :: Eq a0 => a0 -> Either a a0 -> Bool Source # maximum :: Ord a0 => Either a a0 -> a0 Source # minimum :: Ord a0 => Either a a0 -> a0 Source # | |||||
| Traversable (Either a) | Since: base-4.7.0.0 | ||||
Defined in GHC.Internal.Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) Source # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) Source # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) Source # sequence :: Monad m => Either a (m a0) -> m (Either a a0) Source # | |||||
| From (Maybe a) (Either () a) | |||||
| (NormalForm l, NormalForm r) => NormalForm (Either l r) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Either l r -> () Source # | |||||
| (Arbitrary l, Arbitrary r) => Arbitrary (Either l r) Source # | |||||
| 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) Source # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) Source # toConstr :: Either a b -> Constr Source # dataTypeOf :: Either a b -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source # | |||||
| 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.1 | ||||
| (Ord a, Ord b) => Ord (Either a b) | Since: base-2.1 | ||||
Defined in GHC.Internal.Data.Either Methods compare :: Either a b -> Either a b -> Ordering Source # (<) :: Either a b -> Either a b -> Bool Source # (<=) :: Either a b -> Either a b -> Bool Source # (>) :: Either a b -> Either a b -> Bool Source # (>=) :: Either a b -> Either a b -> Bool Source # | |||||
| From (Either a b) (These a b) | |||||
| 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 | |||||
Defined in Basement.Bits Methods (.&.) :: Int8 -> Int8 -> Int8 Source # (.|.) :: Int8 -> Int8 -> Int8 Source # (.^.) :: Int8 -> Int8 -> Int8 Source # (.<<.) :: Int8 -> CountOf Bool -> Int8 Source # (.>>.) :: Int8 -> CountOf Bool -> Int8 Source # bit :: Offset Bool -> Int8 Source # isBitSet :: Int8 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Int8 | |||||
| HasNegation Int8 | |||||
| Integral Int8 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int8 Source # | |||||
| NormalForm Int8 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int8 -> () Source # | |||||
| Additive Int8 | |||||
| IDivisible Int8 | |||||
| Multiplicative Int8 | |||||
| IsIntegral Int8 | |||||
| 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 Source # primShiftToBytes :: Proxy Int8 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () Source # primAddrIndex :: Addr# -> Offset Int8 -> Int8 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () Source # | |||||
| Arbitrary Int8 Source # | |||||
| Storable Int8 Source # | |||||
| StorableFixed Int8 Source # | |||||
| IsField Int8 Source # | |||||
| Hashable Int8 Source # | |||||
| Signed Int8 Source # | |||||
| Bits Int8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int8 -> Int8 -> Int8 Source # (.|.) :: Int8 -> Int8 -> Int8 Source # xor :: Int8 -> Int8 -> Int8 Source # complement :: Int8 -> Int8 Source # shift :: Int8 -> Int -> Int8 Source # rotate :: Int8 -> Int -> Int8 Source # setBit :: Int8 -> Int -> Int8 Source # clearBit :: Int8 -> Int -> Int8 Source # complementBit :: Int8 -> Int -> Int8 Source # testBit :: Int8 -> Int -> Bool Source # bitSizeMaybe :: Int8 -> Maybe Int Source # bitSize :: Int8 -> Int Source # isSigned :: Int8 -> Bool Source # shiftL :: Int8 -> Int -> Int8 Source # unsafeShiftL :: Int8 -> Int -> Int8 Source # shiftR :: Int8 -> Int -> Int8 Source # unsafeShiftR :: Int8 -> Int -> Int8 Source # rotateL :: Int8 -> Int -> Int8 Source # | |||||
| FiniteBits Int8 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int8 -> Int Source # countLeadingZeros :: Int8 -> Int Source # countTrailingZeros :: Int8 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int8 Source # toConstr :: Int8 -> Constr Source # dataTypeOf :: Int8 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int8) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int8) Source # gmapT :: (forall b. Data b => b -> b) -> Int8 -> Int8 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Int8 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int8 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 Source # | |||||
| Bounded Int8 | Since: base-2.1 | ||||
| Enum Int8 | Since: base-2.1 | ||||
| Storable Int8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Int8 -> Int Source # alignment :: Int8 -> Int Source # peekElemOff :: Ptr Int8 -> Int -> IO Int8 Source # pokeElemOff :: Ptr Int8 -> Int -> Int8 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Int8 Source # pokeByteOff :: Ptr b -> Int -> Int8 -> IO () Source # | |||||
| Ix Int8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Num Int8 | Since: base-2.1 | ||||
| Read Int8 | Since: base-2.1 | ||||
| Integral Int8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Real Int8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int8 -> Rational Source # | |||||
| Show Int8 | Since: base-2.1 | ||||
| Eq Int8 | Since: base-2.1 | ||||
| Ord Int8 | Since: base-2.1 | ||||
| Cast Int8 Word8 | |||||
| Cast Word8 Int8 | |||||
| From Int8 Int16 | |||||
| From Int8 Int32 | |||||
| From Int8 Int64 | |||||
| From Int8 Int | |||||
| 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 Source # | |||||
| IntegralUpsize Int8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 Source # | |||||
| IntegralUpsize Int8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 Source # | |||||
| IntegralUpsize Int8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int Source # | |||||
| 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 Methods (.&.) :: Int16 -> Int16 -> Int16 Source # (.|.) :: Int16 -> Int16 -> Int16 Source # (.^.) :: Int16 -> Int16 -> Int16 Source # (.<<.) :: Int16 -> CountOf Bool -> Int16 Source # (.>>.) :: Int16 -> CountOf Bool -> Int16 Source # bit :: Offset Bool -> Int16 Source # isBitSet :: Int16 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Int16 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int16 | |||||
| Integral Int16 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int16 Source # | |||||
| NormalForm Int16 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int16 -> () Source # | |||||
| Additive Int16 | |||||
| IDivisible Int16 | |||||
| Multiplicative Int16 | |||||
| IsIntegral Int16 | |||||
| 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 Source # primShiftToBytes :: Proxy Int16 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () Source # primAddrIndex :: Addr# -> Offset Int16 -> Int16 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () Source # | |||||
| Arbitrary Int16 Source # | |||||
| Storable Int16 Source # | |||||
| StorableFixed Int16 Source # | |||||
| IsField Int16 Source # | |||||
| Hashable Int16 Source # | |||||
| Signed Int16 Source # | |||||
| Bits Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int16 -> Int16 -> Int16 Source # (.|.) :: Int16 -> Int16 -> Int16 Source # xor :: Int16 -> Int16 -> Int16 Source # complement :: Int16 -> Int16 Source # shift :: Int16 -> Int -> Int16 Source # rotate :: Int16 -> Int -> Int16 Source # setBit :: Int16 -> Int -> Int16 Source # clearBit :: Int16 -> Int -> Int16 Source # complementBit :: Int16 -> Int -> Int16 Source # testBit :: Int16 -> Int -> Bool Source # bitSizeMaybe :: Int16 -> Maybe Int Source # bitSize :: Int16 -> Int Source # isSigned :: Int16 -> Bool Source # shiftL :: Int16 -> Int -> Int16 Source # unsafeShiftL :: Int16 -> Int -> Int16 Source # shiftR :: Int16 -> Int -> Int16 Source # unsafeShiftR :: Int16 -> Int -> Int16 Source # rotateL :: Int16 -> Int -> Int16 Source # | |||||
| FiniteBits Int16 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int16 -> Int Source # countLeadingZeros :: Int16 -> Int Source # countTrailingZeros :: Int16 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int16 Source # toConstr :: Int16 -> Constr Source # dataTypeOf :: Int16 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int16) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int16) Source # gmapT :: (forall b. Data b => b -> b) -> Int16 -> Int16 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Int16 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int16 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 Source # | |||||
| Bounded Int16 | Since: base-2.1 | ||||
| Enum Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods succ :: Int16 -> Int16 Source # pred :: Int16 -> Int16 Source # toEnum :: Int -> Int16 Source # fromEnum :: Int16 -> Int Source # enumFrom :: Int16 -> [Int16] Source # enumFromThen :: Int16 -> Int16 -> [Int16] Source # enumFromTo :: Int16 -> Int16 -> [Int16] Source # enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] Source # | |||||
| Storable Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Int16 -> Int Source # alignment :: Int16 -> Int Source # peekElemOff :: Ptr Int16 -> Int -> IO Int16 Source # pokeElemOff :: Ptr Int16 -> Int -> Int16 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Int16 Source # pokeByteOff :: Ptr b -> Int -> Int16 -> IO () Source # | |||||
| Ix Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Num Int16 | Since: base-2.1 | ||||
| Read Int16 | Since: base-2.1 | ||||
| Integral Int16 | Since: base-2.1 | ||||
| Real Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int16 -> Rational Source # | |||||
| Show Int16 | Since: base-2.1 | ||||
| Eq Int16 | Since: base-2.1 | ||||
| Ord Int16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Cast Int16 Word16 | |||||
| Cast Word16 Int16 | |||||
| From Int16 Int32 | |||||
| From Int16 Int64 | |||||
| From Int16 Int | |||||
| From Int8 Int16 | |||||
| From Word8 Int16 | |||||
| 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 Source # | |||||
| IntegralUpsize Int16 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int64 Source # | |||||
| IntegralUpsize Int16 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int Source # | |||||
| IntegralUpsize Int8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int16 Source # | |||||
| IntegralUpsize Word8 Int16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int16 Source # | |||||
| 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 Methods (.&.) :: Int32 -> Int32 -> Int32 Source # (.|.) :: Int32 -> Int32 -> Int32 Source # (.^.) :: Int32 -> Int32 -> Int32 Source # (.<<.) :: Int32 -> CountOf Bool -> Int32 Source # (.>>.) :: Int32 -> CountOf Bool -> Int32 Source # bit :: Offset Bool -> Int32 Source # isBitSet :: Int32 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Int32 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int32 | |||||
| Integral Int32 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int32 Source # | |||||
| NormalForm Int32 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int32 -> () Source # | |||||
| Additive Int32 | |||||
| IDivisible Int32 | |||||
| Multiplicative Int32 | |||||
| IsIntegral Int32 | |||||
| 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 Source # primShiftToBytes :: Proxy Int32 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () Source # primAddrIndex :: Addr# -> Offset Int32 -> Int32 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () Source # | |||||
| Arbitrary Int32 Source # | |||||
| Storable Int32 Source # | |||||
| StorableFixed Int32 Source # | |||||
| IsField Int32 Source # | |||||
| Hashable Int32 Source # | |||||
| Signed Int32 Source # | |||||
| Bits Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int32 -> Int32 -> Int32 Source # (.|.) :: Int32 -> Int32 -> Int32 Source # xor :: Int32 -> Int32 -> Int32 Source # complement :: Int32 -> Int32 Source # shift :: Int32 -> Int -> Int32 Source # rotate :: Int32 -> Int -> Int32 Source # setBit :: Int32 -> Int -> Int32 Source # clearBit :: Int32 -> Int -> Int32 Source # complementBit :: Int32 -> Int -> Int32 Source # testBit :: Int32 -> Int -> Bool Source # bitSizeMaybe :: Int32 -> Maybe Int Source # bitSize :: Int32 -> Int Source # isSigned :: Int32 -> Bool Source # shiftL :: Int32 -> Int -> Int32 Source # unsafeShiftL :: Int32 -> Int -> Int32 Source # shiftR :: Int32 -> Int -> Int32 Source # unsafeShiftR :: Int32 -> Int -> Int32 Source # rotateL :: Int32 -> Int -> Int32 Source # | |||||
| FiniteBits Int32 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int32 -> Int Source # countLeadingZeros :: Int32 -> Int Source # countTrailingZeros :: Int32 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int32 Source # toConstr :: Int32 -> Constr Source # dataTypeOf :: Int32 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int32) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int32) Source # gmapT :: (forall b. Data b => b -> b) -> Int32 -> Int32 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Int32 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int32 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 Source # | |||||
| Bounded Int32 | Since: base-2.1 | ||||
| Enum Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods succ :: Int32 -> Int32 Source # pred :: Int32 -> Int32 Source # toEnum :: Int -> Int32 Source # fromEnum :: Int32 -> Int Source # enumFrom :: Int32 -> [Int32] Source # enumFromThen :: Int32 -> Int32 -> [Int32] Source # enumFromTo :: Int32 -> Int32 -> [Int32] Source # enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] Source # | |||||
| Storable Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Int32 -> Int Source # alignment :: Int32 -> Int Source # peekElemOff :: Ptr Int32 -> Int -> IO Int32 Source # pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Int32 Source # pokeByteOff :: Ptr b -> Int -> Int32 -> IO () Source # | |||||
| Ix Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Num Int32 | Since: base-2.1 | ||||
| Read Int32 | Since: base-2.1 | ||||
| Integral Int32 | Since: base-2.1 | ||||
| Real Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int32 -> Rational Source # | |||||
| Show Int32 | Since: base-2.1 | ||||
| Eq Int32 | Since: base-2.1 | ||||
| Ord Int32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Cast Int32 Word32 | |||||
| Cast Word32 Int32 | |||||
| From Int16 Int32 | |||||
| From Int32 Int64 | |||||
| From Int32 Int | |||||
| From Int8 Int32 | |||||
| From Word16 Int32 | |||||
| From Word8 Int32 | |||||
| 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 Source # | |||||
| IntegralUpsize Int32 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 Source # | |||||
| IntegralUpsize Int32 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int Source # | |||||
| IntegralUpsize Int8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 Source # | |||||
| IntegralUpsize Word8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 Source # | |||||
| 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 Methods (.&.) :: Int64 -> Int64 -> Int64 Source # (.|.) :: Int64 -> Int64 -> Int64 Source # (.^.) :: Int64 -> Int64 -> Int64 Source # (.<<.) :: Int64 -> CountOf Bool -> Int64 Source # (.>>.) :: Int64 -> CountOf Bool -> Int64 Source # bit :: Offset Bool -> Int64 Source # isBitSet :: Int64 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Int64 | |||||
Defined in Basement.Bits | |||||
| HasNegation Int64 | |||||
| Integral Int64 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int64 Source # | |||||
| NormalForm Int64 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int64 -> () Source # | |||||
| Additive Int64 | |||||
| IDivisible Int64 | |||||
| Multiplicative Int64 | |||||
| IsIntegral Int64 | |||||
| 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 Source # primShiftToBytes :: Proxy Int64 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () Source # primAddrIndex :: Addr# -> Offset Int64 -> Int64 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () Source # | |||||
| Arbitrary Int64 Source # | |||||
| Storable Int64 Source # | |||||
| StorableFixed Int64 Source # | |||||
| IsField Int64 Source # | |||||
| Hashable Int64 Source # | |||||
| Signed Int64 Source # | |||||
| Bits Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods (.&.) :: Int64 -> Int64 -> Int64 Source # (.|.) :: Int64 -> Int64 -> Int64 Source # xor :: Int64 -> Int64 -> Int64 Source # complement :: Int64 -> Int64 Source # shift :: Int64 -> Int -> Int64 Source # rotate :: Int64 -> Int -> Int64 Source # setBit :: Int64 -> Int -> Int64 Source # clearBit :: Int64 -> Int -> Int64 Source # complementBit :: Int64 -> Int -> Int64 Source # testBit :: Int64 -> Int -> Bool Source # bitSizeMaybe :: Int64 -> Maybe Int Source # bitSize :: Int64 -> Int Source # isSigned :: Int64 -> Bool Source # shiftL :: Int64 -> Int -> Int64 Source # unsafeShiftL :: Int64 -> Int -> Int64 Source # shiftR :: Int64 -> Int -> Int64 Source # unsafeShiftR :: Int64 -> Int -> Int64 Source # rotateL :: Int64 -> Int -> Int64 Source # | |||||
| FiniteBits Int64 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Int Methods finiteBitSize :: Int64 -> Int Source # countLeadingZeros :: Int64 -> Int Source # countTrailingZeros :: Int64 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int64 Source # toConstr :: Int64 -> Constr Source # dataTypeOf :: Int64 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int64) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int64) Source # gmapT :: (forall b. Data b => b -> b) -> Int64 -> Int64 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Int64 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int64 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 Source # | |||||
| Bounded Int64 | Since: base-2.1 | ||||
| Enum Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods succ :: Int64 -> Int64 Source # pred :: Int64 -> Int64 Source # toEnum :: Int -> Int64 Source # fromEnum :: Int64 -> Int Source # enumFrom :: Int64 -> [Int64] Source # enumFromThen :: Int64 -> Int64 -> [Int64] Source # enumFromTo :: Int64 -> Int64 -> [Int64] Source # enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] Source # | |||||
| Storable Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Int64 -> Int Source # alignment :: Int64 -> Int Source # peekElemOff :: Ptr Int64 -> Int -> IO Int64 Source # pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Int64 Source # pokeByteOff :: Ptr b -> Int -> Int64 -> IO () Source # | |||||
| Ix Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Num Int64 | Since: base-2.1 | ||||
| Read Int64 | Since: base-2.1 | ||||
| Integral Int64 | Since: base-2.1 | ||||
| Real Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int Methods toRational :: Int64 -> Rational Source # | |||||
| Show Int64 | Since: base-2.1 | ||||
| Eq Int64 | Since: base-2.1 | ||||
| Ord Int64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Int | |||||
| Cast Int64 Word64 | |||||
| Cast Int64 Int | |||||
| Cast Int64 Word | |||||
| Cast Word64 Int64 | |||||
| Cast Int Int64 | |||||
| Cast Word Int64 | |||||
| From Int16 Int64 | |||||
| From Int32 Int64 | |||||
| From Int8 Int64 | |||||
| From Word16 Int64 | |||||
| From Word32 Int64 | |||||
| From Word8 Int64 | |||||
| From Int Int64 | |||||
| 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 Source # | |||||
| IntegralUpsize Int32 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 Source # | |||||
| IntegralUpsize Int8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 Source # | |||||
| IntegralUpsize Word8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 Source # | |||||
| IntegralUpsize Int Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 Source # | |||||
| 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 Methods (.&.) :: Word8 -> Word8 -> Word8 Source # (.|.) :: Word8 -> Word8 -> Word8 Source # (.^.) :: Word8 -> Word8 -> Word8 Source # (.<<.) :: Word8 -> CountOf Bool -> Word8 Source # (.>>.) :: Word8 -> CountOf Bool -> Word8 Source # bit :: Offset Bool -> Word8 Source # isBitSet :: Word8 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word8 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word8 | |||||
| Integral Word8 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word8 Source # | |||||
| NormalForm Word8 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word8 -> () Source # | |||||
| Additive Word8 | |||||
| IDivisible Word8 | |||||
| Multiplicative Word8 | |||||
| IsIntegral Word8 | |||||
| IsNatural Word8 | |||||
| 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 Source # primShiftToBytes :: Proxy Word8 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () Source # primAddrIndex :: Addr# -> Offset Word8 -> Word8 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () Source # | |||||
| Arbitrary Word8 Source # | |||||
| Storable Word8 Source # | |||||
| StorableFixed Word8 Source # | |||||
| IsField Word8 Source # | |||||
| Hashable Word8 Source # | |||||
| Bits Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word8 -> Word8 -> Word8 Source # (.|.) :: Word8 -> Word8 -> Word8 Source # xor :: Word8 -> Word8 -> Word8 Source # complement :: Word8 -> Word8 Source # shift :: Word8 -> Int -> Word8 Source # rotate :: Word8 -> Int -> Word8 Source # setBit :: Word8 -> Int -> Word8 Source # clearBit :: Word8 -> Int -> Word8 Source # complementBit :: Word8 -> Int -> Word8 Source # testBit :: Word8 -> Int -> Bool Source # bitSizeMaybe :: Word8 -> Maybe Int Source # bitSize :: Word8 -> Int Source # isSigned :: Word8 -> Bool Source # shiftL :: Word8 -> Int -> Word8 Source # unsafeShiftL :: Word8 -> Int -> Word8 Source # shiftR :: Word8 -> Int -> Word8 Source # unsafeShiftR :: Word8 -> Int -> Word8 Source # rotateL :: Word8 -> Int -> Word8 Source # | |||||
| FiniteBits Word8 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word8 -> Int Source # countLeadingZeros :: Word8 -> Int Source # countTrailingZeros :: Word8 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word8 Source # toConstr :: Word8 -> Constr Source # dataTypeOf :: Word8 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word8) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word8) Source # gmapT :: (forall b. Data b => b -> b) -> Word8 -> Word8 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Word8 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word8 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 Source # | |||||
| Bounded Word8 | Since: base-2.1 | ||||
| Enum Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods succ :: Word8 -> Word8 Source # pred :: Word8 -> Word8 Source # toEnum :: Int -> Word8 Source # fromEnum :: Word8 -> Int Source # enumFrom :: Word8 -> [Word8] Source # enumFromThen :: Word8 -> Word8 -> [Word8] Source # enumFromTo :: Word8 -> Word8 -> [Word8] Source # enumFromThenTo :: Word8 -> Word8 -> Word8 -> [Word8] Source # | |||||
| Storable Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Word8 -> Int Source # alignment :: Word8 -> Int Source # peekElemOff :: Ptr Word8 -> Int -> IO Word8 Source # pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word8 Source # pokeByteOff :: Ptr b -> Int -> Word8 -> IO () Source # | |||||
| Ix Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Num Word8 | Since: base-2.1 | ||||
| Read Word8 | Since: base-2.1 | ||||
| Integral Word8 | Since: base-2.1 | ||||
| Real Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word8 -> Rational Source # | |||||
| Show Word8 | Since: base-2.1 | ||||
| Eq Word8 | Since: base-2.1 | ||||
| Ord Word8 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Cast Int8 Word8 | |||||
| Cast Word8 Int8 | |||||
| From Word8 Word128 | |||||
| From Word8 Word256 | |||||
| From Word8 Int16 | |||||
| From Word8 Int32 | |||||
| From Word8 Int64 | |||||
| From Word8 Word16 | |||||
| From Word8 Word32 | |||||
| From Word8 Word64 | |||||
| From Word8 Int | |||||
| From Word8 Word | |||||
| 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 Source # | |||||
| IntegralUpsize Word8 Int32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 Source # | |||||
| IntegralUpsize Word8 Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 Source # | |||||
| IntegralUpsize Word8 Word16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 Source # | |||||
| IntegralUpsize Word8 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 Source # | |||||
| IntegralUpsize Word8 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 Source # | |||||
| IntegralUpsize Word8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int Source # | |||||
| IntegralUpsize Word8 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word Source # | |||||
| From AsciiString (UArray Word8) | |||||
Defined in Basement.From | |||||
| From String (UArray Word8) | |||||
| Indexable (Block Word8) Word64 | |||||
| Indexable (Ptr Word8) Word64 | |||||
| (KnownNat n, NatWithinBound Word8 n) => From (Zn n) Word8 | |||||
| (KnownNat n, NatWithinBound Word8 n) => From (Zn64 n) Word8 | |||||
| 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 Methods formatArg :: Word16 -> FieldFormatter Source # parseFormat :: Word16 -> ModifierParser Source # | |||||
| BitOps Word16 | |||||
Defined in Basement.Bits Methods (.&.) :: Word16 -> Word16 -> Word16 Source # (.|.) :: Word16 -> Word16 -> Word16 Source # (.^.) :: Word16 -> Word16 -> Word16 Source # (.<<.) :: Word16 -> CountOf Bool -> Word16 Source # (.>>.) :: Word16 -> CountOf Bool -> Word16 Source # bit :: Offset Bool -> Word16 Source # isBitSet :: Word16 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word16 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word16 | |||||
| Integral Word16 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word16 Source # | |||||
| ByteSwap Word16 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word16 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word16 -> () Source # | |||||
| Additive Word16 | |||||
| IDivisible Word16 | |||||
| Multiplicative Word16 | |||||
| IsIntegral Word16 | |||||
| IsNatural Word16 | |||||
| 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 Source # primShiftToBytes :: Proxy Word16 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () Source # primAddrIndex :: Addr# -> Offset Word16 -> Word16 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () Source # | |||||
| Arbitrary Word16 Source # | |||||
| Storable Word16 Source # | |||||
| StorableFixed Word16 Source # | |||||
| IsField Word16 Source # | |||||
| Hashable Word16 Source # | |||||
| Bits Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word16 -> Word16 -> Word16 Source # (.|.) :: Word16 -> Word16 -> Word16 Source # xor :: Word16 -> Word16 -> Word16 Source # complement :: Word16 -> Word16 Source # shift :: Word16 -> Int -> Word16 Source # rotate :: Word16 -> Int -> Word16 Source # setBit :: Word16 -> Int -> Word16 Source # clearBit :: Word16 -> Int -> Word16 Source # complementBit :: Word16 -> Int -> Word16 Source # testBit :: Word16 -> Int -> Bool Source # bitSizeMaybe :: Word16 -> Maybe Int Source # bitSize :: Word16 -> Int Source # isSigned :: Word16 -> Bool Source # shiftL :: Word16 -> Int -> Word16 Source # unsafeShiftL :: Word16 -> Int -> Word16 Source # shiftR :: Word16 -> Int -> Word16 Source # unsafeShiftR :: Word16 -> Int -> Word16 Source # rotateL :: Word16 -> Int -> Word16 Source # | |||||
| FiniteBits Word16 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word16 -> Int Source # countLeadingZeros :: Word16 -> Int Source # countTrailingZeros :: Word16 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word16 Source # toConstr :: Word16 -> Constr Source # dataTypeOf :: Word16 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word16) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word16) Source # gmapT :: (forall b. Data b => b -> b) -> Word16 -> Word16 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Word16 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word16 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 Source # | |||||
| Bounded Word16 | Since: base-2.1 | ||||
| Enum Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods succ :: Word16 -> Word16 Source # pred :: Word16 -> Word16 Source # toEnum :: Int -> Word16 Source # fromEnum :: Word16 -> Int Source # enumFrom :: Word16 -> [Word16] Source # enumFromThen :: Word16 -> Word16 -> [Word16] Source # enumFromTo :: Word16 -> Word16 -> [Word16] Source # enumFromThenTo :: Word16 -> Word16 -> Word16 -> [Word16] Source # | |||||
| Storable Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Word16 -> Int Source # alignment :: Word16 -> Int Source # peekElemOff :: Ptr Word16 -> Int -> IO Word16 Source # pokeElemOff :: Ptr Word16 -> Int -> Word16 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word16 Source # pokeByteOff :: Ptr b -> Int -> Word16 -> IO () Source # | |||||
| Ix Word16 | Since: base-2.1 | ||||
| Num Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Read Word16 | Since: base-2.1 | ||||
| Integral Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word16 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word16 -> Rational Source # | |||||
| Show Word16 | Since: base-2.1 | ||||
| Eq Word16 | Since: base-2.1 | ||||
| Ord Word16 | Since: base-2.1 | ||||
| Cast Int16 Word16 | |||||
| Cast Word16 Int16 | |||||
| From Word16 Word128 | |||||
| From Word16 Word256 | |||||
| From Word16 Int32 | |||||
| From Word16 Int64 | |||||
| From Word16 Word32 | |||||
| From Word16 Word64 | |||||
| From Word16 Int | |||||
| From Word16 Word | |||||
| From Word8 Word16 | |||||
| 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 Source # | |||||
| IntegralUpsize Word16 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word64 Source # | |||||
| IntegralUpsize Word16 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word Source # | |||||
| IntegralUpsize Word8 Word16 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 Source # | |||||
| Storable (BE Word16) Source # | |||||
| Storable (LE Word16) Source # | |||||
| StorableFixed (BE Word16) Source # | |||||
| StorableFixed (LE Word16) Source # | |||||
| (KnownNat n, NatWithinBound Word16 n) => From (Zn n) Word16 | |||||
| (KnownNat n, NatWithinBound Word16 n) => From (Zn64 n) Word16 | |||||
| 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 Methods formatArg :: Word32 -> FieldFormatter Source # parseFormat :: Word32 -> ModifierParser Source # | |||||
| BitOps Word32 | |||||
Defined in Basement.Bits Methods (.&.) :: Word32 -> Word32 -> Word32 Source # (.|.) :: Word32 -> Word32 -> Word32 Source # (.^.) :: Word32 -> Word32 -> Word32 Source # (.<<.) :: Word32 -> CountOf Bool -> Word32 Source # (.>>.) :: Word32 -> CountOf Bool -> Word32 Source # bit :: Offset Bool -> Word32 Source # isBitSet :: Word32 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word32 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word32 | |||||
| Integral Word32 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word32 Source # | |||||
| ByteSwap Word32 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word32 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word32 -> () Source # | |||||
| Additive Word32 | |||||
| IDivisible Word32 | |||||
| Multiplicative Word32 | |||||
| IsIntegral Word32 | |||||
| IsNatural Word32 | |||||
| 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 Source # primShiftToBytes :: Proxy Word32 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () Source # primAddrIndex :: Addr# -> Offset Word32 -> Word32 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () Source # | |||||
| Arbitrary Word32 Source # | |||||
| Storable Word32 Source # | |||||
| StorableFixed Word32 Source # | |||||
| IsField Word32 Source # | |||||
| Hashable Word32 Source # | |||||
| Bits Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word32 -> Word32 -> Word32 Source # (.|.) :: Word32 -> Word32 -> Word32 Source # xor :: Word32 -> Word32 -> Word32 Source # complement :: Word32 -> Word32 Source # shift :: Word32 -> Int -> Word32 Source # rotate :: Word32 -> Int -> Word32 Source # setBit :: Word32 -> Int -> Word32 Source # clearBit :: Word32 -> Int -> Word32 Source # complementBit :: Word32 -> Int -> Word32 Source # testBit :: Word32 -> Int -> Bool Source # bitSizeMaybe :: Word32 -> Maybe Int Source # bitSize :: Word32 -> Int Source # isSigned :: Word32 -> Bool Source # shiftL :: Word32 -> Int -> Word32 Source # unsafeShiftL :: Word32 -> Int -> Word32 Source # shiftR :: Word32 -> Int -> Word32 Source # unsafeShiftR :: Word32 -> Int -> Word32 Source # rotateL :: Word32 -> Int -> Word32 Source # | |||||
| FiniteBits Word32 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word32 -> Int Source # countLeadingZeros :: Word32 -> Int Source # countTrailingZeros :: Word32 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word32 Source # toConstr :: Word32 -> Constr Source # dataTypeOf :: Word32 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word32) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word32) Source # gmapT :: (forall b. Data b => b -> b) -> Word32 -> Word32 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Word32 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word32 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 Source # | |||||
| Bounded Word32 | Since: base-2.1 | ||||
| Enum Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods succ :: Word32 -> Word32 Source # pred :: Word32 -> Word32 Source # toEnum :: Int -> Word32 Source # fromEnum :: Word32 -> Int Source # enumFrom :: Word32 -> [Word32] Source # enumFromThen :: Word32 -> Word32 -> [Word32] Source # enumFromTo :: Word32 -> Word32 -> [Word32] Source # enumFromThenTo :: Word32 -> Word32 -> Word32 -> [Word32] Source # | |||||
| Storable Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Word32 -> Int Source # alignment :: Word32 -> Int Source # peekElemOff :: Ptr Word32 -> Int -> IO Word32 Source # pokeElemOff :: Ptr Word32 -> Int -> Word32 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word32 Source # pokeByteOff :: Ptr b -> Int -> Word32 -> IO () Source # | |||||
| Ix Word32 | Since: base-2.1 | ||||
| Num Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Read Word32 | Since: base-2.1 | ||||
| Integral Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word32 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word32 -> Rational Source # | |||||
| Show Word32 | Since: base-2.1 | ||||
| Eq Word32 | Since: base-2.1 | ||||
| Ord Word32 | Since: base-2.1 | ||||
| Cast Int32 Word32 | |||||
| Cast Word32 Int32 | |||||
| From Word16 Word32 | |||||
| From Word32 Word128 | |||||
| From Word32 Word256 | |||||
| From Word32 Int64 | |||||
| From Word32 Word64 | |||||
| From Word32 Int | |||||
| From Word32 Word | |||||
| From Word8 Word32 | |||||
| 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 Source # | |||||
| IntegralUpsize Word32 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 Source # | |||||
| IntegralUpsize Word32 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word Source # | |||||
| IntegralUpsize Word8 Word32 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 Source # | |||||
| Storable (BE Word32) Source # | |||||
| Storable (LE Word32) Source # | |||||
| StorableFixed (BE Word32) Source # | |||||
| StorableFixed (LE Word32) Source # | |||||
| (KnownNat n, NatWithinBound Word32 n) => From (Zn n) Word32 | |||||
| (KnownNat n, NatWithinBound Word32 n) => From (Zn64 n) Word32 | |||||
| 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 Methods formatArg :: Word64 -> FieldFormatter Source # parseFormat :: Word64 -> ModifierParser Source # | |||||
| BitOps Word64 | |||||
Defined in Basement.Bits Methods (.&.) :: Word64 -> Word64 -> Word64 Source # (.|.) :: Word64 -> Word64 -> Word64 Source # (.^.) :: Word64 -> Word64 -> Word64 Source # (.<<.) :: Word64 -> CountOf Bool -> Word64 Source # (.>>.) :: Word64 -> CountOf Bool -> Word64 Source # bit :: Offset Bool -> Word64 Source # isBitSet :: Word64 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word64 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word64 | |||||
| Integral Word64 | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word64 Source # | |||||
| ByteSwap Word64 | |||||
Defined in Basement.Endianness | |||||
| NormalForm Word64 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word64 -> () Source # | |||||
| Additive Word64 | |||||
| IDivisible Word64 | |||||
| Multiplicative Word64 | |||||
| IsIntegral Word64 | |||||
| IsNatural Word64 | |||||
| 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 Source # primShiftToBytes :: Proxy Word64 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () Source # primAddrIndex :: Addr# -> Offset Word64 -> Word64 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () Source # | |||||
| Arbitrary Word64 Source # | |||||
| Storable Word64 Source # | |||||
| StorableFixed Word64 Source # | |||||
| IsField Word64 Source # | |||||
| Hashable Word64 Source # | |||||
| Bits Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods (.&.) :: Word64 -> Word64 -> Word64 Source # (.|.) :: Word64 -> Word64 -> Word64 Source # xor :: Word64 -> Word64 -> Word64 Source # complement :: Word64 -> Word64 Source # shift :: Word64 -> Int -> Word64 Source # rotate :: Word64 -> Int -> Word64 Source # setBit :: Word64 -> Int -> Word64 Source # clearBit :: Word64 -> Int -> Word64 Source # complementBit :: Word64 -> Int -> Word64 Source # testBit :: Word64 -> Int -> Bool Source # bitSizeMaybe :: Word64 -> Maybe Int Source # bitSize :: Word64 -> Int Source # isSigned :: Word64 -> Bool Source # shiftL :: Word64 -> Int -> Word64 Source # unsafeShiftL :: Word64 -> Int -> Word64 Source # shiftR :: Word64 -> Int -> Word64 Source # unsafeShiftR :: Word64 -> Int -> Word64 Source # rotateL :: Word64 -> Int -> Word64 Source # | |||||
| FiniteBits Word64 | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Word Methods finiteBitSize :: Word64 -> Int Source # countLeadingZeros :: Word64 -> Int Source # countTrailingZeros :: Word64 -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word64 Source # toConstr :: Word64 -> Constr Source # dataTypeOf :: Word64 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word64) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word64) Source # gmapT :: (forall b. Data b => b -> b) -> Word64 -> Word64 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Word64 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word64 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 Source # | |||||
| Bounded Word64 | Since: base-2.1 | ||||
| Enum Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods succ :: Word64 -> Word64 Source # pred :: Word64 -> Word64 Source # toEnum :: Int -> Word64 Source # fromEnum :: Word64 -> Int Source # enumFrom :: Word64 -> [Word64] Source # enumFromThen :: Word64 -> Word64 -> [Word64] Source # enumFromTo :: Word64 -> Word64 -> [Word64] Source # enumFromThenTo :: Word64 -> Word64 -> Word64 -> [Word64] Source # | |||||
| Storable Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Word64 -> Int Source # alignment :: Word64 -> Int Source # peekElemOff :: Ptr Word64 -> Int -> IO Word64 Source # pokeElemOff :: Ptr Word64 -> Int -> Word64 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word64 Source # pokeByteOff :: Ptr b -> Int -> Word64 -> IO () Source # | |||||
| Ix Word64 | Since: base-2.1 | ||||
| Num Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Read Word64 | Since: base-2.1 | ||||
| Integral Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word | |||||
| Real Word64 | Since: base-2.1 | ||||
Defined in GHC.Internal.Word Methods toRational :: Word64 -> Rational Source # | |||||
| Show Word64 | Since: base-2.1 | ||||
| Eq Word64 | Since: base-2.1 | ||||
| Ord Word64 | Since: base-2.1 | ||||
| Cast Int64 Word64 | |||||
| Cast Word64 Int64 | |||||
| Cast Word64 Int | |||||
| Cast Word64 Word | |||||
| Cast Int Word64 | |||||
| Cast Word Word64 | |||||
| From Word16 Word64 | |||||
| From Word32 Word64 | |||||
| From Word64 Word128 | |||||
| From Word64 Word256 | |||||
| From Word8 Word64 | |||||
| From Word Word64 | |||||
| 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 Source # | |||||
| IntegralUpsize Word32 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 Source # | |||||
| IntegralUpsize Word8 Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 Source # | |||||
| IntegralUpsize Word Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 Source # | |||||
| Storable (BE Word64) Source # | |||||
| Storable (LE Word64) Source # | |||||
| StorableFixed (BE Word64) Source # | |||||
| StorableFixed (LE Word64) Source # | |||||
| Indexable (Block Word8) Word64 | |||||
| Indexable (Ptr Word8) Word64 | |||||
| (KnownNat n, NatWithinBound Word64 n) => From (Zn n) Word64 | |||||
| From (Zn64 n) Word64 | |||||
| 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 | |||||
Defined in Basement.Bits Methods (.&.) :: Word -> Word -> Word Source # (.|.) :: Word -> Word -> Word Source # (.^.) :: Word -> Word -> Word Source # (.<<.) :: Word -> CountOf Bool -> Word Source # (.>>.) :: Word -> CountOf Bool -> Word Source # bit :: Offset Bool -> Word Source # isBitSet :: Word -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word | |||||
| HasNegation Word | |||||
| Integral Word | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word Source # | |||||
| NormalForm Word | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word -> () Source # | |||||
| Additive Word | |||||
| IDivisible Word | |||||
| Multiplicative Word | |||||
| IsIntegral Word | |||||
| IsNatural Word | |||||
| 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 Source # primShiftToBytes :: Proxy Word -> Int Source # primBaUIndex :: ByteArray# -> Offset Word -> Word Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () Source # primAddrIndex :: Addr# -> Offset Word -> Word Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () Source # | |||||
| Arbitrary Word Source # | |||||
| IsField Word Source # | |||||
| Bits Word | Since: base-2.1 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Word -> Word -> Word Source # (.|.) :: Word -> Word -> Word Source # xor :: Word -> Word -> Word Source # complement :: Word -> Word Source # shift :: Word -> Int -> Word Source # rotate :: Word -> Int -> Word Source # setBit :: Word -> Int -> Word Source # clearBit :: Word -> Int -> Word Source # complementBit :: Word -> Int -> Word Source # testBit :: Word -> Int -> Bool Source # bitSizeMaybe :: Word -> Maybe Int Source # bitSize :: Word -> Int Source # isSigned :: Word -> Bool Source # shiftL :: Word -> Int -> Word Source # unsafeShiftL :: Word -> Int -> Word Source # shiftR :: Word -> Int -> Word Source # unsafeShiftR :: Word -> Int -> Word Source # rotateL :: Word -> Int -> Word Source # | |||||
| FiniteBits Word | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Word -> Int Source # countLeadingZeros :: Word -> Int Source # countTrailingZeros :: Word -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word Source # toConstr :: Word -> Constr Source # dataTypeOf :: Word -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) Source # gmapT :: (forall b. Data b => b -> b) -> Word -> Word Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word Source # | |||||
| Bounded Word | Since: base-2.1 | ||||
| Enum Word | Since: base-2.1 | ||||
| Storable Word | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Word -> Int Source # alignment :: Word -> Int Source # peekElemOff :: Ptr Word -> Int -> IO Word Source # pokeElemOff :: Ptr Word -> Int -> Word -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word Source # pokeByteOff :: Ptr b -> Int -> Word -> IO () Source # | |||||
| Num Word | Since: base-2.1 | ||||
| Read Word | Since: base-4.5.0.0 | ||||
| Integral Word | Since: base-2.1 | ||||
Defined in GHC.Internal.Real | |||||
| Real Word | Since: base-2.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Word -> Rational Source # | |||||
| Show Word | Since: base-2.1 | ||||
| Eq Word | |||||
| Ord Word | |||||
| Cast Int64 Word | |||||
| Cast Word64 Word | |||||
| Cast Int Word | |||||
| Cast Word Int64 | |||||
| Cast Word Word64 | |||||
| Cast Word Int | |||||
| From Word16 Word | |||||
| From Word32 Word | |||||
| From Word8 Word | |||||
| From Word Word64 | |||||
| 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 Source # | |||||
| IntegralUpsize Word32 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word Source # | |||||
| IntegralUpsize Word8 Word | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word Source # | |||||
| IntegralUpsize Word Word64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 Source # | |||||
| From Word (CountOf ty) | |||||
| From Word (Offset ty) | |||||
| 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 Source # foldMap :: Monoid m => (a -> m) -> UWord a -> m Source # foldMap' :: Monoid m => (a -> m) -> UWord a -> m Source # foldr :: (a -> b -> b) -> b -> UWord a -> b Source # foldr' :: (a -> b -> b) -> b -> UWord a -> b Source # foldl :: (b -> a -> b) -> b -> UWord a -> b Source # foldl' :: (b -> a -> b) -> b -> UWord a -> b Source # foldr1 :: (a -> a -> a) -> UWord a -> a Source # foldl1 :: (a -> a -> a) -> UWord a -> a Source # toList :: UWord a -> [a] Source # null :: UWord a -> Bool Source # length :: UWord a -> Int Source # elem :: Eq a => a -> UWord a -> Bool Source # maximum :: Ord a => UWord a -> a Source # minimum :: Ord a => UWord a -> a Source # | |||||
| Traversable (UWord :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| From (CountOf ty) Word | |||||
| 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 Methods compare :: URec Word p -> URec Word p -> Ordering Source # (<) :: URec Word p -> URec Word p -> Bool Source # (<=) :: URec Word p -> URec Word p -> Bool Source # (>) :: URec Word p -> URec Word p -> Bool Source # (>=) :: URec Word p -> URec Word p -> Bool Source # | |||||
| 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 Source # (.|.) :: Word128 -> Word128 -> Word128 Source # (.^.) :: Word128 -> Word128 -> Word128 Source # (.<<.) :: Word128 -> CountOf Bool -> Word128 Source # (.>>.) :: Word128 -> CountOf Bool -> Word128 Source # bit :: Offset Bool -> Word128 Source # isBitSet :: Word128 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word128 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word128 | |||||
| Integral Word128 | |||||
Defined in Basement.Types.Word128 Methods fromInteger :: Integer -> Word128 Source # | |||||
| NormalForm Word128 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word128 -> () Source # | |||||
| Additive Word128 | |||||
| IDivisible Word128 | |||||
| Multiplicative Word128 | |||||
| IsIntegral Word128 | |||||
| IsNatural 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 Source # primShiftToBytes :: Proxy Word128 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () Source # primAddrIndex :: Addr# -> Offset Word128 -> Word128 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () Source # | |||||
| Arbitrary Word128 Source # | |||||
| Storable Word128 Source # | |||||
| StorableFixed Word128 Source # | |||||
| IsField Word128 Source # | |||||
| Hashable Word128 Source # | |||||
| Bits Word128 | |||||
Defined in Basement.Types.Word128 Methods (.&.) :: Word128 -> Word128 -> Word128 Source # (.|.) :: Word128 -> Word128 -> Word128 Source # xor :: Word128 -> Word128 -> Word128 Source # complement :: Word128 -> Word128 Source # shift :: Word128 -> Int -> Word128 Source # rotate :: Word128 -> Int -> Word128 Source # bit :: Int -> Word128 Source # setBit :: Word128 -> Int -> Word128 Source # clearBit :: Word128 -> Int -> Word128 Source # complementBit :: Word128 -> Int -> Word128 Source # testBit :: Word128 -> Int -> Bool Source # bitSizeMaybe :: Word128 -> Maybe Int Source # bitSize :: Word128 -> Int Source # isSigned :: Word128 -> Bool Source # shiftL :: Word128 -> Int -> Word128 Source # unsafeShiftL :: Word128 -> Int -> Word128 Source # shiftR :: Word128 -> Int -> Word128 Source # unsafeShiftR :: Word128 -> Int -> Word128 Source # rotateL :: Word128 -> Int -> Word128 Source # | |||||
| Bounded Word128 | |||||
| Enum Word128 | |||||
Defined in Basement.Types.Word128 Methods succ :: Word128 -> Word128 Source # pred :: Word128 -> Word128 Source # toEnum :: Int -> Word128 Source # fromEnum :: Word128 -> Int Source # enumFrom :: Word128 -> [Word128] Source # enumFromThen :: Word128 -> Word128 -> [Word128] Source # enumFromTo :: Word128 -> Word128 -> [Word128] Source # enumFromThenTo :: Word128 -> Word128 -> Word128 -> [Word128] Source # | |||||
| Storable Word128 | |||||
Defined in Basement.Types.Word128 Methods sizeOf :: Word128 -> Int Source # alignment :: Word128 -> Int Source # peekElemOff :: Ptr Word128 -> Int -> IO Word128 Source # pokeElemOff :: Ptr Word128 -> Int -> Word128 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word128 Source # pokeByteOff :: Ptr b -> Int -> Word128 -> IO () Source # | |||||
| Num Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| Show Word128 | |||||
| Eq Word128 | |||||
| Ord Word128 | |||||
Defined in Basement.Types.Word128 | |||||
| From Word128 Word256 | |||||
| From Word16 Word128 | |||||
| From Word32 Word128 | |||||
| From Word64 Word128 | |||||
| From Word8 Word128 | |||||
| Storable (BE Word128) Source # | |||||
| Storable (LE Word128) Source # | |||||
| StorableFixed (BE Word128) Source # | |||||
| StorableFixed (LE Word128) Source # | |||||
| (KnownNat n, NatWithinBound Word128 n) => From (Zn n) Word128 | |||||
| From (Zn64 n) Word128 | |||||
| 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 Source # (.|.) :: Word256 -> Word256 -> Word256 Source # (.^.) :: Word256 -> Word256 -> Word256 Source # (.<<.) :: Word256 -> CountOf Bool -> Word256 Source # (.>>.) :: Word256 -> CountOf Bool -> Word256 Source # bit :: Offset Bool -> Word256 Source # isBitSet :: Word256 -> Offset Bool -> Bool Source # | |||||
| FiniteBitsOps Word256 | |||||
Defined in Basement.Bits | |||||
| HasNegation Word256 | |||||
| Integral Word256 | |||||
Defined in Basement.Types.Word256 Methods fromInteger :: Integer -> Word256 Source # | |||||
| NormalForm Word256 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Word256 -> () Source # | |||||
| Additive Word256 | |||||
| IDivisible Word256 | |||||
| Multiplicative Word256 | |||||
| IsIntegral Word256 | |||||
| IsNatural 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 Source # primShiftToBytes :: Proxy Word256 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word256 -> Word256 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> prim Word256 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> Word256 -> prim () Source # primAddrIndex :: Addr# -> Offset Word256 -> Word256 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word256 -> prim Word256 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word256 -> Word256 -> prim () Source # | |||||
| Arbitrary Word256 Source # | |||||
| Storable Word256 Source # | |||||
| StorableFixed Word256 Source # | |||||
| IsField Word256 Source # | |||||
| Hashable Word256 Source # | |||||
| Bits Word256 | |||||
Defined in Basement.Types.Word256 Methods (.&.) :: Word256 -> Word256 -> Word256 Source # (.|.) :: Word256 -> Word256 -> Word256 Source # xor :: Word256 -> Word256 -> Word256 Source # complement :: Word256 -> Word256 Source # shift :: Word256 -> Int -> Word256 Source # rotate :: Word256 -> Int -> Word256 Source # bit :: Int -> Word256 Source # setBit :: Word256 -> Int -> Word256 Source # clearBit :: Word256 -> Int -> Word256 Source # complementBit :: Word256 -> Int -> Word256 Source # testBit :: Word256 -> Int -> Bool Source # bitSizeMaybe :: Word256 -> Maybe Int Source # bitSize :: Word256 -> Int Source # isSigned :: Word256 -> Bool Source # shiftL :: Word256 -> Int -> Word256 Source # unsafeShiftL :: Word256 -> Int -> Word256 Source # shiftR :: Word256 -> Int -> Word256 Source # unsafeShiftR :: Word256 -> Int -> Word256 Source # rotateL :: Word256 -> Int -> Word256 Source # | |||||
| Bounded Word256 | |||||
| Enum Word256 | |||||
Defined in Basement.Types.Word256 Methods succ :: Word256 -> Word256 Source # pred :: Word256 -> Word256 Source # toEnum :: Int -> Word256 Source # fromEnum :: Word256 -> Int Source # enumFrom :: Word256 -> [Word256] Source # enumFromThen :: Word256 -> Word256 -> [Word256] Source # enumFromTo :: Word256 -> Word256 -> [Word256] Source # enumFromThenTo :: Word256 -> Word256 -> Word256 -> [Word256] Source # | |||||
| Storable Word256 | |||||
Defined in Basement.Types.Word256 Methods sizeOf :: Word256 -> Int Source # alignment :: Word256 -> Int Source # peekElemOff :: Ptr Word256 -> Int -> IO Word256 Source # pokeElemOff :: Ptr Word256 -> Int -> Word256 -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Word256 Source # pokeByteOff :: Ptr b -> Int -> Word256 -> IO () Source # | |||||
| Num Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| Show Word256 | |||||
| Eq Word256 | |||||
| Ord Word256 | |||||
Defined in Basement.Types.Word256 | |||||
| From Word128 Word256 | |||||
| From Word16 Word256 | |||||
| From Word32 Word256 | |||||
| From Word64 Word256 | |||||
| From Word8 Word256 | |||||
| Storable (BE Word256) Source # | |||||
| Storable (LE Word256) Source # | |||||
| StorableFixed (BE Word256) Source # | |||||
| StorableFixed (LE Word256) Source # | |||||
| (KnownNat n, NatWithinBound Word256 n) => From (Zn n) Word256 | |||||
| From (Zn64 n) Word256 | |||||
| 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 | |||||
| Integral Int | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int Source # | |||||
| NormalForm Int | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Int -> () Source # | |||||
| Additive Int | |||||
| IDivisible Int | |||||
| Multiplicative Int | |||||
| IsIntegral Int | |||||
| 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 Source # primShiftToBytes :: Proxy Int -> Int Source # primBaUIndex :: ByteArray# -> Offset Int -> Int Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> prim Int Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> Int -> prim () Source # primAddrIndex :: Addr# -> Offset Int -> Int Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int -> prim Int Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int -> Int -> prim () Source # | |||||
| Arbitrary Int Source # | |||||
| IsField Int Source # | |||||
| Signed Int Source # | |||||
| Bits Int | Since: base-2.1 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Int -> Int -> Int Source # (.|.) :: Int -> Int -> Int Source # xor :: Int -> Int -> Int Source # complement :: Int -> Int Source # shift :: Int -> Int -> Int Source # rotate :: Int -> Int -> Int Source # setBit :: Int -> Int -> Int Source # clearBit :: Int -> Int -> Int Source # complementBit :: Int -> Int -> Int Source # testBit :: Int -> Int -> Bool Source # bitSizeMaybe :: Int -> Maybe Int Source # bitSize :: Int -> Int Source # isSigned :: Int -> Bool Source # shiftL :: Int -> Int -> Int Source # unsafeShiftL :: Int -> Int -> Int Source # shiftR :: Int -> Int -> Int Source # unsafeShiftR :: Int -> Int -> Int Source # rotateL :: Int -> Int -> Int Source # | |||||
| FiniteBits Int | Since: base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Int -> Int Source # countLeadingZeros :: Int -> Int Source # countTrailingZeros :: Int -> Int Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int Source # toConstr :: Int -> Constr Source # dataTypeOf :: Int -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) Source # gmapT :: (forall b. Data b => b -> b) -> Int -> Int Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int Source # | |||||
| Bounded Int | Since: base-2.1 | ||||
| Enum Int | Since: base-2.1 | ||||
Defined in GHC.Internal.Enum | |||||
| Storable Int | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
| Num Int | Since: base-2.1 | ||||
| Read Int | Since: base-2.1 | ||||
| Integral Int | Since: base-2.0.1 | ||||
| Real Int | Since: base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Int -> Rational Source # | |||||
| Show Int | Since: base-2.1 | ||||
| Eq Int | |||||
| Ord Int | |||||
| Cast Int64 Int | |||||
| Cast Word64 Int | |||||
| Cast Int Int64 | |||||
| Cast Int Word64 | |||||
| Cast Int Word | |||||
| Cast Word Int | |||||
| From Int16 Int | |||||
| From Int32 Int | |||||
| From Int8 Int | |||||
| From Word16 Int | |||||
| From Word32 Int | |||||
| From Word8 Int | |||||
| From Int Int64 | |||||
| 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 Source # | |||||
| IntegralUpsize Int32 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int Source # | |||||
| IntegralUpsize Int8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int Source # | |||||
| IntegralUpsize Word8 Int | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int Source # | |||||
| IntegralUpsize Int Int64 | |||||
Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 Source # | |||||
| 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 Source # foldMap :: Monoid m => (a -> m) -> UInt a -> m Source # foldMap' :: Monoid m => (a -> m) -> UInt a -> m Source # foldr :: (a -> b -> b) -> b -> UInt a -> b Source # foldr' :: (a -> b -> b) -> b -> UInt a -> b Source # foldl :: (b -> a -> b) -> b -> UInt a -> b Source # foldl' :: (b -> a -> b) -> b -> UInt a -> b Source # foldr1 :: (a -> a -> a) -> UInt a -> a Source # foldl1 :: (a -> a -> a) -> UInt a -> a Source # toList :: UInt a -> [a] Source # null :: UInt a -> Bool Source # length :: UInt a -> Int Source # elem :: Eq a => a -> UInt a -> Bool Source # maximum :: Ord a => UInt a -> a Source # minimum :: Ord a => UInt a -> a Source # | |||||
| Traversable (UInt :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| From (CountOf ty) Int | |||||
| 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 Methods compare :: URec Int p -> URec Int p -> Ordering Source # (<) :: URec Int p -> URec Int p -> Bool Source # (<=) :: URec Int p -> URec Int p -> Bool Source # (>) :: URec Int p -> URec Int p -> Bool Source # (>=) :: URec Int p -> URec Int p -> Bool Source # | |||||
| 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 Methods formatArg :: Integer -> FieldFormatter Source # parseFormat :: Integer -> ModifierParser Source # | |||||
| Fractional Rational | |||||
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Rational Source # | |||||
| HasNegation Integer | |||||
| Integral Integer | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Integer Source # | |||||
| NormalForm Integer | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Integer -> () Source # | |||||
| Additive Rational | |||||
| Additive Integer | |||||
| Divisible Rational | |||||
| IDivisible Integer | |||||
| Multiplicative Rational | |||||
| Multiplicative Integer | |||||
| IsIntegral Integer | |||||
| Subtractive Integer | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Arbitrary Integer Source # | |||||
| IsField Integer Source # | |||||
| Hashable Integer Source # | |||||
| IntegralRounding Rational Source # | |||||
| Signed Integer Source # | |||||
| Bits Integer | Since: base-2.1 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Integer -> Integer -> Integer Source # (.|.) :: Integer -> Integer -> Integer Source # xor :: Integer -> Integer -> Integer Source # complement :: Integer -> Integer Source # shift :: Integer -> Int -> Integer Source # rotate :: Integer -> Int -> Integer Source # bit :: Int -> Integer Source # setBit :: Integer -> Int -> Integer Source # clearBit :: Integer -> Int -> Integer Source # complementBit :: Integer -> Int -> Integer Source # testBit :: Integer -> Int -> Bool Source # bitSizeMaybe :: Integer -> Maybe Int Source # bitSize :: Integer -> Int Source # isSigned :: Integer -> Bool Source # shiftL :: Integer -> Int -> Integer Source # unsafeShiftL :: Integer -> Int -> Integer Source # shiftR :: Integer -> Int -> Integer Source # unsafeShiftR :: Integer -> Int -> Integer Source # rotateL :: Integer -> Int -> Integer Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer Source # toConstr :: Integer -> Constr Source # dataTypeOf :: Integer -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) Source # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source # | |||||
| Enum Integer | Since: base-2.1 | ||||
Defined in GHC.Internal.Enum Methods succ :: Integer -> Integer Source # pred :: Integer -> Integer Source # toEnum :: Int -> Integer Source # fromEnum :: Integer -> Int Source # enumFrom :: Integer -> [Integer] Source # enumFromThen :: Integer -> Integer -> [Integer] Source # enumFromTo :: Integer -> Integer -> [Integer] Source # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] Source # | |||||
| Num Integer | Since: base-2.1 | ||||
Defined in GHC.Internal.Num | |||||
| Read Integer | Since: base-2.1 | ||||
| Integral Integer | Since: base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods quot :: Integer -> Integer -> Integer Source # rem :: Integer -> Integer -> Integer Source # div :: Integer -> Integer -> Integer Source # mod :: Integer -> Integer -> Integer Source # quotRem :: Integer -> Integer -> (Integer, Integer) Source # | |||||
| Real Integer | Since: base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Integer -> Rational Source # | |||||
| Show Integer | Since: base-2.1 | ||||
| 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 Source # | |||||
| 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 Methods formatArg :: Natural -> FieldFormatter Source # parseFormat :: Natural -> ModifierParser Source # | |||||
| Integral Natural | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Natural Source # | |||||
| NormalForm Natural | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Natural -> () Source # | |||||
| Additive Natural | |||||
| IDivisible Natural | |||||
| Multiplicative Natural | |||||
| IsIntegral Natural | |||||
| IsNatural Natural | |||||
| Subtractive Natural | |||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||
| Arbitrary Natural Source # | |||||
| IsField Natural Source # | |||||
| Hashable Natural Source # | |||||
| Bits Natural | Since: base-4.8.0 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Natural -> Natural -> Natural Source # (.|.) :: Natural -> Natural -> Natural Source # xor :: Natural -> Natural -> Natural Source # complement :: Natural -> Natural Source # shift :: Natural -> Int -> Natural Source # rotate :: Natural -> Int -> Natural Source # bit :: Int -> Natural Source # setBit :: Natural -> Int -> Natural Source # clearBit :: Natural -> Int -> Natural Source # complementBit :: Natural -> Int -> Natural Source # testBit :: Natural -> Int -> Bool Source # bitSizeMaybe :: Natural -> Maybe Int Source # bitSize :: Natural -> Int Source # isSigned :: Natural -> Bool Source # shiftL :: Natural -> Int -> Natural Source # unsafeShiftL :: Natural -> Int -> Natural Source # shiftR :: Natural -> Int -> Natural Source # unsafeShiftR :: Natural -> Int -> Natural Source # rotateL :: Natural -> Int -> Natural Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural Source # toConstr :: Natural -> Constr Source # dataTypeOf :: Natural -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) Source # gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source # | |||||
| Enum Natural | Since: base-4.8.0.0 | ||||
Defined in GHC.Internal.Enum Methods succ :: Natural -> Natural Source # pred :: Natural -> Natural Source # toEnum :: Int -> Natural Source # fromEnum :: Natural -> Int Source # enumFrom :: Natural -> [Natural] Source # enumFromThen :: Natural -> Natural -> [Natural] Source # enumFromTo :: Natural -> Natural -> [Natural] Source # enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] Source # | |||||
| Num Natural | Note that Since: base-4.8.0.0 | ||||
Defined in GHC.Internal.Num | |||||
| Read Natural | Since: base-4.8.0.0 | ||||
| Integral Natural | Since: base-4.8.0.0 | ||||
Defined in GHC.Internal.Real Methods quot :: Natural -> Natural -> Natural Source # rem :: Natural -> Natural -> Natural Source # div :: Natural -> Natural -> Natural Source # mod :: Natural -> Natural -> Natural Source # quotRem :: Natural -> Natural -> (Natural, Natural) Source # | |||||
| Real Natural | Since: base-4.8.0.0 | ||||
Defined in GHC.Internal.Real Methods toRational :: Natural -> Rational Source # | |||||
| 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 Source # | |||||
| 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 Source # | |||||
| 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 Source # | |||||
| HasNegation Float | |||||
| Integral Float | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Float Source # | |||||
| NormalForm Float | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Float -> () Source # | |||||
| 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 Source # primShiftToBytes :: Proxy Float -> Int Source # primBaUIndex :: ByteArray# -> Offset Float -> Float Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () Source # primAddrIndex :: Addr# -> Offset Float -> Float Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () Source # | |||||
| Arbitrary Float Source # | |||||
| Storable Float Source # | |||||
| StorableFixed Float Source # | |||||
| Trigonometry Float Source # | |||||
Defined in Foundation.Math.Trigonometry Methods sin :: Float -> Float Source # cos :: Float -> Float Source # tan :: Float -> Float Source # asin :: Float -> Float Source # acos :: Float -> Float Source # atan :: Float -> Float Source # sinh :: Float -> Float Source # cosh :: Float -> Float Source # tanh :: Float -> Float Source # asinh :: Float -> Float Source # | |||||
| IntegralRounding Float Source # | |||||
| Signed Float Source # | |||||
| FloatingPoint Float Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float Source # toConstr :: Float -> Constr Source # dataTypeOf :: Float -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) Source # gmapT :: (forall b. Data b => b -> b) -> Float -> Float Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source # | |||||
| Enum Float |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods succ :: Float -> Float Source # pred :: Float -> Float Source # toEnum :: Int -> Float Source # fromEnum :: Float -> Int Source # enumFrom :: Float -> [Float] Source # enumFromThen :: Float -> Float -> [Float] Source # enumFromTo :: Float -> Float -> [Float] Source # enumFromThenTo :: Float -> Float -> Float -> [Float] Source # | |||||
| Floating Float | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods exp :: Float -> Float Source # log :: Float -> Float Source # sqrt :: Float -> Float Source # (**) :: Float -> Float -> Float Source # logBase :: Float -> Float -> Float Source # sin :: Float -> Float Source # cos :: Float -> Float Source # tan :: Float -> Float Source # asin :: Float -> Float Source # acos :: Float -> Float Source # atan :: Float -> Float Source # sinh :: Float -> Float Source # cosh :: Float -> Float Source # tanh :: Float -> Float Source # asinh :: Float -> Float Source # acosh :: Float -> Float Source # atanh :: Float -> Float Source # log1p :: Float -> Float Source # expm1 :: Float -> Float Source # | |||||
| RealFloat Float | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Float -> Integer Source # floatDigits :: Float -> Int Source # floatRange :: Float -> (Int, Int) Source # decodeFloat :: Float -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Float Source # exponent :: Float -> Int Source # significand :: Float -> Float Source # scaleFloat :: Int -> Float -> Float Source # isNaN :: Float -> Bool Source # isInfinite :: Float -> Bool Source # isDenormalized :: Float -> Bool Source # isNegativeZero :: Float -> Bool Source # | |||||
| Storable Float | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Float -> Int Source # alignment :: Float -> Int Source # peekElemOff :: Ptr Float -> Int -> IO Float Source # pokeElemOff :: Ptr Float -> Int -> Float -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Float Source # pokeByteOff :: Ptr b -> Int -> Float -> IO () Source # | |||||
| Num Float | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 | ||||
| Read Float | Since: base-2.1 | ||||
| Fractional Float | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 | ||||
| Real Float | Beware that
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods toRational :: Float -> Rational Source # | |||||
| RealFrac Float | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 | ||||
| Show Float | Since: base-2.1 | ||||
| Eq Float | Note that due to the presence of
Also note that
| ||||
| Ord Float | See | ||||
Defined in GHC.Classes | |||||
| 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 Source # foldMap :: Monoid m => (a -> m) -> UFloat a -> m Source # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m Source # foldr :: (a -> b -> b) -> b -> UFloat a -> b Source # foldr' :: (a -> b -> b) -> b -> UFloat a -> b Source # foldl :: (b -> a -> b) -> b -> UFloat a -> b Source # foldl' :: (b -> a -> b) -> b -> UFloat a -> b Source # foldr1 :: (a -> a -> a) -> UFloat a -> a Source # foldl1 :: (a -> a -> a) -> UFloat a -> a Source # toList :: UFloat a -> [a] Source # null :: UFloat a -> Bool Source # length :: UFloat a -> Int Source # elem :: Eq a => a -> UFloat a -> Bool Source # maximum :: Ord a => UFloat a -> a Source # minimum :: Ord a => UFloat a -> a Source # | |||||
| Traversable (UFloat :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| 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 Methods compare :: URec Float p -> URec Float p -> Ordering Source # (<) :: URec Float p -> URec Float p -> Bool Source # (<=) :: URec Float p -> URec Float p -> Bool Source # (>) :: URec Float p -> URec Float p -> Bool Source # (>=) :: URec Float p -> URec Float p -> Bool Source # max :: URec Float p -> URec Float p -> URec Float p Source # min :: URec Float p -> URec Float p -> URec Float p Source # | |||||
| 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 Methods formatArg :: Double -> FieldFormatter Source # parseFormat :: Double -> ModifierParser Source # | |||||
| Fractional Double | |||||
Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Double Source # | |||||
| HasNegation Double | |||||
| Integral Double | |||||
Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Double Source # | |||||
| NormalForm Double | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Double -> () Source # | |||||
| 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 Source # primShiftToBytes :: Proxy Double -> Int Source # primBaUIndex :: ByteArray# -> Offset Double -> Double Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () Source # primAddrIndex :: Addr# -> Offset Double -> Double Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () Source # | |||||
| Arbitrary Double Source # | |||||
| Storable Double Source # | |||||
| StorableFixed Double Source # | |||||
| IsField Double Source # | |||||
| Trigonometry Double Source # | |||||
Defined in Foundation.Math.Trigonometry Methods sin :: Double -> Double Source # cos :: Double -> Double Source # tan :: Double -> Double Source # asin :: Double -> Double Source # acos :: Double -> Double Source # atan :: Double -> Double Source # sinh :: Double -> Double Source # cosh :: Double -> Double Source # tanh :: Double -> Double Source # asinh :: Double -> Double Source # | |||||
| IntegralRounding Double Source # | |||||
| Signed Double Source # | |||||
| FloatingPoint Double Source # | |||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double Source # toConstr :: Double -> Constr Source # dataTypeOf :: Double -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) Source # gmapT :: (forall b. Data b => b -> b) -> Double -> Double Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source # | |||||
| Enum Double |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods succ :: Double -> Double Source # pred :: Double -> Double Source # toEnum :: Int -> Double Source # fromEnum :: Double -> Int Source # enumFrom :: Double -> [Double] Source # enumFromThen :: Double -> Double -> [Double] Source # enumFromTo :: Double -> Double -> [Double] Source # enumFromThenTo :: Double -> Double -> Double -> [Double] Source # | |||||
| Floating Double | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods exp :: Double -> Double Source # log :: Double -> Double Source # sqrt :: Double -> Double Source # (**) :: Double -> Double -> Double Source # logBase :: Double -> Double -> Double Source # sin :: Double -> Double Source # cos :: Double -> Double Source # tan :: Double -> Double Source # asin :: Double -> Double Source # acos :: Double -> Double Source # atan :: Double -> Double Source # sinh :: Double -> Double Source # cosh :: Double -> Double Source # tanh :: Double -> Double Source # asinh :: Double -> Double Source # acosh :: Double -> Double Source # atanh :: Double -> Double Source # log1p :: Double -> Double Source # expm1 :: Double -> Double Source # | |||||
| RealFloat Double | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Double -> Integer Source # floatDigits :: Double -> Int Source # floatRange :: Double -> (Int, Int) Source # decodeFloat :: Double -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Double Source # exponent :: Double -> Int Source # significand :: Double -> Double Source # scaleFloat :: Int -> Double -> Double Source # isNaN :: Double -> Bool Source # isInfinite :: Double -> Bool Source # isDenormalized :: Double -> Bool Source # isNegativeZero :: Double -> Bool Source # | |||||
| Storable Double | Since: base-2.1 | ||||
Defined in GHC.Internal.Foreign.Storable Methods sizeOf :: Double -> Int Source # alignment :: Double -> Int Source # peekElemOff :: Ptr Double -> Int -> IO Double Source # pokeElemOff :: Ptr Double -> Int -> Double -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Double Source # pokeByteOff :: Ptr b -> Int -> Double -> IO () Source # | |||||
| Num Double | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 | ||||
Defined in GHC.Internal.Float | |||||
| Read Double | Since: base-2.1 | ||||
| Fractional Double | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 | ||||
| Real Double | Beware that
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods toRational :: Double -> Rational Source # | |||||
| RealFrac Double | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 | ||||
| Show Double | Since: base-2.1 | ||||
| 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 Source # foldMap :: Monoid m => (a -> m) -> UDouble a -> m Source # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m Source # foldr :: (a -> b -> b) -> b -> UDouble a -> b Source # foldr' :: (a -> b -> b) -> b -> UDouble a -> b Source # foldl :: (b -> a -> b) -> b -> UDouble a -> b Source # foldl' :: (b -> a -> b) -> b -> UDouble a -> b Source # foldr1 :: (a -> a -> a) -> UDouble a -> a Source # foldl1 :: (a -> a -> a) -> UDouble a -> a Source # toList :: UDouble a -> [a] Source # null :: UDouble a -> Bool Source # length :: UDouble a -> Int Source # elem :: Eq a => a -> UDouble a -> Bool Source # maximum :: Ord a => UDouble a -> a Source # minimum :: Ord a => UDouble a -> a Source # | |||||
| Traversable (UDouble :: Type -> Type) | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Traversable | |||||
| 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 Source # (<) :: URec Double p -> URec Double p -> Bool Source # (<=) :: URec Double p -> URec Double p -> Bool Source # (>) :: URec Double p -> URec Double p -> Bool Source # (>=) :: URec Double p -> URec Double p -> Bool Source # max :: URec Double p -> URec Double p -> URec Double p Source # min :: URec Double p -> URec Double p -> URec Double p Source # | |||||
| 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) | |||||
| TryFrom Int (CountOf ty) | |||||
| Integral (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> CountOf ty Source # | |||||
| NormalForm (CountOf a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: CountOf a -> () Source # | |||||
| Additive (CountOf ty) | |||||
| IsIntegral (CountOf ty) | |||||
| IsNatural (CountOf ty) | |||||
| Subtractive (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
| Arbitrary (CountOf ty) Source # | |||||
| IsField (CountOf a) Source # | |||||
| Monoid (CountOf ty) | |||||
| Semigroup (CountOf ty) | |||||
| Enum (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods succ :: CountOf ty -> CountOf ty Source # pred :: CountOf ty -> CountOf ty Source # toEnum :: Int -> CountOf ty Source # fromEnum :: CountOf ty -> Int Source # enumFrom :: CountOf ty -> [CountOf ty] Source # enumFromThen :: CountOf ty -> CountOf ty -> [CountOf ty] Source # enumFromTo :: CountOf ty -> CountOf ty -> [CountOf ty] Source # enumFromThenTo :: CountOf ty -> CountOf ty -> CountOf ty -> [CountOf ty] Source # | |||||
| Num (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods (+) :: CountOf ty -> CountOf ty -> CountOf ty Source # (-) :: CountOf ty -> CountOf ty -> CountOf ty Source # (*) :: CountOf ty -> CountOf ty -> CountOf ty Source # negate :: CountOf ty -> CountOf ty Source # abs :: CountOf ty -> CountOf ty Source # signum :: CountOf ty -> CountOf ty Source # fromInteger :: Integer -> CountOf ty Source # | |||||
| Show (CountOf ty) | |||||
| Eq (CountOf ty) | |||||
| Ord (CountOf ty) | |||||
Defined in Basement.Types.OffsetSize Methods compare :: CountOf ty -> CountOf ty -> Ordering Source # (<) :: CountOf ty -> CountOf ty -> Bool Source # (<=) :: CountOf ty -> CountOf ty -> Bool Source # (>) :: CountOf ty -> CountOf ty -> Bool Source # (>=) :: CountOf ty -> CountOf ty -> Bool Source # | |||||
| From (CountOf ty) Int | |||||
| From (CountOf ty) Word | |||||
| 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) | |||||
| TryFrom Int (Offset ty) | |||||
| Integral (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> Offset ty Source # | |||||
| NormalForm (Offset a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Offset a -> () Source # | |||||
| Additive (Offset ty) | |||||
| IsIntegral (Offset ty) | |||||
| IsNatural (Offset ty) | |||||
| Subtractive (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Associated Types
| |||||
| IsField (Offset a) Source # | |||||
| Enum (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Methods succ :: Offset ty -> Offset ty Source # pred :: Offset ty -> Offset ty Source # toEnum :: Int -> Offset ty Source # fromEnum :: Offset ty -> Int Source # enumFrom :: Offset ty -> [Offset ty] Source # enumFromThen :: Offset ty -> Offset ty -> [Offset ty] Source # enumFromTo :: Offset ty -> Offset ty -> [Offset ty] Source # enumFromThenTo :: Offset ty -> Offset ty -> Offset ty -> [Offset ty] Source # | |||||
| Num (Offset ty) | |||||
Defined in Basement.Types.OffsetSize Methods (+) :: Offset ty -> Offset ty -> Offset ty Source # (-) :: Offset ty -> Offset ty -> Offset ty Source # (*) :: Offset ty -> Offset ty -> Offset ty Source # negate :: Offset ty -> Offset ty Source # abs :: Offset ty -> Offset ty Source # signum :: Offset ty -> Offset ty Source # fromInteger :: Integer -> Offset ty Source # | |||||
| Show (Offset ty) | |||||
| Eq (Offset ty) | |||||
| Ord (Offset ty) | |||||
Defined in Basement.Types.OffsetSize | |||||
| 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 | |||||||||
| From String (UArray Word8) | |||||||||
| NormalForm (UArray ty) | |||||||||
Defined in Basement.UArray.Base Methods toNormalForm :: UArray ty -> () Source # | |||||||||
| PrimType ty => Buildable (UArray ty) Source # | |||||||||
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 () Source # build :: PrimMonad prim => Int -> Builder (UArray ty) (Mutable (UArray ty)) (Step (UArray ty)) prim err () -> prim (Either err (UArray ty)) Source # | |||||||||
| PrimType ty => Collection (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Collection Methods null :: UArray ty -> Bool Source # length :: UArray ty -> CountOf (Element (UArray ty)) Source # elem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool Source # notElem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool Source # maximum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) Source # minimum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) Source # any :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool Source # all :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool Source # | |||||||||
| PrimType ty => Copy (UArray ty) Source # | |||||||||
| PrimType ty => Fold1able (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Foldable | |||||||||
| PrimType ty => Foldable (UArray ty) Source # | |||||||||
| PrimType ty => IndexedCollection (UArray ty) Source # | |||||||||
| PrimType ty => InnerFunctor (UArray ty) Source # | |||||||||
| PrimType ty => Sequential (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # revTake :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # drop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # revDrop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # splitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) Source # revSplitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) Source # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] Source # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # breakEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) Source # takeWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # dropWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty Source # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) Source # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # spanEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # reverse :: UArray ty -> UArray ty Source # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) Source # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) Source # snoc :: UArray ty -> Element (UArray ty) -> UArray ty Source # cons :: Element (UArray ty) -> UArray ty -> UArray ty Source # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) Source # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty Source # singleton :: Element (UArray ty) -> UArray ty Source # head :: NonEmpty (UArray ty) -> Element (UArray ty) Source # last :: NonEmpty (UArray ty) -> Element (UArray ty) Source # tail :: NonEmpty (UArray ty) -> UArray ty Source # init :: NonEmpty (UArray ty) -> UArray ty Source # replicate :: CountOf (Element (UArray ty)) -> Element (UArray ty) -> UArray ty Source # isPrefixOf :: UArray ty -> UArray ty -> Bool Source # isSuffixOf :: UArray ty -> UArray ty -> Bool Source # isInfixOf :: UArray ty -> UArray ty -> Bool Source # stripPrefix :: UArray ty -> UArray ty -> Maybe (UArray ty) Source # stripSuffix :: UArray ty -> UArray ty -> Maybe (UArray ty) Source # | |||||||||
| PrimType ty => Zippable (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (UArray ty)) -> a -> b -> UArray ty Source # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (UArray ty)) -> a -> b -> c -> UArray ty Source # 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 Source # 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 Source # 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 Source # 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 Source # | |||||||||
| PrimType a => Hashable (UArray a) Source # | |||||||||
| 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) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UArray ty) Source # toConstr :: UArray ty -> Constr Source # dataTypeOf :: UArray ty -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UArray ty)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UArray ty)) Source # gmapT :: (forall b. Data b => b -> b) -> UArray ty -> UArray ty Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r Source # gmapQ :: (forall d. Data d => d -> u) -> UArray ty -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> UArray ty -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) Source # | |||||||||
| 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) | |||||||||
Defined in Basement.UArray.Base | |||||||||
| TryFrom (UArray Word8) String | |||||||||
| PrimType ty => From (Block ty) (UArray ty) | |||||||||
| PrimType ty => From (Array ty) (UArray ty) | |||||||||
| PrimType ty => From (UArray ty) (Block ty) | |||||||||
| PrimType ty => From (UArray ty) (Array ty) | |||||||||
| (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) | |||||||||
| type Mutable (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element (UArray ty) Source # | |||||||||
Defined in Foundation.Collection.Element | |||||||||
| type Item (UArray ty) | |||||||||
Defined in Basement.UArray.Base | |||||||||
class Eq ty => PrimType ty Source #
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 Source # primShiftToBytes :: Proxy Char7 -> Int Source # primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () Source # primAddrIndex :: Addr# -> Offset Char7 -> Char7 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () Source # | |||||
| PrimType Word128 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word128 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word128 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () Source # primAddrIndex :: Addr# -> Offset Word128 -> Word128 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () Source # | |||||
| PrimType Word256 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word256 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word256 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word256 -> Word256 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> prim Word256 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> Word256 -> prim () Source # primAddrIndex :: Addr# -> Offset Word256 -> Word256 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word256 -> prim Word256 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word256 -> Word256 -> prim () Source # | |||||
| PrimType NanoSeconds Source # | |||||
Defined in Foundation.Time.Types Associated Types
Methods primSizeInBytes :: Proxy NanoSeconds -> CountOf Word8 Source # primShiftToBytes :: Proxy NanoSeconds -> Int Source # primBaUIndex :: ByteArray# -> Offset NanoSeconds -> NanoSeconds Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> prim NanoSeconds Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> NanoSeconds -> prim () Source # primAddrIndex :: Addr# -> Offset NanoSeconds -> NanoSeconds Source # primAddrRead :: PrimMonad prim => Addr# -> Offset NanoSeconds -> prim NanoSeconds Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset NanoSeconds -> NanoSeconds -> prim () Source # | |||||
| PrimType Seconds Source # | |||||
Defined in Foundation.Time.Types Associated Types
Methods primSizeInBytes :: Proxy Seconds -> CountOf Word8 Source # primShiftToBytes :: Proxy Seconds -> Int Source # primBaUIndex :: ByteArray# -> Offset Seconds -> Seconds Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> prim Seconds Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> Seconds -> prim () Source # primAddrIndex :: Addr# -> Offset Seconds -> Seconds Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Seconds -> prim Seconds Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Seconds -> Seconds -> prim () Source # | |||||
| PrimType CChar | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy CChar -> CountOf Word8 Source # primShiftToBytes :: Proxy CChar -> Int Source # primBaUIndex :: ByteArray# -> Offset CChar -> CChar Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> prim CChar Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> CChar -> prim () Source # primAddrIndex :: Addr# -> Offset CChar -> CChar Source # primAddrRead :: PrimMonad prim => Addr# -> Offset CChar -> prim CChar Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset CChar -> CChar -> prim () Source # | |||||
| PrimType CUChar | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy CUChar -> CountOf Word8 Source # primShiftToBytes :: Proxy CUChar -> Int Source # primBaUIndex :: ByteArray# -> Offset CUChar -> CUChar Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> prim CUChar Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> CUChar -> prim () Source # primAddrIndex :: Addr# -> Offset CUChar -> CUChar Source # primAddrRead :: PrimMonad prim => Addr# -> Offset CUChar -> prim CUChar Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset CUChar -> CUChar -> prim () Source # | |||||
| PrimType Int16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int16 -> CountOf Word8 Source # primShiftToBytes :: Proxy Int16 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () Source # primAddrIndex :: Addr# -> Offset Int16 -> Int16 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () Source # | |||||
| PrimType Int32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int32 -> CountOf Word8 Source # primShiftToBytes :: Proxy Int32 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () Source # primAddrIndex :: Addr# -> Offset Int32 -> Int32 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () Source # | |||||
| PrimType Int64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int64 -> CountOf Word8 Source # primShiftToBytes :: Proxy Int64 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () Source # primAddrIndex :: Addr# -> Offset Int64 -> Int64 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () Source # | |||||
| PrimType Int8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int8 -> CountOf Word8 Source # primShiftToBytes :: Proxy Int8 -> Int Source # primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () Source # primAddrIndex :: Addr# -> Offset Int8 -> Int8 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () Source # | |||||
| PrimType Word16 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word16 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word16 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () Source # primAddrIndex :: Addr# -> Offset Word16 -> Word16 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () Source # | |||||
| PrimType Word32 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word32 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word32 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () Source # primAddrIndex :: Addr# -> Offset Word32 -> Word32 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () Source # | |||||
| PrimType Word64 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word64 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word64 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () Source # primAddrIndex :: Addr# -> Offset Word64 -> Word64 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () Source # | |||||
| PrimType Word8 | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word8 -> CountOf Word8 Source # primShiftToBytes :: Proxy Word8 -> Int Source # primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () Source # primAddrIndex :: Addr# -> Offset Word8 -> Word8 Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () Source # | |||||
| PrimType Char | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Char -> CountOf Word8 Source # primShiftToBytes :: Proxy Char -> Int Source # primBaUIndex :: ByteArray# -> Offset Char -> Char Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () Source # primAddrIndex :: Addr# -> Offset Char -> Char Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () Source # | |||||
| PrimType Double | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Double -> CountOf Word8 Source # primShiftToBytes :: Proxy Double -> Int Source # primBaUIndex :: ByteArray# -> Offset Double -> Double Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () Source # primAddrIndex :: Addr# -> Offset Double -> Double Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () Source # | |||||
| PrimType Float | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Float -> CountOf Word8 Source # primShiftToBytes :: Proxy Float -> Int Source # primBaUIndex :: ByteArray# -> Offset Float -> Float Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () Source # primAddrIndex :: Addr# -> Offset Float -> Float Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () Source # | |||||
| PrimType Int | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Int -> CountOf Word8 Source # primShiftToBytes :: Proxy Int -> Int Source # primBaUIndex :: ByteArray# -> Offset Int -> Int Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> prim Int Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> Int -> prim () Source # primAddrIndex :: Addr# -> Offset Int -> Int Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Int -> prim Int Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int -> Int -> prim () Source # | |||||
| PrimType Word | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy Word -> CountOf Word8 Source # primShiftToBytes :: Proxy Word -> Int Source # primBaUIndex :: ByteArray# -> Offset Word -> Word Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () Source # primAddrIndex :: Addr# -> Offset Word -> Word Source # primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () Source # | |||||
| PrimType a => PrimType (BE a) | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy (BE a) -> CountOf Word8 Source # primShiftToBytes :: Proxy (BE a) -> Int Source # primBaUIndex :: ByteArray# -> Offset (BE a) -> BE a Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> prim (BE a) Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> BE a -> prim () Source # primAddrIndex :: Addr# -> Offset (BE a) -> BE a Source # primAddrRead :: PrimMonad prim => Addr# -> Offset (BE a) -> prim (BE a) Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset (BE a) -> BE a -> prim () Source # | |||||
| PrimType a => PrimType (LE a) | |||||
Defined in Basement.PrimType Associated Types
Methods primSizeInBytes :: Proxy (LE a) -> CountOf Word8 Source # primShiftToBytes :: Proxy (LE a) -> Int Source # primBaUIndex :: ByteArray# -> Offset (LE a) -> LE a Source # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> prim (LE a) Source # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> LE a -> prim () Source # primAddrIndex :: Addr# -> Offset (LE a) -> LE a Source # primAddrRead :: PrimMonad prim => Addr# -> Offset (LE a) -> prim (LE a) Source # primAddrWrite :: PrimMonad prim => Addr# -> Offset (LE a) -> LE a -> prim () Source # | |||||
Array of a
Instances
| Mappable Array Source # | |||||||||
Defined in Foundation.Collection.Mappable Methods traverse :: Applicative f => (a -> f b) -> Array a -> f (Array b) Source # sequenceA :: Applicative f => Array (f a) -> f (Array a) Source # mapM :: (Applicative m, Monad m) => (a -> m b) -> Array a -> m (Array b) Source # sequence :: (Applicative m, Monad m) => Array (m a) -> m (Array a) Source # | |||||||||
| Functor Array | |||||||||
| NormalForm a => NormalForm (Array a) | |||||||||
Defined in Basement.BoxedArray Methods toNormalForm :: Array a -> () Source # | |||||||||
| Buildable (Array ty) Source # | |||||||||
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 () Source # build :: PrimMonad prim => Int -> Builder (Array ty) (Mutable (Array ty)) (Step (Array ty)) prim err () -> prim (Either err (Array ty)) Source # | |||||||||
| Collection (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Collection Methods null :: Array ty -> Bool Source # length :: Array ty -> CountOf (Element (Array ty)) Source # elem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool Source # notElem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool Source # maximum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) Source # minimum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) Source # any :: (Element (Array ty) -> Bool) -> Array ty -> Bool Source # all :: (Element (Array ty) -> Bool) -> Array ty -> Bool Source # | |||||||||
| Copy (Array ty) Source # | |||||||||
| Fold1able (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Foldable | |||||||||
| Foldable (Array ty) Source # | |||||||||
| IndexedCollection (Array ty) Source # | |||||||||
| InnerFunctor (Array ty) Source # | |||||||||
| Sequential (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # revTake :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # drop :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # revDrop :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # splitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) Source # revSplitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) Source # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] Source # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # breakEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) Source # takeWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # dropWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # intersperse :: Element (Array ty) -> Array ty -> Array ty Source # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) Source # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # spanEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # reverse :: Array ty -> Array ty Source # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) Source # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) Source # snoc :: Array ty -> Element (Array ty) -> Array ty Source # cons :: Element (Array ty) -> Array ty -> Array ty Source # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) Source # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty Source # singleton :: Element (Array ty) -> Array ty Source # head :: NonEmpty (Array ty) -> Element (Array ty) Source # last :: NonEmpty (Array ty) -> Element (Array ty) Source # tail :: NonEmpty (Array ty) -> Array ty Source # init :: NonEmpty (Array ty) -> Array ty Source # replicate :: CountOf (Element (Array ty)) -> Element (Array ty) -> Array ty Source # isPrefixOf :: Array ty -> Array ty -> Bool Source # isSuffixOf :: Array ty -> Array ty -> Bool Source # isInfixOf :: Array ty -> Array ty -> Bool Source # stripPrefix :: Array ty -> Array ty -> Maybe (Array ty) Source # stripSuffix :: Array ty -> Array ty -> Maybe (Array ty) Source # | |||||||||
| BoxedZippable (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Zippable Methods zip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => a -> b -> Array ty Source # zip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => a -> b -> c -> Array ty Source # 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 Source # 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 Source # 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 Source # 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 Source # unzip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => Array ty -> (a, b) Source # unzip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => Array ty -> (a, b, c) Source # 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) Source # 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) Source # 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) Source # 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) Source # | |||||||||
| Zippable (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (Array ty)) -> a -> b -> Array ty Source # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (Array ty)) -> a -> b -> c -> Array ty Source # 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 Source # 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 Source # 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 Source # 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 Source # | |||||||||
| Hashable a => Hashable (Array a) Source # | |||||||||
| 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) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Array ty) Source # toConstr :: Array ty -> Constr Source # dataTypeOf :: Array ty -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Array ty)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Array ty)) Source # gmapT :: (forall b. Data b => b -> b) -> Array ty -> Array ty Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Array ty -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Array ty -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) Source # | |||||||||
| IsList (Array ty) | |||||||||
| Show a => Show (Array a) | |||||||||
| Eq a => Eq (Array a) | |||||||||
| Ord a => Ord (Array a) | |||||||||
Defined in Basement.BoxedArray | |||||||||
| PrimType ty => From (Array ty) (Block ty) | |||||||||
| PrimType ty => From (Array ty) (UArray ty) | |||||||||
| PrimType ty => From (UArray ty) (Array ty) | |||||||||
| (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) | |||||||||
| type Mutable (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step (Array ty) Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element (Array ty) Source # | |||||||||
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 -> () Source # | |||||||||
| Arbitrary String Source # | |||||||||
| Buildable String Source # | |||||||||
Defined in Foundation.Collection.Buildable Associated Types
| |||||||||
| Collection String Source # | |||||||||
Defined in Foundation.Collection.Collection Methods null :: String -> Bool Source # length :: String -> CountOf (Element String) Source # elem :: (Eq a, a ~ Element String) => Element String -> String -> Bool Source # notElem :: (Eq a, a ~ Element String) => Element String -> String -> Bool Source # maximum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String Source # minimum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String Source # | |||||||||
| Copy String Source # | |||||||||
| IndexedCollection String Source # | |||||||||
| InnerFunctor String Source # | |||||||||
| Sequential String Source # | |||||||||
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element String) -> String -> String Source # revTake :: CountOf (Element String) -> String -> String Source # drop :: CountOf (Element String) -> String -> String Source # revDrop :: CountOf (Element String) -> String -> String Source # splitAt :: CountOf (Element String) -> String -> (String, String) Source # revSplitAt :: CountOf (Element String) -> String -> (String, String) Source # splitOn :: (Element String -> Bool) -> String -> [String] Source # break :: (Element String -> Bool) -> String -> (String, String) Source # breakEnd :: (Element String -> Bool) -> String -> (String, String) Source # breakElem :: Element String -> String -> (String, String) Source # takeWhile :: (Element String -> Bool) -> String -> String Source # dropWhile :: (Element String -> Bool) -> String -> String Source # intersperse :: Element String -> String -> String Source # intercalate :: Element String -> String -> Element String Source # span :: (Element String -> Bool) -> String -> (String, String) Source # spanEnd :: (Element String -> Bool) -> String -> (String, String) Source # filter :: (Element String -> Bool) -> String -> String Source # partition :: (Element String -> Bool) -> String -> (String, String) Source # reverse :: String -> String Source # uncons :: String -> Maybe (Element String, String) Source # unsnoc :: String -> Maybe (String, Element String) Source # snoc :: String -> Element String -> String Source # cons :: Element String -> String -> String Source # find :: (Element String -> Bool) -> String -> Maybe (Element String) Source # sortBy :: (Element String -> Element String -> Ordering) -> String -> String Source # singleton :: Element String -> String Source # head :: NonEmpty String -> Element String Source # last :: NonEmpty String -> Element String Source # tail :: NonEmpty String -> String Source # init :: NonEmpty String -> String Source # replicate :: CountOf (Element String) -> Element String -> String Source # isPrefixOf :: String -> String -> Bool Source # isSuffixOf :: String -> String -> Bool Source # isInfixOf :: String -> String -> Bool Source # | |||||||||
| Zippable String Source # | |||||||||
Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element String) -> a -> b -> String Source # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element String) -> a -> b -> c -> String Source # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element String) -> a -> b -> c -> d -> String Source # 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 Source # 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 Source # 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 Source # | |||||||||
| IsField String Source # | |||||||||
| Hashable String Source # | |||||||||
| ParserSource String Source # | |||||||||
Defined in Foundation.Parser Methods nullChunk :: String -> Chunk String -> Bool Source # appendChunk :: String -> Chunk String -> String Source # subChunk :: String -> Offset (Element String) -> CountOf (Element String) -> Chunk String Source # spanChunk :: String -> Offset (Element String) -> (Element String -> Bool) -> (Chunk String, Offset (Element String)) Source # | |||||||||
| 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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c String Source # toConstr :: String -> Constr Source # dataTypeOf :: String -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c String) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c String) Source # gmapT :: (forall b. Data b => b -> b) -> String -> String Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> String -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> String -> r Source # gmapQ :: (forall d. Data d => d -> u) -> String -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> String -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> String -> m String Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> String -> m String Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> String -> m String Source # | |||||||||
| IsString String | |||||||||
Defined in Basement.UTF8.Base Methods fromString :: String -> String Source # | |||||||||
| IsList String | |||||||||
| Show String | |||||||||
| Eq String | |||||||||
| Ord String | |||||||||
| From AsciiString String | |||||||||
Defined in Basement.From Methods from :: AsciiString -> String Source # | |||||||||
| From String (UArray Word8) | |||||||||
| Show (ParseError String) Source # | |||||||||
Defined in Foundation.Parser | |||||||||
| TryFrom (UArray Word8) String | |||||||||
| IsProperty (String, Bool) Source # | |||||||||
| type Mutable String Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Step String Source # | |||||||||
Defined in Foundation.Collection.Buildable | |||||||||
| type Element String Source # | |||||||||
Defined in Foundation.Collection.Element | |||||||||
| type Chunk String Source # | |||||||||
Defined in Foundation.Parser | |||||||||
| type Item String | |||||||||
Defined in Basement.UTF8.Base | |||||||||
Numeric functions
(^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 Source #
raise a number to an integral power
fromIntegral :: (Integral a, Num b) => a -> b Source #
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 Source #
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 Source # sconcat :: NonEmpty AsciiString -> AsciiString Source # stimes :: Integral b => b -> AsciiString -> AsciiString Source # | |
| Semigroup String | |
| Semigroup Bitmap Source # | |
| Semigroup CSV Source # | |
| Semigroup Row Source # | |
| Semigroup FileName Source # | |
| 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 ExceptionContext | |
Defined in GHC.Internal.Exception.Context Methods (<>) :: ExceptionContext -> ExceptionContext -> ExceptionContext Source # sconcat :: NonEmpty ExceptionContext -> ExceptionContext Source # stimes :: Integral b => b -> ExceptionContext -> ExceptionContext Source # | |
| 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 Source # sconcat :: NonEmpty (Comparison a) -> Comparison a Source # stimes :: Integral b => b -> Comparison a -> Comparison a Source # | |
| 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 Source # sconcat :: NonEmpty (Equivalence a) -> Equivalence a Source # stimes :: Integral b => b -> Equivalence a -> Equivalence a Source # | |
| 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 Source # sconcat :: NonEmpty (WrappedMonoid m) -> WrappedMonoid m Source # stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m Source # | |
| PrimType ty => Semigroup (Block ty) | |
| Semigroup (Array a) | |
| Semigroup (CountOf ty) | |
| PrimType ty => Semigroup (UArray ty) | |
| Semigroup (ChunkedUArray a) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods (<>) :: ChunkedUArray a -> ChunkedUArray a -> ChunkedUArray a Source # sconcat :: NonEmpty (ChunkedUArray a) -> ChunkedUArray a Source # stimes :: Integral b => b -> ChunkedUArray a -> ChunkedUArray a Source # | |
| Semigroup (DList a) Source # | |
| 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 Source # sconcat :: NonEmpty (Generically a) -> Generically a Source # stimes :: Integral b => b -> Generically a -> Generically a Source # | |
| 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 Source #
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]
mappend :: a -> a -> a Source #
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 Source # mappend :: AsciiString -> AsciiString -> AsciiString Source # mconcat :: [AsciiString] -> AsciiString Source # | |
| Monoid String | |
| Monoid Bitmap Source # | |
| Monoid CSV Source # | |
| Monoid Row Source # | |
| Monoid FileName Source # | |
| Monoid All | Since: base-2.1 |
| Monoid Any | Since: base-2.1 |
| Monoid ExceptionContext | |
Defined in GHC.Internal.Exception.Context Methods mempty :: ExceptionContext Source # mappend :: ExceptionContext -> ExceptionContext -> ExceptionContext Source # mconcat :: [ExceptionContext] -> ExceptionContext Source # | |
| Monoid Ordering | Since: base-2.1 |
| Monoid () | Since: base-2.1 |
| Monoid (Comparison a) |
mempty :: Comparison a mempty = Comparison _ _ -> EQ |
Defined in Data.Functor.Contravariant Methods mempty :: Comparison a Source # mappend :: Comparison a -> Comparison a -> Comparison a Source # mconcat :: [Comparison a] -> Comparison a Source # | |
| Monoid (Equivalence a) |
mempty :: Equivalence a mempty = Equivalence _ _ -> True |
Defined in Data.Functor.Contravariant Methods mempty :: Equivalence a Source # mappend :: Equivalence a -> Equivalence a -> Equivalence a Source # mconcat :: [Equivalence a] -> Equivalence a Source # | |
| 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 Source # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source # mconcat :: [WrappedMonoid m] -> WrappedMonoid m Source # | |
| PrimType ty => Monoid (Block ty) | |
| Monoid (Array a) | |
| Monoid (CountOf ty) | |
| PrimType ty => Monoid (UArray ty) | |
| Monoid (ChunkedUArray a) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods mempty :: ChunkedUArray a Source # mappend :: ChunkedUArray a -> ChunkedUArray a -> ChunkedUArray a Source # mconcat :: [ChunkedUArray a] -> ChunkedUArray a Source # | |
| Monoid (DList a) Source # | |
| 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.1 |
| Monoid (Last a) | Since: base-2.1 |
| Monoid a => Monoid (Dual a) | Since: base-2.1 |
| Monoid (Endo a) | Since: base-2.1 |
| Num a => Monoid (Product a) | Since: base-2.1 |
| Num a => Monoid (Sum a) | Since: base-2.1 |
| (Generic a, Monoid (Rep a ())) => Monoid (Generically a) | Since: base-4.17.0.0 |
Defined in GHC.Internal.Generics Methods mempty :: Generically a Source # mappend :: Generically a -> Generically a -> Generically a Source # mconcat :: [Generically a] -> Generically a Source # | |
| 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.1 |
| Monoid a => Monoid (Solo a) | Since: base-4.15 |
| Monoid [a] | Since: base-2.1 |
| 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.1 |
| Monoid b => Monoid (a -> b) | Since: base-2.1 |
| 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.1 |
| (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.1 |
| 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.1 |
(<>) :: Semigroup a => a -> a -> a infixr 6 Source #
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 Source #
A set of methods for ordered colection
Methods
Check if a collection is empty
length :: c -> CountOf (Element c) Source #
Length of a collection (number of Element c)
elem :: (Eq a, a ~ Element c) => Element c -> c -> Bool Source #
Check if a collection contains a specific element
This is the inverse of notElem.
notElem :: (Eq a, a ~ Element c) => Element c -> c -> Bool Source #
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 Source #
Get the maximum element of a collection
minimum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c Source #
Get the minimum element of a collection
any :: (Element c -> Bool) -> c -> Bool Source #
Determine is any elements of the collection satisfy the predicate
all :: (Element c -> Bool) -> c -> Bool Source #
Determine is all elements of the collection satisfy the predicate
Instances
| Collection AsciiString Source # | |
Defined in Foundation.Collection.Collection Methods null :: AsciiString -> Bool Source # length :: AsciiString -> CountOf (Element AsciiString) Source # elem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool Source # notElem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool Source # maximum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString Source # minimum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString Source # any :: (Element AsciiString -> Bool) -> AsciiString -> Bool Source # all :: (Element AsciiString -> Bool) -> AsciiString -> Bool Source # | |
| Collection String Source # | |
Defined in Foundation.Collection.Collection Methods null :: String -> Bool Source # length :: String -> CountOf (Element String) Source # elem :: (Eq a, a ~ Element String) => Element String -> String -> Bool Source # notElem :: (Eq a, a ~ Element String) => Element String -> String -> Bool Source # maximum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String Source # minimum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String Source # | |
| Collection Bitmap Source # | |
Defined in Foundation.Array.Bitmap Methods null :: Bitmap -> Bool Source # length :: Bitmap -> CountOf (Element Bitmap) Source # elem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool Source # notElem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool Source # maximum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap Source # minimum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap Source # | |
| Collection CSV Source # | |
Defined in Foundation.Format.CSV.Types Methods length :: CSV -> CountOf (Element CSV) Source # elem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool Source # notElem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool Source # maximum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV Source # minimum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV Source # | |
| Collection Row Source # | |
Defined in Foundation.Format.CSV.Types Methods length :: Row -> CountOf (Element Row) Source # elem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool Source # notElem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool Source # maximum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row Source # minimum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row Source # | |
| PrimType ty => Collection (Block ty) Source # | |
Defined in Foundation.Collection.Collection Methods null :: Block ty -> Bool Source # length :: Block ty -> CountOf (Element (Block ty)) Source # elem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool Source # notElem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool Source # maximum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) Source # minimum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) Source # any :: (Element (Block ty) -> Bool) -> Block ty -> Bool Source # all :: (Element (Block ty) -> Bool) -> Block ty -> Bool Source # | |
| Collection (Array ty) Source # | |
Defined in Foundation.Collection.Collection Methods null :: Array ty -> Bool Source # length :: Array ty -> CountOf (Element (Array ty)) Source # elem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool Source # notElem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool Source # maximum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) Source # minimum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) Source # any :: (Element (Array ty) -> Bool) -> Array ty -> Bool Source # all :: (Element (Array ty) -> Bool) -> Array ty -> Bool Source # | |
| Collection c => Collection (NonEmpty c) Source # | |
Defined in Foundation.Collection.Collection Methods null :: NonEmpty c -> Bool Source # length :: NonEmpty c -> CountOf (Element (NonEmpty c)) Source # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool Source # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool Source # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) Source # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) Source # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool Source # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool Source # | |
| PrimType ty => Collection (UArray ty) Source # | |
Defined in Foundation.Collection.Collection Methods null :: UArray ty -> Bool Source # length :: UArray ty -> CountOf (Element (UArray ty)) Source # elem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool Source # notElem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool Source # maximum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) Source # minimum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) Source # any :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool Source # all :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool Source # | |
| PrimType ty => Collection (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods null :: ChunkedUArray ty -> Bool Source # length :: ChunkedUArray ty -> CountOf (Element (ChunkedUArray ty)) Source # elem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool Source # notElem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool Source # maximum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) Source # minimum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) Source # any :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool Source # all :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool Source # | |
| Collection (DList a) Source # | |
Defined in Foundation.List.DList Methods null :: DList a -> Bool Source # length :: DList a -> CountOf (Element (DList a)) Source # elem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool Source # notElem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool Source # maximum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) Source # minimum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) Source # any :: (Element (DList a) -> Bool) -> DList a -> Bool Source # all :: (Element (DList a) -> Bool) -> DList a -> Bool Source # | |
| Collection [a] Source # | |
Defined in Foundation.Collection.Collection Methods length :: [a] -> CountOf (Element [a]) Source # elem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool Source # notElem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool Source # maximum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] Source # minimum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] Source # | |
and :: (Collection col, Element col ~ Bool) => col -> Bool Source #
Return True if all the elements in the collection are True
or :: (Collection col, Element col ~ Bool) => col -> Bool Source #
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 Source #
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 Source #
Take the first @n elements of a collection
revTake :: CountOf (Element c) -> c -> c Source #
Take the last @n elements of a collection
drop :: CountOf (Element c) -> c -> c Source #
Drop the first @n elements of a collection
revDrop :: CountOf (Element c) -> c -> c Source #
Drop the last @n elements of a collection
splitAt :: CountOf (Element c) -> c -> (c, c) Source #
Split the collection at the @n'th elements
revSplitAt :: CountOf (Element c) -> c -> (c, c) Source #
Split the collection at the @n'th elements from the end
splitOn :: (Element c -> Bool) -> c -> [c] Source #
Split on a specific elements returning a list of colletion
break :: (Element c -> Bool) -> c -> (c, c) Source #
Split a collection when the predicate return true
breakEnd :: (Element c -> Bool) -> c -> (c, c) Source #
Split a collection when the predicate return true starting from the end of the collection
breakElem :: Element c -> c -> (c, c) Source #
Split a collection at the given element
takeWhile :: (Element c -> Bool) -> c -> c Source #
Return the longest prefix in the collection that satisfy the predicate
dropWhile :: (Element c -> Bool) -> c -> c Source #
Return the longest prefix in the collection that satisfy the predicate
intersperse :: Element c -> c -> c Source #
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 Source #
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) Source #
Split a collection while the predicate return true
spanEnd :: (Element c -> Bool) -> c -> (c, c) Source #
Split a collection while the predicate return true starting from the end of the collection
filter :: (Element c -> Bool) -> c -> c Source #
Filter all the elements that satisfy the predicate
partition :: (Element c -> Bool) -> c -> (c, c) Source #
Partition the elements that satisfy the predicate and those that don't
Reverse a collection
uncons :: c -> Maybe (Element c, c) Source #
Decompose a collection into its first element and the remaining collection. If the collection is empty, returns Nothing.
unsnoc :: c -> Maybe (c, Element c) Source #
Decompose a collection into a collection without its last element, and the last element If the collection is empty, returns Nothing.
snoc :: c -> Element c -> c Source #
Prepend an element to an ordered collection
cons :: Element c -> c -> c Source #
Append an element to an ordered collection
find :: (Element c -> Bool) -> c -> Maybe (Element c) Source #
Find an element in an ordered collection
sortBy :: (Element c -> Element c -> Ordering) -> c -> c Source #
Sort an ordered collection using the specified order function
singleton :: Element c -> c Source #
Create a collection with a single element
head :: NonEmpty c -> Element c Source #
get the first element of a non-empty collection
last :: NonEmpty c -> Element c Source #
get the last element of a non-empty collection
tail :: NonEmpty c -> c Source #
Extract the elements after the first element of a non-empty collection.
init :: NonEmpty c -> c Source #
Extract the elements before the last element of a non-empty collection.
replicate :: CountOf (Element c) -> Element c -> c Source #
Create a collection where the element in parameter is repeated N time
isPrefixOf :: c -> c -> Bool Source #
Takes two collections and returns True iff the first collection is a prefix of the second.
default isPrefixOf :: Eq c => c -> c -> Bool Source #
isSuffixOf :: c -> c -> Bool Source #
Takes two collections and returns True iff the first collection is a suffix of the second.
default isSuffixOf :: Eq c => c -> c -> Bool Source #
isInfixOf :: c -> c -> Bool Source #
Takes two collections and returns True iff the first collection is an infix of the second.
stripPrefix :: c -> c -> Maybe c Source #
Try to strip a prefix from a collection
stripSuffix :: c -> c -> Maybe c Source #
Try to strip a suffix from a collection
Instances
| Sequential AsciiString Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source # revTake :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source # drop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source # revDrop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source # splitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) Source # revSplitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) Source # splitOn :: (Element AsciiString -> Bool) -> AsciiString -> [AsciiString] Source # break :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source # breakEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source # breakElem :: Element AsciiString -> AsciiString -> (AsciiString, AsciiString) Source # takeWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source # dropWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source # intersperse :: Element AsciiString -> AsciiString -> AsciiString Source # intercalate :: Element AsciiString -> AsciiString -> Element AsciiString Source # span :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source # spanEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source # filter :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source # partition :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source # reverse :: AsciiString -> AsciiString Source # uncons :: AsciiString -> Maybe (Element AsciiString, AsciiString) Source # unsnoc :: AsciiString -> Maybe (AsciiString, Element AsciiString) Source # snoc :: AsciiString -> Element AsciiString -> AsciiString Source # cons :: Element AsciiString -> AsciiString -> AsciiString Source # find :: (Element AsciiString -> Bool) -> AsciiString -> Maybe (Element AsciiString) Source # sortBy :: (Element AsciiString -> Element AsciiString -> Ordering) -> AsciiString -> AsciiString Source # singleton :: Element AsciiString -> AsciiString Source # head :: NonEmpty AsciiString -> Element AsciiString Source # last :: NonEmpty AsciiString -> Element AsciiString Source # tail :: NonEmpty AsciiString -> AsciiString Source # init :: NonEmpty AsciiString -> AsciiString Source # replicate :: CountOf (Element AsciiString) -> Element AsciiString -> AsciiString Source # isPrefixOf :: AsciiString -> AsciiString -> Bool Source # isSuffixOf :: AsciiString -> AsciiString -> Bool Source # isInfixOf :: AsciiString -> AsciiString -> Bool Source # stripPrefix :: AsciiString -> AsciiString -> Maybe AsciiString Source # stripSuffix :: AsciiString -> AsciiString -> Maybe AsciiString Source # | |
| Sequential String Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element String) -> String -> String Source # revTake :: CountOf (Element String) -> String -> String Source # drop :: CountOf (Element String) -> String -> String Source # revDrop :: CountOf (Element String) -> String -> String Source # splitAt :: CountOf (Element String) -> String -> (String, String) Source # revSplitAt :: CountOf (Element String) -> String -> (String, String) Source # splitOn :: (Element String -> Bool) -> String -> [String] Source # break :: (Element String -> Bool) -> String -> (String, String) Source # breakEnd :: (Element String -> Bool) -> String -> (String, String) Source # breakElem :: Element String -> String -> (String, String) Source # takeWhile :: (Element String -> Bool) -> String -> String Source # dropWhile :: (Element String -> Bool) -> String -> String Source # intersperse :: Element String -> String -> String Source # intercalate :: Element String -> String -> Element String Source # span :: (Element String -> Bool) -> String -> (String, String) Source # spanEnd :: (Element String -> Bool) -> String -> (String, String) Source # filter :: (Element String -> Bool) -> String -> String Source # partition :: (Element String -> Bool) -> String -> (String, String) Source # reverse :: String -> String Source # uncons :: String -> Maybe (Element String, String) Source # unsnoc :: String -> Maybe (String, Element String) Source # snoc :: String -> Element String -> String Source # cons :: Element String -> String -> String Source # find :: (Element String -> Bool) -> String -> Maybe (Element String) Source # sortBy :: (Element String -> Element String -> Ordering) -> String -> String Source # singleton :: Element String -> String Source # head :: NonEmpty String -> Element String Source # last :: NonEmpty String -> Element String Source # tail :: NonEmpty String -> String Source # init :: NonEmpty String -> String Source # replicate :: CountOf (Element String) -> Element String -> String Source # isPrefixOf :: String -> String -> Bool Source # isSuffixOf :: String -> String -> Bool Source # isInfixOf :: String -> String -> Bool Source # | |
| Sequential Bitmap Source # | |
Defined in Foundation.Array.Bitmap Methods take :: CountOf (Element Bitmap) -> Bitmap -> Bitmap Source # revTake :: CountOf (Element Bitmap) -> Bitmap -> Bitmap Source # drop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap Source # revDrop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap Source # splitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) Source # revSplitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) Source # splitOn :: (Element Bitmap -> Bool) -> Bitmap -> [Bitmap] Source # break :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) Source # breakEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) Source # breakElem :: Element Bitmap -> Bitmap -> (Bitmap, Bitmap) Source # takeWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap Source # dropWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap Source # intersperse :: Element Bitmap -> Bitmap -> Bitmap Source # intercalate :: Element Bitmap -> Bitmap -> Element Bitmap Source # span :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) Source # spanEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) Source # filter :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap Source # partition :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) Source # reverse :: Bitmap -> Bitmap Source # uncons :: Bitmap -> Maybe (Element Bitmap, Bitmap) Source # unsnoc :: Bitmap -> Maybe (Bitmap, Element Bitmap) Source # snoc :: Bitmap -> Element Bitmap -> Bitmap Source # cons :: Element Bitmap -> Bitmap -> Bitmap Source # find :: (Element Bitmap -> Bool) -> Bitmap -> Maybe (Element Bitmap) Source # sortBy :: (Element Bitmap -> Element Bitmap -> Ordering) -> Bitmap -> Bitmap Source # singleton :: Element Bitmap -> Bitmap Source # head :: NonEmpty Bitmap -> Element Bitmap Source # last :: NonEmpty Bitmap -> Element Bitmap Source # tail :: NonEmpty Bitmap -> Bitmap Source # init :: NonEmpty Bitmap -> Bitmap Source # replicate :: CountOf (Element Bitmap) -> Element Bitmap -> Bitmap Source # isPrefixOf :: Bitmap -> Bitmap -> Bool Source # isSuffixOf :: Bitmap -> Bitmap -> Bool Source # isInfixOf :: Bitmap -> Bitmap -> Bool Source # | |
| Sequential CSV Source # | |
Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element CSV) -> CSV -> CSV Source # revTake :: CountOf (Element CSV) -> CSV -> CSV Source # drop :: CountOf (Element CSV) -> CSV -> CSV Source # revDrop :: CountOf (Element CSV) -> CSV -> CSV Source # splitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) Source # revSplitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) Source # splitOn :: (Element CSV -> Bool) -> CSV -> [CSV] Source # break :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) Source # breakEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) Source # breakElem :: Element CSV -> CSV -> (CSV, CSV) Source # takeWhile :: (Element CSV -> Bool) -> CSV -> CSV Source # dropWhile :: (Element CSV -> Bool) -> CSV -> CSV Source # intersperse :: Element CSV -> CSV -> CSV Source # intercalate :: Element CSV -> CSV -> Element CSV Source # span :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) Source # spanEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) Source # filter :: (Element CSV -> Bool) -> CSV -> CSV Source # partition :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) Source # reverse :: CSV -> CSV Source # uncons :: CSV -> Maybe (Element CSV, CSV) Source # unsnoc :: CSV -> Maybe (CSV, Element CSV) Source # snoc :: CSV -> Element CSV -> CSV Source # cons :: Element CSV -> CSV -> CSV Source # find :: (Element CSV -> Bool) -> CSV -> Maybe (Element CSV) Source # sortBy :: (Element CSV -> Element CSV -> Ordering) -> CSV -> CSV Source # singleton :: Element CSV -> CSV Source # head :: NonEmpty CSV -> Element CSV Source # last :: NonEmpty CSV -> Element CSV Source # tail :: NonEmpty CSV -> CSV Source # init :: NonEmpty CSV -> CSV Source # replicate :: CountOf (Element CSV) -> Element CSV -> CSV Source # isPrefixOf :: CSV -> CSV -> Bool Source # isSuffixOf :: CSV -> CSV -> Bool Source # isInfixOf :: CSV -> CSV -> Bool Source # | |
| Sequential Row Source # | |
Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element Row) -> Row -> Row Source # revTake :: CountOf (Element Row) -> Row -> Row Source # drop :: CountOf (Element Row) -> Row -> Row Source # revDrop :: CountOf (Element Row) -> Row -> Row Source # splitAt :: CountOf (Element Row) -> Row -> (Row, Row) Source # revSplitAt :: CountOf (Element Row) -> Row -> (Row, Row) Source # splitOn :: (Element Row -> Bool) -> Row -> [Row] Source # break :: (Element Row -> Bool) -> Row -> (Row, Row) Source # breakEnd :: (Element Row -> Bool) -> Row -> (Row, Row) Source # breakElem :: Element Row -> Row -> (Row, Row) Source # takeWhile :: (Element Row -> Bool) -> Row -> Row Source # dropWhile :: (Element Row -> Bool) -> Row -> Row Source # intersperse :: Element Row -> Row -> Row Source # intercalate :: Element Row -> Row -> Element Row Source # span :: (Element Row -> Bool) -> Row -> (Row, Row) Source # spanEnd :: (Element Row -> Bool) -> Row -> (Row, Row) Source # filter :: (Element Row -> Bool) -> Row -> Row Source # partition :: (Element Row -> Bool) -> Row -> (Row, Row) Source # reverse :: Row -> Row Source # uncons :: Row -> Maybe (Element Row, Row) Source # unsnoc :: Row -> Maybe (Row, Element Row) Source # snoc :: Row -> Element Row -> Row Source # cons :: Element Row -> Row -> Row Source # find :: (Element Row -> Bool) -> Row -> Maybe (Element Row) Source # sortBy :: (Element Row -> Element Row -> Ordering) -> Row -> Row Source # singleton :: Element Row -> Row Source # head :: NonEmpty Row -> Element Row Source # last :: NonEmpty Row -> Element Row Source # tail :: NonEmpty Row -> Row Source # init :: NonEmpty Row -> Row Source # replicate :: CountOf (Element Row) -> Element Row -> Row Source # isPrefixOf :: Row -> Row -> Bool Source # isSuffixOf :: Row -> Row -> Bool Source # isInfixOf :: Row -> Row -> Bool Source # | |
| PrimType ty => Sequential (Block ty) Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source # revTake :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source # drop :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source # revDrop :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source # splitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) Source # revSplitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) Source # splitOn :: (Element (Block ty) -> Bool) -> Block ty -> [Block ty] Source # break :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source # breakEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source # breakElem :: Element (Block ty) -> Block ty -> (Block ty, Block ty) Source # takeWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source # dropWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source # intersperse :: Element (Block ty) -> Block ty -> Block ty Source # intercalate :: Element (Block ty) -> Block ty -> Element (Block ty) Source # span :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source # spanEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source # filter :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source # partition :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source # reverse :: Block ty -> Block ty Source # uncons :: Block ty -> Maybe (Element (Block ty), Block ty) Source # unsnoc :: Block ty -> Maybe (Block ty, Element (Block ty)) Source # snoc :: Block ty -> Element (Block ty) -> Block ty Source # cons :: Element (Block ty) -> Block ty -> Block ty Source # find :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Element (Block ty)) Source # sortBy :: (Element (Block ty) -> Element (Block ty) -> Ordering) -> Block ty -> Block ty Source # singleton :: Element (Block ty) -> Block ty Source # head :: NonEmpty (Block ty) -> Element (Block ty) Source # last :: NonEmpty (Block ty) -> Element (Block ty) Source # tail :: NonEmpty (Block ty) -> Block ty Source # init :: NonEmpty (Block ty) -> Block ty Source # replicate :: CountOf (Element (Block ty)) -> Element (Block ty) -> Block ty Source # isPrefixOf :: Block ty -> Block ty -> Bool Source # isSuffixOf :: Block ty -> Block ty -> Bool Source # isInfixOf :: Block ty -> Block ty -> Bool Source # stripPrefix :: Block ty -> Block ty -> Maybe (Block ty) Source # stripSuffix :: Block ty -> Block ty -> Maybe (Block ty) Source # | |
| Sequential (Array ty) Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # revTake :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # drop :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # revDrop :: CountOf (Element (Array ty)) -> Array ty -> Array ty Source # splitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) Source # revSplitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) Source # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] Source # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # breakEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) Source # takeWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # dropWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # intersperse :: Element (Array ty) -> Array ty -> Array ty Source # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) Source # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # spanEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source # reverse :: Array ty -> Array ty Source # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) Source # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) Source # snoc :: Array ty -> Element (Array ty) -> Array ty Source # cons :: Element (Array ty) -> Array ty -> Array ty Source # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) Source # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty Source # singleton :: Element (Array ty) -> Array ty Source # head :: NonEmpty (Array ty) -> Element (Array ty) Source # last :: NonEmpty (Array ty) -> Element (Array ty) Source # tail :: NonEmpty (Array ty) -> Array ty Source # init :: NonEmpty (Array ty) -> Array ty Source # replicate :: CountOf (Element (Array ty)) -> Element (Array ty) -> Array ty Source # isPrefixOf :: Array ty -> Array ty -> Bool Source # isSuffixOf :: Array ty -> Array ty -> Bool Source # isInfixOf :: Array ty -> Array ty -> Bool Source # stripPrefix :: Array ty -> Array ty -> Maybe (Array ty) Source # stripSuffix :: Array ty -> Array ty -> Maybe (Array ty) Source # | |
| PrimType ty => Sequential (UArray ty) Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # revTake :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # drop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # revDrop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty Source # splitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) Source # revSplitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) Source # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] Source # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # breakEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) Source # takeWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # dropWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty Source # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) Source # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # spanEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source # reverse :: UArray ty -> UArray ty Source # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) Source # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) Source # snoc :: UArray ty -> Element (UArray ty) -> UArray ty Source # cons :: Element (UArray ty) -> UArray ty -> UArray ty Source # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) Source # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty Source # singleton :: Element (UArray ty) -> UArray ty Source # head :: NonEmpty (UArray ty) -> Element (UArray ty) Source # last :: NonEmpty (UArray ty) -> Element (UArray ty) Source # tail :: NonEmpty (UArray ty) -> UArray ty Source # init :: NonEmpty (UArray ty) -> UArray ty Source # replicate :: CountOf (Element (UArray ty)) -> Element (UArray ty) -> UArray ty Source # isPrefixOf :: UArray ty -> UArray ty -> Bool Source # isSuffixOf :: UArray ty -> UArray ty -> Bool Source # isInfixOf :: UArray ty -> UArray ty -> Bool Source # stripPrefix :: UArray ty -> UArray ty -> Maybe (UArray ty) Source # stripSuffix :: UArray ty -> UArray ty -> Maybe (UArray ty) Source # | |
| PrimType ty => Sequential (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods take :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty Source # revTake :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty Source # drop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty Source # revDrop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty Source # splitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # revSplitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # splitOn :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> [ChunkedUArray ty] Source # break :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # breakEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # breakElem :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # takeWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty Source # dropWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty Source # intersperse :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty Source # intercalate :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> Element (ChunkedUArray ty) Source # span :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # spanEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # filter :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty Source # partition :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) Source # reverse :: ChunkedUArray ty -> ChunkedUArray ty Source # uncons :: ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty), ChunkedUArray ty) Source # unsnoc :: ChunkedUArray ty -> Maybe (ChunkedUArray ty, Element (ChunkedUArray ty)) Source # snoc :: ChunkedUArray ty -> Element (ChunkedUArray ty) -> ChunkedUArray ty Source # cons :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty Source # find :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty)) Source # sortBy :: (Element (ChunkedUArray ty) -> Element (ChunkedUArray ty) -> Ordering) -> ChunkedUArray ty -> ChunkedUArray ty Source # singleton :: Element (ChunkedUArray ty) -> ChunkedUArray ty Source # head :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) Source # last :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) Source # tail :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty Source # init :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty Source # replicate :: CountOf (Element (ChunkedUArray ty)) -> Element (ChunkedUArray ty) -> ChunkedUArray ty Source # isPrefixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # isSuffixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # isInfixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool Source # stripPrefix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) Source # stripSuffix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) Source # | |
| Sequential (DList a) Source # | |
Defined in Foundation.List.DList Methods take :: CountOf (Element (DList a)) -> DList a -> DList a Source # revTake :: CountOf (Element (DList a)) -> DList a -> DList a Source # drop :: CountOf (Element (DList a)) -> DList a -> DList a Source # revDrop :: CountOf (Element (DList a)) -> DList a -> DList a Source # splitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) Source # revSplitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) Source # splitOn :: (Element (DList a) -> Bool) -> DList a -> [DList a] Source # break :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source # breakEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source # breakElem :: Element (DList a) -> DList a -> (DList a, DList a) Source # takeWhile :: (Element (DList a) -> Bool) -> DList a -> DList a Source # dropWhile :: (Element (DList a) -> Bool) -> DList a -> DList a Source # intersperse :: Element (DList a) -> DList a -> DList a Source # intercalate :: Element (DList a) -> DList a -> Element (DList a) Source # span :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source # spanEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source # filter :: (Element (DList a) -> Bool) -> DList a -> DList a Source # partition :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source # reverse :: DList a -> DList a Source # uncons :: DList a -> Maybe (Element (DList a), DList a) Source # unsnoc :: DList a -> Maybe (DList a, Element (DList a)) Source # snoc :: DList a -> Element (DList a) -> DList a Source # cons :: Element (DList a) -> DList a -> DList a Source # find :: (Element (DList a) -> Bool) -> DList a -> Maybe (Element (DList a)) Source # sortBy :: (Element (DList a) -> Element (DList a) -> Ordering) -> DList a -> DList a Source # singleton :: Element (DList a) -> DList a Source # head :: NonEmpty (DList a) -> Element (DList a) Source # last :: NonEmpty (DList a) -> Element (DList a) Source # tail :: NonEmpty (DList a) -> DList a Source # init :: NonEmpty (DList a) -> DList a Source # replicate :: CountOf (Element (DList a)) -> Element (DList a) -> DList a Source # isPrefixOf :: DList a -> DList a -> Bool Source # isSuffixOf :: DList a -> DList a -> Bool Source # isInfixOf :: DList a -> DList a -> Bool Source # stripPrefix :: DList a -> DList a -> Maybe (DList a) Source # stripSuffix :: DList a -> DList a -> Maybe (DList a) Source # | |
| Sequential [a] Source # | |
Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element [a]) -> [a] -> [a] Source # revTake :: CountOf (Element [a]) -> [a] -> [a] Source # drop :: CountOf (Element [a]) -> [a] -> [a] Source # revDrop :: CountOf (Element [a]) -> [a] -> [a] Source # splitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) Source # revSplitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) Source # splitOn :: (Element [a] -> Bool) -> [a] -> [[a]] Source # break :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source # breakEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source # breakElem :: Element [a] -> [a] -> ([a], [a]) Source # takeWhile :: (Element [a] -> Bool) -> [a] -> [a] Source # dropWhile :: (Element [a] -> Bool) -> [a] -> [a] Source # intersperse :: Element [a] -> [a] -> [a] Source # intercalate :: Element [a] -> [a] -> Element [a] Source # span :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source # spanEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source # filter :: (Element [a] -> Bool) -> [a] -> [a] Source # partition :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source # reverse :: [a] -> [a] Source # uncons :: [a] -> Maybe (Element [a], [a]) Source # unsnoc :: [a] -> Maybe ([a], Element [a]) Source # snoc :: [a] -> Element [a] -> [a] Source # cons :: Element [a] -> [a] -> [a] Source # find :: (Element [a] -> Bool) -> [a] -> Maybe (Element [a]) Source # sortBy :: (Element [a] -> Element [a] -> Ordering) -> [a] -> [a] Source # singleton :: Element [a] -> [a] Source # head :: NonEmpty [a] -> Element [a] Source # last :: NonEmpty [a] -> Element [a] Source # tail :: NonEmpty [a] -> [a] Source # init :: NonEmpty [a] -> [a] Source # replicate :: CountOf (Element [a]) -> Element [a] -> [a] Source # isPrefixOf :: [a] -> [a] -> Bool Source # isSuffixOf :: [a] -> [a] -> Bool Source # isInfixOf :: [a] -> [a] -> Bool Source # stripPrefix :: [a] -> [a] -> Maybe [a] Source # stripSuffix :: [a] -> [a] -> Maybe [a] Source # | |
NonEmpty property for any Collection
Instances
| Collection c => Collection (NonEmpty c) Source # | |||||
Defined in Foundation.Collection.Collection Methods null :: NonEmpty c -> Bool Source # length :: NonEmpty c -> CountOf (Element (NonEmpty c)) Source # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool Source # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool Source # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) Source # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) Source # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool Source # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool Source # | |||||
| IsList c => IsList (NonEmpty c) | |||||
Defined in Basement.NonEmpty Associated Types
| |||||
| Show a => Show (NonEmpty a) | |||||
| Eq a => Eq (NonEmpty a) | |||||
| type Element (NonEmpty a) Source # | |||||
Defined in Foundation.Collection.Element | |||||
| type Item (NonEmpty c) | |||||
Defined in Basement.NonEmpty | |||||
nonEmpty :: Collection c => c -> Maybe (NonEmpty c) Source #
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 Source #
Give the ability to fold a collection on itself
Methods
foldl' :: (a -> Element collection -> a) -> a -> collection -> a Source #
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 Source #
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 Source #
Right-associative fold of a structure, but with strict application of the operator.
Instances
| Foldable Bitmap Source # | |
| PrimType ty => Foldable (Block ty) Source # | |
| Foldable (Array ty) Source # | |
| PrimType ty => Foldable (UArray ty) Source # | |
| PrimType ty => Foldable (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods foldl' :: (a -> Element (ChunkedUArray ty) -> a) -> a -> ChunkedUArray ty -> a Source # foldr :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a Source # foldr' :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a Source # | |
| Foldable (DList a) Source # | |
| Foldable [a] Source # | |
| PrimType ty => Foldable (BlockN n ty) Source # | |
| Foldable (ListN n a) Source # | |
Maybe
mapMaybe :: (a -> Maybe b) -> [a] -> [b] Source #
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] Source #
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 Source #
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 Source #
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] Source #
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]) Source #
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 Source #
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 Source #
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 Source #
An associative binary operation
Monad
Exceptions
class (Typeable e, Show e) => Exception e where Source #
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 Source #
toException should produce a SomeException with no attached ExceptionContext.
fromException :: SomeException -> Maybe e Source #
displayException :: e -> String Source #
Render this exception value in a human-friendly manner.
Default implementation: .show
Since: base-4.8.0.0
backtraceDesired :: e -> Bool Source #
Instances
| Exception Timeout | Since: base-4.7.0.0 |
Defined in System.Timeout Methods toException :: Timeout -> SomeException Source # fromException :: SomeException -> Maybe Timeout Source # displayException :: Timeout -> String Source # backtraceDesired :: Timeout -> Bool Source # | |
| Exception InvalidRecast | |
Defined in Basement.Exception Methods toException :: InvalidRecast -> SomeException Source # fromException :: SomeException -> Maybe InvalidRecast Source # displayException :: InvalidRecast -> String Source # backtraceDesired :: InvalidRecast -> Bool Source # | |
| Exception NonEmptyCollectionIsEmpty | |
Defined in Basement.Exception | |
| Exception OutOfBound | |
Defined in Basement.Exception Methods toException :: OutOfBound -> SomeException Source # fromException :: SomeException -> Maybe OutOfBound Source # displayException :: OutOfBound -> String Source # backtraceDesired :: OutOfBound -> Bool Source # | |
| Exception ASCII7_Invalid | |
Defined in Basement.String.Encoding.ASCII7 Methods toException :: ASCII7_Invalid -> SomeException Source # fromException :: SomeException -> Maybe ASCII7_Invalid Source # displayException :: ASCII7_Invalid -> String Source # backtraceDesired :: ASCII7_Invalid -> Bool Source # | |
| Exception ISO_8859_1_Invalid | |
Defined in Basement.String.Encoding.ISO_8859_1 Methods toException :: ISO_8859_1_Invalid -> SomeException Source # fromException :: SomeException -> Maybe ISO_8859_1_Invalid Source # displayException :: ISO_8859_1_Invalid -> String Source # backtraceDesired :: ISO_8859_1_Invalid -> Bool Source # | |
| Exception UTF16_Invalid | |
Defined in Basement.String.Encoding.UTF16 Methods toException :: UTF16_Invalid -> SomeException Source # fromException :: SomeException -> Maybe UTF16_Invalid Source # displayException :: UTF16_Invalid -> String Source # backtraceDesired :: UTF16_Invalid -> Bool Source # | |
| Exception UTF32_Invalid | |
Defined in Basement.String.Encoding.UTF32 Methods toException :: UTF32_Invalid -> SomeException Source # fromException :: SomeException -> Maybe UTF32_Invalid Source # displayException :: UTF32_Invalid -> String Source # backtraceDesired :: UTF32_Invalid -> Bool Source # | |
| Exception ValidationFailure | |
Defined in Basement.UTF8.Types | |
| Exception PartialError Source # | |
Defined in Foundation.Partial Methods toException :: PartialError -> SomeException Source # fromException :: SomeException -> Maybe PartialError Source # displayException :: PartialError -> String Source # backtraceDesired :: PartialError -> Bool Source # | |
| Exception Void | Since: base-4.8.0.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: Void -> SomeException Source # fromException :: SomeException -> Maybe Void Source # displayException :: Void -> String Source # backtraceDesired :: Void -> Bool Source # | |
| Exception NestedAtomically | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: NestedAtomically -> SomeException Source # fromException :: SomeException -> Maybe NestedAtomically Source # | |
| 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 Source # fromException :: SomeException -> Maybe NoMethodError Source # displayException :: NoMethodError -> String Source # backtraceDesired :: NoMethodError -> Bool Source # | |
| Exception NonTermination | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: NonTermination -> SomeException Source # fromException :: SomeException -> Maybe NonTermination Source # | |
| Exception PatternMatchFail | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException Source # fromException :: SomeException -> Maybe PatternMatchFail Source # | |
| Exception RecConError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecConError -> SomeException Source # fromException :: SomeException -> Maybe RecConError Source # displayException :: RecConError -> String Source # backtraceDesired :: RecConError -> Bool Source # | |
| Exception RecSelError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecSelError -> SomeException Source # fromException :: SomeException -> Maybe RecSelError Source # displayException :: RecSelError -> String Source # backtraceDesired :: RecSelError -> Bool Source # | |
| Exception RecUpdError | Since: base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: RecUpdError -> SomeException Source # fromException :: SomeException -> Maybe RecUpdError Source # displayException :: RecUpdError -> String Source # backtraceDesired :: RecUpdError -> Bool Source # | |
| Exception TypeError | Since: base-4.9.0.0 |
Defined in GHC.Internal.Control.Exception.Base Methods toException :: TypeError -> SomeException Source # fromException :: SomeException -> Maybe TypeError Source # displayException :: TypeError -> String Source # backtraceDesired :: TypeError -> Bool Source # | |
| Exception ErrorCall | Since: base-4.0.0.0 |
Defined in GHC.Internal.Exception Methods toException :: ErrorCall -> SomeException Source # fromException :: SomeException -> Maybe ErrorCall Source # displayException :: ErrorCall -> String Source # backtraceDesired :: ErrorCall -> Bool Source # | |
| Exception ArithException | Since: base-4.0.0.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: ArithException -> SomeException Source # fromException :: SomeException -> Maybe ArithException Source # | |
| Exception SomeException | This drops any attached Since: base-3.0 |
Defined in GHC.Internal.Exception.Type Methods toException :: SomeException -> SomeException Source # fromException :: SomeException -> Maybe SomeException Source # displayException :: SomeException -> String Source # backtraceDesired :: SomeException -> Bool Source # | |
| 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 Source # fromException :: SomeException -> Maybe ArrayException Source # | |
| Exception AssertionFailed | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: AssertionFailed -> SomeException Source # fromException :: SomeException -> Maybe AssertionFailed Source # | |
| Exception AsyncException | Since: base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: AsyncException -> SomeException Source # fromException :: SomeException -> Maybe AsyncException Source # | |
| Exception BlockedIndefinitelyOnMVar | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception | |
| 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 Source # fromException :: SomeException -> Maybe CompactionFailed Source # | |
| Exception Deadlock | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: Deadlock -> SomeException Source # fromException :: SomeException -> Maybe Deadlock Source # displayException :: Deadlock -> String Source # backtraceDesired :: Deadlock -> Bool Source # | |
| Exception ExitCode | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: ExitCode -> SomeException Source # fromException :: SomeException -> Maybe ExitCode Source # displayException :: ExitCode -> String Source # backtraceDesired :: ExitCode -> Bool Source # | |
| Exception FixIOException | Since: base-4.11.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: FixIOException -> SomeException Source # fromException :: SomeException -> Maybe FixIOException Source # | |
| Exception IOException | Since: base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods toException :: IOException -> SomeException Source # fromException :: SomeException -> Maybe IOException Source # displayException :: IOException -> String Source # backtraceDesired :: IOException -> Bool Source # | |
| Exception SomeAsyncException | Since: base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception | |
| (Typeable input, Show input) => Exception (ParseError input) Source # | |
Defined in Foundation.Parser Methods toException :: ParseError input -> SomeException Source # fromException :: SomeException -> Maybe (ParseError input) Source # displayException :: ParseError input -> String Source # backtraceDesired :: ParseError input -> Bool Source # | |
| Exception a => Exception (ExceptionWithContext a) | |
Defined in GHC.Internal.Exception.Type Methods toException :: ExceptionWithContext a -> SomeException Source # fromException :: SomeException -> Maybe (ExceptionWithContext a) Source # displayException :: ExceptionWithContext a -> String Source # backtraceDesired :: ExceptionWithContext a -> Bool Source # | |
| Exception e => Exception (NoBacktrace e) | |
Defined in GHC.Internal.Exception.Type Methods toException :: NoBacktrace e -> SomeException Source # fromException :: SomeException -> Maybe (NoBacktrace e) Source # displayException :: NoBacktrace e -> String Source # backtraceDesired :: NoBacktrace e -> Bool Source # | |
class Typeable (a :: k) Source #
The class Typeable allows a concrete representation of a type to
be calculated.
Minimal complete definition
typeRep#
data SomeException Source #
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 Source # fromException :: SomeException -> Maybe SomeException Source # displayException :: SomeException -> String Source # backtraceDesired :: SomeException -> Bool Source # | |
| Show SomeException | Since: ghc-internal-3.0 |
Defined in GHC.Internal.Exception.Type | |
data IOException Source #
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 Source # fromException :: SomeException -> Maybe IOException Source # displayException :: IOException -> String Source # backtraceDesired :: IOException -> Bool Source # | |
| Show IOException | 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 Methods (==) :: IOException -> IOException -> Bool Source # (/=) :: IOException -> IOException -> Bool Source # | |
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 Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] Source # | |
| 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 Source # foldMap :: Monoid m => (a -> m) -> Proxy a -> m Source # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m Source # foldr :: (a -> b -> b) -> b -> Proxy a -> b Source # foldr' :: (a -> b -> b) -> b -> Proxy a -> b Source # foldl :: (b -> a -> b) -> b -> Proxy a -> b Source # foldl' :: (b -> a -> b) -> b -> Proxy a -> b Source # foldr1 :: (a -> a -> a) -> Proxy a -> a Source # foldl1 :: (a -> a -> a) -> Proxy a -> a Source # toList :: Proxy a -> [a] Source # null :: Proxy a -> Bool Source # length :: Proxy a -> Int Source # elem :: Eq a => a -> Proxy a -> Bool Source # maximum :: Ord a => Proxy a -> a Source # minimum :: Ord a => Proxy a -> a Source # | |
| Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Data.Traversable | |
| 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) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) Source # toConstr :: Proxy t -> Constr Source # dataTypeOf :: Proxy t -> DataType Source # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) Source # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) Source # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) Source # | |
| Bounded (Proxy t) | Since: base-4.7.0.0 |
| Enum (Proxy s) | Since: base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy Methods succ :: Proxy s -> Proxy s Source # pred :: Proxy s -> Proxy s Source # toEnum :: Int -> Proxy s Source # fromEnum :: Proxy s -> Int Source # enumFrom :: Proxy s -> [Proxy s] Source # enumFromThen :: Proxy s -> Proxy s -> [Proxy s] Source # enumFromTo :: Proxy s -> Proxy s -> [Proxy s] Source # enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] Source # | |
| 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 Source #
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
Partialiality wrapper.
partial :: a -> Partial a Source #
Create a value that is partial. this can only be
unwrap using the fromPartial function
data PartialError Source #
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 Source # | |
Defined in Foundation.Partial Methods toException :: PartialError -> SomeException Source # fromException :: SomeException -> Maybe PartialError Source # displayException :: PartialError -> String Source # backtraceDesired :: PartialError -> Bool Source # | |
| Show PartialError Source # | |
Defined in Foundation.Partial | |
| Eq PartialError Source # | |
Defined in Foundation.Partial Methods (==) :: PartialError -> PartialError -> Bool Source # (/=) :: PartialError -> PartialError -> Bool Source # | |
fromPartial :: Partial a -> a Source #
Dewrap a possible partial value
ifThenElse :: Bool -> a -> a -> a Source #
for support of if .. then .. else