plutus-core-1.0.0.1: Language library for Plutus Core
Safe Haskell None
Language Haskell2010

PlutusPrelude

Synopsis

Reexports from base

(&) :: a -> (a -> b) -> b infixl 1 Source #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $ , which allows & to be nested in $ .

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c') infixr 3 Source #

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.

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 Source #

Flipped version of <$> .

(<&>) = flip fmap

Examples

Expand

Apply (+1) to a list, a Just and a Right :

>>> Just 2 <&> (+1)
Just 3
>>> [1,2,3] <&> (+1)
[2,3,4]
>>> Right 3 <&> (+1)
Right 4

Since: base-4.11.0.0

toList :: Foldable t => t a -> [a] Source #

List of elements of a structure, from left to right.

Since: base-4.8.0.0

bool :: a -> a -> Bool -> a Source #

Case analysis for the Bool type. bool x y p evaluates to x when p is False , and evaluates to y when p is True .

This is equivalent to if p then y else x ; that is, one can think of it as an if-then-else construct with its arguments reordered.

Examples

Expand

Basic usage:

>>> bool "foo" "bar" True
"bar"
>>> bool "foo" "bar" False
"foo"

Confirm that bool x y p and if p then y else x are equivalent:

>>> let p = True; x = "bar"; y = "foo"
>>> bool x y p == if p then y else x
True
>>> let p = False
>>> bool x y p == if p then y else x
True

Since: base-4.7.0.0

first :: Bifunctor p => (a -> b) -> p a c -> p b c Source #

Map covariantly over the first argument.

first f ≡ bimap f id

Examples

Expand
>>> first toUpper ('j', 3)
('J',3)
>>> first toUpper (Left 'j')
Left 'J'

second :: Bifunctor p => (b -> c) -> p a b -> p a c Source #

Map covariantly over the second argument.

secondbimap id

Examples

Expand
>>> second (+1) ('j', 3)
('j',4)
>>> second (+1) (Right 3)
Right 4

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 Source #

on b u x y runs the binary function b on the results of applying unary function u to two arguments x and y . From the opposite perspective, it transforms two inputs and combines the outputs.

((+) `on` f) x y = f x + f y

Typical usage: sortBy ( compare `on` fst ) .

Algebraic properties:

  • (*) `on` id = (*) -- (if (*) ∉ {⊥, const ⊥})
  • ((*) `on` f) `on` g = (*) `on` (f . g)
  • flip on f . flip on g = flip on (g . f)

isNothing :: Maybe a -> Bool Source #

The isNothing function returns True iff its argument is Nothing .

Examples

Expand

Basic usage:

>>> isNothing (Just 3)
False
>>> isNothing (Just ())
False
>>> isNothing Nothing
True

Only the outer constructor is taken into consideration:

>>> isNothing (Just Nothing)
False

isJust :: Maybe a -> Bool Source #

The isJust function returns True iff its argument is of the form Just _ .

Examples

Expand

Basic usage:

>>> isJust (Just 3)
True
>>> isJust (Just ())
True
>>> isJust Nothing
False

Only the outer constructor is taken into consideration:

>>> isJust (Just Nothing)
True

fromMaybe :: a -> Maybe a -> a Source #

The fromMaybe function takes a default value and and Maybe value. If the Maybe is Nothing , it returns the default values; otherwise, it returns the value contained in the Maybe .

Examples

Expand

Basic usage:

>>> fromMaybe "" (Just "Hello, World!")
"Hello, World!"
>>> fromMaybe "" Nothing
""

Read an integer from a string using readMaybe . If we fail to parse an integer, we want to return 0 by default:

>>> import Text.Read ( readMaybe )
>>> fromMaybe 0 (readMaybe "5")
5
>>> fromMaybe 0 (readMaybe "")
0

guard :: Alternative f => Bool -> f () Source #

Conditional failure of Alternative computations. Defined by

guard True  = pure ()
guard False = empty

Examples

Expand

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 Just (x `div` y) otherwise. For example:

>>> 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)

foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b Source #

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

fold :: ( Foldable t, Monoid m) => t m -> m Source #

Combine the elements of a structure using a monoid.

for :: ( Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b) Source #

for is traverse with its arguments flipped. For a version that ignores the results see for_ .

throw :: forall (r :: RuntimeRep ) (a :: TYPE r) e. Exception e => e -> a Source #

Throw an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad.

join :: Monad m => m (m a) -> m a Source #

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.

' join bss ' can be understood as the do expression

do bs <- bss
   bs

Examples

Expand

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

to run an STM transaction and the IO action it returns.

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 Source #

Right-to-left composition of Kleisli arrows. ( >=> ) , with the arguments flipped.

Note how this operator resembles function composition ( . ) :

(.)   ::            (b ->   c) -> (a ->   b) -> a ->   c
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 Source #

Left-to-right composition of Kleisli arrows.

' (bs >=> cs) a ' can be understood as the do expression

do b <- bs a
   cs b

($>) :: Functor f => f a -> b -> f b infixl 4 Source #

Flipped version of <$ .

Using ApplicativeDo : ' as $> b ' can be understood as the do expression

do as
   pure b

with an inferred Functor constraint.

Examples

Expand

Replace the contents of a Maybe Int with a constant String :

>>> Nothing $> "foo"
Nothing
>>> Just 90210 $> "foo"
Just "foo"

Replace the contents of an Either Int Int with a constant String , resulting in an Either Int String :

>>> Left 8675309 $> "foo"
Left 8675309
>>> Right 8675309 $> "foo"
Right "foo"

Replace each element of a list with a constant String :

>>> [1,2,3] $> "foo"
["foo","foo","foo"]

Replace the second element of a pair with a constant String :

>>> (1,2) $> "foo"
(1,"foo")

Since: base-4.7.0.0

fromRight :: b -> Either a b -> b Source #

Return the contents of a Right -value or a default value otherwise.

Examples

Expand

Basic usage:

>>> fromRight 1 (Right 3)
3
>>> fromRight 1 (Left "foo")
1

Since: base-4.10.0.0

isRight :: Either a b -> Bool Source #

Return True if the given value is a Right -value, False otherwise.

Examples

Expand

Basic usage:

>>> isRight (Left "foo")
False
>>> isRight (Right 3)
True

Assuming a Left value signifies some sort of error, we can use isRight to write a very simple reporting function that only outputs "SUCCESS" when a computation has succeeded.

This example shows how isRight might be used to avoid pattern matching when one does not care about the value contained in the constructor:

>>> import Control.Monad ( when )
>>> let report e = when (isRight e) $ putStrLn "SUCCESS"
>>> report (Left "parse error")
>>> report (Right 1)
SUCCESS

Since: base-4.7.0.0

void :: Functor f => f a -> f () Source #

void value discards or ignores the result of evaluation, such as the return value of an IO action.

Using ApplicativeDo : ' void as ' can be understood as the do expression

do as
   pure ()

with an inferred Functor constraint.

Examples

Expand

Replace the contents of a Maybe Int with unit:

>>> void Nothing
Nothing
>>> void (Just 3)
Just ()

Replace the contents of an Either Int Int with unit, resulting in an 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

through :: Functor f => (a -> f b) -> a -> f a Source #

Makes an effectful function ignore its result value and return its input value.

