| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Goal.Core
Contents
Description
This module re-exports a number of (compatible) modules from across base
and other libraries, as well as most of the modules in goal-core. It does
not re-export the Vector modules, which should be imported with
qualification.
Synopsis
- module Goal.Core.Util
- module Goal.Core.Project
- module Goal.Core.Circuit
- ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- fix :: (a -> a) -> a
- flip :: (a -> b -> c) -> b -> a -> c
- (.) :: (b -> c) -> (a -> b) -> a -> c
- const :: a -> b -> a
- id :: a -> a
- module Data.Functor
- module Data.Foldable
- module Data.Traversable
- module Data.Ord
- module Data.Maybe
- module Data.Either
- (.!) :: FromField a => Record -> Int -> Parser a
- (.:) :: FromField a => NamedRecord -> ByteString -> Parser a
- (.=) :: ToField a => ByteString -> a -> (ByteString, ByteString)
- defaultOptions :: Options
- genericHeaderOrder :: (Generic a, GToNamedRecordHeader (Rep a)) => Options -> a -> Header
- genericParseNamedRecord :: (Generic a, GFromNamedRecord (Rep a)) => Options -> NamedRecord -> Parser a
- genericParseRecord :: (Generic a, GFromRecord (Rep a)) => Options -> Record -> Parser a
- genericToNamedRecord :: (Generic a, GToRecord (Rep a) (ByteString, ByteString)) => Options -> a -> NamedRecord
- genericToRecord :: (Generic a, GToRecord (Rep a) Field) => Options -> a -> Record
- index :: FromField a => Record -> Int -> Parser a
- lookup :: FromField a => NamedRecord -> ByteString -> Parser a
- namedField :: ToField a => ByteString -> a -> (ByteString, ByteString)
- namedRecord :: [(ByteString, ByteString)] -> NamedRecord
- record :: [ByteString] -> Record
- runParser :: Parser a -> Either String a
- unsafeIndex :: FromField a => Record -> Int -> Parser a
- decode :: FromRecord a => HasHeader -> ByteString -> Either String (Vector a)
- decodeByName :: FromNamedRecord a => ByteString -> Either String (Header, Vector a)
- decodeByNameWith :: FromNamedRecord a => DecodeOptions -> ByteString -> Either String (Header, Vector a)
- decodeByNameWithP :: (NamedRecord -> Parser a) -> DecodeOptions -> ByteString -> Either String (Header, Vector a)
- decodeWith :: FromRecord a => DecodeOptions -> HasHeader -> ByteString -> Either String (Vector a)
- decodeWithP :: (Record -> Parser a) -> DecodeOptions -> HasHeader -> ByteString -> Either String (Vector a)
- defaultEncodeOptions :: EncodeOptions
- encode :: ToRecord a => [a] -> ByteString
- encodeByName :: ToNamedRecord a => Header -> [a] -> ByteString
- encodeByNameWith :: ToNamedRecord a => EncodeOptions -> Header -> [a] -> ByteString
- encodeDefaultOrderedByName :: (DefaultOrdered a, ToNamedRecord a) => [a] -> ByteString
- encodeDefaultOrderedByNameWith :: (DefaultOrdered a, ToNamedRecord a) => EncodeOptions -> [a] -> ByteString
- encodeWith :: ToRecord a => EncodeOptions -> [a] -> ByteString
- defaultDecodeOptions :: DecodeOptions
- newtype Only a = Only {
- fromOnly :: a
- class DefaultOrdered a where
- headerOrder :: a -> Header
- class FromField a where
- parseField :: Field -> Parser a
- class FromNamedRecord a where
- parseNamedRecord :: NamedRecord -> Parser a
- class FromRecord a where
- parseRecord :: Record -> Parser a
- class GFromNamedRecord (f :: k -> Type)
- class GFromRecord (f :: k -> Type)
- class GToNamedRecordHeader (a :: k -> Type)
- class GToRecord (a :: k -> Type) f
- data Options
- class ToField a where
- toField :: a -> Field
- class ToNamedRecord a where
- toNamedRecord :: a -> NamedRecord
- class ToRecord a where
- data EncodeOptions = EncodeOptions {
- encDelimiter :: !Word8
- encUseCrLf :: !Bool
- encIncludeHeader :: !Bool
- encQuoting :: !Quoting
- data Quoting
- data DecodeOptions = DecodeOptions {
- decDelimiter :: !Word8
- type Csv = Vector Record
- data HasHeader
- type Header = Vector Name
- type Name = ByteString
- type NamedRecord = HashMap ByteString ByteString
- type Record = Vector Field
- module Data.Proxy
- type Type = Type
- module Data.Functor.Identity
- module Data.Type.Equality
- (<$) :: Functor f => a -> f b -> f a
- class Functor f => Applicative (f :: Type -> Type) where
- optional :: Alternative f => f a -> f (Maybe a)
- newtype WrappedMonad (m :: Type -> Type) a = WrapMonad {
- unwrapMonad :: m a
- newtype WrappedArrow (a :: Type -> Type -> Type) b c = WrapArrow {
- unwrapArrow :: a b c
- newtype ZipList a = ZipList {
- getZipList :: [a]
- newtype Const a (b :: k) = Const {
- getConst :: a
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- liftA :: Applicative f => (a -> b) -> f a -> f b
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- class Applicative f => Alternative (f :: Type -> Type) where
- guard :: Alternative f => Bool -> f ()
- class Applicative m => Monad (m :: Type -> Type) where
- class Functor (f :: Type -> Type) where
- class Monad m => MonadFail (m :: Type -> Type) where
- mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- void :: Functor f => f a -> f ()
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
- data RealWorld
- type family PrimState (m :: Type -> Type)
- class Monad m => PrimMonad (m :: Type -> Type) where
- evalPrim :: forall a m. PrimMonad m => a -> m a
- ioToPrim :: (PrimMonad m, PrimState m ~ RealWorld) => IO a -> m a
- liftPrim :: (PrimBase m1, PrimMonad m2, PrimState m1 ~ PrimState m2) => m1 a -> m2 a
- noDuplicate :: PrimMonad m => m ()
- primToIO :: (PrimBase m, PrimState m ~ RealWorld) => m a -> IO a
- primToPrim :: (PrimBase m1, PrimMonad m2, PrimState m1 ~ PrimState m2) => m1 a -> m2 a
- primToST :: PrimBase m => m a -> ST (PrimState m) a
- primitive_ :: PrimMonad m => (State# (PrimState m) -> State# (PrimState m)) -> m ()
- stToPrim :: PrimMonad m => ST (PrimState m) a -> m a
- touch :: PrimMonad m => a -> m ()
- unsafeDupableInterleave :: PrimBase m => m a -> m a
- unsafeIOToPrim :: PrimMonad m => IO a -> m a
- unsafeInlineIO :: IO a -> a
- unsafeInlinePrim :: PrimBase m => m a -> a
- unsafeInlineST :: ST s a -> a
- unsafeInterleave :: PrimBase m => m a -> m a
- unsafePrimToIO :: PrimBase m => m a -> IO a
- unsafePrimToPrim :: (PrimBase m1, PrimMonad m2) => m1 a -> m2 a
- unsafePrimToST :: PrimBase m => m a -> ST s a
- unsafeSTToPrim :: PrimMonad m => ST s a -> m a
- class (PrimMonad m, s ~ PrimState m) => MonadPrim s (m :: Type -> Type)
- class (PrimBase m, MonadPrim s m) => MonadPrimBase s (m :: Type -> Type)
- class PrimMonad m => PrimBase (m :: Type -> Type)
- module Control.Monad.ST
- leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- returnA :: Arrow a => a b b
- class Category a => Arrow (a :: Type -> Type -> Type) where
- newtype Kleisli (m :: Type -> Type) a b = Kleisli {
- runKleisli :: a -> m b
- class Arrow a => ArrowZero (a :: Type -> Type -> Type) where
- zeroArrow :: a b c
- class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type)
- class Arrow a => ArrowChoice (a :: Type -> Type -> Type) where
- class Arrow a => ArrowApply (a :: Type -> Type -> Type) where
- app :: a (a b c, b) c
- newtype ArrowMonad (a :: Type -> Type -> Type) b = ArrowMonad (a () b)
- class Arrow a => ArrowLoop (a :: Type -> Type -> Type) where
- loop :: a (b, d) (c, d) -> a b c
- (>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- (<<<) :: forall k cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- module Control.Concurrent
- rnf2 :: (NFData2 p, NFData a, NFData b) => p a b -> ()
- rnf1 :: (NFData1 f, NFData a) => f a -> ()
- rwhnf :: a -> ()
- (<$!!>) :: (Monad m, NFData b) => (a -> b) -> m a -> m b
- ($!!) :: NFData a => (a -> b) -> a -> b
- deepseq :: NFData a => a -> b -> b
- class NFData a where
- rnf :: a -> ()
- class NFData1 (f :: Type -> Type) where
- liftRnf :: (a -> ()) -> f a -> ()
- class NFData2 (p :: Type -> Type -> Type) where
- liftRnf2 :: (a -> ()) -> (b -> ()) -> p a b -> ()
- class Fractional a => Floating a where
- showOct :: (Integral a, Show a) => a -> ShowS
- showHex :: (Integral a, Show a) => a -> ShowS
- showIntAtBase :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS
- showHFloat :: RealFloat a => a -> ShowS
- showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showGFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showFFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showEFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showInt :: Integral a => a -> ShowS
- readSigned :: Real a => ReadS a -> ReadS a
- readFloat :: RealFrac a => ReadS a
- readHex :: (Eq a, Num a) => ReadS a
- readDec :: (Eq a, Num a) => ReadS a
- readOct :: (Eq a, Num a) => ReadS a
- readInt :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
- lexDigits :: ReadS String
- fromRat :: RealFloat a => Rational -> a
- floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)
- showFloat :: RealFloat a => a -> ShowS
- showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS
- class KnownNat (n :: Nat)
- data Nat
- type family (a :: Nat) + (b :: Nat) :: Nat where ...
- type family (a :: Nat) * (b :: Nat) :: Nat where ...
- type family (a :: Nat) ^ (b :: Nat) :: Nat where ...
- type family (a :: Nat) <=? (b :: Nat) :: Bool where ...
- type family (a :: Nat) - (b :: Nat) :: Nat where ...
- type family CmpNat (a :: Nat) (b :: Nat) :: Ordering where ...
- type family Div (a :: Nat) (b :: Nat) :: Nat where ...
- type family Log2 (a :: Nat) :: Nat where ...
- sameNat :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Proxy a -> Proxy b -> Maybe (a :~: b)
- someNatVal :: Natural -> SomeNat
- natVal' :: forall (n :: Nat). KnownNat n => Proxy# n -> Natural
- natVal :: forall (n :: Nat) proxy. KnownNat n => proxy n -> Natural
- data SomeNat = KnownNat n => SomeNat (Proxy n)
- type (<=) (x :: Nat) (y :: Nat) = (x <=? y) ~ 'True
- class Generic a
- module Debug.Trace
- module System.Directory
- type NatNumber = Natural
- data ByteString
- orderedHeader :: [ByteString] -> Header
Module Exports
module Goal.Core.Util
module Goal.Core.Project
module Goal.Core.Circuit
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b infixr 0 #
Application operator. This operator is redundant, since ordinary
application (f x) means the same as (f . However, $ x)$ has
low, right-associative binding precedence, so it sometimes allows
parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as ,
or map ($ 0) xs.zipWith ($) fs xs
Note that ( is levity-polymorphic in its result type, so that
$)foo where $ Truefoo :: Bool -> Int# is well-typed.
is the least fixed point of the function fix ff,
i.e. the least defined x such that f x = x.
For example, we can write the factorial function using direct recursion as
>>>let fac n = if n <= 1 then 1 else n * fac (n-1) in fac 5120
This uses the fact that Haskell’s let introduces recursive bindings. We can
rewrite this definition using fix,
>>>fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5120
Instead of making a recursive call, we introduce a dummy parameter rec;
when used within fix, this parameter then refers to fix’s argument, hence
the recursion is reintroduced.
flip :: (a -> b -> c) -> b -> a -> c #
takes its (first) two arguments in the reverse order of flip ff.
>>>flip (++) "hello" "world""worldhello"
const x is a unary function which evaluates to x for all inputs.
>>>const 42 "hello"42
>>>map (const 42) [0..3][42,42,42,42]
module Data.Functor
module Data.Foldable
module Data.Traversable
module Data.Ord
module Data.Maybe
module Data.Either
(.:) :: FromField a => NamedRecord -> ByteString -> Parser a #
(.=) :: ToField a => ByteString -> a -> (ByteString, ByteString) #
genericHeaderOrder :: (Generic a, GToNamedRecordHeader (Rep a)) => Options -> a -> Header #
genericParseNamedRecord :: (Generic a, GFromNamedRecord (Rep a)) => Options -> NamedRecord -> Parser a #
genericParseRecord :: (Generic a, GFromRecord (Rep a)) => Options -> Record -> Parser a #
genericToNamedRecord :: (Generic a, GToRecord (Rep a) (ByteString, ByteString)) => Options -> a -> NamedRecord #
lookup :: FromField a => NamedRecord -> ByteString -> Parser a #
namedField :: ToField a => ByteString -> a -> (ByteString, ByteString) #
namedRecord :: [(ByteString, ByteString)] -> NamedRecord #
record :: [ByteString] -> Record #
unsafeIndex :: FromField a => Record -> Int -> Parser a #
decode :: FromRecord a => HasHeader -> ByteString -> Either String (Vector a) #
decodeByName :: FromNamedRecord a => ByteString -> Either String (Header, Vector a) #
decodeByNameWith :: FromNamedRecord a => DecodeOptions -> ByteString -> Either String (Header, Vector a) #
decodeByNameWithP :: (NamedRecord -> Parser a) -> DecodeOptions -> ByteString -> Either String (Header, Vector a) #
decodeWith :: FromRecord a => DecodeOptions -> HasHeader -> ByteString -> Either String (Vector a) #
decodeWithP :: (Record -> Parser a) -> DecodeOptions -> HasHeader -> ByteString -> Either String (Vector a) #
encode :: ToRecord a => [a] -> ByteString #
encodeByName :: ToNamedRecord a => Header -> [a] -> ByteString #
encodeByNameWith :: ToNamedRecord a => EncodeOptions -> Header -> [a] -> ByteString #
encodeDefaultOrderedByName :: (DefaultOrdered a, ToNamedRecord a) => [a] -> ByteString #
encodeDefaultOrderedByNameWith :: (DefaultOrdered a, ToNamedRecord a) => EncodeOptions -> [a] -> ByteString #
encodeWith :: ToRecord a => EncodeOptions -> [a] -> ByteString #
Instances
| Functor Only | |
| Eq a => Eq (Only a) | |
| Data a => Data (Only a) | |
Defined in Data.Tuple.Only Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Only a -> c (Only a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Only a) # toConstr :: Only a -> Constr # dataTypeOf :: Only a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Only a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a)) # gmapT :: (forall b. Data b => b -> b) -> Only a -> Only a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r # gmapQ :: (forall d. Data d => d -> u) -> Only a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Only a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # | |
| Ord a => Ord (Only a) | |
| Read a => Read (Only a) | |
| Show a => Show (Only a) | |
| Generic (Only a) | |
| NFData a => NFData (Only a) | |
Defined in Data.Tuple.Only | |
| FromField a => FromRecord (Only a) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (Only a) # | |
| ToField a => ToRecord (Only a) | |
Defined in Data.Csv.Conversion | |
| type Rep (Only a) | |
Defined in Data.Tuple.Only | |
Methods
parseField :: Field -> Parser a #
Instances
class FromNamedRecord a where #
Minimal complete definition
Nothing
Methods
parseNamedRecord :: NamedRecord -> Parser a #
Instances
| (FromField a, FromField b, Ord a) => FromNamedRecord (Map a b) | |
Defined in Data.Csv.Conversion Methods parseNamedRecord :: NamedRecord -> Parser (Map a b) # | |
| (Eq a, FromField a, FromField b, Hashable a) => FromNamedRecord (HashMap a b) | |
Defined in Data.Csv.Conversion Methods parseNamedRecord :: NamedRecord -> Parser (HashMap a b) # | |
class FromRecord a where #
Minimal complete definition
Nothing
Methods
parseRecord :: Record -> Parser a #
Instances
| FromField a => FromRecord [a] | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser [a] # | |
| FromField a => FromRecord (Only a) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (Only a) # | |
| FromField a => FromRecord (Vector a) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (Vector a) # | |
| (FromField a, Unbox a) => FromRecord (Vector a) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (Vector a) # | |
| (FromField a, FromField b) => FromRecord (a, b) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b) # | |
| (FromField a, FromField b, FromField c) => FromRecord (a, b, c) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c) # | |
| (FromField a, FromField b, FromField c, FromField d) => FromRecord (a, b, c, d) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e) => FromRecord (a, b, c, d, e) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f) => FromRecord (a, b, c, d, e, f) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g) => FromRecord (a, b, c, d, e, f, g) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h) => FromRecord (a, b, c, d, e, f, g, h) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i) => FromRecord (a, b, c, d, e, f, g, h, i) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j) => FromRecord (a, b, c, d, e, f, g, h, i, j) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j, FromField k) => FromRecord (a, b, c, d, e, f, g, h, i, j, k) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j, k) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j, FromField k, FromField l) => FromRecord (a, b, c, d, e, f, g, h, i, j, k, l) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j, k, l) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j, FromField k, FromField l, FromField m) => FromRecord (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j, FromField k, FromField l, FromField m, FromField n) => FromRecord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
| (FromField a, FromField b, FromField c, FromField d, FromField e, FromField f, FromField g, FromField h, FromField i, FromField j, FromField k, FromField l, FromField m, FromField n, FromField o) => FromRecord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
Defined in Data.Csv.Conversion Methods parseRecord :: Record -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
class GFromNamedRecord (f :: k -> Type) #
Minimal complete definition
gparseNamedRecord
Instances
| GFromRecordSum f NamedRecord => GFromNamedRecord (M1 i n f :: k -> Type) | |
Defined in Data.Csv.Conversion Methods gparseNamedRecord :: forall (p :: k0). Options -> NamedRecord -> Parser (M1 i n f p) | |
class GFromRecord (f :: k -> Type) #
Minimal complete definition
gparseRecord
Instances
| GFromRecordSum f Record => GFromRecord (M1 i n f :: k -> Type) | |
Defined in Data.Csv.Conversion Methods gparseRecord :: forall (p :: k0). Options -> Record -> Parser (M1 i n f p) | |
class GToNamedRecordHeader (a :: k -> Type) #
Minimal complete definition
gtoNamedRecordHeader
Instances
class GToRecord (a :: k -> Type) f #
Minimal complete definition
gtoRecord
Instances
| GToRecord (U1 :: k -> Type) f | |
Defined in Data.Csv.Conversion | |
| ToField a => GToRecord (K1 i a :: k -> Type) Field | |
Defined in Data.Csv.Conversion | |
| (GToRecord a f, GToRecord b f) => GToRecord (a :+: b :: k -> Type) f | |
Defined in Data.Csv.Conversion | |
| (GToRecord a f, GToRecord b f) => GToRecord (a :*: b :: k -> Type) f | |
Defined in Data.Csv.Conversion | |
| GToRecord a f => GToRecord (M1 D c a :: k -> Type) f | |
Defined in Data.Csv.Conversion | |
| GToRecord a f => GToRecord (M1 C c a :: k -> Type) f | |
Defined in Data.Csv.Conversion | |
| GToRecord a Field => GToRecord (M1 S c a :: k -> Type) Field | |
Defined in Data.Csv.Conversion | |
| (ToField a, Selector s) => GToRecord (M1 S s (K1 i a :: k -> Type) :: k -> Type) (ByteString, ByteString) | |
Defined in Data.Csv.Conversion Methods gtoRecord :: forall (p :: k0). Options -> M1 S s (K1 i a) p -> [(ByteString, ByteString)] | |
Instances
class ToNamedRecord a where #
Minimal complete definition
Nothing
Methods
toNamedRecord :: a -> NamedRecord #
Instances
| (ToField a, ToField b, Ord a) => ToNamedRecord (Map a b) | |
Defined in Data.Csv.Conversion Methods toNamedRecord :: Map a b -> NamedRecord # | |
| (Eq a, ToField a, ToField b, Hashable a) => ToNamedRecord (HashMap a b) | |
Defined in Data.Csv.Conversion Methods toNamedRecord :: HashMap a b -> NamedRecord # | |
Minimal complete definition
Nothing
Instances
data EncodeOptions #
Constructors
| EncodeOptions | |
Fields
| |
Instances
| Eq EncodeOptions | |
Defined in Data.Csv.Encoding Methods (==) :: EncodeOptions -> EncodeOptions -> Bool # (/=) :: EncodeOptions -> EncodeOptions -> Bool # | |
| Show EncodeOptions | |
Defined in Data.Csv.Encoding Methods showsPrec :: Int -> EncodeOptions -> ShowS # show :: EncodeOptions -> String # showList :: [EncodeOptions] -> ShowS # | |
Constructors
| QuoteNone | |
| QuoteMinimal | |
| QuoteAll |
data DecodeOptions #
Constructors
| DecodeOptions | |
Fields
| |
Instances
| Eq DecodeOptions | |
Defined in Data.Csv.Parser Methods (==) :: DecodeOptions -> DecodeOptions -> Bool # (/=) :: DecodeOptions -> DecodeOptions -> Bool # | |
| Show DecodeOptions | |
Defined in Data.Csv.Parser Methods showsPrec :: Int -> DecodeOptions -> ShowS # show :: DecodeOptions -> String # showList :: [DecodeOptions] -> ShowS # | |
type Name = ByteString #
type NamedRecord = HashMap ByteString ByteString #
module Data.Proxy
module Data.Functor.Identity
module Data.Type.Equality
class Functor f => Applicative (f :: Type -> Type) where #
A functor with application, providing operations to
A minimal complete definition must include implementations of pure
and of either <*> or liftA2. If it defines both, then they must behave
the same as their default definitions:
(<*>) =liftA2id
liftA2f x y = f<$>x<*>y
Further, any definition must satisfy the following:
- Identity
pureid<*>v = v- Composition
pure(.)<*>u<*>v<*>w = u<*>(v<*>w)- Homomorphism
puref<*>purex =pure(f x)- Interchange
u
<*>purey =pure($y)<*>u
The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:
As a consequence of these laws, the Functor instance for f will satisfy
It may be useful to note that supposing
forall x y. p (q x y) = f x . g y
it follows from the above that
liftA2p (liftA2q u v) =liftA2f u .liftA2g v
If f is also a Monad, it should satisfy
(which implies that pure and <*> satisfy the applicative functor laws).
Methods
Lift a value.
(<*>) :: f (a -> b) -> f a -> f b infixl 4 #
Sequential application.
A few functors support an implementation of <*> that is more
efficient than the default one.
Using ApplicativeDo: 'fs ' can be understood as
the <*> asdo expression
do f <- fs a <- as pure (f a)
liftA2 :: (a -> b -> c) -> f a -> f b -> f c #
Lift a binary function to actions.
Some functors support an implementation of liftA2 that is more
efficient than the default one. In particular, if fmap is an
expensive operation, it is likely better to use liftA2 than to
fmap over the structure and then use <*>.
This became a typeclass method in 4.10.0.0. Prior to that, it was
a function defined in terms of <*> and fmap.
Using ApplicativeDo: '' can be understood
as the liftA2 f as bsdo expression
do a <- as b <- bs pure (f a b)
(*>) :: f a -> f b -> f b infixl 4 #
Sequence actions, discarding the value of the first argument.
'as ' can be understood as the *> bsdo expression
do as bs
This is a tad complicated for our ApplicativeDo extension
which will give it a Monad constraint. For an Applicative
constraint we write it of the form
do _ <- as b <- bs pure b
(<*) :: f a -> f b -> f a infixl 4 #
Sequence actions, discarding the value of the second argument.
Using ApplicativeDo: 'as ' can be understood as
the <* bsdo expression
do a <- as bs pure a
Instances
| Applicative [] | Since: base-2.1 |
| Applicative Maybe | Since: base-2.1 |
| Applicative IO | Since: base-2.1 |
| Applicative Par1 | Since: base-4.9.0.0 |
| Applicative Q | |
| Applicative Complex | Since: base-4.9.0.0 |
| Applicative Min | Since: base-4.9.0.0 |
| Applicative Max | Since: base-4.9.0.0 |
| Applicative First | Since: base-4.9.0.0 |
| Applicative Last | Since: base-4.9.0.0 |
| Applicative Option | Since: base-4.9.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 |
| Applicative Identity | Since: base-4.8.0.0 |
| Applicative STM | Since: base-4.8.0.0 |
| Applicative First | Since: base-4.8.0.0 |
| Applicative Last | Since: base-4.8.0.0 |
| Applicative Dual | Since: base-4.8.0.0 |
| Applicative Sum | Since: base-4.8.0.0 |
| Applicative Product | Since: base-4.8.0.0 |
| Applicative Down | Since: base-4.11.0.0 |
| Applicative ReadP | Since: base-4.6.0.0 |
| Applicative NonEmpty | Since: base-4.9.0.0 |
| Applicative Tree | |
| Applicative Seq | Since: containers-0.5.4 |
| Applicative P | Since: base-4.5.0.0 |
| Applicative Parser | |
| Applicative Vector | |
| Applicative Id | |
| Applicative Array | |
| Applicative Box | |
| Applicative Parser | |
| Applicative ParserResult | |
Defined in Options.Applicative.Types | |
| Applicative ReadM | |
| Applicative SmallArray | |
Defined in Data.Primitive.SmallArray | |
| Applicative Root | |
| Applicative ParserM | |
| Applicative (Either e) | Since: base-3.0 |
| Applicative (U1 :: Type -> Type) | Since: base-4.9.0.0 |
| Monoid a => Applicative ((,) a) | For tuples, the ("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)Since: base-2.1 |
| Applicative (ST s) | Since: base-4.4.0.0 |
| Applicative (ST s) | Since: base-2.1 |
| Monad m => Applicative (WrappedMonad m) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a # | |
| Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0 |
Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 # | |
| Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| (Functor m, Monad m) => Applicative (MaybeT m) | |
| Applicative m => Applicative (ListT m) | |
| Applicative (Parser i) | |
| Representable f => Applicative (Co f) | |
| Alternative f => Applicative (Cofree f) | |
| Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0 |
| (Monoid a, Monoid b) => Applicative ((,,) a b) | Since: base-4.14.0.0 |
| Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0 |
Defined in Control.Arrow | |
| Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1 |
| Applicative f => Applicative (Ap f) | Since: base-4.12.0.0 |
| Applicative f => Applicative (Alt f) | Since: base-4.8.0.0 |
| (Applicative f, Monad f) => Applicative (WhenMissing f x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods pure :: a -> WhenMissing f x a # (<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b # liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c # (*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b # (<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a # | |
| (Functor m, Monad m) => Applicative (ExceptT e m) | |
Defined in Control.Monad.Trans.Except | |
| Applicative m => Applicative (IdentityT m) | |
Defined in Control.Monad.Trans.Identity | |
| (Functor m, Monad m) => Applicative (ErrorT e m) | |
Defined in Control.Monad.Trans.Error | |
| Applicative m => Applicative (ReaderT r m) | |
Defined in Control.Monad.Trans.Reader | |
| (Functor m, Monad m) => Applicative (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| (Functor m, Monad m) => Applicative (StateT s m) | |
Defined in Control.Monad.Trans.State.Strict | |
| (Monoid w, Applicative m) => Applicative (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Lazy | |
| (Monoid w, Applicative m) => Applicative (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Strict | |
| (Monoid w, Functor m, Monad m) => Applicative (AccumT w m) | |
Defined in Control.Monad.Trans.Accum | |
| (Functor m, Monad m) => Applicative (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.CPS | |
| (Functor m, Monad m) => Applicative (SelectT r m) | |
Defined in Control.Monad.Trans.Select | |
| Applicative (Tagged s) | |
| Biapplicative p => Applicative (Join p) | |
| Applicative ((->) r :: Type -> Type) | Since: base-2.1 |
| Monoid c => Applicative (K1 i c :: Type -> Type) | Since: base-4.12.0.0 |
| (Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0 |
| (Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) | Since: base-4.14.0.0 |
Defined in GHC.Base | |
| (Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
| (Monad f, Applicative f) => Applicative (WhenMatched f x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods pure :: a -> WhenMatched f x y a # (<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b # liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c # (*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b # (<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a # | |
| (Applicative f, Monad f) => Applicative (WhenMissing f k x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods pure :: a -> WhenMissing f k x a # (<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b # liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c # (*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # (<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a # | |
| Applicative (ContT r m) | |
Defined in Control.Monad.Trans.Cont | |
| Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0 |
| (Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0 |
| (Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose | |
| (Monad f, Applicative f) => Applicative (WhenMatched f k x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods pure :: a -> WhenMatched f k x y a # (<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b # liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c # (*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # (<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a # | |
| (Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Strict | |
| (Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Lazy | |
| (Functor m, Monad m) => Applicative (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.CPS | |
optional :: Alternative f => f a -> f (Maybe a) #
One or none.
newtype WrappedMonad (m :: Type -> Type) a #
Constructors
| WrapMonad | |
Fields
| |
Instances
newtype WrappedArrow (a :: Type -> Type -> Type) b c #
Constructors
| WrapArrow | |
Fields
| |
Instances
| Generic1 (WrappedArrow a b :: Type -> Type) | Since: base-4.7.0.0 |
Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> Type # Methods from1 :: forall (a0 :: k). WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 # to1 :: forall (a0 :: k). Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 # | |
| Arrow a => Functor (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # | |
| Generic (WrappedArrow a b c) | Since: base-4.7.0.0 |
Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: Type -> Type # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c # | |
| type Rep1 (WrappedArrow a b :: Type -> Type) | |
Defined in Control.Applicative type Rep1 (WrappedArrow a b :: Type -> Type) = D1 ('MetaData "WrappedArrow" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapArrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (a b)))) | |
| type Rep (WrappedArrow a b c) | |
Defined in Control.Applicative type Rep (WrappedArrow a b c) = D1 ('MetaData "WrappedArrow" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapArrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a b c)))) | |
Lists, but with an Applicative functor based on zipping.
Constructors
| ZipList | |
Fields
| |
Instances
| Functor ZipList | Since: base-2.1 |
| 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 |
| Foldable ZipList | Since: base-4.9.0.0 |
Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldMap' :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # | |
| Traversable ZipList | Since: base-4.9.0.0 |
| Alternative ZipList | Since: base-4.11.0.0 |
| NFData1 ZipList | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| IsList (ZipList a) | Since: base-4.15.0.0 |
| Eq a => Eq (ZipList a) | Since: base-4.7.0.0 |
| Ord a => Ord (ZipList a) | Since: base-4.7.0.0 |
| Read a => Read (ZipList a) | Since: base-4.7.0.0 |
| Show a => Show (ZipList a) | Since: base-4.7.0.0 |
| Generic (ZipList a) | Since: base-4.7.0.0 |
| NFData a => NFData (ZipList a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| Generic1 ZipList | Since: base-4.7.0.0 |
| type Rep (ZipList a) | |
Defined in Control.Applicative | |
| type Item (ZipList a) | |
| type Rep1 ZipList | |
Defined in Control.Applicative | |
The Const functor.
Instances
| Generic1 (Const a :: k -> Type) | Since: base-4.9.0.0 |
| Unbox a => Vector Vector (Const a b) | |
Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Const a b) -> m (Vector (Const a b)) basicUnsafeThaw :: PrimMonad m => Vector (Const a b) -> m (Mutable Vector (PrimState m) (Const a b)) basicLength :: Vector (Const a b) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Const a b) -> Vector (Const a b) basicUnsafeIndexM :: Monad m => Vector (Const a b) -> Int -> m (Const a b) basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Const a b) -> Vector (Const a b) -> m () | |
| Unbox a => MVector MVector (Const a b) | |
Defined in Data.Vector.Unboxed.Base Methods basicLength :: MVector s (Const a b) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (Const a b) -> MVector s (Const a b) basicOverlaps :: MVector s (Const a b) -> MVector s (Const a b) -> Bool basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Const a b)) basicInitialize :: PrimMonad m => MVector (PrimState m) (Const a b) -> m () basicUnsafeReplicate :: PrimMonad m => Int -> Const a b -> m (MVector (PrimState m) (Const a b)) basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> m (Const a b) basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> Const a b -> m () basicClear :: PrimMonad m => MVector (PrimState m) (Const a b) -> m () basicSet :: PrimMonad m => MVector (PrimState m) (Const a b) -> Const a b -> m () basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Const a b) -> MVector (PrimState m) (Const a b) -> m () basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Const a b) -> MVector (PrimState m) (Const a b) -> m () basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> m (MVector (PrimState m) (Const a b)) | |
| Eq2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 |
| Ord2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read2 (Const :: Type -> Type -> Type) | 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 (Const a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] # | |
| Show2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 |
| NFData2 (Const :: Type -> Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| Hashable2 (Const :: Type -> Type -> Type) | |
Defined in Data.Hashable.Class | |
| Functor (Const m :: Type -> Type) | Since: base-2.1 |
| Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1 |
| Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0 |
Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # | |
| Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0 |
| Eq a => Eq1 (Const a :: Type -> Type) | Since: base-4.9.0.0 |
| Ord a => Ord1 (Const a :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read a => Read1 (Const a :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] # | |
| Show a => Show1 (Const a :: Type -> Type) | Since: base-4.9.0.0 |
| NFData a => NFData1 (Const a :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| Hashable a => Hashable1 (Const a :: Type -> Type) | |
Defined in Data.Hashable.Class | |
| Bounded a => Bounded (Const a b) | Since: base-4.9.0.0 |
| Enum a => Enum (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # fromEnum :: Const a b -> Int # enumFrom :: Const a b -> [Const a b] # enumFromThen :: Const a b -> Const a b -> [Const a b] # enumFromTo :: Const a b -> Const a b -> [Const a b] # enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] # | |
| Eq a => Eq (Const a b) | Since: base-4.9.0.0 |
| Floating a => Floating (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # | |
| Fractional a => Fractional (Const a b) | Since: base-4.9.0.0 |
| Integral a => Integral (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods quot :: Const a b -> Const a b -> Const a b # rem :: Const a b -> Const a b -> Const a b # div :: Const a b -> Const a b -> Const a b # mod :: Const a b -> Const a b -> Const a b # quotRem :: Const a b -> Const a b -> (Const a b, Const a b) # divMod :: Const a b -> Const a b -> (Const a b, Const a b) # | |
| Num a => Num (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const | |
| Ord a => Ord (Const a b) | Since: base-4.9.0.0 |
| Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Real a => Real (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational # | |
| RealFloat a => RealFloat (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods floatRadix :: Const a b -> Integer # floatDigits :: Const a b -> Int # floatRange :: Const a b -> (Int, Int) # decodeFloat :: Const a b -> (Integer, Int) # encodeFloat :: Integer -> Int -> Const a b # exponent :: Const a b -> Int # significand :: Const a b -> Const a b # scaleFloat :: Int -> Const a b -> Const a b # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # | |
| RealFrac a => RealFrac (Const a b) | Since: base-4.9.0.0 |
| Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Ix a => Ix (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods range :: (Const a b, Const a b) -> [Const a b] # index :: (Const a b, Const a b) -> Const a b -> Int # unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int # inRange :: (Const a b, Const a b) -> Const a b -> Bool # rangeSize :: (Const a b, Const a b) -> Int # unsafeRangeSize :: (Const a b, Const a b) -> Int # | |
| IsString a => IsString (Const a b) | Since: base-4.9.0.0 |
Defined in Data.String Methods fromString :: String -> Const a b # | |
| Generic (Const a b) | Since: base-4.9.0.0 |
| Semigroup a => Semigroup (Const a b) | Since: base-4.9.0.0 |
| Monoid a => Monoid (Const a b) | Since: base-4.9.0.0 |
| Storable a => Storable (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const | |
| Bits a => Bits (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods (.&.) :: Const a b -> Const a b -> Const a b # (.|.) :: Const a b -> Const a b -> Const a b # xor :: Const a b -> Const a b -> Const a b # complement :: Const a b -> Const a b # shift :: Const a b -> Int -> Const a b # rotate :: Const a b -> Int -> Const a b # setBit :: Const a b -> Int -> Const a b # clearBit :: Const a b -> Int -> Const a b # complementBit :: Const a b -> Int -> Const a b # testBit :: Const a b -> Int -> Bool # bitSizeMaybe :: Const a b -> Maybe Int # isSigned :: Const a b -> Bool # shiftL :: Const a b -> Int -> Const a b # unsafeShiftL :: Const a b -> Int -> Const a b # shiftR :: Const a b -> Int -> Const a b # unsafeShiftR :: Const a b -> Int -> Const a b # rotateL :: Const a b -> Int -> Const a b # | |
| FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int # countLeadingZeros :: Const a b -> Int # countTrailingZeros :: Const a b -> Int # | |
| NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| FromField a => FromField (Const a b) | |
Defined in Data.Csv.Conversion Methods parseField :: Field -> Parser (Const a b) # | |
| ToField a => ToField (Const a b) | |
Defined in Data.Csv.Conversion | |
| Unbox a => Unbox (Const a b) | |
Defined in Data.Vector.Unboxed.Base | |
| Hashable a => Hashable (Const a b) | |
Defined in Data.Hashable.Class | |
| Prim a => Prim (Const a b) | |
Defined in Data.Primitive.Types Methods alignment# :: Const a b -> Int# indexByteArray# :: ByteArray# -> Int# -> Const a b readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Const a b #) writeByteArray# :: MutableByteArray# s -> Int# -> Const a b -> State# s -> State# s setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Const a b -> State# s -> State# s indexOffAddr# :: Addr# -> Int# -> Const a b readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Const a b #) writeOffAddr# :: Addr# -> Int# -> Const a b -> State# s -> State# s setOffAddr# :: Addr# -> Int# -> Int# -> Const a b -> State# s -> State# s | |
| type Rep1 (Const a :: k -> Type) | |
Defined in Data.Functor.Const | |
| newtype MVector s (Const a b) | |
Defined in Data.Vector.Unboxed.Base | |
| type Rep (Const a b) | |
Defined in Data.Functor.Const | |
| newtype Vector (Const a b) | |
Defined in Data.Vector.Unboxed.Base | |
(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #
An infix synonym for fmap.
The name of this operator is an allusion to $.
Note the similarities between their types:
($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b
Whereas $ is function application, <$> is function
application lifted over a Functor.
Examples
Convert from a to a Maybe Int using Maybe
Stringshow:
>>>show <$> NothingNothing>>>show <$> Just 3Just "3"
Convert from an to an
Either Int IntEither IntString using show:
>>>show <$> Left 17Left 17>>>show <$> Right 17Right "17"
Double each element of a list:
>>>(*2) <$> [1,2,3][2,4,6]
Apply even to the second element of a pair:
>>>even <$> (2,2)(2,True)
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d #
Lift a ternary function to actions.
Using ApplicativeDo: '' can be understood
as the liftA3 f as bs csdo expression
do a <- as b <- bs c <- cs pure (f a b c)
liftA :: Applicative f => (a -> b) -> f a -> f b #
(<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 #
class Applicative f => Alternative (f :: Type -> Type) where #
A monoid on applicative functors.
If defined, some and many should be the least solutions
of the equations:
Methods
(<|>) :: f a -> f a -> f a infixl 3 #
An associative binary operation
One or more.
Zero or more.
Instances
guard :: Alternative f => Bool -> f () #
Conditional failure of Alternative computations. Defined by
guard True =pure() guard False =empty
Examples
Common uses of guard include conditionally signaling an error in
an error monad and conditionally rejecting the current choice in an
Alternative-based parser.
As an example of signaling an error in the error monad Maybe,
consider a safe division function safeDiv x y that returns
Nothing when the denominator y is zero and otherwise. For example:Just (x `div`
y)
>>> safeDiv 4 0 Nothing >>> safeDiv 4 2 Just 2
A definition of safeDiv using guards, but not guard:
safeDiv :: Int -> Int -> Maybe Int
safeDiv x y | y /= 0 = Just (x `div` y)
| otherwise = Nothing
A definition of safeDiv using guard and Monad do-notation:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x `div` y)
class Applicative m => Monad (m :: Type -> Type) where #
The Monad class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad should satisfy the following:
- Left identity
returna>>=k = k a- Right identity
m>>=return= m- Associativity
m>>=(\x -> k x>>=h) = (m>>=k)>>=h
Furthermore, the Monad and Applicative operations should relate as follows:
The above laws imply:
and that pure and (<*>) satisfy the applicative functor laws.
The instances of Monad for lists, Maybe and IO
defined in the Prelude satisfy these laws.
Minimal complete definition
Methods
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
'as ' can be understood as the >>= bsdo expression
do a <- as bs a
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
'as ' can be understood as the >> bsdo expression
do as bs
Inject a value into the monadic type.
Instances
| Monad [] | Since: base-2.1 |
| Monad Maybe | Since: base-2.1 |
| Monad IO | Since: base-2.1 |
| Monad Par1 | Since: base-4.9.0.0 |
| Monad Q | |
| Monad Complex | Since: base-4.9.0.0 |
| Monad Min | Since: base-4.9.0.0 |
| Monad Max | Since: base-4.9.0.0 |
| Monad First | Since: base-4.9.0.0 |
| Monad Last | Since: base-4.9.0.0 |
| Monad Option | Since: base-4.9.0.0 |
| Monad Identity | Since: base-4.8.0.0 |
| Monad STM | Since: base-4.3.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 Sum | Since: base-4.8.0.0 |
| Monad Product | Since: base-4.8.0.0 |
| Monad Down | Since: base-4.11.0.0 |
| Monad ReadP | Since: base-2.1 |
| Monad NonEmpty | Since: base-4.9.0.0 |
| Monad Tree | |
| Monad Seq | |
| Monad P | Since: base-2.1 |
| Monad Parser | |
| Monad Vector | |
| Monad Id | |
| Monad Array | |
| Monad Box | |
| Monad ParserResult | |
| Monad ReadM | |
| Monad SmallArray | |
| Monad Root | |
| Monad ParserM | |
| Monad (Either e) | Since: base-4.4.0.0 |
| Monad (U1 :: Type -> Type) | Since: base-4.9.0.0 |
| Monoid a => Monad ((,) a) | Since: base-4.9.0.0 |
| Monad (ST s) | Since: base-2.1 |
| Monad (ST s) | 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 # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # | |
| ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1 |
Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # | |
| Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Monad m => Monad (MaybeT m) | |
| Monad m => Monad (ListT m) | |
| Monad (Parser i) | |
| Representable f => Monad (Co f) | |
| Alternative f => Monad (Cofree f) | |
| 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 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 |
| (Applicative f, Monad f) => Monad (WhenMissing f x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods (>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b # (>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b # return :: a -> WhenMissing f x a # | |
| Monad m => Monad (ExceptT e m) | |
| Monad m => Monad (IdentityT m) | |
| (Monad m, Error e) => Monad (ErrorT e m) | |
| Monad m => Monad (ReaderT r m) | |
| Monad m => Monad (StateT s m) | |
| Monad m => Monad (StateT s m) | |
| (Monoid w, Monad m) => Monad (WriterT w m) | |
| (Monoid w, Monad m) => Monad (WriterT w m) | |
| (Monoid w, Functor m, Monad m) => Monad (AccumT w m) | |
| Monad m => Monad (WriterT w m) | |
| Monad m => Monad (SelectT r m) | |
| Monad (Tagged s) | |
| Monad ((->) r :: Type -> Type) | Since: base-2.1 |
| (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 f, Monad g) => Monad (Product f g) | Since: base-4.9.0.0 |
| (Monad f, Applicative f) => Monad (WhenMatched f x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods (>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b # (>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b # return :: a -> WhenMatched f x y a # | |
| (Applicative f, Monad f) => Monad (WhenMissing f k x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods (>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b # (>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # return :: a -> WhenMissing f k x a # | |
| Monad (ContT r m) | |
| Monad f => Monad (M1 i c f) | Since: base-4.9.0.0 |
| (Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods (>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b # (>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # return :: a -> WhenMatched f k x y a # | |
| (Monoid w, Monad m) => Monad (RWST r w s m) | |
| (Monoid w, Monad m) => Monad (RWST r w s m) | |
| Monad m => Monad (RWST r w s m) | |
class Functor (f :: Type -> Type) where #
A type f is a Functor if it provides a function fmap which, given any types a and b
lets you apply any function from (a -> b) to turn an f a into an f b, preserving the
structure of f. Furthermore f needs to adhere to the following:
Note, that the second law follows from the free theorem of the type fmap and
the first law, so you need only check that the former condition holds.
Minimal complete definition
Methods
fmap :: (a -> b) -> f a -> f b #
Using ApplicativeDo: '' can be understood as
the fmap f asdo expression
do a <- as pure (f a)
with an inferred Functor constraint.
Instances
| Functor [] | Since: base-2.1 |
| Functor Maybe | Since: base-2.1 |
| Functor IO | Since: base-2.1 |
| Functor Par1 | Since: base-4.9.0.0 |
| Functor Q | |
| Functor Complex | Since: base-4.9.0.0 |
| Functor Min | Since: base-4.9.0.0 |
| Functor Max | Since: base-4.9.0.0 |
| Functor First | Since: base-4.9.0.0 |
| Functor Last | Since: base-4.9.0.0 |
| Functor Option | Since: base-4.9.0.0 |
| Functor ZipList | Since: base-2.1 |
| Functor Identity | Since: base-4.8.0.0 |
| Functor STM | Since: base-4.3.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 Sum | Since: base-4.8.0.0 |
| Functor Product | Since: base-4.8.0.0 |
| Functor Down | Since: base-4.11.0.0 |
| Functor ReadP | Since: base-2.1 |
| Functor NonEmpty | Since: base-4.9.0.0 |
| Functor IntMap | |
| Functor Tree | |
| Functor Seq | |
| Functor FingerTree | |
Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> FingerTree a -> FingerTree b # (<$) :: a -> FingerTree b -> FingerTree a # | |
| Functor Digit | |
| Functor Node | |
| Functor Elem | |
| Functor ViewL | |
| Functor ViewR | |
| Functor Doc | |
| Functor AnnotDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods fmap :: (a -> b) -> AnnotDetails a -> AnnotDetails b # (<$) :: a -> AnnotDetails b -> AnnotDetails a # | |
| Functor Span | |
| Functor P | Since: base-4.8.0.0 |
Defined in Text.ParserCombinators.ReadP | |
| Functor Only | |
| Functor Parser | |
Defined in Data.Csv.Conversion | |
| Functor Vector | |
Defined in Data.Vector | |
| Functor Id | |
Defined in Data.Vector.Fusion.Util | |
| Functor Array | |
Defined in Data.Primitive.Array | |
| Functor Box | |
Defined in Data.Vector.Fusion.Util | |
| Functor Parser | |
Defined in Options.Applicative.Types | |
| Functor ParserFailure | |
Defined in Options.Applicative.Types | |
| Functor ParserInfo | |
Defined in Options.Applicative.Types | |
| Functor ParserResult | |
Defined in Options.Applicative.Types | |
| Functor ReadM | |
Defined in Options.Applicative.Types | |
| Functor SmallArray | |
Defined in Data.Primitive.SmallArray | |
| Functor Root | |
Defined in Numeric.RootFinding | |
| Functor OptReader | |
Defined in Options.Applicative.Types | |
| Functor Option | |
Defined in Options.Applicative.Types | |
| Functor CReader | |
Defined in Options.Applicative.Types | |
| Functor ParserM | |
Defined in Options.Applicative.Types | |
| Functor (Either a) | Since: base-3.0 |
| Functor (V1 :: Type -> Type) | Since: base-4.9.0.0 |
| Functor (U1 :: Type -> Type) | Since: base-4.9.0.0 |
| Functor ((,) a) | Since: base-2.1 |
| Functor (ST s) | Since: base-2.1 |
| Functor (Array i) | Since: base-2.1 |
| Functor (Arg a) | Since: base-4.9.0.0 |
| Functor (ST s) | 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 # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a # | |
| Arrow a => Functor (ArrowMonad a) | Since: base-4.6.0.0 |
Defined in Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 # | |
| Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Functor (Map k) | |
| Functor m => Functor (MaybeT m) | |
| Functor m => Functor (ListT m) | |
| Functor (IResult i) | |
Defined in Data.Attoparsec.Internal.Types | |
| Functor (Parser i) | |
Defined in Data.Attoparsec.Internal.Types | |
| Functor (HashMap k) | |
Defined in Data.HashMap.Internal | |
| Functor f => Functor (Co f) | |
Defined in Data.Functor.Rep | |
| Functor f => Functor (Cofree f) | |
Defined in Control.Comonad.Cofree | |
| Functor f => Functor (Rec1 f) | 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 (URec (Ptr ()) :: Type -> Type) | Since: base-4.9.0.0 |
| Functor ((,,) a b) | Since: base-4.14.0.0 |
| Arrow a => Functor (WrappedArrow a b) | Since: base-2.1 |
Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| 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 |
| (Applicative f, Monad f) => Functor (WhenMissing f x) | Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods fmap :: (a -> b) -> WhenMissing f x a -> WhenMissing f x b # (<$) :: a -> WhenMissing f x b -> WhenMissing f x a # | |
| Functor m => Functor (ExceptT e m) | |
| Functor m => Functor (IdentityT m) | |
| Functor m => Functor (ErrorT e m) | |
| Functor m => Functor (ReaderT r m) | |
| Functor m => Functor (StateT s m) | |
| Functor m => Functor (StateT s m) | |
| Functor m => Functor (WriterT w m) | |
| Functor m => Functor (WriterT w m) | |
| Functor m => Functor (AccumT w m) | |
| Functor m => Functor (WriterT w m) | |
| Functor m => Functor (SelectT r m) | |
| Monad m => Functor (Bundle m v) | |
Defined in Data.Vector.Fusion.Bundle.Monadic | |
| Functor v => Functor (Vector v n) | |
Defined in Data.Vector.Generic.Sized.Internal | |
| Functor (Tagged s) | |
Defined in Data.Tagged | |
| Bifunctor p => Functor (Join p) | |
Defined in Data.Bifunctor.Join | |
| Functor ((->) r :: Type -> Type) | Since: base-2.1 |
| Functor (K1 i c :: Type -> Type) | Since: base-4.9.0.0 |
| (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 ((,,,) a b c) | 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 f => Functor (WhenMatched f x y) | Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods fmap :: (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b # (<$) :: a -> WhenMatched f x y b -> WhenMatched f x y a # | |
| (Applicative f, Monad f) => Functor (WhenMissing f k x) | Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods fmap :: (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b # (<$) :: a -> WhenMissing f k x b -> WhenMissing f k x a # | |
| Functor (ContT r m) | |
| Functor f => Functor (M1 i c f) | Since: base-4.9.0.0 |
| (Functor f, Functor g) => Functor (f :.: g) | Since: base-4.9.0.0 |
| (Functor f, Functor g) => Functor (Compose f g) | Since: base-4.9.0.0 |
| Functor f => Functor (WhenMatched f k x y) | Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods fmap :: (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b # (<$) :: a -> WhenMatched f k x y b -> WhenMatched f k x y a # | |
| Functor m => Functor (RWST r w s m) | |
| Functor m => Functor (RWST r w s m) | |
| Functor m => Functor (RWST r w s m) | |
| Functor (Clown f a :: Type -> Type) | |
Defined in Data.Bifunctor.Clown | |
| Bifunctor p => Functor (Flip p a) | |
Defined in Data.Bifunctor.Flip | |
| Functor g => Functor (Joker g a) | |
Defined in Data.Bifunctor.Joker | |
| Bifunctor p => Functor (WrappedBifunctor p a) | |
Defined in Data.Bifunctor.Wrapped | |
| (Functor f, Bifunctor p) => Functor (Tannen f p a) | |
Defined in Data.Bifunctor.Tannen | |
| (Bifunctor p, Functor g) => Functor (Biff p f g a) | |
Defined in Data.Bifunctor.Biff | |
class Monad m => MonadFail (m :: Type -> Type) where #
When a value is bound in do-notation, the pattern on the left
hand side of <- might not match. In this case, this class
provides a function to recover.
A Monad without a MonadFail instance may only be used in conjunction
with pattern that always match, such as newtypes, tuples, data types with
only a single data constructor, and irrefutable patterns (~pat).
Instances of MonadFail should satisfy the following law: fail s should
be a left zero for >>=,
fail s >>= f = fail s
If your Monad is also MonadPlus, a popular definition is
fail _ = mzero
Since: base-4.9.0.0
Instances
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) #
Map each element of a structure to a monadic action, evaluate
these actions from left to right, and collect the results. For
a version that ignores the results see mapM_.
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) #
Evaluate each monadic action in the structure from left to
right, and collect the results. For a version that ignores the
results see sequence_.
unless :: Applicative f => Bool -> f () -> f () #
The reverse of when.
replicateM_ :: Applicative m => Int -> m a -> m () #
Like replicateM, but discards the result.
replicateM :: Applicative m => Int -> m a -> m [a] #
performs the action replicateM n actn times,
gathering the results.
Using ApplicativeDo: '' can be understood as
the replicateM 5 asdo expression
do a1 <- as a2 <- as a3 <- as a4 <- as a5 <- as pure [a1,a2,a3,a4,a5]
Note the Applicative constraint.
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #
Like foldM, but discards the result.
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #
The foldM function is analogous to foldl, except that its result is
encapsulated in a monad. Note that foldM works from left-to-right over
the list arguments. This could be an issue where ( and the `folded
function' are not commutative.>>)
foldM f a1 [x1, x2, ..., xm] == do a2 <- f a1 x1 a3 <- f a2 x2 ... f am xm
If right-to-left evaluation is required, the input list should be reversed.
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) #
The mapAndUnzipM function maps its first argument over a list, returning
the result as a pair of lists. This function is mainly used with complicated
data structures or a state monad.
forever :: Applicative f => f a -> f b #
Repeat an action indefinitely.
Using ApplicativeDo: '' can be understood as the
pseudo-forever asdo expression
do as as ..
with as repeating.
Examples
A common use of forever is to process input from network sockets,
Handles, and channels
(e.g. MVar and
Chan).
For example, here is how we might implement an echo
server, using
forever both to listen for client connections on a network socket
and to echo client input on client connection handles:
echoServer :: Socket -> IO () echoServer socket =forever$ do client <- accept socketforkFinally(echo client) (\_ -> hClose client) where echo :: Handle -> IO () echo client =forever$ hGetLine client >>= hPutStrLn client
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #
Left-to-right composition of Kleisli arrows.
'(bs ' can be understood as the >=> cs) ado expression
do b <- bs a cs b
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #
This generalizes the list-based filter function.
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #
sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #
Evaluate each monadic action in the structure from left to right,
and ignore the results. For a version that doesn't ignore the
results see sequence.
As of base 4.8.0.0, sequence_ is just sequenceA_, specialized
to Monad.
void :: Functor f => f a -> f () #
discards or ignores the result of evaluation, such
as the return value of an void valueIO action.
Using ApplicativeDo: '' can be understood as the
void asdo expression
do as pure ()
with an inferred Functor constraint.
Examples
Replace the contents of a with unit:Maybe Int
>>>void NothingNothing>>>void (Just 3)Just ()
Replace the contents of an
with unit, resulting in an Either Int Int:Either Int ()
>>>void (Left 8675309)Left 8675309>>>void (Right 8675309)Right ()
Replace every element of a list with unit:
>>>void [1,2,3][(),(),()]
Replace the second element of a pair with unit:
>>>void (1,2)(1,())
Discard the result of an IO action:
>>>mapM print [1,2]1 2 [(),()]>>>void $ mapM print [1,2]1 2
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2).
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2).
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r #
Promote a function to a monad, scanning the monadic arguments from
left to right (cf. liftM2).
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r #
Promote a function to a monad, scanning the monadic arguments from left to right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3] liftM2 (+) (Just 1) Nothing = Nothing
when :: Applicative f => Bool -> f () -> f () #
Conditional execution of Applicative expressions. For example,
when debug (putStrLn "Debugging")
will output the string Debugging if the Boolean value debug
is True, and otherwise do nothing.
(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #
Same as >>=, but with the arguments interchanged.
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where #
Monads that also support choice and failure.
Minimal complete definition
Nothing
Methods
The identity of mplus. It should also satisfy the equations
mzero >>= f = mzero v >> mzero = mzero
The default definition is
mzero = empty
An associative operation. The default definition is
mplus = (<|>)
Instances
RealWorld is deeply magical. It is primitive, but it is not
unlifted (hence ptrArg). We never manipulate values of type
RealWorld; it's only used in the type system, to parameterise State#.
type family PrimState (m :: Type -> Type) #
Instances
class Monad m => PrimMonad (m :: Type -> Type) where #
Instances
| PrimMonad IO | |
| PrimMonad (ST s) | |
| PrimMonad (ST s) | |
| PrimMonad m => PrimMonad (MaybeT m) | |
| PrimMonad m => PrimMonad (ListT m) | |
| PrimMonad m => PrimMonad (ExceptT e m) | |
| PrimMonad m => PrimMonad (IdentityT m) | |
| (Error e, PrimMonad m) => PrimMonad (ErrorT e m) | |
| PrimMonad m => PrimMonad (ReaderT r m) | |
| PrimMonad m => PrimMonad (StateT s m) | |
| PrimMonad m => PrimMonad (StateT s m) | |
| (Monoid w, PrimMonad m) => PrimMonad (WriterT w m) | |
| (Monoid w, PrimMonad m) => PrimMonad (WriterT w m) | |
| (Monoid w, PrimMonad m) => PrimMonad (AccumT w m) | |
| (Monoid w, PrimMonad m) => PrimMonad (WriterT w m) | |
| PrimMonad m => PrimMonad (SelectT r m) | |
| PrimMonad m => PrimMonad (ContT r m) | |
| (Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) | |
| (Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) | |
| (Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) | |
noDuplicate :: PrimMonad m => m () #
unsafeDupableInterleave :: PrimBase m => m a -> m a #
unsafeIOToPrim :: PrimMonad m => IO a -> m a #
unsafeInlineIO :: IO a -> a #
unsafeInlinePrim :: PrimBase m => m a -> a #
unsafeInlineST :: ST s a -> a #
unsafeInterleave :: PrimBase m => m a -> m a #
unsafePrimToIO :: PrimBase m => m a -> IO a #
unsafePrimToPrim :: (PrimBase m1, PrimMonad m2) => m1 a -> m2 a #
unsafePrimToST :: PrimBase m => m a -> ST s a #
unsafeSTToPrim :: PrimMonad m => ST s a -> m a #
class (PrimMonad m, s ~ PrimState m) => MonadPrim s (m :: Type -> Type) #
Instances
| (PrimMonad m, s ~ PrimState m) => MonadPrim s m | |
Defined in Control.Monad.Primitive | |
class (PrimBase m, MonadPrim s m) => MonadPrimBase s (m :: Type -> Type) #
Instances
| (PrimBase m, MonadPrim s m) => MonadPrimBase s m | |
Defined in Control.Monad.Primitive | |
class PrimMonad m => PrimBase (m :: Type -> Type) #
Minimal complete definition
internal
module Control.Monad.ST
leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) #
Any instance of ArrowApply can be made into an instance of
ArrowChoice by defining left = leftApp.
(^<<) :: Arrow a => (c -> d) -> a b c -> a b d infixr 1 #
Postcomposition with a pure function (right-to-left variant).
(<<^) :: Arrow a => a c d -> (b -> c) -> a b d infixr 1 #
Precomposition with a pure function (right-to-left variant).
class Category a => Arrow (a :: Type -> Type -> Type) where #
The basic arrow class.
Instances should satisfy the following laws:
arrid =idarr(f >>> g) =arrf >>>arrgfirst(arrf) =arr(firstf)first(f >>> g) =firstf >>>firstgfirstf >>>arrfst=arrfst>>> ffirstf >>>arr(id*** g) =arr(id*** g) >>>firstffirst(firstf) >>>arrassoc =arrassoc >>>firstf
where
assoc ((a,b),c) = (a,(b,c))
The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
Lift a function to an arrow.
first :: a b c -> a (b, d) (c, d) #
Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
second :: a b c -> a (d, b) (d, c) #
A mirror image of first.
The default definition may be overridden with a more efficient version if desired.
(***) :: a b c -> a b' c' -> a (b, b') (c, c') infixr 3 #
Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(&&&) :: a b c -> a b c' -> a b (c, c') infixr 3 #
Fanout: send the input to both argument arrows and combine their output.
The default definition may be overridden with a more efficient version if desired.
Instances
| Monad m => Arrow (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| Monad m => Arrow (Circuit m) Source # | |
Defined in Goal.Core.Circuit | |
| Arrow ((->) :: Type -> Type -> Type) | Since: base-2.1 |
| (Arrow p, Arrow q) => Arrow (Product p q) | |
Defined in Data.Bifunctor.Product Methods arr :: (b -> c) -> Product p q b c # first :: Product p q b c -> Product p q (b, d) (c, d) # second :: Product p q b c -> Product p q (d, b) (d, c) # (***) :: Product p q b c -> Product p q b' c' -> Product p q (b, b') (c, c') # (&&&) :: Product p q b c -> Product p q b c' -> Product p q b (c, c') # | |
| (Applicative f, Arrow p) => Arrow (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
newtype Kleisli (m :: Type -> Type) a b #
Kleisli arrows of a monad.
Constructors
| Kleisli | |
Fields
| |
Instances
| Monad m => Arrow (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| MonadPlus m => ArrowPlus (Kleisli m) | Since: base-2.1 |
| Monad m => ArrowChoice (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| Monad m => ArrowApply (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the Since: base-2.1 |
Defined in Control.Arrow | |
| Monad m => Category (Kleisli m :: Type -> Type -> Type) | Since: base-3.0 |
| Generic1 (Kleisli m a :: Type -> Type) | Since: base-4.14.0.0 |
| Monad m => Monad (Kleisli m a) | Since: base-4.14.0.0 |
| Functor m => Functor (Kleisli m a) | Since: base-4.14.0.0 |
| Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0 |
Defined in Control.Arrow | |
| Alternative m => Alternative (Kleisli m a) | Since: base-4.14.0.0 |
| MonadPlus m => MonadPlus (Kleisli m a) | Since: base-4.14.0.0 |
| Generic (Kleisli m a b) | Since: base-4.14.0.0 |
| type Rep1 (Kleisli m a :: Type -> Type) | |
| type Rep (Kleisli m a b) | |
Defined in Control.Arrow | |
class Arrow a => ArrowZero (a :: Type -> Type -> Type) where #
Instances
| MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| (ArrowZero p, ArrowZero q) => ArrowZero (Product p q) | |
Defined in Data.Bifunctor.Product | |
| (Applicative f, ArrowZero p) => ArrowZero (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type) #
A monoid on arrows.
Minimal complete definition
Instances
| MonadPlus m => ArrowPlus (Kleisli m) | Since: base-2.1 |
| (ArrowPlus p, ArrowPlus q) => ArrowPlus (Product p q) | |
Defined in Data.Bifunctor.Product | |
| (Applicative f, ArrowPlus p) => ArrowPlus (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
class Arrow a => ArrowChoice (a :: Type -> Type -> Type) where #
Choice, for arrows that support it. This class underlies the
if and case constructs in arrow notation.
Instances should satisfy the following laws:
left(arrf) =arr(leftf)left(f >>> g) =leftf >>>leftgf >>>
arrLeft=arrLeft>>>leftfleftf >>>arr(id+++ g) =arr(id+++ g) >>>leftfleft(leftf) >>>arrassocsum =arrassocsum >>>leftf
where
assocsum (Left (Left x)) = Left x assocsum (Left (Right y)) = Right (Left y) assocsum (Right z) = Right (Right z)
The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
left :: a b c -> a (Either b d) (Either c d) #
Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.
right :: a b c -> a (Either d b) (Either d c) #
A mirror image of left.
The default definition may be overridden with a more efficient version if desired.
(+++) :: a b c -> a b' c' -> a (Either b b') (Either c c') infixr 2 #
Split the input between the two argument arrows, retagging and merging their outputs. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(|||) :: a b d -> a c d -> a (Either b c) d infixr 2 #
Fanin: Split the input between the two argument arrows and merge their outputs.
The default definition may be overridden with a more efficient version if desired.
Instances
| Monad m => ArrowChoice (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| Monad m => ArrowChoice (Circuit m) Source # | |
Defined in Goal.Core.Circuit | |
| ArrowChoice ((->) :: Type -> Type -> Type) | Since: base-2.1 |
| (ArrowChoice p, ArrowChoice q) => ArrowChoice (Product p q) | |
Defined in Data.Bifunctor.Product Methods left :: Product p q b c -> Product p q (Either b d) (Either c d) # right :: Product p q b c -> Product p q (Either d b) (Either d c) # (+++) :: Product p q b c -> Product p q b' c' -> Product p q (Either b b') (Either c c') # (|||) :: Product p q b d -> Product p q c d -> Product p q (Either b c) d # | |
| (Applicative f, ArrowChoice p) => ArrowChoice (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
class Arrow a => ArrowApply (a :: Type -> Type -> Type) where #
Some arrows allow application of arrow inputs to other inputs. Instances should satisfy the following laws:
first(arr(\x ->arr(\y -> (x,y)))) >>>app=idfirst(arr(g >>>)) >>>app=secondg >>>appfirst(arr(>>> h)) >>>app=app>>> h
Such arrows are equivalent to monads (see ArrowMonad).
Instances
| Monad m => ArrowApply (Kleisli m) | Since: base-2.1 |
Defined in Control.Arrow | |
| ArrowApply ((->) :: Type -> Type -> Type) | Since: base-2.1 |
Defined in Control.Arrow | |
newtype ArrowMonad (a :: Type -> Type -> Type) b #
The ArrowApply class is equivalent to Monad: any monad gives rise
to a Kleisli arrow, and any instance of ArrowApply defines a monad.
Constructors
| ArrowMonad (a () b) |
Instances
class Arrow a => ArrowLoop (a :: Type -> Type -> Type) where #
The loop operator expresses computations in which an output value
is fed back as input, although the computation occurs only once.
It underlies the rec value recursion construct in arrow notation.
loop should satisfy the following laws:
- extension
loop(arrf) =arr(\ b ->fst(fix(\ (c,d) -> f (b,d))))- left tightening
loop(firsth >>> f) = h >>>loopf- right tightening
loop(f >>>firsth) =loopf >>> h- sliding
loop(f >>>arr(id*** k)) =loop(arr(id*** k) >>> f)- vanishing
loop(loopf) =loop(arrunassoc >>> f >>>arrassoc)- superposing
second(loopf) =loop(arrassoc >>>secondf >>>arrunassoc)
where
assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)
Instances
| MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the Since: base-2.1 |
Defined in Control.Arrow | |
| ArrowLoop ((->) :: Type -> Type -> Type) | Since: base-2.1 |
Defined in Control.Arrow | |
| (ArrowLoop p, ArrowLoop q) => ArrowLoop (Product p q) | |
Defined in Data.Bifunctor.Product | |
| (Applicative f, ArrowLoop p) => ArrowLoop (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
(>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c infixr 1 #
Left-to-right composition
(<<<) :: forall k cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c infixr 1 #
Right-to-left composition
module Control.Concurrent
rnf2 :: (NFData2 p, NFData a, NFData b) => p a b -> () #
Lift the standard rnf function through the type constructor.
Since: deepseq-1.4.3.0
rnf1 :: (NFData1 f, NFData a) => f a -> () #
Lift the standard rnf function through the type constructor.
Since: deepseq-1.4.3.0
(<$!!>) :: (Monad m, NFData b) => (a -> b) -> m a -> m b infixl 4 #
Deeply strict version of <$>.
Since: deepseq-1.4.3.0
($!!) :: NFData a => (a -> b) -> a -> b infixr 0 #
the deep analogue of $!. In the expression f $!! x, x is
fully evaluated before the function f is applied to it.
Since: deepseq-1.2.0.0
deepseq :: NFData a => a -> b -> b #
deepseq: fully evaluates the first argument, before returning the
second.
The name deepseq is used to illustrate the relationship to seq:
where seq is shallow in the sense that it only evaluates the top
level of its argument, deepseq traverses the entire data structure
evaluating it completely.
deepseq can be useful for forcing pending exceptions,
eradicating space leaks, or forcing lazy I/O to happen. It is
also useful in conjunction with parallel Strategies (see the
parallel package).
There is no guarantee about the ordering of evaluation. The
implementation may evaluate the components of the structure in
any order or in parallel. To impose an actual order on
evaluation, use pseq from Control.Parallel in the
parallel package.
Since: deepseq-1.1.0.0
A class of types that can be fully evaluated.
Since: deepseq-1.1.0.0
Minimal complete definition
Nothing
Methods
rnf should reduce its argument to normal form (that is, fully
evaluate all sub-components), and then return ().
Generic NFData deriving
Starting with GHC 7.2, you can automatically derive instances
for types possessing a Generic instance.
Note: Generic1 can be auto-derived starting with GHC 7.4
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic, Generic1)
import Control.DeepSeq
data Foo a = Foo a String
deriving (Eq, Generic, Generic1)
instance NFData a => NFData (Foo a)
instance NFData1 Foo
data Colour = Red | Green | Blue
deriving Generic
instance NFData ColourStarting with GHC 7.10, the example above can be written more
concisely by enabling the new DeriveAnyClass extension:
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
import GHC.Generics (Generic)
import Control.DeepSeq
data Foo a = Foo a String
deriving (Eq, Generic, Generic1, NFData, NFData1)
data Colour = Red | Green | Blue
deriving (Generic, NFData)
Compatibility with previous deepseq versions
Prior to version 1.4.0.0, the default implementation of the rnf
method was defined as
rnfa =seqa ()
However, starting with deepseq-1.4.0.0, the default
implementation is based on DefaultSignatures allowing for
more accurate auto-derived NFData instances. If you need the
previously used exact default rnf method implementation
semantics, use
instance NFData Colour where rnf x = seq x ()
or alternatively
instance NFData Colour where rnf = rwhnf
or
{-# LANGUAGE BangPatterns #-}
instance NFData Colour where rnf !_ = ()Instances
| NFData Bool | |
Defined in Control.DeepSeq | |
| NFData Char | |
Defined in Control.DeepSeq | |
| NFData Double | |
Defined in Control.DeepSeq | |
| NFData Float | |
Defined in Control.DeepSeq | |
| NFData Int | |
Defined in Control.DeepSeq | |
| NFData Int8 | |
Defined in Control.DeepSeq | |
| NFData Int16 | |
Defined in Control.DeepSeq | |
| NFData Int32 | |
Defined in Control.DeepSeq | |
| NFData Int64 | |
Defined in Control.DeepSeq | |
| NFData Integer | |
Defined in Control.DeepSeq | |
| NFData Natural | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Ordering | |
Defined in Control.DeepSeq | |
| NFData Word | |
Defined in Control.DeepSeq | |
| NFData Word8 | |
Defined in Control.DeepSeq | |
| NFData Word16 | |
Defined in Control.DeepSeq | |
| NFData Word32 | |
Defined in Control.DeepSeq | |
| NFData Word64 | |
Defined in Control.DeepSeq | |
| NFData CallStack | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData () | |
Defined in Control.DeepSeq | |
| NFData TyCon | NOTE: Prior to Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Void | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Unique | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Version | Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
| NFData ThreadId | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData ExitCode | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData MaskingState | Since: deepseq-1.4.4.0 |
Defined in Control.DeepSeq Methods rnf :: MaskingState -> () # | |
| NFData TypeRep | NOTE: Prior to Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData All | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Any | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CSChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CShort | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUShort | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CInt | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUInt | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CULong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CLLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CULLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CBool | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData CFloat | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CDouble | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CPtrdiff | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CSize | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CWchar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CSigAtomic | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq Methods rnf :: CSigAtomic -> () # | |
| NFData CClock | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CTime | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUSeconds | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CSUSeconds | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq Methods rnf :: CSUSeconds -> () # | |
| NFData CFile | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CFpos | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CJmpBuf | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CIntPtr | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUIntPtr | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CIntMax | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData CUIntMax | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData Fingerprint | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq Methods rnf :: Fingerprint -> () # | |
| NFData SrcLoc | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData ShortByteString | |
Defined in Data.ByteString.Short.Internal Methods rnf :: ShortByteString -> () # | |
| NFData ByteString | |
Defined in Data.ByteString.Lazy.Internal Methods rnf :: ByteString -> () # | |
| NFData ByteString | |
Defined in Data.ByteString.Internal Methods rnf :: ByteString -> () # | |
| NFData IntSet | |
Defined in Data.IntSet.Internal | |
| NFData Doc | |
Defined in Text.PrettyPrint.HughesPJ | |
| NFData TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods rnf :: TextDetails -> () # | |
| NFData ZonedTime | |
Defined in Data.Time.LocalTime.Internal.ZonedTime | |
| NFData LocalTime | |
Defined in Data.Time.LocalTime.Internal.LocalTime | |
| NFData ShortText | |
Defined in Data.Text.Short.Internal | |
| NFData StdGen | |
Defined in System.Random.Internal | |
| NFData ByteArray | |
Defined in Data.Primitive.ByteArray | |
| NFData NewtonStep | |
Defined in Numeric.RootFinding | |
| NFData RiddersStep | |
Defined in Numeric.RootFinding | |
| NFData a => NFData [a] | |
Defined in Control.DeepSeq | |
| NFData a => NFData (Maybe a) | |
Defined in Control.DeepSeq | |
| NFData a => NFData (Ratio a) | |
Defined in Control.DeepSeq | |
| NFData (Ptr a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData (FunPtr a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Complex a) | |
Defined in Control.DeepSeq | |
| NFData a => NFData (Min a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Max a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (First a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Last a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData m => NFData (WrappedMonoid m) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq Methods rnf :: WrappedMonoid m -> () # | |
| NFData a => NFData (Option a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData (StableName a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq Methods rnf :: StableName a -> () # | |
| NFData a => NFData (ZipList a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Identity a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData (IORef a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (First a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Last a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Dual a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Sum a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Product a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (Down a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData (MVar a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (NonEmpty a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData (IntMap a) | |
Defined in Data.IntMap.Internal | |
| NFData a => NFData (Tree a) | |
| NFData a => NFData (Seq a) | |
Defined in Data.Sequence.Internal | |
| NFData a => NFData (FingerTree a) | |
Defined in Data.Sequence.Internal Methods rnf :: FingerTree a -> () # | |
| NFData a => NFData (Digit a) | |
Defined in Data.Sequence.Internal | |
| NFData a => NFData (Node a) | |
Defined in Data.Sequence.Internal | |
| NFData a => NFData (Elem a) | |
Defined in Data.Sequence.Internal | |
| NFData a => NFData (Set a) | |
Defined in Data.Set.Internal | |
| NFData a => NFData (Doc a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ | |
| NFData a => NFData (AnnotDetails a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods rnf :: AnnotDetails a -> () # | |
| NFData a => NFData (Only a) | |
Defined in Data.Tuple.Only | |
| NFData a => NFData (Vector a) | |
Defined in Data.Vector | |
| NFData a => NFData (Array a) | |
Defined in Data.Primitive.Array | |
| NFData (Vector a) | |
Defined in Data.Vector.Unboxed.Base | |
| NFData (Finite n) | |
Defined in Data.Finite.Internal | |
| NFData (Vector a) | |
Defined in Data.Vector.Storable | |
| (Storable t, NFData t) => NFData (Matrix t) | |
Defined in Internal.Matrix | |
| (NFData t, Numeric t) => NFData (LU t) | |
Defined in Internal.Algorithms | |
| (NFData t, Numeric t) => NFData (Herm t) | |
Defined in Internal.Algorithms | |
| NFData g => NFData (StateGen g) | |
Defined in System.Random.Internal | |
| NFData a => NFData (Hashed a) | |
Defined in Data.Hashable.Class | |
| NFData (MutableByteArray s) | |
Defined in Data.Primitive.ByteArray | |
| NFData (PrimArray a) | |
Defined in Data.Primitive.PrimArray | |
| NFData a => NFData (SmallArray a) | |
Defined in Data.Primitive.SmallArray | |
| NFData a => NFData (HashSet a) | |
Defined in Data.HashSet.Internal | |
| NFData (Vector a) | |
Defined in Data.Vector.Primitive | |
| NFData a => NFData (Root a) | |
Defined in Numeric.RootFinding | |
| (NFData t, Numeric t) => NFData (LDL t) | |
Defined in Internal.Algorithms | |
| (NFData t, Numeric t) => NFData (QR t) | |
Defined in Internal.Algorithms | |
| NFData (a -> b) | This instance is for convenience and consistency with Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
| (NFData a, NFData b) => NFData (Either a b) | |
Defined in Control.DeepSeq | |
| (NFData a, NFData b) => NFData (a, b) | |
Defined in Control.DeepSeq | |
| (NFData a, NFData b) => NFData (Array a b) | |
Defined in Control.DeepSeq | |
| NFData (Fixed a) | Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
| (NFData a, NFData b) => NFData (Arg a b) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData (STRef s a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
| (NFData k, NFData a) => NFData (Map k a) | |
Defined in Data.Map.Internal | |
| NFData (MVector s a) | |
Defined in Data.Vector.Unboxed.Base | |
| (NFData i, NFData r) => NFData (IResult i r) | |
Defined in Data.Attoparsec.Internal.Types | |
| (NFData k, NFData v) => NFData (HashMap k v) | |
Defined in Data.HashMap.Internal | |
| (NFData k, NFData v) => NFData (Leaf k v) | |
Defined in Data.HashMap.Internal | |
| NFData (MVector s a) | |
Defined in Data.Vector.Storable.Mutable | |
| NFData t => NFData (Mod n t) | |
Defined in Internal.Modular | |
| NFData (MutablePrimArray s a) | |
Defined in Data.Primitive.PrimArray | |
| NFData (MVector s a) | |
Defined in Data.Vector.Primitive.Mutable | |
| (NFData a1, NFData a2, NFData a3) => NFData (a1, a2, a3) | |
Defined in Control.DeepSeq | |
| NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| NFData (a :~: b) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData (v a) => NFData (Vector v n a) | |
Defined in Data.Vector.Generic.Sized.Internal | |
| NFData b => NFData (Tagged s b) | |
Defined in Data.Tagged | |
| (NFData a1, NFData a2, NFData a3, NFData a4) => NFData (a1, a2, a3, a4) | |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g, NFData a) => NFData (Product f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g, NFData a) => NFData (Sum f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData (a :~~: b) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData (v s a) => NFData (MVector v n s a) | |
Defined in Data.Vector.Generic.Mutable.Sized.Internal | |
| NFData (v a) => NFData (Matrix v m n a) Source # | |
Defined in Goal.Core.Vector.Generic | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5) | |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g, NFData a) => NFData (Compose f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6) | |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7) | |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8) | |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9) | |
Defined in Control.DeepSeq | |
class NFData1 (f :: Type -> Type) where #
A class of functors that can be fully evaluated.
Since: deepseq-1.4.3.0
Minimal complete definition
Nothing
Methods
Instances
| NFData1 [] | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Maybe | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Ratio | Available on Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Ptr | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 FunPtr | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Min | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Max | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 First | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Last | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 WrappedMonoid | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> WrappedMonoid a -> () # | |
| NFData1 Option | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 StableName | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> StableName a -> () # | |
| NFData1 ZipList | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Identity | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 IORef | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 First | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Last | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Dual | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Sum | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Product | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Down | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 MVar | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 NonEmpty | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 Vector | |
Defined in Data.Vector | |
| NFData1 Array | |
Defined in Data.Primitive.Array | |
| NFData1 Vector | |
Defined in Data.Vector.Unboxed.Base | |
| NFData1 Vector | |
Defined in Data.Vector.Storable | |
| NFData1 SmallArray | |
Defined in Data.Primitive.SmallArray | |
| NFData1 HashSet | |
Defined in Data.HashSet.Internal | |
| NFData1 Vector | |
Defined in Data.Vector.Primitive | |
| NFData a => NFData1 (Either a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData1 ((,) a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData1 (Array a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 (Fixed :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData1 (Arg a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 (Proxy :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 (STRef s) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 (MVector s) | |
Defined in Data.Vector.Unboxed.Base | |
| NFData k => NFData1 (HashMap k) | |
Defined in Data.HashMap.Internal | |
| NFData k => NFData1 (Leaf k) | |
Defined in Data.HashMap.Internal | |
| NFData1 (MVector s) | |
Defined in Data.Vector.Storable.Mutable | |
| NFData1 (MVector s) | |
Defined in Data.Vector.Primitive.Mutable | |
| (NFData a1, NFData a2) => NFData1 ((,,) a1 a2) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData a => NFData1 (Const a :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 ((:~:) a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3) => NFData1 ((,,,) a1 a2 a3) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g) => NFData1 (Product f g) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g) => NFData1 (Sum f g) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData1 ((:~~:) a :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4) => NFData1 ((,,,,) a1 a2 a3 a4) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData1 f, NFData1 g) => NFData1 (Compose f g) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData1 ((,,,,,) a1 a2 a3 a4 a5) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData1 ((,,,,,,) a1 a2 a3 a4 a5 a6) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData1 ((,,,,,,,) a1 a2 a3 a4 a5 a6 a7) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData1 ((,,,,,,,,) a1 a2 a3 a4 a5 a6 a7 a8) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
class NFData2 (p :: Type -> Type -> Type) where #
A class of bifunctors that can be fully evaluated.
Since: deepseq-1.4.3.0
Methods
Instances
| NFData2 Either | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 (,) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 Array | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 Arg | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 STRef | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 HashMap | |
Defined in Data.HashMap.Internal | |
| NFData2 Leaf | |
Defined in Data.HashMap.Internal | |
| NFData a1 => NFData2 ((,,) a1) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 (Const :: Type -> Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 ((:~:) :: Type -> Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2) => NFData2 ((,,,) a1 a2) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| NFData2 ((:~~:) :: Type -> Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3) => NFData2 ((,,,,) a1 a2 a3) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4) => NFData2 ((,,,,,) a1 a2 a3 a4) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData2 ((,,,,,,) a1 a2 a3 a4 a5) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData2 ((,,,,,,,) a1 a2 a3 a4 a5 a6) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData2 ((,,,,,,,,) a1 a2 a3 a4 a5 a6 a7) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
class Fractional a => Floating a where #
Trigonometric and hyperbolic functions and related functions.
The Haskell Report defines no laws for Floating. However, (, +)(
and *)exp are customarily expected to define an exponential field and have
the following properties:
exp (a + b)=exp a * exp bexp (fromInteger 0)=fromInteger 1
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Methods
Instances
| Floating Double | Since: base-2.1 |
| Floating Float | Since: base-2.1 |
| Floating CFloat | |
| Floating CDouble | |
| RealFloat a => Floating (Complex a) | Since: base-2.1 |
Defined in Data.Complex Methods exp :: Complex a -> Complex a # log :: Complex a -> Complex a # sqrt :: Complex a -> Complex a # (**) :: Complex a -> Complex a -> Complex a # logBase :: Complex a -> Complex a -> Complex a # sin :: Complex a -> Complex a # cos :: Complex a -> Complex a # tan :: Complex a -> Complex a # asin :: Complex a -> Complex a # acos :: Complex a -> Complex a # atan :: Complex a -> Complex a # sinh :: Complex a -> Complex a # cosh :: Complex a -> Complex a # tanh :: Complex a -> Complex a # asinh :: Complex a -> Complex a # acosh :: Complex a -> Complex a # atanh :: Complex a -> Complex a # log1p :: Complex a -> Complex a # expm1 :: Complex a -> Complex a # | |
| Floating a => Floating (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods exp :: Identity a -> Identity a # log :: Identity a -> Identity a # sqrt :: Identity a -> Identity a # (**) :: Identity a -> Identity a -> Identity a # logBase :: Identity a -> Identity a -> Identity a # sin :: Identity a -> Identity a # cos :: Identity a -> Identity a # tan :: Identity a -> Identity a # asin :: Identity a -> Identity a # acos :: Identity a -> Identity a # atan :: Identity a -> Identity a # sinh :: Identity a -> Identity a # cosh :: Identity a -> Identity a # tanh :: Identity a -> Identity a # asinh :: Identity a -> Identity a # acosh :: Identity a -> Identity a # atanh :: Identity a -> Identity a # log1p :: Identity a -> Identity a # expm1 :: Identity a -> Identity a # | |
| Floating a => Floating (Down a) | Since: base-4.14.0.0 |
| Floating a => Floating (Const a b) | Since: base-4.9.0.0 |
Defined in Data.Functor.Const Methods exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # | |
| Floating a => Floating (Tagged s a) | |
Defined in Data.Tagged Methods exp :: Tagged s a -> Tagged s a # log :: Tagged s a -> Tagged s a # sqrt :: Tagged s a -> Tagged s a # (**) :: Tagged s a -> Tagged s a -> Tagged s a # logBase :: Tagged s a -> Tagged s a -> Tagged s a # sin :: Tagged s a -> Tagged s a # cos :: Tagged s a -> Tagged s a # tan :: Tagged s a -> Tagged s a # asin :: Tagged s a -> Tagged s a # acos :: Tagged s a -> Tagged s a # atan :: Tagged s a -> Tagged s a # sinh :: Tagged s a -> Tagged s a # cosh :: Tagged s a -> Tagged s a # tanh :: Tagged s a -> Tagged s a # asinh :: Tagged s a -> Tagged s a # acosh :: Tagged s a -> Tagged s a # atanh :: Tagged s a -> Tagged s a # log1p :: Tagged s a -> Tagged s a # expm1 :: Tagged s a -> Tagged s a # | |
| (KnownNat m, KnownNat n, Numeric x, Floating x) => Floating (Matrix Vector m n x) Source # | |
Defined in Goal.Core.Vector.Generic Methods exp :: Matrix Vector m n x -> Matrix Vector m n x # log :: Matrix Vector m n x -> Matrix Vector m n x # sqrt :: Matrix Vector m n x -> Matrix Vector m n x # (**) :: Matrix Vector m n x -> Matrix Vector m n x -> Matrix Vector m n x # logBase :: Matrix Vector m n x -> Matrix Vector m n x -> Matrix Vector m n x # sin :: Matrix Vector m n x -> Matrix Vector m n x # cos :: Matrix Vector m n x -> Matrix Vector m n x # tan :: Matrix Vector m n x -> Matrix Vector m n x # asin :: Matrix Vector m n x -> Matrix Vector m n x # acos :: Matrix Vector m n x -> Matrix Vector m n x # atan :: Matrix Vector m n x -> Matrix Vector m n x # sinh :: Matrix Vector m n x -> Matrix Vector m n x # cosh :: Matrix Vector m n x -> Matrix Vector m n x # tanh :: Matrix Vector m n x -> Matrix Vector m n x # asinh :: Matrix Vector m n x -> Matrix Vector m n x # acosh :: Matrix Vector m n x -> Matrix Vector m n x # atanh :: Matrix Vector m n x -> Matrix Vector m n x # log1p :: Matrix Vector m n x -> Matrix Vector m n x # expm1 :: Matrix Vector m n x -> Matrix Vector m n x # | |
showIntAtBase :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS #
Shows a non-negative Integral number using the base specified by the
first argument, and the character representation specified by the second.
showHFloat :: RealFloat a => a -> ShowS #
Show a floating-point value in the hexadecimal format,
similar to the %a specifier in C's printf.
>>>showHFloat (212.21 :: Double) """0x1.a86b851eb851fp7">>>showHFloat (-12.76 :: Float) """-0x1.9851ecp3">>>showHFloat (-0 :: Double) """-0x0p+0"
showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #
Show a signed RealFloat value
using standard decimal notation for arguments whose absolute value lies
between 0.1 and 9,999,999, and scientific notation otherwise.
This behaves as showFFloat, except that a decimal point
is always guaranteed, even if not needed.
Since: base-4.7.0.0
showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #
Show a signed RealFloat value
using standard decimal notation (e.g. 245000, 0.0015).
This behaves as showFFloat, except that a decimal point
is always guaranteed, even if not needed.
Since: base-4.7.0.0
showGFloat :: RealFloat a => Maybe Int -> a -> ShowS #
Show a signed RealFloat value
using standard decimal notation for arguments whose absolute value lies
between 0.1 and 9,999,999, and scientific notation otherwise.
In the call , if showGFloat digs valdigs is Nothing,
the value is shown to full precision; if digs is ,
then at most Just dd digits after the decimal point are shown.
showFFloat :: RealFloat a => Maybe Int -> a -> ShowS #
Show a signed RealFloat value
using standard decimal notation (e.g. 245000, 0.0015).
In the call , if showFFloat digs valdigs is Nothing,
the value is shown to full precision; if digs is ,
then at most Just dd digits after the decimal point are shown.
showEFloat :: RealFloat a => Maybe Int -> a -> ShowS #
Show a signed RealFloat value
using scientific (exponential) notation (e.g. 2.45e2, 1.5e-3).
In the call , if showEFloat digs valdigs is Nothing,
the value is shown to full precision; if digs is ,
then at most Just dd digits after the decimal point are shown.
readSigned :: Real a => ReadS a -> ReadS a #
Reads a signed Real value, given a reader for an unsigned value.
readFloat :: RealFrac a => ReadS a #
Reads an unsigned RealFrac value,
expressed in decimal scientific notation.
readHex :: (Eq a, Num a) => ReadS a #
Read an unsigned number in hexadecimal notation. Both upper or lower case letters are allowed.
>>>readHex "deadbeef"[(3735928559,"")]
readDec :: (Eq a, Num a) => ReadS a #
Read an unsigned number in decimal notation.
>>>readDec "0644"[(644,"")]
readOct :: (Eq a, Num a) => ReadS a #
Read an unsigned number in octal notation.
>>>readOct "0644"[(420,"")]
Arguments
| :: Num a | |
| => a | the base |
| -> (Char -> Bool) | a predicate distinguishing valid digits in this base |
| -> (Char -> Int) | a function converting a valid digit character to an |
| -> ReadS a |
Reads an unsigned Integral value in an arbitrary base.
floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int) #
floatToDigits takes a base and a non-negative RealFloat number,
and returns a list of digits and an exponent.
In particular, if x>=0, and
floatToDigits base x = ([d1,d2,...,dn], e)
then
n >= 1
x = 0.d1d2...dn * (base**e)
0 <= di <= base-1
showFloat :: RealFloat a => a -> ShowS #
Show a signed RealFloat value to full precision
using standard decimal notation for arguments whose absolute value lies
between 0.1 and 9,999,999, and scientific notation otherwise.
Arguments
| :: Real a | |
| => (a -> ShowS) | a function that can show unsigned values |
| -> Int | the precedence of the enclosing context |
| -> a | the value to show |
| -> ShowS |
Converts a possibly-negative Real value to a string.
This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.
Since: base-4.7.0.0
Minimal complete definition
natSing
(Kind) This is the kind of type-level natural numbers.
Instances
| KnownNat n => HasResolution (n :: Nat) | For example, |
Defined in Data.Fixed Methods resolution :: p n -> Integer # | |
| (KnownNat a, KnownNat b) => KnownBoolNat2 "GHC.TypeNats.<=?" (a :: Nat) (b :: Nat) | |
Defined in GHC.TypeLits.KnownNat Methods boolNatSing2 :: SBoolKb "GHC.TypeNats.<=?" | |
| (KnownBool a, KnownNat b, KnownNat c) => KnownNat2Bool "Data.Type.Bool.If" a (b :: Nat) (c :: Nat) | |
Defined in GHC.TypeLits.KnownNat Methods natBoolSing3 :: SNatKn "Data.Type.Bool.If" | |
type family (a :: Nat) + (b :: Nat) :: Nat where ... infixl 6 #
Addition of type-level naturals.
Since: base-4.7.0.0
type family (a :: Nat) * (b :: Nat) :: Nat where ... infixl 7 #
Multiplication of type-level naturals.
Since: base-4.7.0.0
type family (a :: Nat) ^ (b :: Nat) :: Nat where ... infixr 8 #
Exponentiation of type-level naturals.
Since: base-4.7.0.0
type family (a :: Nat) <=? (b :: Nat) :: Bool where ... infix 4 #
Comparison of type-level naturals, as a function.
NOTE: The functionality for this function should be subsumed
by CmpNat, so this might go away in the future.
Please let us know, if you encounter discrepancies between the two.
type family (a :: Nat) - (b :: Nat) :: Nat where ... infixl 6 #
Subtraction of type-level naturals.
Since: base-4.7.0.0
type family CmpNat (a :: Nat) (b :: Nat) :: Ordering where ... #
Comparison of type-level naturals, as a function.
Since: base-4.7.0.0
type family Div (a :: Nat) (b :: Nat) :: Nat where ... infixl 7 #
Division (round down) of natural numbers.
Div x 0 is undefined (i.e., it cannot be reduced).
Since: base-4.11.0.0
type family Log2 (a :: Nat) :: Nat where ... #
Log base 2 (round down) of natural numbers.
Log 0 is undefined (i.e., it cannot be reduced).
Since: base-4.11.0.0
sameNat :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Proxy a -> Proxy b -> Maybe (a :~: b) #
We either get evidence that this function was instantiated with the
same type-level numbers, or Nothing.
Since: base-4.7.0.0
someNatVal :: Natural -> SomeNat #
Convert an integer into an unknown type-level natural.
Since: base-4.10.0.0
This type represents unknown type-level natural numbers.
Since: base-4.10.0.0
type (<=) (x :: Nat) (y :: Nat) = (x <=? y) ~ 'True infix 4 #
Comparison of type-level naturals, as a constraint.
Since: base-4.7.0.0
Representable types of kind *.
This class is derivable in GHC with the DeriveGeneric flag on.
A Generic instance must satisfy the following laws:
from.to≡idto.from≡id
Instances
module Debug.Trace
module System.Directory
(Re)names
data ByteString #
A space-efficient representation of a Word8 vector, supporting many
efficient operations.
A ByteString contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.
Instances
orderedHeader :: [ByteString] -> Header Source #