Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
GeniusYield.Imports
Contents
Description
Synopsis
- coerce ∷ ∀ (k ∷ RuntimeRep) (a ∷ TYPE k) (b ∷ TYPE k). Coercible a b ⇒ a → b
- guard ∷ Alternative f ⇒ Bool → f ()
- join ∷ Monad m ⇒ m (m a) → m a
- class IsString a where
- fromString ∷ String → a
- liftA2 ∷ Applicative f ⇒ (a → b → c) → f a → f b → f c
- toList ∷ Foldable t ⇒ t a → [a]
- foldl' ∷ Foldable t ⇒ (b → a → b) → b → t a → b
- class Generic a
- data Natural
- type Type = Type
- data Constraint
- data CallStack
- class Contravariant (f ∷ Type → Type) where
- absurd ∷ Void → a
- data Void
- second ∷ Bifunctor p ⇒ (b → c) → p a b → p a c
- bimap ∷ Bifunctor p ⇒ (a → b) → (c → d) → p a c → p b d
- first ∷ Bifunctor p ⇒ (a → b) → p a c → p b c
- printf ∷ PrintfType r ⇒ String → r
- class PrintfArg a where
- formatArg ∷ a → FieldFormatter
- parseFormat ∷ a → ModifierParser
- unless ∷ Applicative f ⇒ Bool → f () → f ()
- foldM ∷ (Foldable t, Monad m) ⇒ (b → a → m b) → b → t a → m b
- forM ∷ (Traversable t, Monad m) ⇒ t a → (a → m b) → m (t b)
- newtype Identity a = Identity {
- runIdentity ∷ a
- throwIO ∷ Exception e ⇒ e → IO a
- catch ∷ Exception e ⇒ IO a → (e → IO a) → IO a
- class (Typeable e, Show e) ⇒ Exception e
- newtype Const a (b ∷ k) = Const {
- getConst ∷ a
- find ∷ Foldable t ⇒ (a → Bool) → t a → Maybe a
- minimumBy ∷ Foldable t ⇒ (a → a → Ordering) → t a → a
- maximumBy ∷ Foldable t ⇒ (a → a → Ordering) → t a → a
- forM_ ∷ (Foldable t, Monad m) ⇒ t a → (a → m b) → m ()
- sortBy ∷ (a → a → Ordering) → [a] → [a]
- fromRight ∷ b → Either a b → b
- data Proxy (t ∷ k) = Proxy
- data (a ∷ k) :~: (b ∷ k) where
- isAlphaNum ∷ Char → Bool
- isHexDigit ∷ Char → Bool
- fromMaybe ∷ a → Maybe a → a
- isJust ∷ Maybe a → Bool
- on ∷ (b → b → c) → (a → b) → a → a → c
- void ∷ Functor f ⇒ f a → f ()
- ap ∷ Monad m ⇒ m (a → b) → m a → m b
- when ∷ Applicative f ⇒ Bool → f () → f ()
- type HasCallStack = ?callStack ∷ CallStack
- data Map k a
- data Set a
- encodeUtf8 ∷ Text → ByteString
- data Text
- class FromJSON a where
- parseJSON ∷ Value → Parser a
- parseJSONList ∷ Value → Parser [a]
- class ToJSON a where
- toJSON ∷ a → Value
- toEncoding ∷ a → Encoding
- toJSONList ∷ [a] → Value
- toEncodingList ∷ [a] → Encoding
- data Some (tag ∷ k → Type) where
- rightToMaybe ∷ Either a b → Maybe b
- ifor_ ∷ (FoldableWithIndex i t, Applicative f) ⇒ t a → (i → a → f b) → f ()
- itoList ∷ FoldableWithIndex i f ⇒ f a → [(i, a)]
- withSome ∷ Some tag → (∀ (a ∷ k). tag a → b) → b
- catMaybes ∷ Filterable f ⇒ f (Maybe a) → f a
- mapMaybe ∷ Filterable f ⇒ (a → Maybe b) → f a → f b
- wither ∷ (Witherable t, Applicative f) ⇒ (a → f (Maybe b)) → t a → f (t b)
- iwither ∷ (WitherableWithIndex i t, Applicative f) ⇒ (i → a → f (Maybe b)) → t a → f (t b)
- pattern TODO ∷ () ⇒ HasCallStack ⇒ a
- findFirst ∷ Foldable f ⇒ (a → Maybe b) → f a → Maybe b
- decodeUtf8Lenient ∷ ByteString → Text
- lazyDecodeUtf8Lenient ∷ ByteString → Text
- hush ∷ Either e a → Maybe a
- hoistMaybe ∷ Applicative m ⇒ Maybe b → MaybeT m b
- singleton ∷ a → [a]
Documentation
coerce ∷ ∀ (k ∷ RuntimeRep) (a ∷ TYPE k) (b ∷ TYPE k). Coercible a b ⇒ a → b #
The function coerce
allows you to safely convert between values of
types that have the same representation with no run-time overhead. In the
simplest case you can use it instead of a newtype constructor, to go from
the newtype's concrete type to the abstract type. But it also works in
more complicated settings, e.g. converting a list of newtypes to a list of
concrete types.
This function is runtime-representation polymorphic, but the
RuntimeRep
type argument is marked as Inferred
, meaning
that it is not available for visible type application. This means
the typechecker will accept coerce @Int @Age 42
.
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)
join ∷ Monad m ⇒ m (m a) → m a #
The join
function is the conventional monad join operator. It
is used to remove one level of monadic structure, projecting its
bound argument into the outer level.
'
' can be understood as the join
bssdo
expression
do bs <- bss bs
Examples
A common use of join
is to run an IO
computation returned from
an STM
transaction, since STM
transactions
can't perform IO
directly. Recall that
atomically
:: STM a -> IO a
is used to run STM
transactions atomically. So, by
specializing the types of atomically
and join
to
atomically
:: STM (IO b) -> IO (IO b)join
:: IO (IO b) -> IO b
we can compose them as
join
.atomically
:: STM (IO b) -> IO b
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
Methods
fromString ∷ String → a #
Instances
IsString ShortByteString | Beware: |
Defined in Data.ByteString.Short.Internal Methods | |
IsString ByteString | Beware: |
Defined in Data.ByteString.Lazy.Internal Methods fromString ∷ String → ByteString # | |
IsString ByteString | Beware: |
Defined in Data.ByteString.Internal Methods fromString ∷ String → ByteString # | |
IsString Doc | |
Defined in Text.PrettyPrint.HughesPJ Methods fromString ∷ String → Doc # | |
IsString Builder | |
Defined in Data.Text.Internal.Builder Methods fromString ∷ String → Builder # | |
IsString PraosNonce | |
Defined in Cardano.Api.ProtocolParameters Methods fromString ∷ String → PraosNonce # | |
IsString ScriptHash | |
Defined in Cardano.Api.Script Methods fromString ∷ String → ScriptHash # | |
IsString TextEnvelopeDescr | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods fromString ∷ String → TextEnvelopeDescr # | |
IsString TextEnvelopeType | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods fromString ∷ String → TextEnvelopeType # | |
IsString TxId | |
Defined in Cardano.Api.TxIn Methods fromString ∷ String → TxId # | |
IsString AssetName | |
Defined in Cardano.Api.Value Methods fromString ∷ String → AssetName # | |
IsString PolicyId | |
Defined in Cardano.Api.Value Methods fromString ∷ String → PolicyId # | |
IsString Value | |
Defined in Data.Aeson.Types.Internal Methods fromString ∷ String → Value # | |
IsString Key | |
Defined in Data.Aeson.Key Methods fromString ∷ String → Key # | |
IsString IPv6 | |
Defined in Data.IP.Addr Methods fromString ∷ String → IPv6 # | |
IsString IPv4 | |
Defined in Data.IP.Addr Methods fromString ∷ String → IPv4 # | |
IsString ScrubbedBytes | |
Defined in Data.ByteArray.ScrubbedBytes Methods fromString ∷ String → ScrubbedBytes # | |
IsString ByteArray | |
Defined in Codec.CBOR.ByteArray Methods fromString ∷ String → ByteArray # | |
IsString ShortText | |
Defined in Data.Text.Short.Internal Methods fromString ∷ String → ShortText # | |
IsString RequestBody | |
Defined in Network.HTTP.Client.Types Methods fromString ∷ String → RequestBody # | |
IsString Alphabet | |
Defined in Data.ByteString.Base58.Internal Methods fromString ∷ String → Alphabet # | |
IsString ByteString64 | |
Defined in Data.ByteString.Base64.Type Methods fromString ∷ String → ByteString64 # | |
IsString String | |
Defined in Basement.UTF8.Base Methods fromString ∷ String0 → String # | |
IsString AsciiString | |
Defined in Basement.Types.AsciiString Methods fromString ∷ String → AsciiString # | |
IsString PubKeyHash | |
Defined in Plutus.V1.Ledger.Crypto Methods fromString ∷ String → PubKeyHash # | |
IsString CurrencySymbol | |
Defined in Plutus.V1.Ledger.Value Methods fromString ∷ String → CurrencySymbol # | |
IsString TokenName | |
Defined in Plutus.V1.Ledger.Value Methods fromString ∷ String → TokenName # | |
IsString DatumHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → DatumHash # | |
IsString ValidatorHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → ValidatorHash # | |
IsString TxId | |
Defined in Plutus.V1.Ledger.Tx Methods fromString ∷ String → TxId # | |
IsString SlicedByteArray | |
Defined in Codec.CBOR.ByteArray.Sliced Methods fromString ∷ String → SlicedByteArray # | |
IsString GroupName | |
Defined in Hedgehog.Internal.Property Methods fromString ∷ String → GroupName # | |
IsString LabelName | |
Defined in Hedgehog.Internal.Property Methods fromString ∷ String → LabelName # | |
IsString PropertyName | |
Defined in Hedgehog.Internal.Property Methods fromString ∷ String → PropertyName # | |
IsString UnliftingError | |
Defined in PlutusCore.Evaluation.Machine.Exception Methods fromString ∷ String → UnliftingError # | |
IsString LedgerBytes | |
Defined in Plutus.V1.Ledger.Bytes Methods fromString ∷ String → LedgerBytes # | |
IsString MintingPolicyHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → MintingPolicyHash # | |
IsString RedeemerHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → RedeemerHash # | |
IsString ScriptHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → ScriptHash # | |
IsString StakeValidatorHash | |
Defined in Plutus.V1.Ledger.Scripts Methods fromString ∷ String → StakeValidatorHash # | |
IsString MediaType | |
Defined in Network.HTTP.Media.MediaType.Internal Methods fromString ∷ String → MediaType # | |
IsString Environment | |
Defined in Katip.Core Methods fromString ∷ String → Environment # | |
IsString LogStr | |
Defined in Katip.Core Methods fromString ∷ String → LogStr # | |
IsString Namespace | |
Defined in Katip.Core Methods fromString ∷ String → Namespace # | |
IsString IP | |
Defined in Data.IP.Addr Methods fromString ∷ String → IP # | |
IsString IPRange | |
Defined in Data.IP.Range Methods fromString ∷ String → IPRange # | |
IsString Query | |
Defined in Database.PostgreSQL.Simple.Types Methods fromString ∷ String → Query # | |
IsString Identifier | |
Defined in Database.PostgreSQL.Simple.Types Methods fromString ∷ String → Identifier # | |
IsString QualifiedIdentifier | |
Defined in Database.PostgreSQL.Simple.Types Methods fromString ∷ String → QualifiedIdentifier # | |
IsString GYDatumHash # | |
Defined in GeniusYield.Types.Datum Methods fromString ∷ String → GYDatumHash # | |
IsString LogSrc # | |
Defined in GeniusYield.Types.Logging Methods fromString ∷ String → LogSrc # | |
IsString GYLogNamespace # | |
Defined in GeniusYield.Types.Logging Methods | |
IsString Host | |
Defined in Data.Swagger.Internal Methods fromString ∷ String → Host # | |
IsString License | |
Defined in Data.Swagger.Internal Methods fromString ∷ String → License # | |
IsString Response | |
Defined in Data.Swagger.Internal Methods fromString ∷ String → Response # | |
IsString Tag | |
Defined in Data.Swagger.Internal Methods fromString ∷ String → Tag # | |
IsString GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash Methods | |
IsString GYExtendedPaymentSigningKey # | |
Defined in GeniusYield.Types.Key Methods | |
IsString GYPaymentSigningKey # | |
Defined in GeniusYield.Types.Key Methods | |
IsString GYPaymentVerificationKey # | |
Defined in GeniusYield.Types.Key Methods | |
IsString GYMintingPolicyId # |
|
Defined in GeniusYield.Types.Script Methods | |
IsString GYValidatorHash # |
|
Defined in GeniusYield.Types.Script Methods | |
IsString GYAddressBech32 # | |
Defined in GeniusYield.Types.Address Methods | |
IsString GYTime # |
|
Defined in GeniusYield.Types.Time Methods fromString ∷ String → GYTime # | |
IsString GYTxId # |
|
Defined in GeniusYield.Types.Tx Methods fromString ∷ String → GYTxId # | |
IsString GYTxOutRef # |
|
Defined in GeniusYield.Types.TxOutRef Methods fromString ∷ String → GYTxOutRef # | |
IsString GYTokenName # | Does NOT UTF8-encode. |
Defined in GeniusYield.Types.Value Methods fromString ∷ String → GYTokenName # | |
IsString GYAssetClass # | |
Defined in GeniusYield.Types.Value Methods | |
IsString Seed | |
Defined in Crypto.Encoding.BIP39 Methods fromString ∷ String → Seed # | |
IsString Project | |
Defined in Blockfrost.Auth Methods fromString ∷ String → Project # | |
IsString Address | |
Defined in Blockfrost.Types.Shared.Address Methods fromString ∷ String → Address # | |
IsString AssetId | |
Defined in Blockfrost.Types.Shared.AssetId Methods fromString ∷ String → AssetId # | |
IsString BlockHash | |
Defined in Blockfrost.Types.Shared.BlockHash Methods fromString ∷ String → BlockHash # | |
IsString DatumHash | |
Defined in Blockfrost.Types.Shared.DatumHash Methods fromString ∷ String → DatumHash # | |
IsString PolicyId | |
Defined in Blockfrost.Types.Shared.PolicyId Methods fromString ∷ String → PolicyId # | |
IsString PoolId | |
Defined in Blockfrost.Types.Shared.PoolId Methods fromString ∷ String → PoolId # | |
IsString ScriptHash | |
Defined in Blockfrost.Types.Shared.ScriptHash Methods fromString ∷ String → ScriptHash # | |
IsString TxHash | |
Defined in Blockfrost.Types.Shared.TxHash Methods fromString ∷ String → TxHash # | |
a ~ Char ⇒ IsString [a] |
Since: base-2.1 |
Defined in Data.String Methods fromString ∷ String → [a] # | |
IsString a ⇒ IsString (Identity a) | Since: base-4.9.0.0 |
Defined in Data.String Methods fromString ∷ String → Identity a # | |
a ~ Char ⇒ IsString (Seq a) | Since: containers-0.5.7 |
Defined in Data.Sequence.Internal Methods fromString ∷ String → Seq a # | |
IsString (Doc a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods fromString ∷ String → Doc a # | |
IsString (Hash BlockHeader) | |
Defined in Cardano.Api.Block Methods fromString ∷ String → Hash BlockHeader # | |
IsString (Hash ByronKey) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → Hash ByronKey # | |
IsString (Hash ByronKeyLegacy) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → Hash ByronKeyLegacy # | |
IsString (Hash GenesisDelegateExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash GenesisDelegateExtendedKey # | |
IsString (Hash GenesisDelegateKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash GenesisDelegateKey # | |
IsString (Hash GenesisExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash GenesisExtendedKey # | |
IsString (Hash GenesisKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash GenesisKey # | |
IsString (Hash GenesisUTxOKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash GenesisUTxOKey # | |
IsString (Hash PaymentExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash PaymentExtendedKey # | |
IsString (Hash PaymentKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash PaymentKey # | |
IsString (Hash StakeExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash StakeExtendedKey # | |
IsString (Hash StakeKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash StakeKey # | |
IsString (Hash ScriptData) | |
Defined in Cardano.Api.ScriptData Methods fromString ∷ String → Hash ScriptData # | |
IsString (Hash StakePoolKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → Hash StakePoolKey # | |
IsString (Hash VrfKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → Hash VrfKey # | |
IsString (Hash KesKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → Hash KesKey # | |
IsString (SigningKey ByronKey) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → SigningKey ByronKey # | |
IsString (SigningKey ByronKeyLegacy) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → SigningKey ByronKeyLegacy # | |
IsString (SigningKey GenesisDelegateExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey GenesisDelegateExtendedKey # | |
IsString (SigningKey GenesisDelegateKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey GenesisDelegateKey # | |
IsString (SigningKey GenesisExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey GenesisExtendedKey # | |
IsString (SigningKey GenesisKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey GenesisKey # | |
IsString (SigningKey GenesisUTxOKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey GenesisUTxOKey # | |
IsString (SigningKey PaymentExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey PaymentExtendedKey # | |
IsString (SigningKey PaymentKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey PaymentKey # | |
IsString (SigningKey StakeExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey StakeExtendedKey # | |
IsString (SigningKey StakeKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey StakeKey # | |
IsString (SigningKey StakePoolKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → SigningKey StakePoolKey # | |
IsString (SigningKey VrfKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → SigningKey VrfKey # | |
IsString (SigningKey KesKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → SigningKey KesKey # | |
IsString (VerificationKey ByronKey) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → VerificationKey ByronKey # | |
IsString (VerificationKey ByronKeyLegacy) | |
Defined in Cardano.Api.KeysByron Methods fromString ∷ String → VerificationKey ByronKeyLegacy # | |
IsString (VerificationKey GenesisDelegateExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey GenesisDelegateExtendedKey # | |
IsString (VerificationKey GenesisDelegateKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey GenesisDelegateKey # | |
IsString (VerificationKey GenesisExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey GenesisExtendedKey # | |
IsString (VerificationKey GenesisKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey GenesisKey # | |
IsString (VerificationKey GenesisUTxOKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey GenesisUTxOKey # | |
IsString (VerificationKey PaymentExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey PaymentExtendedKey # | |
IsString (VerificationKey PaymentKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey PaymentKey # | |
IsString (VerificationKey StakeExtendedKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey StakeExtendedKey # | |
IsString (VerificationKey StakeKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey StakeKey # | |
IsString (VerificationKey StakePoolKey) | |
Defined in Cardano.Api.KeysShelley Methods fromString ∷ String → VerificationKey StakePoolKey # | |
IsString (VerificationKey VrfKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → VerificationKey VrfKey # | |
IsString (VerificationKey KesKey) | |
Defined in Cardano.Api.KeysPraos Methods fromString ∷ String → VerificationKey KesKey # | |
a ~ Char ⇒ IsString (DList a) | |
Defined in Data.DList.Internal Methods fromString ∷ String → DList a # | |
IsString (Doc ann) | |
Defined in Prettyprinter.Internal Methods fromString ∷ String → Doc ann # | |
KnownNat n ⇒ IsString (PinnedSizedBytes n) | |
Defined in Cardano.Crypto.PinnedSizedBytes Methods fromString ∷ String → PinnedSizedBytes n # | |
a ~ Char ⇒ IsString (DNonEmpty a) | |
Defined in Data.DList.DNonEmpty.Internal Methods fromString ∷ String → DNonEmpty a # | |
(IsString s, FoldCase s) ⇒ IsString (CI s) | |
Defined in Data.CaseInsensitive.Internal Methods fromString ∷ String → CI s # | |
IsString a ⇒ IsString (Graph a) | |
Defined in Algebra.Graph Methods fromString ∷ String → Graph a # | |
IsString a ⇒ IsString (AdjacencyMap a) | |
Defined in Algebra.Graph.AdjacencyMap Methods fromString ∷ String → AdjacencyMap a # | |
IsString a ⇒ IsString (Graph a) | |
Defined in Algebra.Graph.Undirected Methods fromString ∷ String → Graph a # | |
IsString a ⇒ IsString (AdjacencyMap a) | |
Defined in Algebra.Graph.NonEmpty.AdjacencyMap Methods fromString ∷ String → AdjacencyMap a # | |
IsString (Doc a) | |
Defined in Text.PrettyPrint.Annotated.WL Methods fromString ∷ String → Doc a # | |
IsString (AddrRange IPv6) | |
Defined in Data.IP.Range Methods fromString ∷ String → AddrRange IPv6 # | |
IsString (AddrRange IPv4) | |
Defined in Data.IP.Range Methods fromString ∷ String → AddrRange IPv4 # | |
(IsString a, Hashable a) ⇒ IsString (Hashed a) | |
Defined in Data.Hashable.Class Methods fromString ∷ String → Hashed a # | |
IsString a ⇒ IsString (Referenced a) | |
Defined in Data.Swagger.Internal Methods fromString ∷ String → Referenced a # | |
HashAlgorithm h ⇒ IsString (Hash h a) | |
Defined in Cardano.Crypto.Hash.Class Methods fromString ∷ String → Hash h a # | |
IsString a ⇒ IsString (AdjacencyMap e a) | |
Defined in Algebra.Graph.Labelled.AdjacencyMap Methods fromString ∷ String → AdjacencyMap e a # | |
IsString a ⇒ IsString (Graph e a) | |
Defined in Algebra.Graph.Labelled Methods fromString ∷ String → Graph e a # | |
IsString a ⇒ IsString (Const a b) | Since: base-4.9.0.0 |
Defined in Data.String Methods fromString ∷ String → Const a b # | |
IsString a ⇒ IsString (Tagged s a) | |
Defined in Data.Tagged Methods fromString ∷ String → Tagged s a # |
liftA2 ∷ Applicative f ⇒ (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)
toList ∷ Foldable t ⇒ t a → [a] #
List of elements of a structure, from left to right.
Since: base-4.8.0.0
foldl' ∷ Foldable t ⇒ (b → a → b) → b → t a → b #
Left-associative fold of a structure but with strict application of the operator.
This ensures that each step of the fold is forced to weak head normal
form before being applied, avoiding the collection of thunks that would
otherwise occur. This is often what you want to strictly reduce a finite
list to a single, monolithic result (e.g. length
).
For a general Foldable
structure this should be semantically identical
to,
foldl' f z =foldl'
f z .toList
Since: base-4.6.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
≡id
to
.from
≡id
Instances
Generic Bool | Since: base-4.6.0.0 |
Generic Ordering | Since: base-4.6.0.0 |
Generic Exp | |
Generic Match | |
Generic Clause | |
Generic Pat | |
Generic Type | |
Generic Dec | |
Generic Name | |
Generic FunDep | |
Generic InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep InjectivityAnn ∷ Type → Type # | |
Generic Overlap | |
Generic () | Since: base-4.6.0.0 |
Generic Void | Since: base-4.8.0.0 |
Generic Version | Since: base-4.9.0.0 |
Generic ExitCode | |
Generic All | Since: base-4.7.0.0 |
Generic Any | Since: base-4.7.0.0 |
Generic Fixity | Since: base-4.7.0.0 |
Generic Associativity | Since: base-4.7.0.0 |
Defined in GHC.Generics Associated Types type Rep Associativity ∷ Type → Type # | |
Generic SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics Associated Types type Rep SourceUnpackedness ∷ Type → Type # Methods | |
Generic SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Associated Types type Rep SourceStrictness ∷ Type → Type # Methods from ∷ SourceStrictness → Rep SourceStrictness x # to ∷ Rep SourceStrictness x → SourceStrictness # | |
Generic DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Associated Types type Rep DecidedStrictness ∷ Type → Type # Methods from ∷ DecidedStrictness → Rep DecidedStrictness x # to ∷ Rep DecidedStrictness x → DecidedStrictness # | |
Generic Extension | |
Generic ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type Associated Types type Rep ForeignSrcLang ∷ Type → Type # | |
Generic PrimType | |
Generic StgInfoTable | |
Defined in GHC.Exts.Heap.InfoTable.Types Associated Types type Rep StgInfoTable ∷ Type → Type # | |
Generic ClosureType | |
Defined in GHC.Exts.Heap.ClosureTypes Associated Types type Rep ClosureType ∷ Type → Type # | |
Generic Doc | |
Generic TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Associated Types type Rep TextDetails ∷ Type → Type # | |
Generic Style | |
Generic Mode | |
Generic ModName | |
Generic PkgName | |
Generic Module | |
Generic OccName | |
Generic NameFlavour | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep NameFlavour ∷ Type → Type # | |
Generic NameSpace | |
Generic Loc | |
Generic Info | |
Generic ModuleInfo | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep ModuleInfo ∷ Type → Type # | |
Generic Fixity | |
Generic FixityDirection | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep FixityDirection ∷ Type → Type # Methods from ∷ FixityDirection → Rep FixityDirection x # to ∷ Rep FixityDirection x → FixityDirection # | |
Generic Lit | |
Generic Bytes | |
Generic Body | |
Generic Guard | |
Generic Stmt | |
Generic Range | |
Generic DerivClause | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep DerivClause ∷ Type → Type # | |
Generic DerivStrategy | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep DerivStrategy ∷ Type → Type # | |
Generic TypeFamilyHead | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep TypeFamilyHead ∷ Type → Type # | |
Generic TySynEqn | |
Generic Foreign | |
Generic Callconv | |
Generic Safety | |
Generic Pragma | |
Generic Inline | |
Generic RuleMatch | |
Generic Phases | |
Generic RuleBndr | |
Generic AnnTarget | |
Generic SourceUnpackedness | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceUnpackedness ∷ Type → Type # Methods | |
Generic SourceStrictness | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceStrictness ∷ Type → Type # Methods from ∷ SourceStrictness → Rep SourceStrictness x # to ∷ Rep SourceStrictness x → SourceStrictness # | |
Generic DecidedStrictness | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep DecidedStrictness ∷ Type → Type # Methods from ∷ DecidedStrictness → Rep DecidedStrictness x # to ∷ Rep DecidedStrictness x → DecidedStrictness # | |
Generic Con | |
Generic Bang | |
Generic PatSynDir | |
Generic PatSynArgs | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep PatSynArgs ∷ Type → Type # | |
Generic TyVarBndr | |
Generic FamilyResultSig | |
Defined in Language.Haskell.TH.Syntax Associated Types type Rep FamilyResultSig ∷ Type → Type # Methods from ∷ FamilyResultSig → Rep FamilyResultSig x # to ∷ Rep FamilyResultSig x → FamilyResultSig # | |
Generic TyLit | |
Generic Role | |
Generic AnnLookup | |
Generic PraosNonce | |
Generic EpochSlots | |
Generic BlockNo | |
Generic EpochNo | |
Generic SlotNo | |
Generic SystemStart | |
Generic NetworkMagic | |
Generic MempoolSizeAndCapacity | |
Generic EraMismatch | |
Generic Past | |
Generic EraParams | |
Generic SafeZone | |
Generic Bound | |
Generic EraEnd | |
Generic EraSummary | |
Generic ProtVer | |
Generic ByronPartialLedgerConfig | |
Generic BinaryBlockInfo | |
Generic TriggerHardFork | |
Generic MaxMajorProtVer | |
Generic PrefixLen | |
Generic Config | |
Generic CompactAddress | |
Generic RequiresNetworkMagic | |
Generic ProtocolParameters | |
Generic ProtocolVersion | |
Generic PBftSignatureThreshold | |
Generic ProtocolMagicId | |
Generic ChunkInfo | |
Generic CoreNodeId | |
Generic SoftwareVersion | |
Generic CompactRedeemVerificationKey | |
Generic Lovelace | |
Generic ChainValidationState | |
Generic VerificationKey | |
Generic GenesisHash | |
Generic CandidateProtocolUpdate | |
Generic SlotNumber | |
Generic Endorsement | |
Generic ByronHash | |
Generic Tx | |
Generic ByteSpan | |
Generic ByronTransition | |
Generic Map | |
Generic ScheduledDelegation | |
Generic EpochNumber | |
Generic State | |
Generic UTxO | |
Generic ByronOtherHeaderEnvelopeError | |
Generic PBftSelectView | |
Generic ToSign | |
Generic PraosEnvelopeError | |
Generic PositiveUnitInterval | |
Generic Network | |
Generic Coin | |
Generic PraosParams | |
Generic TPraosParams | |
Generic Nonce | |
Generic KESInfo | |
Generic ChainPredicateFailure | |
Generic Value | |
Generic AccountState | |
Generic Ptr | |
Generic DeltaCoin | |
Generic LogWeight | |
Generic Likelihood | |
Generic RewardType | |
Generic AlonzoMeasure | |
Generic ExUnits | |
Generic Globals | |
Generic StakePoolRelay | |
Generic RewardParams | |
Generic RewardInfoPool | |
Generic UnitInterval | |
Generic NonNegativeInterval | |
Generic ShelleyTransition | |
Generic SecurityParam | |
Generic TransitionInfo | |
Generic RelativeTime | |
Generic CostModels | |
Generic Prices | |
Generic AlonzoGenesis | |
Generic Metadatum | |
Generic Language | |
Generic CostModel | |
Generic Data | |
Generic ExCPU | |
Generic ExMemory | |
Generic ExBudget | |
Generic TyName | |
Generic Name | |
Generic Strictness | |
Generic Recursivity | |
Generic DeBruijn | |
Generic NamedDeBruijn | |
Generic NamedTyDeBruijn | |
Generic Index | |
Generic TyDeBruijn | |
Generic ParseError | |
Generic DefaultFun | |
Generic SourcePos | |
Generic FreeVariableError | |
Generic ConstructorInfo | |
Generic DatatypeInfo | |
Generic Desirability | |
Generic PoolMetadata | |
Generic IPv6 | |
Generic IPv4 | |
Generic FsPath | |
Generic Time | |
Generic ProtocolParameters | |
Generic SlotLength | |
Generic TimeInEra | |
Generic SlotInEra | |
Generic SlotInEpoch | |
Generic EpochSize | |
Generic IsEBB | |
Generic TicknPredicateFailure | |
Generic TicknState | |
Generic KESPeriod | |
Generic ActiveSlotCoeff | |
Generic ValidityInterval | |
Generic InputVRF | |
Generic EpochInEra | |
Generic TimeInSlot | |
Generic URIAuth | |
Generic URI | |
Generic BaseUrl | |
Generic Scheme | |
Generic ClientError | |
Generic RequestBody | |
Generic CabalSpecVersion | |
Generic Structure | |
Generic PError | |
Generic Position | |
Generic PWarnType | |
Generic PWarning | |
Generic Arch | |
Generic OS | |
Generic Platform | |
Generic AdjacencyIntMap | |
Generic Alphabet | |
Generic ByteString64 | |
Generic Address | |
Generic NetworkMagic | |
Generic AddrAttributes | |
Generic HDAddressPayload | |
Generic Address' | |
Generic PubKeyHash | |
Generic MIRPot | |
Generic Url | |
Generic SignKey | |
Generic VerKey | |
Generic XPub | |
Generic CekMachineCosts | |
Generic TxInWitness | |
Generic TxSigData | |
Generic SignTag | |
Generic IsValid | |
Generic LangDepView | |
Generic RdmrPtr | |
Generic TxIn | |
Generic XPub | |
Generic Point | |
Generic Proof | |
Generic Output | |
Generic RedeemVerificationKey | |
Generic RedeemSigningKey | |
Generic Tag | |
Generic EvaluationContext | |
Generic ScriptResult | |
Generic PlutusDebug | |
Generic ScriptFailure | |
Generic StakingCredential | |
Generic POSIXTime | |
Generic Address | |
Generic TxInInfo | |
Generic TxOut | |
Generic CurrencySymbol | |
Generic TokenName | |
Generic TxInfo | |
Generic TxInfo | |
Generic Credential | |
Generic DCert | |
Generic DatumHash | |
Generic Datum | |
Generic ValidatorHash | |
Generic ScriptPurpose | |
Generic Value | |
Generic TxId | |
Generic TxOutRef | |
Generic FailureDescription | |
Generic TagMismatchDescription | |
Generic DnsName | |
Generic Port | |
Generic PositiveInterval | |
Generic Seed | |
Generic ChainDifficulty | |
Generic Proof | |
Generic SscPayload | |
Generic ProposalBody | |
Generic SscProof | |
Generic EpochAndSlotCount | |
Generic TxProof | |
Generic CompactTxIn | |
Generic CompactTxOut | |
Generic State | |
Generic BlockCount | |
Generic UTxOConfiguration | |
Generic ApplicationName | |
Generic ApplicationVersion | |
Generic ProtocolUpdateProposal | |
Generic SoftwareUpdateProposal | |
Generic SlotCount | |
Generic TxOut | |
Generic AddrType | |
Generic CompactTxId | |
Generic Environment | |
Generic State | |
Generic State | |
Generic Environment | |
Generic UnparsedFields | |
Generic AddrSpendingData | |
Generic LovelacePortion | |
Generic TxFeePolicy | |
Generic TxSizeLinear | |
Generic GenesisData | |
Generic SoftforkRule | |
Generic GeneratedSecrets | |
Generic PoorSecret | |
Generic GenesisSpec | |
Generic FakeAvvmOptions | |
Generic InstallerHash | |
Generic SystemTag | |
Generic ProtocolParametersUpdate | |
Generic Environment | |
Generic RegistrationEnvironment | |
Generic Duration | |
Generic ChainChecksPParams | |
Generic ChainCode | |
Generic Histogram | |
Generic PerformanceEstimate | |
Generic StakeShare | |
Generic VotingPeriod | |
Generic Filler | |
Generic Half | |
Generic NewtonParam | |
Generic NewtonStep | |
Generic RiddersParam | |
Generic RiddersStep | |
Generic Tolerance | |
Generic Pos | |
Generic InvalidPosException | |
Generic MuxError | |
Generic SDUSize | |
Generic MaxSlotNo | |
Generic CurrentSlot | |
Generic NodeId | |
Generic PBftParams | |
Generic PBftMockVerKeyHash | |
Generic ChainType | |
Generic ScheduledGc | |
Generic DiskSnapshot | |
Generic SnapshotInterval | |
Generic ChunkNo | |
Generic CRC | |
Generic ChunkSize | |
Generic RelativeSlot | |
Generic ChunkSlot | |
Generic BlockOrEBB | |
Generic PrimaryIndex | |
Generic TraceCacheEvent | |
Generic BlockSize | |
Generic ValidationPolicy | |
Generic BlocksPerFile | |
Generic BlockOffset | |
Generic BlockSize | |
Generic Appender | |
Generic RegistryStatus | |
Generic Fingerprint | |
Generic PeerAdvertise | |
Generic FileDescriptor | |
Generic LocalAddress | |
Generic LocalSocket | |
Generic SatInt | |
Generic ModelAddedSizes | |
Generic ModelConstantOrLinear | |
Generic ModelConstantOrTwoArguments | |
Generic ModelFiveArguments | |
Generic ModelFourArguments | |
Generic ModelLinearSize | |
Generic ModelMaxSize | |
Generic ModelMinSize | |
Generic ModelMultipliedSizes | |
Generic ModelOneArgument | |
Generic ModelSixArguments | |
Generic ModelSubtractedSizes | |
Generic ModelThreeArguments | |
Generic ModelTwoArguments | |
Generic Support | |
Generic CkUserError | |
Generic CekUserError | |
Generic StepKind | |
Generic LedgerBytes | |
Generic ScriptContext | |
Generic MintingPolicy | |
Generic MintingPolicyHash | |
Generic Redeemer | |
Generic RedeemerHash | |
Generic Script | |
Generic ScriptError | |
Generic ScriptHash | |
Generic StakeValidator | |
Generic StakeValidatorHash | |
Generic Validator | |
Generic DiffMilliSeconds | |
Generic RedeemerPtr | |
Generic ScriptTag | |
Generic TxIn | |
Generic TxInType | |
Generic AssetClass | |
Generic ScriptContext | |
Generic TxInInfo | |
Generic TxOut | |
Generic OutputDatum | |
Generic CovLoc | |
Generic CoverageAnnotation | |
Generic CoverageData | |
Generic CoverageIndex | |
Generic CoverageMetadata | |
Generic CoverageReport | |
Generic Metadata | |
Generic StudentT | |
Generic ConstructorVariant | |
Generic DatatypeVariant | |
Generic FieldStrictness | |
Generic Strictness | |
Generic Unpackedness | |
Generic Specificity | |
Generic CompressionLevel | |
Generic CompressionStrategy | |
Generic Format | |
Generic MemoryLevel | |
Generic Method | |
Generic WindowBits | |
Generic Form | |
Generic AcceptHeader | |
Generic NoContent | |
Generic IsSecure | |
Generic Environment | |
Generic LogStr | |
Generic Namespace | |
Generic Severity | |
Generic Verbosity | |
Generic IP | |
Generic IPRange | |
Generic ConnectInfo | |
Generic Clock | |
Generic TimeSpec | |
Generic Outcome | |
Generic Expr | |
Generic GYEra # | |
Generic ApiKeyLocation | |
Generic ApiKeyParams | |
Generic Contact | |
Generic Example | |
Generic ExternalDocs | |
Generic Header | |
Generic Host | |
Generic Info | |
Generic License | |
Generic NamedSchema | |
Generic OAuth2Flow | |
Generic OAuth2Params | |
Generic Operation | |
Generic Param | |
Generic ParamAnySchema | |
Generic ParamLocation | |
Generic ParamOtherSchema | |
Generic PathItem | |
Generic Response | |
Generic Responses | |
Generic Schema | |
Generic Scheme | |
Generic SecurityDefinitions | |
Generic SecurityScheme | |
Generic SecuritySchemeType | |
Generic Swagger | |
Generic Tag | |
Generic Xml | |
Generic GYRational # | |
Defined in GeniusYield.Types.Rational Associated Types type Rep GYRational ∷ Type → Type # | |
Generic GYAddress # | |
Generic GYAssetClass # | |
Defined in GeniusYield.Types.Value Associated Types type Rep GYAssetClass ∷ Type → Type # | |
Generic AddressInfo | |
Generic ErrInspectAddress |