coerce :: forall (k :: RuntimeRep ) (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b Source #

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 .

class Generic a Source #

Representable types of kind * . This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . toid
to . fromid

Minimal complete definition

from , to

Instances

Instances details
Generic Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type Source #

Generic Ordering

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Generic Exp
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Exp :: Type -> Type Source #

Generic Match
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Clause
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Pat
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pat :: Type -> Type Source #

Generic Type
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Type :: Type -> Type Source #

Generic Dec
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Dec :: Type -> Type Source #

Generic Name
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Name :: Type -> Type Source #

Generic FunDep
Instance details

Defined in Language.Haskell.TH.Syntax

Generic InjectivityAnn
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Overlap
Instance details

Defined in Language.Haskell.TH.Syntax

Generic ()

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type Source #

Methods

from :: () -> Rep () x Source #

to :: Rep () x -> () Source #

Generic Version

Since: base-4.9.0.0

Instance details

Defined in Data.Version

Generic Value
Instance details

Defined in Data.Aeson.Types.Internal

Generic AdjacencyIntMap
Instance details

Defined in Algebra.Graph.AdjacencyIntMap

Generic DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic Associativity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Generic Fixity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Generic Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type Source #

Generic ExitCode
Instance details

Defined in GHC.IO.Exception

Generic All

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type Source #

Generic Any

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type Source #

Generic ByteSpan
Instance details

Defined in Cardano.Binary.Annotated

Generic Filler
Instance details

Defined in Flat.Filler

Generic Extension
Instance details

Defined in GHC.LanguageExtensions.Type

Generic ForeignSrcLang
Instance details

Defined in GHC.ForeignSrcLang.Type

Generic PrimType
Instance details

Defined in GHC.Exts.Heap.Closures

Generic StgInfoTable
Instance details

Defined in GHC.Exts.Heap.InfoTable.Types

Generic ClosureType
Instance details

Defined in GHC.Exts.Heap.ClosureTypes

Generic Half
Instance details

Defined in Numeric.Half.Internal

Associated Types

type Rep Half :: Type -> Type Source #

Generic Stmt
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Stmt :: Type -> Type Source #

Generic ModName
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Phases
Instance details

Defined in Language.Haskell.TH.Syntax

Generic RuleBndr
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Pragma
Instance details

Defined in Language.Haskell.TH.Syntax

Generic DerivClause
Instance details

Defined in Language.Haskell.TH.Syntax

Generic DerivStrategy
Instance details

Defined in Language.Haskell.TH.Syntax

Generic TySynEqn
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Fixity
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Info
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Info :: Type -> Type Source #

Generic Con
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Con :: Type -> Type Source #

Generic TyVarBndr
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Pos
Instance details

Defined in Text.Megaparsec.Pos

Associated Types

type Rep Pos :: Type -> Type Source #

Generic InvalidPosException
Instance details

Defined in Text.Megaparsec.Pos

Generic SourcePos
Instance details

Defined in Text.Megaparsec.Pos

Generic Doc
Instance details

Defined in Text.PrettyPrint.HughesPJ

Associated Types

type Rep Doc :: Type -> Type Source #

Generic TextDetails
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Generic Style
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Generic Mode
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode :: Type -> Type Source #

Generic PkgName
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Module
Instance details

Defined in Language.Haskell.TH.Syntax

Generic OccName
Instance details

Defined in Language.Haskell.TH.Syntax

Generic NameFlavour
Instance details

Defined in Language.Haskell.TH.Syntax

Generic NameSpace
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Loc
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Loc :: Type -> Type Source #

Generic ModuleInfo
Instance details

Defined in Language.Haskell.TH.Syntax

Generic FixityDirection
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Lit
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Lit :: Type -> Type Source #

Generic Bytes
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Body
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Body :: Type -> Type Source #

Generic Guard
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Range
Instance details

Defined in Language.Haskell.TH.Syntax

Generic TypeFamilyHead
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Foreign
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Callconv
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Safety
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Inline
Instance details

Defined in Language.Haskell.TH.Syntax

Generic RuleMatch
Instance details

Defined in Language.Haskell.TH.Syntax

Generic AnnTarget
Instance details

Defined in Language.Haskell.TH.Syntax

Generic SourceUnpackedness
Instance details

Defined in Language.Haskell.TH.Syntax

Generic SourceStrictness
Instance details

Defined in Language.Haskell.TH.Syntax

Generic DecidedStrictness
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Bang
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bang :: Type -> Type Source #

Generic PatSynDir
Instance details

Defined in Language.Haskell.TH.Syntax

Generic PatSynArgs
Instance details

Defined in Language.Haskell.TH.Syntax

Generic FamilyResultSig
Instance details

Defined in Language.Haskell.TH.Syntax

Generic TyLit
Instance details

Defined in Language.Haskell.TH.Syntax

Generic Role
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Role :: Type -> Type Source #

Generic AnnLookup
Instance details

Defined in Language.Haskell.TH.Syntax

Generic DatatypeInfo
Instance details

Defined in Language.Haskell.TH.Datatype

Generic DatatypeVariant
Instance details

Defined in Language.Haskell.TH.Datatype

Generic ConstructorInfo
Instance details

Defined in Language.Haskell.TH.Datatype

Generic ConstructorVariant
Instance details

Defined in Language.Haskell.TH.Datatype

Generic FieldStrictness
Instance details

Defined in Language.Haskell.TH.Datatype

Generic Unpackedness
Instance details

Defined in Language.Haskell.TH.Datatype

Generic Strictness
Instance details

Defined in Language.Haskell.TH.Datatype

Generic Specificity
Instance details

Defined in Language.Haskell.TH.Datatype.TyVarBndr

Generic SatInt Source #
Instance details

Defined in Data.SatInt

Generic Data Source #
Instance details

Defined in PlutusCore.Data

Associated Types

type Rep Data :: Type -> Type Source #

Generic TyName Source #
Instance details

Defined in PlutusCore.Name

Generic Name Source #
Instance details

Defined in PlutusCore.Name

Associated Types

type Rep Name :: Type -> Type Source #

Generic FreeVariableError Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic TyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic NamedTyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic DeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic NamedDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic Index Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Generic ExCPU Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExMemory Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Generic ModelSixArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelFiveArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelFourArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelThreeArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelTwoArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelConstantOrTwoArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelConstantOrLinear Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelMaxSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelMinSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelMultipliedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelLinearSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelSubtractedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelAddedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ModelOneArgument Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ParseError Source #
Instance details

Defined in PlutusCore.Error

Generic DefaultFun Source #
Instance details

Defined in PlutusCore.Default.Builtins

Generic CekMachineCosts Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Generic CekUserError Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic StepKind Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic Strictness Source #
Instance details

Defined in PlutusIR.Core.Type

Generic Recursivity Source #
Instance details

Defined in PlutusIR.Core.Type

Generic ExtensionFun Source #
Instance details

Defined in PlutusCore.Examples.Builtins

Generic [a]

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type Source #

Methods

from :: [a] -> Rep [a] x Source #

to :: Rep [a] x -> [a] Source #

Generic ( Maybe a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Maybe a) :: Type -> Type Source #

Generic ( Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Par1 p) :: Type -> Type Source #

Generic ( Solo a)
Instance details

Defined in Data.Tuple.Solo

Associated Types

type Rep ( Solo a) :: Type -> Type Source #

Generic ( Only a)
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep ( Only a) :: Type -> Type Source #

Generic ( Tree a)

Since: containers-0.5.8

Instance details

Defined in Data.Tree

Associated Types

type Rep ( Tree a) :: Type -> Type Source #

Generic ( Graph a)
Instance details

Defined in Algebra.Graph.Undirected

Associated Types

type Rep ( Graph a) :: Type -> Type Source #

Generic ( AdjacencyMap a)
Instance details

Defined in Algebra.Graph.NonEmpty.AdjacencyMap

Associated Types

type Rep ( AdjacencyMap a) :: Type -> Type Source #

Generic ( Graph a)
Instance details

Defined in Algebra.Graph

Associated Types

type Rep ( Graph a) :: Type -> Type Source #

Generic ( AdjacencyMap a)
Instance details

Defined in Algebra.Graph.AdjacencyMap

Associated Types

type Rep ( AdjacencyMap a) :: Type -> Type Source #

Generic ( Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep ( Identity a) :: Type -> Type Source #

Generic ( Complex a)

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Associated Types

type Rep ( Complex a) :: Type -> Type Source #

Generic ( Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( Min a) :: Type -> Type Source #

Generic ( Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( Max a) :: Type -> Type Source #

Generic ( First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( First a) :: Type -> Type Source #

Generic ( Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( Last a) :: Type -> Type Source #

Generic ( WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Generic ( Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( Option a) :: Type -> Type Source #

Generic ( ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep ( ZipList a) :: Type -> Type Source #

Generic ( First a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep ( First a) :: Type -> Type Source #

Generic ( Last a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep ( Last a) :: Type -> Type Source #

Generic ( Dual a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep ( Dual a) :: Type -> Type Source #

Generic ( Endo a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep ( Endo a) :: Type -> Type Source #

Generic ( Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep ( Sum a) :: Type -> Type Source #

Generic ( Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep ( Product a) :: Type -> Type Source #

Generic ( Down a)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Down a) :: Type -> Type Source #

Generic ( NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( NonEmpty a) :: Type -> Type Source #

Generic ( SigDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

Generic ( SigDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

Generic ( SignKeyDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

Generic ( SignKeyDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

Generic ( VerKeyDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

Generic ( VerKeyDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

Generic ( SCC vertex)

Since: containers-0.5.9

Instance details

Defined in Data.Graph

Associated Types

type Rep ( SCC vertex) :: Type -> Type Source #

Methods

from :: SCC vertex -> Rep ( SCC vertex) x Source #

to :: Rep ( SCC vertex) x -> SCC vertex Source #

Generic ( FingerTree a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( FingerTree a) :: Type -> Type Source #

Generic ( Digit a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( Digit a) :: Type -> Type Source #

Generic ( Node a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( Node a) :: Type -> Type Source #

Generic ( Elem a)

Since: containers-0.6.1

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( Elem a) :: Type -> Type Source #

Generic ( ViewL a)

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( ViewL a) :: Type -> Type Source #

Generic ( ViewR a)

Since: containers-0.5.8

Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep ( ViewR a) :: Type -> Type Source #

Generic ( Fix f)
Instance details

Defined in Data.Fix

Associated Types

type Rep ( Fix f) :: Type -> Type Source #

Generic ( PostAligned a)
Instance details

Defined in Flat.Filler

Associated Types

type Rep ( PostAligned a) :: Type -> Type Source #

Generic ( PreAligned a)
Instance details

Defined in Flat.Filler

Associated Types

type Rep ( PreAligned a) :: Type -> Type Source #

Generic ( GenClosure b)
Instance details

Defined in GHC.Exts.Heap.Closures

Associated Types

type Rep ( GenClosure b) :: Type -> Type Source #

Generic ( ErrorItem t)
Instance details

Defined in Text.Megaparsec.Error

Associated Types

type Rep ( ErrorItem t) :: Type -> Type Source #

Generic ( ErrorFancy e)
Instance details

Defined in Text.Megaparsec.Error

Associated Types

type Rep ( ErrorFancy e) :: Type -> Type Source #

Generic ( PosState s)
Instance details

Defined in Text.Megaparsec.State

Associated Types

type Rep ( PosState s) :: Type -> Type Source #

Generic ( Doc a)
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep ( Doc a) :: Type -> Type Source #

Generic ( Doc ann)
Instance details

Defined in Prettyprinter.Internal

Associated Types

type Rep ( Doc ann) :: Type -> Type Source #

Generic ( SimpleDocStream ann)
Instance details

Defined in Prettyprinter.Internal

Associated Types

type Rep ( SimpleDocStream ann) :: Type -> Type Source #

Generic ( Maybe a)
Instance details

Defined in Data.Strict.Maybe

Associated Types

type Rep ( Maybe a) :: Type -> Type Source #

Generic ( Window a)
Instance details

Defined in System.Console.Terminal.Common

Associated Types

type Rep ( Window a) :: Type -> Type Source #

Generic ( Doc a)
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Associated Types

type Rep ( Doc a) :: Type -> Type Source #

Generic ( SimpleDoc a)
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Associated Types

type Rep ( SimpleDoc a) :: Type -> Type Source #

Generic ( EvaluationResult a) Source #
Instance details

Defined in PlutusCore.Evaluation.Result

Generic ( CostingFun model) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Associated Types

type Rep ( CostingFun model) :: Type -> Type Source #

Generic ( BuiltinCostModelBase f) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Generic ( Version ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Version ann) :: Type -> Type Source #

Generic ( Kind ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Kind ann) :: Type -> Type Source #

Generic ( Normalized a) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Normalized a) :: Type -> Type Source #

Generic ( MachineError fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Associated Types

type Rep ( MachineError fun) :: Type -> Type Source #

Generic ( UniqueError ann) Source #
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep ( UniqueError ann) :: Type -> Type Source #

Generic ( ExBudgetCategory fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic ( TallyingSt fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Associated Types

type Rep ( TallyingSt fun) :: Type -> Type Source #

Generic ( CekExTally fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Associated Types

type Rep ( CekExTally fun) :: Type -> Type Source #

Generic ( Either a b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Either a b) :: Type -> Type Source #

Generic ( V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( V1 p) :: Type -> Type Source #

Generic ( U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( U1 p) :: Type -> Type Source #

Generic (a, b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b) :: Type -> Type Source #

Methods

from :: (a, b) -> Rep (a, b) x Source #

to :: Rep (a, b) x -> (a, b) Source #

Generic ( Graph e a)
Instance details

Defined in Algebra.Graph.Labelled

Associated Types

type Rep ( Graph e a) :: Type -> Type Source #

Generic ( AdjacencyMap e a)
Instance details

Defined in Algebra.Graph.Labelled.AdjacencyMap

Associated Types

type Rep ( AdjacencyMap e a) :: Type -> Type Source #

Generic ( Void f)
Instance details

Defined in Barbies.Internal.Trivial

Associated Types

type Rep ( Void f) :: Type -> Type Source #

Generic ( Unit f)
Instance details

Defined in Barbies.Internal.Trivial

Associated Types

type Rep ( Unit f) :: Type -> Type Source #

Generic ( Container b a)
Instance details

Defined in Barbies.Internal.Containers

Associated Types

type Rep ( Container b a) :: Type -> Type Source #

Generic ( ErrorContainer b e)
Instance details

Defined in Barbies.Internal.Containers

Associated Types

type Rep ( ErrorContainer b e) :: Type -> Type Source #

Generic ( Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep ( Arg a b) :: Type -> Type Source #

Generic ( WrappedMonad m a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep ( WrappedMonad m a) :: Type -> Type Source #

Generic ( Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Proxy t) :: Type -> Type Source #

Generic ( Bimap a b)
Instance details

Defined in Data.Bimap

Associated Types

type Rep ( Bimap a b) :: Type -> Type Source #

Generic ( Annotated b a)
Instance details

Defined in Cardano.Binary.Annotated

Associated Types

type Rep ( Annotated b a) :: Type -> Type Source #

Generic ( SignedDSIGN v a)
Instance details

Defined in Cardano.Crypto.DSIGN.Class

Associated Types

type Rep ( SignedDSIGN v a) :: Type -> Type Source #

Generic ( Hash h a)
Instance details

Defined in Cardano.Crypto.Hash.Class

Associated Types

type Rep ( Hash h a) :: Type -> Type Source #

Generic ( Cofree f a)
Instance details

Defined in Control.Comonad.Cofree

Associated Types

type Rep ( Cofree f a) :: Type -> Type Source #

Generic ( Free f a)
Instance details

Defined in Control.Monad.Free

Associated Types

type Rep ( Free f a) :: Type -> Type Source #

Generic ( ListT m a)
Instance details

Defined in ListT

Associated Types

type Rep ( ListT m a) :: Type -> Type Source #

Generic ( ParseErrorBundle s e)
Instance details

Defined in Text.Megaparsec.Error

Generic ( State s e)
Instance details

Defined in Text.Megaparsec.State

Associated Types

type Rep ( State s e) :: Type -> Type Source #

Generic ( ParseError s e)
Instance details

Defined in Text.Megaparsec.Error

Associated Types

type Rep ( ParseError s e) :: Type -> Type Source #

Generic ( ListF a b)
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep ( ListF a b) :: Type -> Type Source #

Generic ( NonEmptyF a b)
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep ( NonEmptyF a b) :: Type -> Type Source #

Generic ( TreeF a b)
Instance details

Defined in Data.Functor.Base

Associated Types

type Rep ( TreeF a b) :: Type -> Type Source #

Generic ( These a b)
Instance details

Defined in Data.These

Associated Types

type Rep ( These a b) :: Type -> Type Source #

Generic ( Pair a b)
Instance details

Defined in Data.Strict.Tuple

Associated Types

type Rep ( Pair a b) :: Type -> Type Source #

Generic ( These a b)
Instance details

Defined in Data.Strict.These

Associated Types

type Rep ( These a b) :: Type -> Type Source #

Generic ( Either a b)
Instance details

Defined in Data.Strict.Either

Associated Types

type Rep ( Either a b) :: Type -> Type Source #

Generic ( TyVarDecl tyname ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( TyVarDecl tyname ann) :: Type -> Type Source #

Methods

from :: TyVarDecl tyname ann -> Rep ( TyVarDecl tyname ann) x Source #

to :: Rep ( TyVarDecl tyname ann) x -> TyVarDecl tyname ann Source #

Generic ( EvaluationError user internal) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Associated Types

type Rep ( EvaluationError user internal) :: Type -> Type Source #

Methods

from :: EvaluationError user internal -> Rep ( EvaluationError user internal) x Source #

to :: Rep ( EvaluationError user internal) x -> EvaluationError user internal Source #

Generic ( ErrorWithCause err cause) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Associated Types

type Rep ( ErrorWithCause err cause) :: Type -> Type Source #

Generic ( Def var val) Source #
Instance details

Defined in PlutusCore.MkPlc

Associated Types

type Rep ( Def var val) :: Type -> Type Source #

Methods

from :: Def var val -> Rep ( Def var val) x Source #

to :: Rep ( Def var val) x -> Def var val Source #

Generic ( UVarDecl name ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Associated Types

type Rep ( UVarDecl name ann) :: Type -> Type Source #

Methods

from :: UVarDecl name ann -> Rep ( UVarDecl name ann) x Source #

to :: Rep ( UVarDecl name ann) x -> UVarDecl name ann Source #

Generic ( TypeErrorExt uni ann) Source #
Instance details

Defined in PlutusIR.Error

Associated Types

type Rep ( TypeErrorExt uni ann) :: Type -> Type Source #

Generic ( Rec1 f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( Rec1 f p) :: Type -> Type Source #

Generic ( URec ( Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec ( Ptr ()) p) :: Type -> Type Source #

Generic ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Char p) :: Type -> Type Source #

Generic ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec Float p)
Instance details

Defined in GHC.Generics

Generic ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Int p) :: Type -> Type Source #

Generic ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Word p) :: Type -> Type Source #

Generic (a, b, c)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c) :: Type -> Type Source #

Methods

from :: (a, b, c) -> Rep (a, b, c) x Source #

to :: Rep (a, b, c) x -> (a, b, c) Source #

Generic ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Associated Types

type Rep ( Const a b) :: Type -> Type Source #

Generic ( WrappedArrow a b c)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep ( WrappedArrow a b c) :: Type -> Type Source #

Generic ( Kleisli m a b)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Associated Types

type Rep ( Kleisli m a b) :: Type -> Type Source #

Generic ( Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep ( Ap f a) :: Type -> Type Source #

Generic ( Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep ( Alt f a) :: Type -> Type Source #

Generic ( Join p a)
Instance details

Defined in Data.Bifunctor.Join

Associated Types

type Rep ( Join p a) :: Type -> Type Source #

Generic ( Fix p a)
Instance details

Defined in Data.Bifunctor.Fix

Associated Types

type Rep ( Fix p a) :: Type -> Type Source #

Generic ( FreeF f a b)
Instance details

Defined in Control.Monad.Trans.Free

Associated Types

type Rep ( FreeF f a b) :: Type -> Type Source #

Generic ( CofreeF f a b)
Instance details

Defined in Control.Comonad.Trans.Cofree

Associated Types

type Rep ( CofreeF f a b) :: Type -> Type Source #

Generic ( Tagged s b)
Instance details

Defined in Data.Tagged

Associated Types

type Rep ( Tagged s b) :: Type -> Type Source #

Generic ( These1 f g a)
Instance details

Defined in Data.Functor.These

Associated Types

type Rep ( These1 f g a) :: Type -> Type Source #

Generic ( Type tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Type tyname uni ann) :: Type -> Type Source #

Methods

from :: Type tyname uni ann -> Rep ( Type tyname uni ann) x Source #

to :: Rep ( Type tyname uni ann) x -> Type tyname uni ann Source #

Generic ( TyDecl tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( TyDecl tyname uni ann) :: Type -> Type Source #

Methods

from :: TyDecl tyname uni ann -> Rep ( TyDecl tyname uni ann) x Source #

to :: Rep ( TyDecl tyname uni ann) x -> TyDecl tyname uni ann Source #

Generic ( Error uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep ( Error uni fun ann) :: Type -> Type Source #

Methods

from :: Error uni fun ann -> Rep ( Error uni fun ann) x Source #

to :: Rep ( Error uni fun ann) x -> Error uni fun ann Source #

Generic ( K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( K1 i c p) :: Type -> Type Source #

Methods

from :: K1 i c p -> Rep ( K1 i c p) x Source #

to :: Rep ( K1 i c p) x -> K1 i c p Source #

Generic ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type Source #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x Source #

to :: Rep ((f :+: g) p) x -> (f :+: g) p Source #

Generic ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type Source #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x Source #

to :: Rep ((f :*: g) p) x -> (f :*: g) p Source #

Generic (a, b, c, d)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d) :: Type -> Type Source #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x Source #

to :: Rep (a, b, c, d) x -> (a, b, c, d) Source #

Generic ( Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Associated Types

type Rep ( Product f g a) :: Type -> Type Source #

Generic ( Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep ( Sum f g a) :: Type -> Type Source #

Methods

from :: Sum f g a -> Rep ( Sum f g a) x Source #

to :: Rep ( Sum f g a) x -> Sum f g a Source #

Generic ( TypeError term uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep ( TypeError term uni fun ann) :: Type -> Type Source #

Methods

from :: TypeError term uni fun ann -> Rep ( TypeError term uni fun ann) x Source #

to :: Rep ( TypeError term uni fun ann) x -> TypeError term uni fun ann Source #

Generic ( MachineParameters machinecosts term uni fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Associated Types

type Rep ( MachineParameters machinecosts term uni fun) :: Type -> Type Source #

Methods

from :: MachineParameters machinecosts term uni fun -> Rep ( MachineParameters machinecosts term uni fun) x Source #

to :: Rep ( MachineParameters machinecosts term uni fun) x -> MachineParameters machinecosts term uni fun Source #

Generic ( Program name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Associated Types

type Rep ( Program name uni fun ann) :: Type -> Type Source #

Methods

from :: Program name uni fun ann -> Rep ( Program name uni fun ann) x Source #

to :: Rep ( Program name uni fun ann) x -> Program name uni fun ann Source #

Generic ( Term name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Associated Types

type Rep ( Term name uni fun ann) :: Type -> Type Source #

Methods

from :: Term name uni fun ann -> Rep ( Term name uni fun ann) x Source #

to :: Rep ( Term name uni fun ann) x -> Term name uni fun ann Source #

Generic ( M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( M1 i c f p) :: Type -> Type Source #

Methods

from :: M1 i c f p -> Rep ( M1 i c f p) x Source #

to :: Rep ( M1 i c f p) x -> M1 i c f p Source #

Generic ((f :.: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :.: g) p) :: Type -> Type Source #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x Source #

to :: Rep ((f :.: g) p) x -> (f :.: g) p Source #

Generic (a, b, c, d, e)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x Source #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) Source #

Generic ( Compose f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep ( Compose f g a) :: Type -> Type Source #

Generic ( WrappedBifunctor p a b)
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep ( WrappedBifunctor p a b) :: Type -> Type Source #

Generic ( Joker g a b)
Instance details

Defined in Data.Bifunctor.Joker

Associated Types

type Rep ( Joker g a b) :: Type -> Type Source #

Generic ( Flip p a b)
Instance details

Defined in Data.Bifunctor.Flip

Associated Types

type Rep ( Flip p a b) :: Type -> Type Source #

Generic ( Clown f a b)
Instance details

Defined in Data.Bifunctor.Clown

Associated Types

type Rep ( Clown f a b) :: Type -> Type Source #

Generic ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Program tyname name uni fun ann) :: Type -> Type Source #

Methods

from :: Program tyname name uni fun ann -> Rep ( Program tyname name uni fun ann) x Source #

to :: Rep ( Program tyname name uni fun ann) x -> Program tyname name uni fun ann Source #

Generic ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( Term tyname name uni fun ann) :: Type -> Type Source #

Methods

from :: Term tyname name uni fun ann -> Rep ( Term tyname name uni fun ann) x Source #

to :: Rep ( Term tyname name uni fun ann) x -> Term tyname name uni fun ann Source #

Generic ( NormCheckError tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep ( NormCheckError tyname name uni fun ann) :: Type -> Type Source #

Methods

from :: NormCheckError tyname name uni fun ann -> Rep ( NormCheckError tyname name uni fun ann) x Source #

to :: Rep ( NormCheckError tyname name uni fun ann) x -> NormCheckError tyname name uni fun ann Source #

Generic ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Type

Associated Types

type Rep ( Program tyname name uni fun ann) :: Type -> Type Source #

Methods

from :: Program tyname name uni fun ann -> Rep ( Program tyname name uni fun ann) x Source #

to :: Rep ( Program tyname name uni fun ann) x -> Program tyname name uni fun ann Source #

Generic ( Term tyname name uni fun a) Source #
Instance details

Defined in PlutusIR.Core.Type

Associated Types

type Rep ( Term tyname name uni fun a) :: Type -> Type Source #

Methods

from :: Term tyname name uni fun a -> Rep ( Term tyname name uni fun a) x Source #

to :: Rep ( Term tyname name uni fun a) x -> Term tyname name uni fun a Source #

Generic ( Binding tyname name uni fun a) Source #
Instance details

Defined in PlutusIR.Core.Type

Associated Types

type Rep ( Binding tyname name uni fun a) :: Type -> Type Source #

Methods

from :: Binding tyname name uni fun a -> Rep ( Binding tyname name uni fun a) x Source #

to :: Rep ( Binding tyname name uni fun a) x -> Binding tyname name uni fun a Source #

Generic ( Datatype tyname name uni fun a) Source #
Instance details

Defined in PlutusIR.Core.Type

Associated Types

type Rep ( Datatype tyname name uni fun a) :: Type -> Type Source #

Methods

from :: Datatype tyname name uni fun a -> Rep ( Datatype tyname name uni fun a) x Source #

to :: Rep ( Datatype tyname name uni fun a) x -> Datatype tyname name uni fun a Source #

Generic (a, b, c, d, e, f)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x Source #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) Source #

Generic ( Sum p q a b)
Instance details

Defined in Data.Bifunctor.Sum

Associated Types

type Rep ( Sum p q a b) :: Type -> Type Source #

Methods

from :: Sum p q a b -> Rep ( Sum p q a b) x Source #

to :: Rep ( Sum p q a b) x -> Sum p q a b Source #

Generic ( Product f g a b)
Instance details

Defined in Data.Bifunctor.Product

Associated Types

type Rep ( Product f g a b) :: Type -> Type Source #

Generic ( VarDecl tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep ( VarDecl tyname name uni fun ann) :: Type -> Type Source #

Methods

from :: VarDecl tyname name uni fun ann -> Rep ( VarDecl tyname name uni fun ann) x Source #

to :: Rep ( VarDecl tyname name uni fun ann) x -> VarDecl tyname name uni fun ann Source #

Generic (a, b, c, d, e, f, g)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x Source #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) Source #

Generic ( Tannen f p a b)
Instance details

Defined in Data.Bifunctor.Tannen

Associated Types

type Rep ( Tannen f p a b) :: Type -> Type Source #

Methods

from :: Tannen f p a b -> Rep ( Tannen f p a b) x Source #

to :: Rep ( Tannen f p a b) x -> Tannen f p a b Source #

Generic ( Biff p f g a b)
Instance details

Defined in Data.Bifunctor.Biff

Associated Types

type Rep ( Biff p f g a b) :: Type -> Type Source #

Methods

from :: Biff p f g a b -> Rep ( Biff p f g a b) x Source #

to :: Rep ( Biff p f g a b) x -> Biff p f g a b Source #

class NFData a Source #

A class of types that can be fully evaluated.

Since: deepseq-1.1.0.0

Instances

Instances details
NFData Bool
Instance details

Defined in Control.DeepSeq

NFData Char
Instance details

Defined in Control.DeepSeq

NFData Double
Instance details

Defined in Control.DeepSeq

NFData Float
Instance details

Defined in Control.DeepSeq

NFData Int
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int -> () Source #

NFData Int8
Instance details

Defined in Control.DeepSeq

NFData Int16
Instance details

Defined in Control.DeepSeq

NFData Int32
Instance details

Defined in Control.DeepSeq

NFData Int64
Instance details

Defined in Control.DeepSeq

NFData Integer
Instance details

Defined in Control.DeepSeq

NFData Natural

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData Ordering
Instance details

Defined in Control.DeepSeq

NFData Word
Instance details

Defined in Control.DeepSeq

NFData Word8
Instance details

Defined in Control.DeepSeq

NFData Word16
Instance details

Defined in Control.DeepSeq

NFData Word32
Instance details

Defined in Control.DeepSeq

NFData Word64
Instance details

Defined in Control.DeepSeq

NFData CallStack

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

NFData ()
Instance details

Defined in Control.DeepSeq

Methods

rnf :: () -> () Source #

NFData TyCon

NOTE : Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData Version

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

NFData StdGen
Instance details

Defined in System.Random.Internal

NFData ByteString
Instance details

Defined in Data.ByteString.Internal

NFData ByteString
Instance details

Defined in Data.ByteString.Lazy.Internal

NFData Scientific
Instance details

Defined in Data.Scientific

NFData UTCTime
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

NFData JSONPathElement
Instance details

Defined in Data.Aeson.Types.Internal

NFData Value
Instance details

Defined in Data.Aeson.Types.Internal

NFData Key
Instance details

Defined in Data.Aeson.Key

Methods

rnf :: Key -> () Source #

NFData AdjacencyIntMap
Instance details

Defined in Algebra.Graph.AdjacencyIntMap

NFData ThreadId

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData Number
Instance details

Defined in Data.Attoparsec.Number

NFData Void

Defined as rnf = absurd .

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData Unique

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData ExitCode

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

NFData MaskingState

Since: deepseq-1.4.4.0

Instance details

Defined in Control.DeepSeq

NFData TypeRep

NOTE : Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData All

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: All -> () Source #

NFData Any

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Any -> () Source #

NFData CChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CSChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CShort

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUShort

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CInt

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUInt

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CULong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CLLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CULLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CBool

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

NFData CFloat

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CDouble

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CPtrdiff

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CSize

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CWchar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CSigAtomic

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CClock

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CTime

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUSeconds

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CSUSeconds

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CFile

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CFpos

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CJmpBuf

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CIntPtr

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUIntPtr

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CIntMax

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData CUIntMax

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData Fingerprint

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData SrcLoc

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

NFData ShortByteString
Instance details

Defined in Data.ByteString.Short.Internal

NFData DeserialiseFailure
Instance details

Defined in Codec.CBOR.Read

NFData SecretKey
Instance details

Defined in Crypto.ECC.Ed25519Donna

NFData PublicKey
Instance details

Defined in Crypto.ECC.Ed25519Donna

NFData Signature
Instance details

Defined in Crypto.ECC.Ed25519Donna

NFData ByteArray
Instance details

Defined in Data.Primitive.ByteArray

NFData UnicodeException
Instance details

Defined in Data.Text.Encoding.Error

NFData IntSet
Instance details

Defined in Data.IntSet.Internal

NFData Filler
Instance details

Defined in Flat.Filler

NFData DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

NFData NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

NFData Half
Instance details

Defined in Numeric.Half.Internal

NFData Pos
Instance details

Defined in Text.Megaparsec.Pos

Methods

rnf :: Pos -> () Source #

NFData InvalidPosException
Instance details

Defined in Text.Megaparsec.Pos

NFData SourcePos
Instance details

Defined in Text.Megaparsec.Pos

NFData Doc
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

rnf :: Doc -> () Source #

NFData TextDetails
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

NFData ShortText
Instance details

Defined in Data.Text.Short.Internal

NFData ZonedTime
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

NFData LocalTime
Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

NFData TimeOfDay
Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

NFData TimeZone
Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

NFData UniversalTime
Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

NFData SystemTime
Instance details

Defined in Data.Time.Clock.Internal.SystemTime

NFData AbsoluteTime
Instance details

Defined in Data.Time.Clock.Internal.AbsoluteTime

NFData Day
Instance details

Defined in Data.Time.Calendar.Days

Methods

rnf :: Day -> () Source #

NFData QuarterOfYear
Instance details

Defined in Data.Time.Calendar.Quarter.Compat

NFData Quarter
Instance details

Defined in Data.Time.Calendar.Quarter.Compat

NFData Month
Instance details

Defined in Data.Time.Calendar.Month.Compat

NFData UUID
Instance details

Defined in Data.UUID.Types.Internal

NFData WordArray
Instance details

Defined in Data.Word64Array.Word8

NFData SatInt Source #
Instance details

Defined in Data.SatInt

NFData Data Source #
Instance details

Defined in PlutusCore.Data

NFData Unique Source #
Instance details

Defined in PlutusCore.Name

NFData TyName Source #
Instance details

Defined in PlutusCore.Name

NFData Name Source #
Instance details

Defined in PlutusCore.Name

NFData FreeVariableError Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData TyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData NamedTyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData DeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData FakeNamedDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData NamedDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData Index Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

NFData ExCPU Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExMemory Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExRestrictingBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NFData ExBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NFData ModelSixArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelFiveArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelFourArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelThreeArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelTwoArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelConstantOrTwoArguments Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelConstantOrLinear Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelMaxSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelMinSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelMultipliedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelLinearSize Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelSubtractedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelAddedSizes Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ModelOneArgument Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData UnliftingError Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

NFData ParseError Source #
Instance details

Defined in PlutusCore.Error

NFData DefaultFun Source #
Instance details

Defined in PlutusCore.Default.Builtins

NFData CekMachineCosts Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

NFData CekUserError Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData StepKind Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData RestrictingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData CountingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData a => NFData [a]
Instance details

Defined in Control.DeepSeq

Methods

rnf :: [a] -> () Source #

NFData a => NFData ( Maybe a)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Maybe a -> () Source #

NFData a => NFData ( Ratio a)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ratio a -> () Source #

NFData ( Ptr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ptr a -> () Source #

NFData ( FunPtr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: FunPtr a -> () Source #

NFData a => NFData ( Only a)
Instance details

Defined in Data.Tuple.Only

Methods

rnf :: Only a -> () Source #

NFData a => NFData ( IResult a)
Instance details

Defined in Data.Aeson.Types.Internal

NFData a => NFData ( Result a)
Instance details

Defined in Data.Aeson.Types.Internal

Methods

rnf :: Result a -> () Source #

NFData v => NFData ( KeyMap v)
Instance details

Defined in Data.Aeson.KeyMap

Methods

rnf :: KeyMap v -> () Source #

NFData a => NFData ( Tree a)
Instance details

Defined in Data.Tree

Methods

rnf :: Tree a -> () Source #

NFData a => NFData ( Graph a)
Instance details

Defined in Algebra.Graph.Undirected

Methods

rnf :: Graph a -> () Source #

NFData a => NFData ( Relation a)
Instance details

Defined in Algebra.Graph.Relation.Symmetric

NFData a => NFData ( Relation a)
Instance details

Defined in Algebra.Graph.Relation

NFData a => NFData ( AdjacencyMap a)
Instance details

Defined in Algebra.Graph.NonEmpty.AdjacencyMap

NFData a => NFData ( Graph a)
Instance details

Defined in Algebra.Graph

Methods

rnf :: Graph a -> () Source #

NFData a => NFData ( AdjacencyMap a)
Instance details

Defined in Algebra.Graph.AdjacencyMap

NFData a => NFData ( Identity a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData a => NFData ( Complex a)
Instance details

Defined in Control.DeepSeq

NFData a => NFData ( Min a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Min a -> () Source #

NFData a => NFData ( Max a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Max a -> () Source #

NFData a => NFData ( First a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: First a -> () Source #

NFData a => NFData ( Last a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Last a -> () Source #

NFData m => NFData ( WrappedMonoid m)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

NFData a => NFData ( Option a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Option a -> () Source #

NFData ( StableName a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData a => NFData ( ZipList a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData ( IORef a)

NOTE : Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: IORef a -> () Source #

NFData a => NFData ( First a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: First a -> () Source #

NFData a => NFData ( Last a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Last a -> () Source #

NFData a => NFData ( Dual a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Dual a -> () Source #

NFData a => NFData ( Sum a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Sum a -> () Source #

NFData a => NFData ( Product a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

NFData a => NFData ( Down a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Down a -> () Source #

NFData ( MVar a)

NOTE : Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: MVar a -> () Source #

NFData a => NFData ( NonEmpty a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

NFData ( PinnedSizedBytes n)
Instance details

Defined in Cardano.Crypto.PinnedSizedBytes

NFData ( SigDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

NFData ( SigDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

NFData ( SignKeyDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

NFData ( SignKeyDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

NFData ( VerKeyDSIGN SchnorrSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

NFData ( VerKeyDSIGN EcdsaSecp256k1DSIGN )
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

NFData ( PackedBytes n)
Instance details

Defined in Cardano.Crypto.PackedBytes

NFData a => NFData ( Set a)
Instance details

Defined in Data.Set.Internal

Methods

rnf :: Set a -> () Source #

NFData a => NFData ( Seq a)
Instance details

Defined in Data.Sequence.Internal

Methods

rnf :: Seq a -> () Source #

NFData a => NFData ( IntMap a)
Instance details

Defined in Data.IntMap.Internal

Methods

rnf :: IntMap a -> () Source #

NFData a => NFData ( SCC a)
Instance details

Defined in Data.Graph

Methods

rnf :: SCC a -> () Source #

NFData a => NFData ( FingerTree a)
Instance details

Defined in Data.Sequence.Internal

NFData a => NFData ( Digit a)
Instance details

Defined in Data.Sequence.Internal

Methods

rnf :: Digit a -> () Source #

NFData a => NFData ( Node a)
Instance details

Defined in Data.Sequence.Internal

Methods

rnf :: Node a -> () Source #

NFData a => NFData ( Elem a)
Instance details

Defined in Data.Sequence.Internal

Methods

rnf :: Elem a -> () Source #

NFData ( Context a)
Instance details

Defined in Crypto.Hash.Types

NFData ( Digest a)
Instance details

Defined in Crypto.Hash.Types

Methods

rnf :: Digest a -> () Source #

NFData1 f => NFData ( Fix f)
Instance details

Defined in Data.Fix

Methods

rnf :: Fix f -> () Source #

NFData a => NFData ( DNonEmpty a)
Instance details

Defined in Data.DList.DNonEmpty.Internal

NFData a => NFData ( DList a)
Instance details

Defined in Data.DList.Internal

Methods

rnf :: DList a -> () Source #

NFData a => NFData ( PostAligned a)
Instance details

Defined in Flat.Filler

NFData a => NFData ( PreAligned a)
Instance details

Defined in Flat.Filler

NFData ( Get a)
Instance details

Defined in Flat.Decoder.Types

Methods

rnf :: Get a -> () Source #

NFData a => NFData ( Hashed a)
Instance details

Defined in Data.Hashable.Class

Methods

rnf :: Hashed a -> () Source #

NFData ( Vector a)
Instance details

Defined in Data.Vector.Primitive

Methods

rnf :: Vector a -> () Source #

NFData ( Vector a)
Instance details

Defined in Data.Vector.Storable

Methods

rnf :: Vector a -> () Source #

NFData ( Vector a)
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

rnf :: Vector a -> () Source #

NFData a => NFData ( HashSet a)
Instance details

Defined in Data.HashSet.Internal

NFData a => NFData ( Vector a)
Instance details

Defined in Data.Vector

Methods

rnf :: Vector a -> () Source #

NFData t => NFData ( ErrorItem t)
Instance details

Defined in Text.Megaparsec.Error

NFData a => NFData ( ErrorFancy a)
Instance details

Defined in Text.Megaparsec.Error

NFData s => NFData ( PosState s)
Instance details

Defined in Text.Megaparsec.State

NFData a => NFData ( Doc a)
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

rnf :: Doc a -> () Source #

NFData a => NFData ( AnnotDetails a)
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

NFData ( PrimArray a)
Instance details

Defined in Data.Primitive.PrimArray

NFData ( MutableByteArray s)
Instance details

Defined in Data.Primitive.ByteArray

NFData a => NFData ( SmallArray a)
Instance details

Defined in Data.Primitive.SmallArray

NFData a => NFData ( Array a)
Instance details

Defined in Data.Primitive.Array

Methods

rnf :: Array a -> () Source #

NFData a => NFData ( RAList a)
Instance details

Defined in Data.RAList.Internal

Methods

rnf :: RAList a -> () Source #

NFData a => NFData ( Leaf a)
Instance details

Defined in Data.RAList.Tree.Internal

Methods

rnf :: Leaf a -> () Source #

NFData g => NFData ( AtomicGen g)
Instance details

Defined in System.Random.Stateful

NFData g => NFData ( IOGen g)
Instance details

Defined in System.Random.Stateful

Methods

rnf :: IOGen g -> () Source #

NFData g => NFData ( STGen g)
Instance details

Defined in System.Random.Stateful

Methods

rnf :: STGen g -> () Source #

NFData g => NFData ( TGen g)
Instance details

Defined in System.Random.Stateful

Methods

rnf :: TGen g -> () Source #

NFData g => NFData ( StateGen g)
Instance details

Defined in System.Random.Internal

NFData a => NFData ( Maybe a)
Instance details

Defined in Data.Strict.Maybe

Methods

rnf :: Maybe a -> () Source #

NFData a => NFData ( Doc a)
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Methods

rnf :: Doc a -> () Source #

NFData a => NFData ( SimpleDoc a)
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Closed uni => NFData ( SomeTypeIn uni) Source #
Instance details

Defined in Universe.Core

NFData a => NFData ( EvaluationResult a) Source #
Instance details

Defined in PlutusCore.Evaluation.Result

NFData model => NFData ( CostingFun model) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

Methods

rnf :: CostingFun model -> () Source #

AllArgumentModels NFData f => NFData ( BuiltinCostModelBase f) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.BuiltinCostModel

NFData ann => NFData ( Version ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Version ann -> () Source #

NFData ann => NFData ( Kind ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Kind ann -> () Source #

NFData a => NFData ( Normalized a) Source #
Instance details

Defined in PlutusCore.Core.Type

NFData fun => NFData ( MachineError fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

NFData ann => NFData ( UniqueError ann) Source #
Instance details

Defined in PlutusCore.Error

NFData ( BuiltinRuntime val) Source #
Instance details

Defined in PlutusCore.Builtin.Runtime

NFData ( RuntimeScheme n) Source #
Instance details

Defined in PlutusCore.Builtin.Runtime

NFData fun => NFData ( ExBudgetCategory fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData fun => NFData ( TallyingSt fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData fun => NFData ( CekExTally fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData (a -> b)

This instance is for convenience and consistency with seq . This assumes that WHNF is equivalent to NF for functions.

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a -> b) -> () Source #

( NFData a, NFData b) => NFData ( Either a b)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Either a b -> () Source #

( NFData a, NFData b) => NFData (a, b)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a, b) -> () Source #

( NFData k, NFData a) => NFData ( Map k a)
Instance details

Defined in Data.Map.Internal

Methods

rnf :: Map k a -> () Source #

( NFData k, NFData v) => NFData ( HashMap k v)
Instance details

Defined in Data.HashMap.Internal

Methods

rnf :: HashMap k v -> () Source #

( NFData e, NFData a) => NFData ( Graph e a)
Instance details

Defined in Algebra.Graph.Labelled

Methods

rnf :: Graph e a -> () Source #

( NFData a, NFData e) => NFData ( AdjacencyMap e a)
Instance details

Defined in Algebra.Graph.Labelled.AdjacencyMap

( NFData a, NFData b) => NFData ( Array a b)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Array a b -> () Source #

( NFData i, NFData r) => NFData ( IResult i r)
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

rnf :: IResult i r -> () Source #

NFData ( Fixed a)

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Fixed a -> () Source #

( NFData a, NFData b) => NFData ( Arg a b)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Arg a b -> () Source #

NFData ( Proxy a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Proxy a -> () Source #

NFData ( STRef s a)

NOTE : Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: STRef s a -> () Source #

( NFData a, NFData b) => NFData ( Bimap a b)
Instance details

Defined in Data.Bimap

Methods

rnf :: Bimap a b -> () Source #

( NFData b, NFData a) => NFData ( Annotated b a)
Instance details

Defined in Cardano.Binary.Annotated

Methods

rnf :: Annotated b a -> () Source #

NFData ( SigDSIGN v) => NFData ( SignedDSIGN v a)
Instance details

Defined in Cardano.Crypto.DSIGN.Class

NFData ( Hash h a)
Instance details

Defined in Cardano.Crypto.Hash.Class

Methods

rnf :: Hash h a -> () Source #

( NFData s, NFData ( Token s), NFData e) => NFData ( ParseErrorBundle s e)
Instance details

Defined in Text.Megaparsec.Error

( NFData s, NFData ( ParseError s e)) => NFData ( State s e)
Instance details

Defined in Text.Megaparsec.State

Methods

rnf :: State s e -> () Source #

( NFData ( Token s), NFData e) => NFData ( ParseError s e)
Instance details

Defined in Text.Megaparsec.Error

( NFData k, NFData a) => NFData ( MonoidalMap k a)
Instance details

Defined in Data.Map.Monoidal

( NFData k, NFData a) => NFData ( MonoidalHashMap k a)
Instance details

Defined in Data.HashMap.Monoidal

NFData ( MutablePrimArray s a)
Instance details

Defined in Data.Primitive.PrimArray

NFData (f a) => NFData ( Node f a)
Instance details

Defined in Data.RAList.Tree.Internal

Methods

rnf :: Node f a -> () Source #

( NFData a, NFData b) => NFData ( These a b)

Since: these-0.7.1

Instance details

Defined in Data.These

Methods

rnf :: These a b -> () Source #

GNFData tag => NFData ( Some tag)
Instance details

Defined in Data.Some.Newtype

Methods

rnf :: Some tag -> () Source #

GNFData tag => NFData ( Some tag)
Instance details

Defined in Data.Some.GADT

Methods

rnf :: Some tag -> () Source #

( NFData a, NFData b) => NFData ( Pair a b)
Instance details

Defined in Data.Strict.Tuple

Methods

rnf :: Pair a b -> () Source #

( NFData a, NFData b) => NFData ( These a b)
Instance details

Defined in Data.Strict.These

Methods

rnf :: These a b -> () Source #

( NFData a, NFData b) => NFData ( Either a b)
Instance details

Defined in Data.Strict.Either

Methods

rnf :: Either a b -> () Source #

( NFData k, NFData v) => NFData ( Leaf k v)
Instance details

Defined in Data.HashMap.Internal

Methods

rnf :: Leaf k v -> () Source #

NFData ( MVector s a)
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

rnf :: MVector s a -> () Source #

( Closed uni, Everywhere uni NFData ) => NFData ( ValueOf uni a) Source #
Instance details

Defined in Universe.Core

Methods

rnf :: ValueOf uni a -> () Source #

( NFData internal, NFData user) => NFData ( EvaluationError user internal) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

rnf :: EvaluationError user internal -> () Source #

( NFData err, NFData cause) => NFData ( ErrorWithCause err cause) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

rnf :: ErrorWithCause err cause -> () Source #

NFData fun => NFData ( BuiltinsRuntime fun val) Source #
Instance details

Defined in PlutusCore.Builtin.Runtime

Methods

rnf :: BuiltinsRuntime fun val -> () Source #

( NFData ann, Closed uni) => NFData ( TypeErrorExt uni ann) Source #
Instance details

Defined in PlutusIR.Error

Methods

rnf :: TypeErrorExt uni ann -> () Source #

( NFData a1, NFData a2, NFData a3) => NFData (a1, a2, a3)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3) -> () Source #

NFData a => NFData ( Const a b)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Const a b -> () Source #

NFData (a :~: b)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a :~: b) -> () Source #

NFData b => NFData ( Tagged s b)
Instance details

Defined in Data.Tagged

Methods

rnf :: Tagged s b -> () Source #

( NFData1 f, NFData1 g, NFData a) => NFData ( These1 f g a)

This instance is available only with deepseq >= 1.4.3.0

Instance details

Defined in Data.Functor.These

Methods

rnf :: These1 f g a -> () Source #

( NFData ann, NFData tyname, Closed uni) => NFData ( Type tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Type tyname uni ann -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData fun) => NFData ( Error uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Methods

rnf :: Error uni fun ann -> () Source #

( NFData a1, NFData a2, NFData a3, NFData a4) => NFData (a1, a2, a3, a4)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4) -> () Source #

( NFData1 f, NFData1 g, NFData a) => NFData ( Product f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Product f g a -> () Source #

( NFData1 f, NFData1 g, NFData a) => NFData ( Sum f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Sum f g a -> () Source #

NFData (a :~~: b)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a :~~: b) -> () Source #

( Closed uni, NFData ann, NFData term, NFData fun) => NFData ( TypeError term uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Methods

rnf :: TypeError term uni fun ann -> () Source #

( NFData machinecosts, NFData fun) => NFData ( MachineParameters machinecosts term uni fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Methods

rnf :: MachineParameters machinecosts term uni fun -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData name, NFData fun) => NFData ( Program name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Methods

rnf :: Program name uni fun ann -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData name, NFData fun) => NFData ( Term name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Methods

rnf :: Term name uni fun ann -> () Source #

( NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5) -> () Source #

( NFData1 f, NFData1 g, NFData a) => NFData ( Compose f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Compose f g a -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData name, NFData tyname, NFData fun) => NFData ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Program tyname name uni fun ann -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData name, NFData tyname, NFData fun) => NFData ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Term tyname name uni fun ann -> () Source #

( Everywhere uni NFData , Closed uni, NFData ann, NFData tyname, NFData name, NFData fun) => NFData ( NormCheckError tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Methods

rnf :: NormCheckError tyname name uni fun ann -> () Source #

( NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6) -> () Source #

( NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7) -> () Source #

( 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)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7, a8) -> () Source #

( 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)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> () Source #

data Natural Source #

Type representing arbitrary-precision non-negative integers.

>>> 2^100 :: Natural
1267650600228229401496703205376

Operations whose result would be negative throw ( Underflow :: ArithException ) ,

>>> -1 :: Natural
*** Exception: arithmetic underflow

Since: base-4.8.0.0

Instances

Instances details
Enum Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Enum

Eq Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Natural

Integral Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Data Natural

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Natural -> c Natural Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Natural Source #

toConstr :: Natural -> Constr Source #

dataTypeOf :: Natural -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Natural ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Natural ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Natural -> Natural Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Natural -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Natural -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Natural -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Natural -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Natural -> m Natural Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Natural -> m Natural Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Natural -> m Natural Source #

Num Natural

Note that Natural 's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

Since: base-4.8.0.0

Instance details

Defined in GHC.Num

Ord Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Natural

Read Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Read

Real Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Show Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Show

Ix Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Ix

Hashable Natural
Instance details

Defined in Data.Hashable.Class

ToJSON Natural
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey Natural
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Natural
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Natural
Instance details

Defined in Data.Aeson.Types.FromJSON

PrintfArg Natural

Since: base-4.8.0.0

Instance details

Defined in Text.Printf

Bits Natural

Since: base-4.8.0

Instance details

Defined in Data.Bits

Subtractive Natural
Instance details

Defined in Basement.Numerical.Subtractive

NFData Natural

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

FromField Natural

Accepts an unsigned decimal number. Ignores whitespace.

Since: cassava-0.5.1.0

Instance details

Defined in Data.Csv.Conversion

ToField Natural

Uses decimal encoding.

Since: cassava-0.5.1.0

Instance details

Defined in Data.Csv.Conversion

NoThunks Natural
Instance details

Defined in NoThunks.Class

Pretty Natural
Instance details

Defined in Prettyprinter.Internal

UniformRange Natural
Instance details

Defined in System.Random.Internal

Recursive Natural
Instance details

Defined in Data.Functor.Foldable

Corecursive Natural
Instance details

Defined in Data.Functor.Foldable

Serialise Natural

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Pretty Natural
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Lift Natural
Instance details

Defined in Language.Haskell.TH.Syntax

PrettyDefaultBy config Natural => PrettyBy config Natural
>>> prettyBy () (123 :: Natural)
123
Instance details

Defined in Text.PrettyBy.Internal

DefaultPrettyBy config Natural
Instance details

Defined in Text.PrettyBy.Internal

type Difference Natural
Instance details

Defined in Basement.Numerical.Subtractive

type IntBaseType Natural
Instance details

Defined in Data.IntCast

type Base Natural
Instance details

Defined in Data.Functor.Foldable

data NonEmpty a Source #

Non-empty (and non-strict) list type.

Since: base-4.9.0.0

Constructors

a :| [a] infixr 5

Instances

Instances details
Monad NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Functor NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

MonadFix NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Foldable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

ToJSON1 NonEmpty
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON1 NonEmpty
Instance details

Defined in Data.Aeson.Types.FromJSON

Eq1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Ord1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Show1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Read1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Comonad NonEmpty
Instance details

Defined in Control.Comonad

ComonadApply NonEmpty
Instance details

Defined in Control.Comonad

NFData1 NonEmpty

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> NonEmpty a -> () Source #

Hashable1 NonEmpty

Since: hashable-1.3.1.0

Instance details

Defined in Data.Hashable.Class

Apply NonEmpty
Instance details

Defined in Data.Functor.Bind.Class

Traversable1 NonEmpty
Instance details

Defined in Data.Semigroup.Traversable.Class

Alt NonEmpty
Instance details

Defined in Data.Functor.Alt

Bind NonEmpty
Instance details

Defined in Data.Functor.Bind.Class

Foldable1 NonEmpty
Instance details

Defined in Data.Semigroup.Foldable.Class

FunctorWithIndex Int NonEmpty
Instance details

Defined in WithIndex

Methods

imap :: ( Int -> a -> b) -> NonEmpty a -> NonEmpty b Source #

FoldableWithIndex Int NonEmpty
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ( Int -> a -> m) -> NonEmpty a -> m Source #

ifoldMap' :: Monoid m => ( Int -> a -> m) -> NonEmpty a -> m Source #

ifoldr :: ( Int -> a -> b -> b) -> b -> NonEmpty a -> b Source #

ifoldl :: ( Int -> b -> a -> b) -> b -> NonEmpty a -> b Source #

ifoldr' :: ( Int -> a -> b -> b) -> b -> NonEmpty a -> b Source #

ifoldl' :: ( Int -> b -> a -> b) -> b -> NonEmpty a -> b Source #

TraversableWithIndex Int NonEmpty
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => ( Int -> a -> f b) -> NonEmpty a -> f ( NonEmpty b) Source #

Lift a => Lift ( NonEmpty a :: Type )

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

PrettyDefaultBy config ( NonEmpty a) => PrettyBy config ( NonEmpty a)

prettyBy for NonEmpty a is defined in terms of prettyListBy by default.

>>> prettyBy () (True :| [False])
[True, False]
>>> prettyBy () ('a' :| "bc")
abc
>>> prettyBy () (Just False :| [Nothing, Just True])
[False, True]
Instance details

Defined in Text.PrettyBy.Internal

PrettyBy config a => DefaultPrettyBy config ( NonEmpty a)
Instance details

Defined in Text.PrettyBy.Internal

IsList ( NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item ( NonEmpty a) Source #

Eq a => Eq ( NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Data a => Data ( NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> NonEmpty a -> c ( NonEmpty a) Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( NonEmpty a) Source #

toConstr :: NonEmpty a -> Constr Source #

dataTypeOf :: NonEmpty a -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( NonEmpty a)) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( NonEmpty a)) Source #

gmapT :: ( forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> NonEmpty a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> NonEmpty a -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> NonEmpty a -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> NonEmpty a -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> NonEmpty a -> m ( NonEmpty a) Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> NonEmpty a -> m ( NonEmpty a) Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> NonEmpty a -> m ( NonEmpty a) Source #

Ord a => Ord ( NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Read a => Read ( NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Read

Show a => Show ( NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Generic ( NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( NonEmpty a) :: Type -> Type Source #

Semigroup ( NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Hashable a => Hashable ( NonEmpty a)
Instance details

Defined in Data.Hashable.Class

ToJSON a => ToJSON ( NonEmpty a)
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON a => FromJSON ( NonEmpty a)
Instance details

Defined in Data.Aeson.Types.FromJSON

NFData a => NFData ( NonEmpty a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Ixed ( NonEmpty a)
Instance details

Defined in Control.Lens.At

Wrapped ( NonEmpty a)
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped ( NonEmpty a) Source #

Reversing ( NonEmpty a)
Instance details

Defined in Control.Lens.Internal.Iso

Ixed ( NonEmpty a)
Instance details

Defined in Lens.Micro.Internal

SemiSequence ( NonEmpty a)
Instance details

Defined in Data.Sequences

Associated Types

type Index ( NonEmpty a) Source #

MonoFunctor ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

MonoFoldable ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => ( Element ( NonEmpty a) -> m) -> NonEmpty a -> m Source #

ofoldr :: ( Element ( NonEmpty a) -> b -> b) -> b -> NonEmpty a -> b Source #

ofoldl' :: (a0 -> Element ( NonEmpty a) -> a0) -> a0 -> NonEmpty a -> a0 Source #

otoList :: NonEmpty a -> [ Element ( NonEmpty a)] Source #

oall :: ( Element ( NonEmpty a) -> Bool ) -> NonEmpty a -> Bool Source #

oany :: ( Element ( NonEmpty a) -> Bool ) -> NonEmpty a -> Bool Source #

onull :: NonEmpty a -> Bool Source #

olength :: NonEmpty a -> Int Source #

olength64 :: NonEmpty a -> Int64 Source #

ocompareLength :: Integral i => NonEmpty a -> i -> Ordering Source #

otraverse_ :: Applicative f => ( Element ( NonEmpty a) -> f b) -> NonEmpty a -> f () Source #

ofor_ :: Applicative f => NonEmpty a -> ( Element ( NonEmpty a) -> f b) -> f () Source #

omapM_ :: Applicative m => ( Element ( NonEmpty a) -> m ()) -> NonEmpty a -> m () Source #

oforM_ :: Applicative m => NonEmpty a -> ( Element ( NonEmpty a) -> m ()) -> m () Source #

ofoldlM :: Monad m => (a0 -> Element ( NonEmpty a) -> m a0) -> a0 -> NonEmpty a -> m a0 Source #

ofoldMap1Ex :: Semigroup m => ( Element ( NonEmpty a) -> m) -> NonEmpty a -> m Source #

ofoldr1Ex :: ( Element ( NonEmpty a) -> Element ( NonEmpty a) -> Element ( NonEmpty a)) -> NonEmpty a -> Element ( NonEmpty a) Source #

ofoldl1Ex' :: ( Element ( NonEmpty a) -> Element ( NonEmpty a) -> Element ( NonEmpty a)) -> NonEmpty a -> Element ( NonEmpty a) Source #

headEx :: NonEmpty a -> Element ( NonEmpty a) Source #

lastEx :: NonEmpty a -> Element ( NonEmpty a) Source #

unsafeHead :: NonEmpty a -> Element ( NonEmpty a) Source #

unsafeLast :: NonEmpty a -> Element ( NonEmpty a) Source #

maximumByEx :: ( Element ( NonEmpty a) -> Element ( NonEmpty a) -> Ordering ) -> NonEmpty a -> Element ( NonEmpty a) Source #

minimumByEx :: ( Element ( NonEmpty a) -> Element ( NonEmpty a) -> Ordering ) -> NonEmpty a -> Element ( NonEmpty a) Source #

oelem :: Element ( NonEmpty a) -> NonEmpty a -> Bool Source #

onotElem :: Element ( NonEmpty a) -> NonEmpty a -> Bool Source #

MonoTraversable ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

MonoPointed ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

GrowingAppend ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

NoThunks a => NoThunks ( NonEmpty a)
Instance details

Defined in NoThunks.Class

Pretty a => Pretty ( NonEmpty a)
Instance details

Defined in Prettyprinter.Internal

Recursive ( NonEmpty a)
Instance details

Defined in Data.Functor.Foldable

Corecursive ( NonEmpty a)
Instance details

Defined in Data.Functor.Foldable

Serialise a => Serialise ( NonEmpty a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Pretty a => Pretty ( NonEmpty a)
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Generic1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty :: k -> Type Source #

t ~ NonEmpty b => Rewrapped ( NonEmpty a) t
Instance details

Defined in Control.Lens.Wrapped

Reference n t => Reference ( NonEmpty n) t Source #
Instance details

Defined in PlutusCore.Check.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> NonEmpty n -> t NameAnn -> t NameAnn Source #

Each ( NonEmpty a) ( NonEmpty b) a b
each :: Traversal (NonEmpty a) (NonEmpty b) a b
Instance details

Defined in Control.Lens.Each

Each ( NonEmpty a) ( NonEmpty b) a b
Instance details

Defined in Lens.Micro.Internal

type Rep ( NonEmpty a)
Instance details

Defined in GHC.Generics

type Item ( NonEmpty a)
Instance details

Defined in GHC.Exts

type Item ( NonEmpty a) = a
type Index ( NonEmpty a)
Instance details

Defined in Control.Lens.At

type IxValue ( NonEmpty a)
Instance details

Defined in Control.Lens.At

type IxValue ( NonEmpty a) = a
type Unwrapped ( NonEmpty a)
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped ( NonEmpty a) = (a, [a])
type Index ( NonEmpty a)
Instance details

Defined in Lens.Micro.Internal

type IxValue ( NonEmpty a)
Instance details

Defined in Lens.Micro.Internal

type IxValue ( NonEmpty a) = a
type Index ( NonEmpty a)
Instance details

Defined in Data.Sequences

type Element ( NonEmpty a)
Instance details

Defined in Data.MonoTraversable

type Element ( NonEmpty a) = a
type Base ( NonEmpty a)
Instance details

Defined in Data.Functor.Foldable

type Rep1 NonEmpty
Instance details

Defined in GHC.Generics

data Word8 Source #

8-bit unsigned integer type

Instances

Instances details
Bounded Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Eq Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Integral Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Data Word8

Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Word8 -> c Word8 Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Word8 Source #

toConstr :: Word8 -> Constr Source #

dataTypeOf :: Word8 -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Word8 ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Word8 ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Word8 -> Word8 Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Word8 -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Word8 -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Word8 -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Word8 -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Word8 -> m Word8 Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Word8 -> m Word8 Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Word8 -> m Word8 Source #

Num Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Ord Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Read Word8

Since: base-2.1

Instance details

Defined in GHC.Read

Real Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Show Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Ix Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Hashable Word8
Instance details

Defined in Data.Hashable.Class

ToJSON Word8
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey Word8
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Word8
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Word8
Instance details

Defined in Data.Aeson.Types.FromJSON

PrintfArg Word8

Since: base-2.1

Instance details

Defined in Text.Printf

Storable Word8

Since: base-2.1

Instance details

Defined in Foreign.Storable

Bits Word8

Since: base-2.1

Instance details

Defined in GHC.Word

FiniteBits Word8

Since: base-4.6.0.0

Instance details

Defined in GHC.Word

FiniteBitsOps Word8
Instance details

Defined in Basement.Bits

BitOps Word8
Instance details

Defined in Basement.Bits

PrimType Word8
Instance details

Defined in Basement.PrimType

PrimMemoryComparable Word8
Instance details

Defined in Basement.PrimType

Subtractive Word8
Instance details

Defined in Basement.Numerical.Subtractive

NFData Word8
Instance details

Defined in Control.DeepSeq

FromField Word8

Accepts an unsigned decimal number. Ignores whitespace.

Instance details

Defined in Data.Csv.Conversion

ToField Word8

Uses decimal encoding.

Instance details

Defined in Data.Csv.Conversion

Default Word8
Instance details

Defined in Data.Default.Class

Prim Word8
Instance details

Defined in Data.Primitive.Types

Unbox Word8
Instance details

Defined in Data.Vector.Unboxed.Base

NoThunks Word8
Instance details

Defined in NoThunks.Class

Pretty Word8
Instance details

Defined in Prettyprinter.Internal

Uniform Word8
Instance details

Defined in System.Random.Internal

UniformRange Word8
Instance details

Defined in System.Random.Internal

Serialise Word8

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

ByteSource Word8
Instance details

Defined in Data.UUID.Types.Internal.Builder

Methods

(/-/) :: ByteSink Word8 g -> Word8 -> g

Pretty Word8
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Lift Word8
Instance details

Defined in Language.Haskell.TH.Syntax

IArray UArray Word8
Instance details

Defined in Data.Array.Base

Vector Vector Word8
Instance details

Defined in Data.Vector.Unboxed.Base

PrettyDefaultBy config Word8 => PrettyBy config Word8
Instance details

Defined in Text.PrettyBy.Internal

DefaultPrettyBy config Word8
Instance details

Defined in Text.PrettyBy.Internal

MVector MVector Word8
Instance details

Defined in Data.Vector.Unboxed.Base

Cons ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Cons

Cons ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Cons

Snoc ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Cons

Snoc ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Cons

MArray ( STUArray s) Word8 ( ST s)
Instance details

Defined in Data.Array.Base

type PrimSize Word8
Instance details

Defined in Basement.PrimType

type Difference Word8
Instance details

Defined in Basement.Numerical.Subtractive

type NatNumMaxBound Word8
Instance details

Defined in Basement.Nat

type IntBaseType Word8
Instance details

Defined in Data.IntCast

newtype Vector Word8
Instance details

Defined in Data.Vector.Unboxed.Base

type ByteSink Word8 g
Instance details

Defined in Data.UUID.Types.Internal.Builder

type ByteSink Word8 g = Takes1Byte g
newtype MVector s Word8
Instance details

Defined in Data.Vector.Unboxed.Base

class Applicative f => Alternative (f :: Type -> Type ) where Source #

A monoid on applicative functors.

If defined, some and many should be the least solutions of the equations:

Minimal complete definition

empty , (<|>)

Methods

empty :: f a Source #

The identity of <|>

(<|>) :: f a -> f a -> f a infixl 3 Source #

An associative binary operation

some :: f a -> f [a] Source #

One or more.

many :: f a -> f [a] Source #

Zero or more.

Instances

Instances details
Alternative []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

empty :: [a] Source #

(<|>) :: [a] -> [a] -> [a] Source #

some :: [a] -> [[a]] Source #

many :: [a] -> [[a]] Source #

Alternative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Alternative IO

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Alternative IResult
Instance details

Defined in Data.Aeson.Types.Internal

Alternative Result
Instance details

Defined in Data.Aeson.Types.Internal

Alternative Parser
Instance details

Defined in Data.Aeson.Types.Internal

Alternative Graph
Instance details

Defined in Algebra.Graph.Undirected

Alternative Graph
Instance details

Defined in Algebra.Graph

Alternative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Alternative ZipList

Since: base-4.11.0.0

Instance details

Defined in Control.Applicative

Alternative STM

Since: base-4.8.0.0

Instance details

Defined in GHC.Conc.Sync

Alternative ReadPrec

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Alternative ReadP

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Alternative Seq

Since: containers-0.5.4

Instance details

Defined in Data.Sequence.Internal

Alternative Parser
Instance details

Defined in Data.Csv.Conversion

Alternative DList
Instance details

Defined in Data.DList.Internal

Alternative Vector
Instance details

Defined in Data.Vector

Alternative SmallArray
Instance details

Defined in Data.Primitive.SmallArray

Alternative Array
Instance details

Defined in Data.Primitive.Array

Alternative P

Since: base-4.5.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

empty :: P a Source #

(<|>) :: P a -> P a -> P a Source #

some :: P a -> P [a] Source #

many :: P a -> P [a] Source #

Alternative DecodeUniM Source #
Instance details

Defined in Universe.Core

Alternative EvaluationResult Source #
Instance details

Defined in PlutusCore.Evaluation.Result

Alternative ( U1 :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Alternative ( Parser i)
Instance details

Defined in Data.Attoparsec.Internal.Types

MonadPlus m => Alternative ( WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

ArrowPlus a => Alternative ( ArrowMonad a)

Since: base-4.6.0.0

Instance details

Defined in Control.Arrow

Alternative ( Proxy :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

( Functor m, Monad m) => Alternative ( MaybeT m)
Instance details

Defined in Control.Monad.Trans.Maybe

Monad m => Alternative ( CatchT m)
Instance details

Defined in Control.Monad.Catch.Pure

Alternative f => Alternative ( F f)

This violates the Alternative laws, handle with care.

Instance details

Defined in Control.Monad.Free.Church

Alternative v => Alternative ( Free v)

This violates the Alternative laws, handle with care.

Instance details

Defined in Control.Monad.Free

Monad m => Alternative ( IterT m)
Instance details

Defined in Control.Monad.Trans.Iter

Alternative ( Alt f)
Instance details

Defined in Control.Alternative.Free

MonadPlus m => Alternative ( PropertyT m)
Instance details

Defined in Hedgehog.Internal.Property

Monad m => Alternative ( GenT m)
Instance details

Defined in Hedgehog.Internal.Gen

Alternative m => Alternative ( TreeT m)
Instance details

Defined in Hedgehog.Internal.Tree

Alternative f => Alternative ( Yoneda f)
Instance details

Defined in Data.Functor.Yoneda

Alternative ( ReifiedFold s)
Instance details

Defined in Control.Lens.Reified

( Monad m, Functor m) => Alternative ( ListT m)
Instance details

Defined in ListT

Applicative m => Alternative ( ListT m)
Instance details

Defined in Control.Monad.Trans.List

Alternative m => Alternative ( ResourceT m)

Since 1.1.5

Instance details

Defined in Control.Monad.Trans.Resource.Internal

Alternative f => Alternative ( WrappedApplicative f)
Instance details

Defined in Data.Functor.Bind.Class

Alternative f => Alternative ( Lift f)

A combination is Pure only either part is.

Instance details

Defined in Control.Applicative.Lift

Alternative f => Alternative ( WrappedFoldable f)
Instance details

Defined in Witherable

( TypeError NoRegularlyAppliedHkVarsMsg :: Constraint ) => Alternative ( Opaque val) Source #
Instance details

Defined in PlutusCore.Builtin.Polymorphism

Alternative f => Alternative ( Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Alternative m => Alternative ( ReaderT r m)
Instance details

Defined in Control.Monad.Trans.Reader

( ArrowZero a, ArrowPlus a) => Alternative ( WrappedArrow a b)

Since: base-2.1

Instance details

Defined in Control.Applicative

Alternative m => Alternative ( Kleisli m a)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Alternative f => Alternative ( Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Alternative f => Alternative ( Alt f)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

( Functor m, MonadPlus m) => Alternative ( StateT s m)
Instance details

Defined in Control.Monad.Trans.State.Lazy

( Functor m, Monad m, Monoid e) => Alternative ( ExceptT e m)
Instance details

Defined in Control.Monad.Trans.Except

Alternative m => Alternative ( IdentityT m)
Instance details

Defined in Control.Monad.Trans.Identity

( Functor f, MonadPlus m) => Alternative ( FreeT f m)
Instance details

Defined in Control.Monad.Trans.Free

Alternative g => Alternative ( ApT f g)
Instance details

Defined in Control.Applicative.Trans.Free

( Functor m, Monad m, Error e) => Alternative ( ErrorT e m)
Instance details

Defined in Control.Monad.Trans.Error

( Functor m, MonadPlus m) => Alternative ( StateT s m)
Instance details

Defined in Control.Monad.Trans.State.Strict

Alternative f => Alternative ( Backwards f)

Try alternatives in the same order as f .

Instance details

Defined in Control.Applicative.Backwards

( Monoid w, Alternative m) => Alternative ( WriterT w m)
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

( Monoid w, Alternative m) => Alternative ( WriterT w m)
Instance details

Defined in Control.Monad.Trans.Writer.Strict

( Profunctor p, ArrowPlus p) => Alternative ( Tambara p a)
Instance details

Defined in Data.Profunctor.Strong

Alternative f => Alternative ( Reverse f)

Derived instance.

Instance details

Defined in Data.Functor.Reverse

( Monoid w, Functor m, MonadPlus m) => Alternative ( AccumT w m)
Instance details

Defined in Control.Monad.Trans.Accum

( Functor m, MonadPlus m) => Alternative ( WriterT w m)
Instance details

Defined in Control.Monad.Trans.Writer.CPS

( Functor m, MonadPlus m) => Alternative ( SelectT r m)
Instance details

Defined in Control.Monad.Trans.Select

Alternative m => Alternative ( RenameT ren m) Source #
Instance details

Defined in PlutusCore.Rename.Monad

( Alternative f, Alternative g) => Alternative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: (f :*: g) a Source #

(<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source #

some :: (f :*: g) a -> (f :*: g) [a] Source #

many :: (f :*: g) a -> (f :*: g) [a] Source #

( Alternative f, Alternative g) => Alternative ( Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

( Ord e, Stream s) => Alternative ( ParsecT e s m)

empty is a parser that fails without consuming input.

Instance details

Defined in Text.Megaparsec.Internal

Alternative f => Alternative ( Star f a)
Instance details

Defined in Data.Profunctor.Types

Alternative f => Alternative ( M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: M1 i c f a Source #

(<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a Source #

some :: M1 i c f a -> M1 i c f [a] Source #

many :: M1 i c f a -> M1 i c f [a] Source #

( Alternative f, Applicative g) => Alternative (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: (f :.: g) a Source #

(<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source #

some :: (f :.: g) a -> (f :.: g) [a] Source #

many :: (f :.: g) a -> (f :.: g) [a] Source #

( Alternative f, Applicative g) => Alternative ( Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

( Monoid w, Functor m, MonadPlus m) => Alternative ( RWST r w s m)
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

empty :: RWST r w s m a Source #

(<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source #

some :: RWST r w s m a -> RWST r w s m [a] Source #

many :: RWST r w s m a -> RWST r w s m [a] Source #

( Monoid w, Functor m, MonadPlus m) => Alternative ( RWST r w s m)
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

empty :: RWST r w s m a Source #

(<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source #

some :: RWST r w s m a -> RWST r w s m [a] Source #

many :: RWST r w s m a -> RWST r w s m [a] Source #

( Functor m, MonadPlus m) => Alternative ( RWST r w s m)
Instance details

Defined in Control.Monad.Trans.RWS.CPS

Methods

empty :: RWST r w s m a Source #

(<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source #

some :: RWST r w s m a -> RWST r w s m [a] Source #

many :: RWST r w s m a -> RWST r w s m [a] Source #

Alternative m => Alternative ( NormalizeTypeT m tyname uni ann) Source #
Instance details

Defined in PlutusCore.Normalize.Internal

Methods

empty :: NormalizeTypeT m tyname uni ann a Source #

(<|>) :: NormalizeTypeT m tyname uni ann a -> NormalizeTypeT m tyname uni ann a -> NormalizeTypeT m tyname uni ann a Source #

some :: NormalizeTypeT m tyname uni ann a -> NormalizeTypeT m tyname uni ann [a] Source #

many :: NormalizeTypeT m tyname uni ann a -> NormalizeTypeT m tyname uni ann [a] Source #

class ( Typeable e, Show e) => Exception e Source #

Any type that you wish to throw or catch as an exception must be an instance of the Exception class. The simplest case is a new exception type directly below the root:

data MyException = ThisException | ThatException
    deriving Show

instance Exception MyException

The default method definitions in the Exception class do what we need in this case. You can now throw and catch ThisException and ThatException as exceptions:

*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException

In more complicated examples, you may wish to define a whole hierarchy of exceptions:

---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler

data SomeCompilerException = forall e . Exception e => SomeCompilerException e

instance Show SomeCompilerException where
    show (SomeCompilerException e) = show e

instance Exception SomeCompilerException

compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException

compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
    SomeCompilerException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler

data SomeFrontendException = forall e . Exception e => SomeFrontendException e

instance Show SomeFrontendException where
    show (SomeFrontendException e) = show e

instance Exception SomeFrontendException where
    toException = compilerExceptionToException
    fromException = compilerExceptionFromException

frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException

frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
    SomeFrontendException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception

data MismatchedParentheses = MismatchedParentheses
    deriving Show

instance Exception MismatchedParentheses where
    toException   = frontendExceptionToException
    fromException = frontendExceptionFromException

We can now catch a MismatchedParentheses exception as MismatchedParentheses , SomeFrontendException or SomeCompilerException , but not other types, e.g. IOException :

*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses

Instances

Instances details
Exception Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Exception PatternMatchFail

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecSelError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecConError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecUpdError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception NoMethodError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception TypeError

Since: base-4.9.0.0

Instance details

Defined in Control.Exception.Base

Exception NonTermination

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception NestedAtomically

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception BlockedIndefinitelyOnMVar

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception BlockedIndefinitelyOnSTM

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception Deadlock

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception AllocationLimitExceeded

Since: base-4.8.0.0

Instance details

Defined in GHC.IO.Exception

Exception CompactionFailed

Since: base-4.10.0.0

Instance details

Defined in GHC.IO.Exception

Exception AssertionFailed

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception SomeAsyncException

Since: base-4.7.0.0

Instance details

Defined in GHC.IO.Exception

Exception AsyncException

Since: base-4.7.0.0

Instance details

Defined in GHC.IO.Exception

Exception ArrayException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception FixIOException

Since: base-4.11.0.0

Instance details

Defined in GHC.IO.Exception

Exception ExitCode

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception IOException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception ErrorCall

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception

Exception ArithException

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception.Type

Exception SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Exception ASCII7_Invalid
Instance details

Defined in Basement.String.Encoding.ASCII7

Exception ISO_8859_1_Invalid
Instance details

Defined in Basement.String.Encoding.ISO_8859_1

Exception UTF16_Invalid
Instance details

Defined in Basement.String.Encoding.UTF16

Exception UTF32_Invalid
Instance details

Defined in Basement.String.Encoding.UTF32

Exception DeserialiseFailure
Instance details

Defined in Codec.CBOR.Read

Exception UnicodeException
Instance details

Defined in Data.Text.Encoding.Error

Exception CryptoError
Instance details

Defined in Crypto.Error.Types

Exception DecodeException
Instance details

Defined in Flat.Decoder.Types

Exception HandlingException
Instance details

Defined in Control.Lens.Internal.Exception

Exception InvalidPosException
Instance details

Defined in Text.Megaparsec.Pos

Exception InvalidAccess
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Exception ResourceCleanupException
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Exception BimapException
Instance details

Defined in Data.Bimap

Exception FreeVariableError Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Exception CostModelApplyError Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Exception BuiltinErrorCall Source #
Instance details

Defined in PlutusCore.Examples.Builtins

( Show s, Show ( Token s), Show e, ShowErrorComponent e, VisualStream s, TraversableStream s, Typeable s, Typeable e) => Exception ( ParseErrorBundle s e)
Instance details

Defined in Text.Megaparsec.Error

( Show s, Show ( Token s), Show e, ShowErrorComponent e, VisualStream s, Typeable s, Typeable e) => Exception ( ParseError s e)
Instance details

Defined in Text.Megaparsec.Error

( PrettyPlc cause, PrettyPlc err, Typeable cause, Typeable err) => Exception ( ErrorWithCause err cause) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

(PrettyUni uni ann, Typeable uni, Typeable fun, Typeable ann, Pretty fun) => Exception ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

( Reifies s ( SomeException -> Maybe a), Typeable a, Typeable s, Typeable m) => Exception (Handling a s m)
Instance details

Defined in Control.Lens.Internal.Exception

newtype PairT b f a Source #

Constructors

PairT

Fields

Instances

Instances details
Functor f => Functor ( PairT b f) Source #
Instance details

Defined in PlutusPrelude

Methods

fmap :: (a -> b0) -> PairT b f a -> PairT b f b0 Source #

(<$) :: a -> PairT b f b0 -> PairT b f a Source #

class a ~R# b => Coercible (a :: k) (b :: k) Source #

Coercible is a two-parameter class that has instances for types a and b if the compiler can infer that they have the same representation. This class does not have regular instances; instead they are created on-the-fly during type-checking. Trying to manually declare an instance of Coercible is an error.

Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:

instance Coercible a a

Furthermore, for every type constructor there is an instance that allows to coerce under the type constructor. For example, let D be a prototypical type constructor ( data or newtype ) with three type arguments, which have roles nominal , representational resp. phantom . Then there is an instance of the form

instance Coercible b b' => Coercible (D a b c) (D a b' c')

Note that the nominal type arguments are equal, the representational type arguments can differ, but need to have a Coercible instance themself, and the phantom type arguments can be changed arbitrarily.

The third kind of instance exists for every newtype NT = MkNT T and comes in two variants, namely

instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b

This instance is only usable if the constructor MkNT is in scope.

If, as a library author of a type constructor like Set a , you want to prevent a user of your module to write coerce :: Set T -> Set NT , you need to set the role of Set 's type parameter to nominal , by writing

type role Set nominal

For more details about this feature, please refer to Safe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.

Since: ghc-prim-4.7.0.0

class Typeable (a :: k) Source #

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

Lens

type Lens' s a = Lens s s a a Source #

type Lens' = Simple Lens

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source #

Build a Lens from a getter and a setter.

lens :: Functor f => (s -> a) -> (s -> b -> t) -> (a -> f b) -> s -> f t
>>> s ^. lens getter setter
getter s
>>> s & lens getter setter .~ b
setter s b
>>> s & lens getter setter %~ f
setter s (f (getter s))
lens :: (s -> a) -> (s -> a -> s) -> Lens' s a

(^.) :: s -> Getting a s a -> a infixl 8 Source #

View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values.

This is the same operation as view with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with ( . ).

>>> (a,b)^._2
b
>>> ("hello","world")^._2
"world"
>>> import Data.Complex
>>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
2.23606797749979
(^.) ::             s -> Getter s a     -> a
(^.) :: Monoid m => s -> Fold s m       -> m
(^.) ::             s -> Iso' s a       -> a
(^.) ::             s -> Lens' s a      -> a
(^.) :: Monoid m => s -> Traversal' s m -> m

view :: MonadReader s m => Getting a s a -> m a Source #

View the value pointed to by a Getter , Iso or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal value.

view . toid
>>> view (to f) a
f a
>>> view _2 (1,"hello")
"hello"
>>> view (to succ) 5
6
>>> view (_2._1) ("hello",("world","!!!"))
"world"

As view is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold , It may be useful to think of it as having one of these more restricted signatures:

view ::             Getter s a     -> s -> a
view :: Monoid m => Fold s m       -> s -> m
view ::             Iso' s a       -> s -> a
view ::             Lens' s a      -> s -> a
view :: Monoid m => Traversal' s m -> s -> m

In a more general setting, such as when working with a Monad transformer stack you can use:

view :: MonadReader s m             => Getter s a     -> m a
view :: (MonadReader s m, Monoid a) => Fold s a       -> m a
view :: MonadReader s m             => Iso' s a       -> m a
view :: MonadReader s m             => Lens' s a      -> m a
view :: (MonadReader s m, Monoid a) => Traversal' s a -> m a

(.~) :: ASetter s t a b -> b -> s -> t infixr 4 Source #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

This is an infix version of set , provided for consistency with ( .= ).

f <$ a ≡ mapped .~ f $ a
>>> (a,b,c,d) & _4 .~ e
(a,b,c,e)
>>> (42,"world") & _1 .~ "hello"
("hello","world")
>>> (a,b) & both .~ c
(c,c)
(.~) :: Setter s t a b    -> b -> s -> t
(.~) :: Iso s t a b       -> b -> s -> t
(.~) :: Lens s t a b      -> b -> s -> t
(.~) :: Traversal s t a b -> b -> s -> t

set :: ASetter s t a b -> b -> s -> t Source #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

(<$) ≡ set mapped
>>> set _2 "hello" (1,())
(1,"hello")
>>> set mapped () [1,2,3,4]
[(),(),(),()]

Note: Attempting to set a Fold or Getter will fail at compile time with an relatively nice error message.

set :: Setter s t a b    -> b -> s -> t
set :: Iso s t a b       -> b -> s -> t
set :: Lens s t a b      -> b -> s -> t
set :: Traversal s t a b -> b -> s -> t

(%~) :: ASetter s t a b -> (a -> b) -> s -> t infixr 4 Source #

Modifies the target of a Lens or all of the targets of a Setter or Traversal with a user supplied function.

This is an infix version of over .

fmap f ≡ mapped %~ f
fmapDefault f ≡ traverse %~ f
>>> (a,b,c) & _3 %~ f
(a,b,f c)
>>> (a,b) & both %~ f
(f a,f b)
>>> _2 %~ length $ (1,"hello")
(1,5)
>>> traverse %~ f $ [a,b,c]
[f a,f b,f c]
>>> traverse %~ even $ [1,2,3]
[False,True,False]
>>> traverse.traverse %~ length $ [["hello","world"],["!!!"]]
[[5,5],[3]]
(%~) :: Setter s t a b    -> (a -> b) -> s -> t
(%~) :: Iso s t a b       -> (a -> b) -> s -> t
(%~) :: Lens s t a b      -> (a -> b) -> s -> t
(%~) :: Traversal s t a b -> (a -> b) -> s -> t

over :: ASetter s t a b -> (a -> b) -> s -> t Source #

Modify the target of a Lens or all the targets of a Setter or Traversal with a function.

fmapover mapped
fmapDefaultover traverse
sets . overid
over . setsid

Given any valid Setter l , you can also rely on the law:

over l f . over l g = over l (f . g)

e.g.

>>> over mapped f (over mapped g [a,b,c]) == over mapped (f . g) [a,b,c]
True

Another way to view over is to say that it transforms a Setter into a "semantic editor combinator".

>>> over mapped f (Just a)
Just (f a)
>>> over mapped (*10) [1,2,3]
[10,20,30]
>>> over _1 f (a,b)
(f a,b)
>>> over _1 show (10,20)
("10",20)
over :: Setter s t a b -> (a -> b) -> s -> t
over :: ASetter s t a b -> (a -> b) -> s -> t

Debugging

traceShowId :: Show a => a -> a Source #

Like traceShow but returns the shown value instead of a third value.

>>> traceShowId (1+2+3, "hello" ++ "world")
(6,"helloworld")
(6,"helloworld")

Since: base-4.7.0.0

trace :: String -> a -> a Source #

The trace function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of f x but first outputs the message.

>>> let x = 123; f = show
>>> trace ("calling f with x = " ++ show x) (f x)
"calling f with x = 123
123"

The trace function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

Reexports from Control.Composition

(.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d infixr 8 Source #

Custom functions

(<<$>>) :: ( Functor f1, Functor f2) => (a -> b) -> f1 (f2 a) -> f1 (f2 b) infixl 4 Source #

(<<*>>) :: ( Applicative f1, Applicative f2) => f1 (f2 (a -> b)) -> f1 (f2 a) -> f1 (f2 b) infixl 4 Source #

mtraverse :: ( Monad m, Traversable m, Applicative f) => (a -> f (m b)) -> m a -> f (m b) Source #

foldMapM :: ( Foldable f, Monad m, Monoid b) => (a -> m b) -> f a -> m b Source #

Fold a monadic function over a Foldable . The monadic version of foldMap .

reoption :: ( Foldable f, Alternative g) => f a -> g a Source #

This function generalizes eitherToMaybe , eitherToList , listToMaybe and other such functions.

tabulateArray :: ( Bounded i, Enum i, Ix i) => (i -> a) -> Array i a Source #

Basically a Data.Functor.Representable instance for Array . We can't provide an actual instance because of the Distributive superclass: Array i is not Distributive unless we assume that indices in an array range over the entirety of i .

(?) :: Alternative f => Bool -> a -> f a infixr 2 Source #

b ? x is equal to pure x whenever b holds and is empty otherwise.

ensure :: Alternative f => (a -> Bool ) -> a -> f a Source #

ensure p x is equal to pure x whenever p x holds and is empty otherwise.

asksM :: MonadReader r m => (r -> m a) -> m a Source #

A monadic version of asks .

Pretty-printing

data Doc ann Source #

The abstract data type Doc ann represents pretty documents that have been annotated with data of type ann .

More specifically, a value of type Doc represents a non-empty set of possible layouts of a document. The layout functions select one of these possibilities, taking into account things like the width of the output document.

The annotation is an arbitrary piece of data associated with (part of) a document. Annotations may be used by the rendering backends in order to display output differently, such as

  • color information (e.g. when rendering to the terminal)
  • mouseover text (e.g. when rendering to rich HTML)
  • whether to show something or not (to allow simple or detailed versions)

The simplest way to display a Doc is via the Show class.

>>> putStrLn (show (vsep ["hello", "world"]))
hello
world

Instances

Instances details
Functor Doc

Alter the document’s annotations.

This instance makes Doc more flexible (because it can be used in Functor -polymorphic values), but fmap is much less readable compared to using reAnnotate in code that only works for Doc anyway. Consider using the latter when the type does not matter.

Instance details

Defined in Prettyprinter.Internal

Methods

fmap :: (a -> b) -> Doc a -> Doc b Source #

(<$) :: a -> Doc b -> Doc a Source #

Show ( Doc ann)

( show doc) prettyprints document doc with defaultLayoutOptions , ignoring all annotations.

Instance details

Defined in Prettyprinter.Internal

IsString ( Doc ann)
>>> pretty ("hello\nworld")
hello
world

This instance uses the Pretty Text instance, and uses the same newline to line conversion.

Instance details

Defined in Prettyprinter.Internal

Generic ( Doc ann)
Instance details

Defined in Prettyprinter.Internal

Associated Types

type Rep ( Doc ann) :: Type -> Type Source #

Semigroup ( Doc ann)
x <> y = hcat [x, y]
>>> "hello" <> "world" :: Doc ann
helloworld
Instance details

Defined in Prettyprinter.Internal

Monoid ( Doc ann)
mempty = emptyDoc
mconcat = hcat
>>> mappend "hello" "world" :: Doc ann
helloworld
Instance details

Defined in Prettyprinter.Internal

type Rep ( Doc ann)
Instance details

Defined in Prettyprinter.Internal

type Rep ( Doc ann) = D1 (' MetaData "Doc" "Prettyprinter.Internal" "prettyprinter-1.7.1-4IgD8s5wquO6FIO1jHqEQF" ' False ) ((( C1 (' MetaCons "Fail" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "Empty" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "Char" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedUnpack ) ( Rec0 Char )))) :+: ( C1 (' MetaCons "Text" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedUnpack ) ( Rec0 Int ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 Text )) :+: ( C1 (' MetaCons "Line" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "FlatAlt" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann)) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann)))))) :+: (( C1 (' MetaCons "Cat" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann)) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann))) :+: ( C1 (' MetaCons "Nest" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedUnpack ) ( Rec0 Int ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann))) :+: C1 (' MetaCons "Union" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann)) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann))))) :+: (( C1 (' MetaCons "Column" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Int -> Doc ann))) :+: C1 (' MetaCons "WithPageWidth" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( PageWidth -> Doc ann)))) :+: ( C1 (' MetaCons "Nesting" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Int -> Doc ann))) :+: C1 (' MetaCons "Annotated" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ann) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Doc ann)))))))

newtype ShowPretty a Source #

A newtype wrapper around a whose point is to provide a Show instance for anything that has a Pretty instance.

Constructors

ShowPretty

Fields

class Pretty a where Source #

Overloaded conversion to Doc .

Laws:

  1. output should be pretty. :-)

Minimal complete definition

pretty

Methods

pretty :: a -> Doc ann Source #

>>> pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234

prettyList :: [a] -> Doc ann Source #

prettyList is only used to define the instance Pretty a => Pretty [a] . In normal circumstances only the pretty function is used.

>>> prettyList [1, 23, 456]
[1, 23, 456]

Instances

Instances details
Pretty Bool
>>> pretty True
True
Instance details

Defined in Prettyprinter.Internal

Pretty Char

Instead of ( pretty 'n') , consider using line as a more readable alternative.

>>> pretty 'f' <> pretty 'o' <> pretty 'o'
foo
>>> pretty ("string" :: String)
string
Instance details

Defined in Prettyprinter.Internal

Pretty Double
>>> pretty (exp 1 :: Double)
2.71828182845904...
Instance details

Defined in Prettyprinter.Internal

Pretty Float
>>> pretty (pi :: Float)
3.1415927
Instance details

Defined in Prettyprinter.Internal

Pretty Int
>>> pretty (123 :: Int)
123
Instance details

Defined in Prettyprinter.Internal

Pretty Int8
Instance details

Defined in Prettyprinter.Internal

Pretty Int16
Instance details

Defined in Prettyprinter.Internal

Pretty Int32
Instance details

Defined in Prettyprinter.Internal

Pretty Int64
Instance details

Defined in Prettyprinter.Internal

Pretty Integer
>>> pretty (2^123 :: Integer)
10633823966279326983230456482242756608
Instance details

Defined in Prettyprinter.Internal

Pretty Natural
Instance details

Defined in Prettyprinter.Internal

Pretty Word
Instance details

Defined in Prettyprinter.Internal

Pretty Word8
Instance details

Defined in Prettyprinter.Internal

Pretty Word16
Instance details

Defined in Prettyprinter.Internal

Pretty Word32
Instance details

Defined in Prettyprinter.Internal

Pretty Word64
Instance details

Defined in Prettyprinter.Internal

Pretty ()
>>> pretty ()
()

The argument is not used:

>>> pretty (error "Strict?" :: ())
()
Instance details

Defined in Prettyprinter.Internal

Pretty Text

Automatically converts all newlines to line .

>>> pretty ("hello\nworld" :: Text)
hello
world

Note that line can be undone by group :

>>> group (pretty ("hello\nworld" :: Text))
hello world

Manually use hardline if you definitely want newlines.

Instance details

Defined in Prettyprinter.Internal

Pretty Text

(lazy Text instance, identical to the strict version)

Instance details

Defined in Prettyprinter.Internal

Pretty Void

Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.

>>> pretty ([] :: [Void])
[]
Instance details

Defined in Prettyprinter.Internal

Pretty SourcePos Source #
Instance details

Defined in PlutusCore.Error

Pretty ErrorCode Source #
Instance details

Defined in ErrorCode

Pretty Data Source #
Instance details

Defined in PlutusCore.Data

Pretty Unique Source #
Instance details

Defined in PlutusCore.Name

Pretty FreeVariableError Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Pretty Index Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

Pretty ExCPU Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Pretty ExMemory Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Pretty ExRestrictingBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Pretty ExBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Pretty UnliftingError Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Pretty Size Source #
Instance details

Defined in PlutusCore.Size

Pretty ParseError Source #
Instance details

Defined in PlutusCore.Error

Pretty DefaultFun Source #
Instance details

Defined in PlutusCore.Default.Builtins

Pretty CostModelApplyError Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Pretty CekUserError Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Pretty RestrictingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty CountingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty DatatypeComponent Source #
Instance details

Defined in PlutusIR.Compiler.Provenance

Pretty RetainedSize Source #
Instance details

Defined in PlutusIR.Analysis.RetainedSize

Pretty ExtensionFun Source #
Instance details

Defined in PlutusCore.Examples.Builtins

Pretty a => Pretty [a]
>>> pretty [1,2,3]
[1, 2, 3]
Instance details

Defined in Prettyprinter.Internal

Pretty a => Pretty ( Maybe a)

Ignore Nothing s, print Just contents.

>>> pretty (Just True)
True
>>> braces (pretty (Nothing :: Maybe Bool))
{}
>>> pretty [Just 1, Nothing, Just 3, Nothing]
[1, 3]
Instance details

Defined in Prettyprinter.Internal

Pretty a => Pretty ( Identity a)
>>> pretty (Identity 1)
1
Instance details

Defined in Prettyprinter.Internal

Pretty a => Pretty ( NonEmpty a)
Instance details

Defined in Prettyprinter.Internal

GShow uni => Pretty ( SomeTypeIn uni) Source #
Instance details

Defined in PlutusCore.Pretty.PrettyConst

PrettyClassic a => Pretty ( EvaluationResult a) Source #
Instance details

Defined in PlutusCore.Evaluation.Result

Pretty ( Version ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Common

Pretty ann => Pretty ( Kind ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Default

Pretty a => Pretty ( Normalized a) Source #
Instance details

Defined in PlutusCore.Core.Type

Pretty ann => Pretty ( UniqueError ann) Source #
Instance details

Defined in PlutusCore.Error

Show fun => Pretty ( ExBudgetCategory fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

( Show fun, Ord fun) => Pretty ( TallyingSt fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

( Show fun, Ord fun) => Pretty ( CekExTally fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty a => Pretty ( Provenance a) Source #
Instance details

Defined in PlutusIR.Compiler.Provenance

( Pretty a, Pretty b) => Pretty ( Either a b) Source #
Instance details

Defined in PlutusPrelude

( Pretty a1, Pretty a2) => Pretty (a1, a2)
>>> pretty (123, "hello")
(123, hello)
Instance details

Defined in Prettyprinter.Internal

Methods

pretty :: (a1, a2) -> Doc ann Source #

prettyList :: [(a1, a2)] -> Doc ann Source #

PrettyBy config a => Pretty ( AttachPrettyConfig config a)
>>> data Cfg = Cfg
>>> data D = D
>>> instance PrettyBy Cfg D where prettyBy Cfg D = "D"
>>> pretty $ AttachPrettyConfig Cfg D
D
Instance details

Defined in Text.PrettyBy.Internal

DefaultPrettyBy config a => Pretty ( AttachDefaultPrettyConfig config a)
Instance details

Defined in Text.PrettyBy.Internal

( Closed uni, Everywhere uni PrettyConst ) => Pretty ( Some ( ValueOf uni)) Source #
Instance details

Defined in PlutusCore.Pretty.PrettyConst

( Closed uni, Everywhere uni PrettyConst ) => Pretty ( ValueOf uni a) Source #

Special treatment for built-in constants: see the Note in PlutusCore.Pretty.PrettyConst.

Instance details

Defined in PlutusCore.Pretty.PrettyConst

( PrettyClassic tyname, Pretty ann) => Pretty ( TyVarDecl tyname ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

( Pretty err, Pretty cause) => Pretty ( ErrorWithCause err cause) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Pretty val => Pretty ( Opaque val rep) Source #
Instance details

Defined in PlutusCore.Builtin.Polymorphism

( Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3)
>>> pretty (123, "hello", False)
(123, hello, False)
Instance details

Defined in Prettyprinter.Internal

Methods

pretty :: (a1, a2, a3) -> Doc ann Source #

prettyList :: [(a1, a2, a3)] -> Doc ann Source #

Pretty a => Pretty ( Const a b)
Instance details

Defined in Prettyprinter.Internal

( PrettyClassic tyname, GShow uni, Pretty ann) => Pretty ( Type tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Default

Methods

pretty :: Type tyname uni ann -> Doc ann0 Source #

prettyList :: [ Type tyname uni ann] -> Doc ann0 Source #

( Pretty ann, Pretty fun, GShow uni, Closed uni, Everywhere uni PrettyConst ) => Pretty ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

Methods

pretty :: Error uni fun ann -> Doc ann0 Source #

prettyList :: [ Error uni fun ann] -> Doc ann0 Source #

( PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Program name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Default

Methods

pretty :: Program name uni fun ann -> Doc ann0 Source #

prettyList :: [ Program name uni fun ann] -> Doc ann0 Source #

( PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Term name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Default

Methods

pretty :: Term name uni fun ann -> Doc ann0 Source #

prettyList :: [ Term name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Default

Methods

pretty :: Program tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Program tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Default

Methods

pretty :: Term tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Term tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

pretty :: Program tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Program tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

pretty :: Term tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Term tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => Pretty ( Binding tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

pretty :: Binding tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Binding tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Everywhere uni PrettyConst , Pretty ann) => Pretty ( Datatype tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

pretty :: Datatype tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ Datatype tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassic tyname, PrettyClassic name, GShow uni, Everywhere uni PrettyConst , Pretty ann) => Pretty ( VarDecl tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

pretty :: VarDecl tyname name uni fun ann -> Doc ann0 Source #

prettyList :: [ VarDecl tyname name uni fun ann] -> Doc ann0 Source #

class PrettyBy config a where Source #

A class for pretty-printing values in a configurable manner.

A basic example:

>>> data Case = UpperCase | LowerCase
>>> data D = D
>>> instance PrettyBy Case D where prettyBy UpperCase D = "D"; prettyBy LowerCase D = "d"
>>> prettyBy UpperCase D
D
>>> prettyBy LowerCase D
d

The library provides instances for common types like Integer or Bool , so you can't define your own PrettyBy SomeConfig Integer instance. And for the same reason you should not define instances like PrettyBy SomeAnotherConfig a for universally quantified a , because such an instance would overlap with the existing ones. Take for example

>>> data ViaShow = ViaShow
>>> instance Show a => PrettyBy ViaShow a where prettyBy ViaShow = pretty . show

with such an instance prettyBy ViaShow (1 :: Int) throws an error about overlapping instances:

• Overlapping instances for PrettyBy ViaShow Int
    arising from a use of ‘prettyBy’
  Matching instances:
    instance PrettyDefaultBy config Int => PrettyBy config Int
    instance [safe] Show a => PrettyBy ViaShow a

There's a newtype provided specifically for the purpose of defining a PrettyBy instance for any a : PrettyAny . Read its docs for details on when you might want to use it.

The PrettyBy instance for common types is defined in a way that allows to override default pretty-printing behaviour, read the docs of HasPrettyDefaults for details.

Minimal complete definition

Nothing

Methods

prettyBy :: config -> a -> Doc ann Source #

Pretty-print a value of type a the way a config specifies it. The default implementation of prettyBy is in terms of pretty , defaultPrettyFunctorBy or defaultPrettyBifunctorBy depending on the kind of the data type that you're providing an instance for. For example, the default implementation of prettyBy for a monomorphic type is going to be "ignore the config and call pretty over the value":

>>> newtype N = N Int deriving newtype (Pretty)
>>> instance PrettyBy () N
>>> prettyBy () (N 42)
42

The default implementation of prettyBy for a Functor is going to be in terms of defaultPrettyFunctorBy :

>>> newtype N a = N a deriving stock (Functor) deriving newtype (Pretty)
>>> instance PrettyBy () a => PrettyBy () (N a)
>>> prettyBy () (N (42 :: Int))
42

It's fine for the data type to have a phantom parameter as long as the data type is still a Functor (i.e. the parameter has to be of kind Type ). Then defaultPrettyFunctorBy is used again:

>>> newtype N a = N Int deriving stock (Functor) deriving newtype (Pretty)
>>> instance PrettyBy () (N b)
>>> prettyBy () (N 42)
42

If the data type has a single parameter of any other kind, then it's not a functor and so like in the monomorphic case pretty is used:

>>> newtype N (b :: Bool) = N Int deriving newtype (Pretty)
>>> instance PrettyBy () (N b)
>>> prettyBy () (N 42)
42

Same applies to a data type with two parameters: if both the parameters are of kind Type , then the data type is assumed to be a Bifunctor and hence defaultPrettyBifunctorBy is used. If the right parameter is of kind Type and the left parameter is of any other kind, then we fallback to assuming the data type is a Functor and defining prettyBy as defaultPrettyFunctorBy . If both the parameters are not of kind Type , we fallback to implementing prettyBy in terms of pretty like in the monomorphic case.

Note that in all those cases a Pretty instance for the data type has to already exist, so that we can derive a PrettyBy one in terms of it. If it doesn't exist or if your data type is not supported (for example, if it has three or more parameters of kind Type ), then you'll need to provide the implementation manually.

prettyListBy :: config -> [a] -> Doc ann Source #

prettyListBy is used to define the default PrettyBy instance for [a] and NonEmpty a . In normal circumstances only the prettyBy function is used. The default implementation of prettyListBy is in terms of defaultPrettyFunctorBy .

Instances

Instances details
PrettyDefaultBy config Word8 => PrettyBy config Word8
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Word64 => PrettyBy config Word64
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Word32 => PrettyBy config Word32
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Word16 => PrettyBy config Word16
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Word => PrettyBy config Word
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Void => PrettyBy config Void
>>> prettyBy () ([] :: [Void])
[]
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Text => PrettyBy config Text

Automatically converts all newlines to line .

>>> prettyBy () ("hello\nworld" :: Strict.Text)
hello
world
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Text => PrettyBy config Text

An instance for lazy Text . Identitical to the strict one.

Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Natural => PrettyBy config Natural
>>> prettyBy () (123 :: Natural)
123
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Integer => PrettyBy config Integer
>>> prettyBy () (2^(123 :: Int) :: Integer)
10633823966279326983230456482242756608
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Int8 => PrettyBy config Int8
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Int64 => PrettyBy config Int64
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Int32 => PrettyBy config Int32
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Int16 => PrettyBy config Int16
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Int => PrettyBy config Int
>>> prettyBy () (123 :: Int)
123
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Float => PrettyBy config Float
>>> prettyBy () (pi :: Float)
3.1415927
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Double => PrettyBy config Double
>>> prettyBy () (pi :: Double)
3.141592653589793
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Char => PrettyBy config Char

By default a String (i.e. [Char] ) is converted to a Text first and then pretty-printed. So make sure that if you have any non-default pretty-printing for Char or Text , they're in sync.

>>> prettyBy () 'a'
a
>>> prettyBy () "abc"
abc
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config Bool => PrettyBy config Bool
>>> prettyBy () True
True
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config () => PrettyBy config ()
>>> prettyBy () ()
()

The argument is not used:

>>> prettyBy () (error "Strict?" :: ())
()
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> () -> Doc ann Source #

prettyListBy :: config -> [()] -> Doc ann Source #

HasPrettyConfigName config => PrettyBy config TyName Source #
Instance details

Defined in PlutusCore.Name

HasPrettyConfigName config => PrettyBy config Name Source #
Instance details

Defined in PlutusCore.Name

HasPrettyConfigName config => PrettyBy config TyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

HasPrettyConfigName config => PrettyBy config NamedTyDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

HasPrettyConfigName config => PrettyBy config FakeNamedDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

HasPrettyConfigName config => PrettyBy config DeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

HasPrettyConfigName config => PrettyBy config NamedDeBruijn Source #
Instance details

Defined in PlutusCore.DeBruijn.Internal

PrettyBy config ExCPU Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

PrettyBy config ExMemory Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

PrettyBy config ExRestrictingBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

PrettyBy config ExBudget Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

PrettyBy config RestrictingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

PrettyBy config CountingSt Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

PrettyBy PrettyConfigPlc DefaultFun Source #
Instance details

Defined in PlutusCore.Default.Builtins

PrettyBy ConstConfig ByteString Source #
Instance details

Defined in PlutusCore.Pretty.PrettyConst

PrettyBy ConstConfig Data Source #
Instance details

Defined in PlutusCore.Pretty.PrettyConst

PrettyDefaultBy config a => PrettyBy config ( PrettyCommon a)
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config [a] => PrettyBy config [a]

prettyBy for [a] is defined in terms of prettyListBy by default.

>>> prettyBy () [True, False]
[True, False]
>>> prettyBy () "abc"
abc
>>> prettyBy () [Just False, Nothing, Just True]
[False, True]
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> [a] -> Doc ann Source #

prettyListBy :: config -> [[a]] -> Doc ann Source #

PrettyDefaultBy config ( NonEmpty a) => PrettyBy config ( NonEmpty a)

prettyBy for NonEmpty a is defined in terms of prettyListBy by default.

>>> prettyBy () (True :| [False])
[True, False]
>>> prettyBy () ('a' :| "bc")
abc
>>> prettyBy () (Just False :| [Nothing, Just True])
[False, True]
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config ( Maybe a) => PrettyBy config ( Maybe a)

By default a [Maybe a] is converted to [a] first and only then pretty-printed.

>>> braces $ prettyBy () (Just True)
{True}
>>> braces $ prettyBy () (Nothing :: Maybe Bool)
{}
>>> prettyBy () [Just False, Nothing, Just True]
[False, True]
>>> prettyBy () [Nothing, Just 'a', Just 'b', Nothing, Just 'c']
abc
Instance details

Defined in Text.PrettyBy.Internal

Pretty a => PrettyBy config ( IgnorePrettyConfig a)
>>> data Cfg = Cfg
>>> data D = D
>>> instance Pretty D where pretty D = "D"
>>> prettyBy Cfg $ IgnorePrettyConfig D
D
Instance details

Defined in Text.PrettyBy.Internal

PrettyDefaultBy config ( Identity a) => PrettyBy config ( Identity a)
>>> prettyBy () (Identity True)
True
Instance details

Defined in Text.PrettyBy.Internal

PrettyBy config a => PrettyBy config ( EvaluationResult a) Source #
Instance details

Defined in PlutusCore.Evaluation.Result

PrettyBy config a => PrettyBy config ( Normalized a) Source #
Instance details

Defined in PlutusCore.Core.Type

( HasPrettyDefaults config ~ ' True , Pretty fun) => PrettyBy config ( MachineError fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

( Show fun, Ord fun) => PrettyBy config ( TallyingSt fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

( Show fun, Ord fun) => PrettyBy config ( CekExTally fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

DefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlc ( PrettyAny a) Source #
Instance details

Defined in PlutusCore.Pretty.Plc

DefaultPrettyPlcStrategy ( Kind ann) => PrettyBy PrettyConfigPlc ( Kind ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Plc

DefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlcStrategy ( PrettyAny a) Source #
Instance details

Defined in PlutusCore.Pretty.Plc

DefaultPrettyBy ConstConfig ( PrettyAny a) => PrettyBy ConstConfig ( PrettyAny a) Source #
Instance details

Defined in PlutusCore.Pretty.PrettyConst

PrettyDefaultBy config ( Either a b) => PrettyBy config ( Either a b) Source #

An instance extending the set of types supporting default pretty-printing with Either .

Instance details

Defined in PlutusPrelude

Methods

prettyBy :: config -> Either a b -> Doc ann Source #

prettyListBy :: config -> [ Either a b] -> Doc ann Source #

PrettyDefaultBy config (a, b) => PrettyBy config (a, b)
>>> prettyBy () (False, "abc")
(False, abc)
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> (a, b) -> Doc ann Source #

prettyListBy :: config -> [(a, b)] -> Doc ann Source #

( PrettyBy config cause, PrettyBy config err) => PrettyBy config ( ErrorWithCause err cause) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

prettyBy :: config -> ErrorWithCause err cause -> Doc ann Source #

prettyListBy :: config -> [ ErrorWithCause err cause] -> Doc ann Source #

( HasPrettyDefaults config ~ ' True , PrettyBy config internal, Pretty user) => PrettyBy config ( EvaluationError user internal) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

prettyBy :: config -> EvaluationError user internal -> Doc ann Source #

prettyListBy :: config -> [ EvaluationError user internal] -> Doc ann Source #

( Closed uni, GShow uni, Everywhere uni PrettyConst , Pretty fun) => PrettyBy PrettyConfigPlc ( CkValue uni fun) Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

( Closed uni, GShow uni, Everywhere uni PrettyConst , Pretty fun) => PrettyBy PrettyConfigPlc ( CekValue uni fun) Source #
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

PrettyUni uni ann => PrettyBy PrettyConfigPlc ( TypeErrorExt uni ann) Source #
Instance details

Defined in PlutusIR.Error

PrettyDefaultBy config ( Const a b) => PrettyBy config ( Const a b)

Non-polykinded, because Pretty (Const a b) is not polykinded either.

>>> prettyBy () (Const 1 :: Const Integer Bool)
1
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> Const a b -> Doc ann Source #

prettyListBy :: config -> [ Const a b] -> Doc ann Source #

PrettyDefaultBy config (a, b, c) => PrettyBy config (a, b, c)
>>> prettyBy () ('a', "bcd", True)
(a, bcd, True)
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> (a, b, c) -> Doc ann Source #

prettyListBy :: config -> [(a, b, c)] -> Doc ann Source #

DefaultPrettyPlcStrategy ( Type tyname uni ann) => PrettyBy PrettyConfigPlc ( Type tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Plc

( GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc ( Error uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

( GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

( GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty ann, Pretty fun, Pretty term) => PrettyBy PrettyConfigPlc ( TypeError term uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

DefaultPrettyPlcStrategy ( Program name uni fun ann) => PrettyBy PrettyConfigPlc ( Program name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Plc

DefaultPrettyPlcStrategy ( Term name uni fun ann) => PrettyBy PrettyConfigPlc ( Term name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Plc

( Pretty ann, PrettyBy config ( Type tyname uni ann), PrettyBy config ( Term tyname name uni fun ann)) => PrettyBy config ( NormCheckError tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Error

Methods

prettyBy :: config -> NormCheckError tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: config -> [ NormCheckError tyname name uni fun ann] -> Doc ann0 Source #

DefaultPrettyPlcStrategy ( Program tyname name uni fun ann) => PrettyBy PrettyConfigPlc ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Plc

Methods

prettyBy :: PrettyConfigPlc -> Program tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigPlc -> [ Program tyname name uni fun ann] -> Doc ann0 Source #

DefaultPrettyPlcStrategy ( Term tyname name uni fun ann) => PrettyBy PrettyConfigPlc ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Plc

Methods

prettyBy :: PrettyConfigPlc -> Term tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigPlc -> [ Term tyname name uni fun ann] -> Doc ann0 Source #

PrettyBy ( PrettyConfigClassic configName) Strictness Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

PrettyBy ( PrettyConfigClassic configName) Recursivity Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

PrettyBy ( PrettyConfigReadable configName) ( Kind a) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Readable

Pretty ann => PrettyBy ( PrettyConfigClassic configName) ( Kind ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Classic

( PrettyClassicBy configName tyname, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( TyVarDecl tyname ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

( PrettyReadableBy configName tyname, GShow uni) => PrettyBy ( PrettyConfigReadable configName) ( Type tyname uni a) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Readable

( PrettyClassicBy configName tyname, GShow uni, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Type tyname uni ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Classic

Methods

prettyBy :: PrettyConfigClassic configName -> Type tyname uni ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Type tyname uni ann] -> Doc ann0 Source #

PrettyReadableBy configName ( Term name uni fun a) => PrettyBy ( PrettyConfigReadable configName) ( Program name uni fun a) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Readable

( PrettyReadableBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun) => PrettyBy ( PrettyConfigReadable configName) ( Term name uni fun a) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Readable

Methods

prettyBy :: PrettyConfigReadable configName -> Term name uni fun a -> Doc ann Source #

prettyListBy :: PrettyConfigReadable configName -> [ Term name uni fun a] -> Doc ann Source #

( PrettyClassicBy configName ( Term name uni fun ann), Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Program name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Classic

Methods

prettyBy :: PrettyConfigClassic configName -> Program name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Program name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Term name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Pretty.Classic

Methods

prettyBy :: PrettyConfigClassic configName -> Term name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Term name uni fun ann] -> Doc ann0 Source #

PrettyReadableBy configName ( Term tyname name uni fun a) => PrettyBy ( PrettyConfigReadable configName) ( Program tyname name uni fun a) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Readable

Methods

prettyBy :: PrettyConfigReadable configName -> Program tyname name uni fun a -> Doc ann Source #

prettyListBy :: PrettyConfigReadable configName -> [ Program tyname name uni fun a] -> Doc ann Source #

( PrettyReadableBy configName tyname, PrettyReadableBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun) => PrettyBy ( PrettyConfigReadable configName) ( Term tyname name uni fun a) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Readable

Methods

prettyBy :: PrettyConfigReadable configName -> Term tyname name uni fun a -> Doc ann Source #

prettyListBy :: PrettyConfigReadable configName -> [ Term tyname name uni fun a] -> Doc ann Source #

( PrettyClassicBy configName ( Term tyname name uni fun ann), Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Classic

Methods

prettyBy :: PrettyConfigClassic configName -> Program tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Program tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Pretty.Classic

Methods

prettyBy :: PrettyConfigClassic configName -> Term tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Term tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Program tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

prettyBy :: PrettyConfigClassic configName -> Program tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Program tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Term tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

prettyBy :: PrettyConfigClassic configName -> Term tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Term tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Binding tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

prettyBy :: PrettyConfigClassic configName -> Binding tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Binding tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Everywhere uni PrettyConst , Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( Datatype tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

prettyBy :: PrettyConfigClassic configName -> Datatype tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ Datatype tyname name uni fun ann] -> Doc ann0 Source #

( PrettyClassicBy configName tyname, PrettyClassicBy configName name, GShow uni, Everywhere uni PrettyConst , Pretty ann) => PrettyBy ( PrettyConfigClassic configName) ( VarDecl tyname name uni fun ann) Source #
Instance details

Defined in PlutusIR.Core.Instance.Pretty

Methods

prettyBy :: PrettyConfigClassic configName -> VarDecl tyname name uni fun ann -> Doc ann0 Source #

prettyListBy :: PrettyConfigClassic configName -> [ VarDecl tyname name uni fun ann] -> Doc ann0 Source #

type family HasPrettyDefaults config :: Bool Source #

Determines whether a pretty-printing config allows default pretty-printing for types that support it. I.e. it's possible to create a new config and get access to pretty-printing for all types supporting default pretty-printing just by providing the right type instance. Example:

>>> data DefCfg = DefCfg
>>> type instance HasPrettyDefaults DefCfg = 'True
>>> prettyBy DefCfg (['a', 'b', 'c'], (1 :: Int), Just True)
(abc, 1, True)

The set of types supporting default pretty-printing is determined by the prettyprinter library: whatever there has a Pretty instance also supports default pretty-printing in this library and the behavior of pretty x and prettyBy config_with_defaults x must be identical when x is one of such types.

It is possible to override default pretty-printing. For this you need to specify that HasPrettyDefaults is 'False for your config and then define a NonDefaultPrettyBy config instance for each of the types supporting default pretty-printing that you want to pretty-print values of. Note that once HasPrettyDefaults is specified to be 'False , all defaults are lost for your config, so you can't override default pretty-printing for one type and keep the defaults for all the others. I.e. if you have

>>> data NonDefCfg = NonDefCfg
>>> type instance HasPrettyDefaults NonDefCfg = 'False

then you have no defaults available and an attempt to pretty-print a value of a type supporting default pretty-printing

prettyBy NonDefCfg True

results in a type error:

• No instance for (NonDefaultPrettyBy NonDef Bool)
     arising from a use of ‘prettyBy’

As the error suggests you need to provide a NonDefaultPrettyBy instance explicitly:

>>> instance NonDefaultPrettyBy NonDefCfg Bool where nonDefaultPrettyBy _ b = if b then "t" else "f"
>>> prettyBy NonDefCfg True
t

It is also possible not to provide any implementation for nonDefaultPrettyBy , in which case it defaults to being the default pretty-printing for the given type. This can be useful to recover default pretty-printing for types pretty-printing of which you don't want to override:

>>> instance NonDefaultPrettyBy NonDefCfg Int
>>> prettyBy NonDefCfg (42 :: Int)
42

Look into test/NonDefault.hs for an extended example.

We could give the user more fine-grained control over what defaults to override instead of requiring to explicitly provide all the instances whenever there's a need to override any default behavior, but that would complicate the library even more, so we opted for not doing that at the moment.

Note that you can always override default behavior by wrapping a type in newtype and providing a PrettyBy config_name instance for that newtype .

Also note that if you want to extend the set of types supporting default pretty-printing it's not enough to provide a Pretty instance for your type (such logic is hardly expressible in present day Haskell). Read the docs of DefaultPrettyBy for how to extend the set of types supporting default pretty-printing.

type PrettyDefaultBy config = DispatchPrettyDefaultBy ( NonStuckHasPrettyDefaults config) config Source #

PrettyDefaultBy config a is the same thing as PrettyBy config a , when a supports default pretty-printing. Thus PrettyDefaultBy config a and PrettyBy config a are interchangeable constraints for such types, but the latter throws an annoying "this makes type inference for inner bindings fragile" warning, unlike the former. PrettyDefaultBy config a reads as " a supports default pretty-printing and can be pretty-printed via config in either default or non-default manner depending on whether config supports default pretty-printing".

newtype PrettyAny a Source #

A newtype wrapper around a provided for the purporse of defining PrettyBy instances handling any a . For example you can wrap values with the PrettyAny constructor directly like in this last line of

>>> data ViaShow = ViaShow
>>> instance Show a => PrettyBy ViaShow (PrettyAny a) where prettyBy ViaShow = pretty . show . unPrettyAny
>>> prettyBy ViaShow $ PrettyAny True
True

or you can use the type to via-derive instances:

>>> data D = D deriving stock (Show)
>>> deriving via PrettyAny D instance PrettyBy ViaShow D
>>> prettyBy ViaShow D
D

One important use case is handling sum-type configs. For example having two configs you can define their sum and derive PrettyBy for the unified config in terms of its components:

>>> data UpperCase = UpperCase
>>> data LowerCase = LowerCase
>>> data Case = CaseUpperCase UpperCase | CaseLowerCase LowerCase
>>> instance (PrettyBy UpperCase a, PrettyBy LowerCase a) => PrettyBy Case (PrettyAny a) where prettyBy (CaseUpperCase upper) = prettyBy upper . unPrettyAny; prettyBy (CaseLowerCase lower) = prettyBy lower . unPrettyAny

Then having a data type implementing both PrettyBy UpperCase and PrettyBy LowerCase you can derive PrettyBy Case for that data type:

>>> data D = D
>>> instance PrettyBy UpperCase D where prettyBy UpperCase D = "D"
>>> instance PrettyBy LowerCase D where prettyBy LowerCase D = "d"
>>> deriving via PrettyAny D instance PrettyBy Case D
>>> prettyBy UpperCase D
D
>>> prettyBy LowerCase D
d

Look into test/Universal.hs for an extended example.

Constructors

PrettyAny

Fields

class Render str where Source #

A class for rendering Doc s as string types.

Methods

render :: Doc ann -> str Source #

Render a Doc as a string type.

Instances

Instances details
Render Text
Instance details

Defined in Text.PrettyBy.Default

Render Text
Instance details

Defined in Text.PrettyBy.Default

a ~ Char => Render [a]
Instance details

Defined in Text.PrettyBy.Default

Methods

render :: Doc ann -> [a] Source #

display :: forall str a. ( Pretty a, Render str) => a -> str Source #

Pretty-print and render a value as a string type.

GHCi

printPretty :: Pretty a => a -> IO () Source #

A command suitable for use in GHCi as an interactive printer.

Text

Orphan instances

PrettyDefaultBy config ( Either a b) => PrettyBy config ( Either a b) Source #

An instance extending the set of types supporting default pretty-printing with Either .

Instance details

Methods

prettyBy :: config -> Either a b -> Doc ann Source #

prettyListBy :: config -> [ Either a b] -> Doc ann Source #

( PrettyBy config a, PrettyBy config b) => DefaultPrettyBy config ( Either a b) Source #

Default pretty-printing for the spine of Either (elements are pretty-printed the way PrettyBy config constraints specify it).

Instance details

( Pretty a, Pretty b) => Pretty ( Either a b) Source #
Instance details