Classes

The following classes are available globally.

  • An AffineTraversal is an optic that allows to see into a structure and getting, setting or modifying an optional focus.

    A (polymorphic) PAffineTraversal is useful when setting or modifying a value for a type with an optional polymorphic focus.

    A PAffineTraversal can be seen as a weaker Lens and Prism and combines their weakest functions: - set meaning we can focus into an S and set a value B for a target A and obtain a modified source T. - getOrModify meaning it returns the focus of a PAffineTraversal (if present) or the original value.

    Type parameters: - S: Source. - T: Modified source. - A: Focus. - B: Modified focus.

    See more

    Declaration

    Swift

    public class PAffineTraversal<S, T, A, B>
  • A BoundSetter is a Setter that is already bound to a concrete source.

    See more

    Declaration

    Swift

    public class BoundSetter<S, A>
  • A Getter is an optic that allows to see into a structure and getting a focus.

    It can be seen as a function (S) -> A meaning that we can look into an S and get an A.

    Parameters: - S: source of the Getter. - A: focus of the Getter.

    See more

    Declaration

    Swift

    public class Getter<S, A>
  • A Fold is an optic that allows to focus into a structure and get multiple results.

    Fold is a generalization of an instance of Foldable and it is implemented in terms of foldMap.

    Type parameters: - S: Source. - A: Focus.

    See more

    Declaration

    Swift

    open class Fold<S, A>
  • Simulates a Higher-Kinded Type in Swift with 1 type argument.

    This class simulates Higher-Kinded Type support in Swift. Kind<F, A> is an alias for F<A>, which is not syntactically valid in Swift. Classes that want to have HKT support must extend this class. Type parameter F is reserved for a witness to prevent circular references in the inheritance relationship. By convention, witnesses are named like the class they represent, with the prefix For. As an example:

    class ForOption {}
    class Option<A>: Kind<ForOption, A> {}
    
    See more

    Declaration

    Swift

    open class Kind<F, A>
  • StateT transformer represents operations that need to write and read a state through a computation or effect.

    Some computations may not require the full power of this transformer: - For read-only state, see ReaderT / Kleisli. - To accumulate a value without using it on the way, see WriterT.

    See more

    Declaration

    Swift

    public final class StateT<F, S, A> : StateTOf<F, S, A>
  • Witness for the StateT<F, S, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForStateT
  • Partial application of the StateT type constructor, omitting the last type argument.

    See more

    Declaration

    Swift

    public final class StateTPartial<F, S> : Kind2<ForStateT, F, S>
  • ArrayK is a Higher Kinded Type wrapper over Swift arrays.

    See more

    Declaration

    Swift

    public final class ArrayK<A> : ArrayKOf<A>
  • Witness for the ArrayK<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForArrayK
  • Constant data type. Represents a container of two types, holding a value of the left type that remains constant, regardless of the transformation applied to it.

    See more

    Declaration

    Swift

    public final class Const<A, T> : ConstOf<A, T>
  • Witness for the Const<A, T> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForConst
  • Partial application of the Const type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class ConstPartial<A> : Kind<ForConst, A>
  • EitherK is a sum type for kinds. Represents a type where you can hold either a Kind<F, A> or a Kind<G, A>.

    See more

    Declaration

    Swift

    public final class EitherK<F, G, A> : EitherKOf<F, G, A>
  • Witness for the EitherK<F, G, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEitherK
  • Partial application of the EitherK type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class EitherKPartial<F, G> : Kind2<ForEitherK, F, G>
  • Sum type of types A and B. Represents a value of either one of those types, but not both at the same time. Values of type A are called left; values of type B are called right.

    See more

    Declaration

    Swift

    public final class Either<A, B> : EitherOf<A, B>
  • Witness for the Either<A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEither
  • Partial application of the Either type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class EitherPartial<L> : Kind<ForEither, L>
  • The identity data type represents a context of having no effect on the type it wraps. A instance of Id<A> is isomorphic to an instance of A; it is just wrapped without any additional information.

    See more

    Declaration

    Swift

    public final class Id<A> : IdOf<A>
  • Witness for the Id<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForId
  • Ior represents an inclusive-or of two different types. It may have a value of the left type, the right type or both at the same time.

    See more

    Declaration

    Swift

    public final class Ior<A, B> : IorOf<A, B>
  • Witness for the Ior<A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForIor
  • Partial application of the Ior type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class IorPartial<L> : Kind<ForIor, L>
  • Represents optional values. Instances of this type may represent the presence of a value (some) or absence of it (none). This type is isomorphic to native Swift Optional<A> (usually written A?), with the addition of behaving as a Higher Kinded Type.

    See more

    Declaration

    Swift

    public final class Option<A> : OptionOf<A>
  • Witness for the Option<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForOption
  • Describes the result of an operation that may have thrown errors or succeeded. The type parameter corresponds to the result type of the operation.

    See more

    Declaration

    Swift

    public final class Try<A> : TryOf<A>
  • Witness for the Try<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForTry
  • Validated is a data type to represent valid and invalid values. It is similar to Either, but with error accumulation in the invalid case.

    See more

    Declaration

    Swift

    public final class Validated<E, A> : ValidatedOf<E, A>
  • Witness for the Validated<E, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForValidated
  • Partial application of the Validated type constructor, ommitting the last parameter.

    See more

    Declaration

    Swift

    public final class ValidatedPartial<I> : Kind<ForValidated, I>
  • An Iso is a loss less invertible optic that defines an isomorphism between a type S and A.

    A polimorphic PIso is useful when setting or modifying a value for a constructed type; e.g. PIso<<Option<Int>, Option<String>, Int?, String?>.

    • S: Source of a PIso.
    • T: Modified source of a PIso.
    • A: Focus of a PIso.
    • B: Modified target of a PIso.
    See more

    Declaration

    Swift

    public class PIso<S, T, A, B>
  • A Lens (or Functional Reference) is an optic that can focus into a structure for getting, setting or modifying the focus (target).

    A (polymorphic) PLens is useful when setting or modifying a value for a constructed type.

    A PLens can be seen as a pair of functions: - get: (S) -> A meaning we can focus into S and extract an A. - set: (B, S) -> T meaning we can focus into an S and set a value B for a target A and obtain a modified source.

    The type arguments are: - S is the source of a PLens. - T is the modified source of a PLens. - A is the focus of a PLens. - B is the modified focus of a PLens.

    See more

    Declaration

    Swift

    public class PLens<S, T, A, B>
  • A Prism is a loss less invertible optic that can look into a structure and optionally find its focus. It is mostly used for finding a focus that is only present under certain conditions, like in a sum type.

    A (polymorphic) PPrism is useful when setting or modifying a value for a polymorphic sum type.

    A PPrism gathres the two concepts of pattern matching and constructor and thus can be seen as a pair of functions: - getOrModify meaning it returns the focus of a PPRism or the original value. - reverseGet meaining we can construct the source type of a PPrism from a focus.

    Type parameters: - S: Source. - T: Modified source. - A: Focus. - B: Modified focus.

    See more

    Declaration

    Swift

    public class PPrism<S, T, A, B>
  • A Setter is an optic that allows to see into a structure and set or modify its focus.

    A (polymorphic) PSetter is useful when setting or modifying a value for a constructed type.

    A PSetter is a generalization of a Functor.

    Parameters: - S: Source of the PSetter. - T: Modified source of the PSetter. - A: Focus of the PSetter. - B: Modified focus of the PSetter.

    See more

    Declaration

    Swift

    public class PSetter<S, T, A, B>
  • A Traversal is an optic that allows to see into a structure with 0 to N foci.

    Traversal is a generalization of Traverse and can be seen as a representation of modifyF. All methods are written in terms of modifyF.

    Type parameters: - S: Source. - T: Modified source. - A: Focus. - B: Modified focus.

    See more

    Declaration

    Swift

    open class PTraversal<S, T, A, B>
  • Undocumented

    Declaration

    Swift

    public final class ForFix
  • Undocumented

    See more

    Declaration

    Swift

    public class Fix<A> : FixOf<A>
  • Undocumented

    Declaration

    Swift

    public final class ForMu
  • Undocumented

    See more

    Declaration

    Swift

    open class Mu<F> : MuOf<F>
  • Undocumented

    Declaration

    Swift

    public final class ForNu
  • Undocumented

    See more

    Declaration

    Swift

    public class Nu<F> : NuOf<F>
  • Witness for the Coproduct10 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct10
  • Represents a sum type of 10 different types.

    See more

    Declaration

    Swift

    public final class Coproduct10<A, B, C, D, E, F, G, H, I, J> : Coproduct10Of<A, B, C, D, E, F, G, H, I, J>
  • Witness for the Coproduct2 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct2
  • Represents a sum type of 2 different types.

    See more

    Declaration

    Swift

    public final class Coproduct2<A, B> : Coproduct2Of<A, B>
  • Witness for the Coproduct3 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct3
  • Represents a sum type of 3 different types.

    See more

    Declaration

    Swift

    public final class Coproduct3<A, B, C> : Coproduct3Of<A, B, C>
  • Witness for the Coproduct4 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct4
  • Represents a sum type of 4 different types.

    See more

    Declaration

    Swift

    public final class Coproduct4<A, B, C, D> : Coproduct4Of<A, B, C, D>
  • Witness for the Coproduct5 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct5
  • Represents a sum type of 5 different types.

    See more

    Declaration

    Swift

    public final class Coproduct5<A, B, C, D, E> : Coproduct5Of<A, B, C, D, E>
  • Witness for the Coproduct6 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct6
  • Represents a sum type of 6 different types.

    See more

    Declaration

    Swift

    public final class Coproduct6<A, B, C, D, E, F> : Coproduct6Of<A, B, C, D, E, F>
  • Witness for the Coproduct7 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct7
  • Represents a sum type of 7 different types.

    See more

    Declaration

    Swift

    public final class Coproduct7<A, B, C, D, E, F, G> : Coproduct7Of<A, B, C, D, E, F, G>
  • Witness for the Coproduct8 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct8
  • Represents a sum type of 8 different types.

    See more

    Declaration

    Swift

    public final class Coproduct8<A, B, C, D, E, F, G, H> : Coproduct8Of<A, B, C, D, E, F, G, H>
  • Witness for the Coproduct9 data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoproduct9
  • Represents a sum type of 9 different types.

    See more

    Declaration

    Swift

    public final class Coproduct9<A, B, C, D, E, F, G, H, I> : Coproduct9Of<A, B, C, D, E, F, G, H, I>
  • Witness for the Cofree data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCofree
  • Partial application of the Cofree type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class CofreePartial<F> : Kind<ForCofree, F> where F : Functor
  • Cofree is a type that, given any Functor, is able to provide a Comonad instance, that can be interpreted into a more restrictive one.

    See more

    Declaration

    Swift

    public final class Cofree<F, A> : CofreeOf<F, A> where F : Functor
  • Witness for the Free<F, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForFree
  • Partial application of the Free type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class FreePartial<F> : Kind<ForFree, F> where F : Functor
  • Free is a type that, given any Functor, is able to provide a Monad instance, that can be interpreted into a more restrictive one.

    See more

    Declaration

    Swift

    public final class Free<F, A> : FreeOf<F, A> where F : Functor
  • A transformation between two kinds.

    As Function1<A, B> represents a transformation from A to B, FunctionK<F, G> represents a transformation from Kind<F, A> to Kind<G, A>. Subclasses of FunctionK need to implement invoke.

    See more

    Declaration

    Swift

    open class FunctionK<F, G>
  • Witness for the Program<F, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForProgram
  • Partial application of the Program type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class ProgramPartial<F> : Kind<ForProgram, F>
  • Program is a type that, given any type constructor, is able to provide a Monad instance, that can be interpreted into a more restrictive one.

    As opposed to Free, Program does not require F to be a functor, which means that evaluation of map calls are deferred and left for the later interpretation in another monad.

    See more

    Declaration

    Swift

    public final class Program<F, A> : ProgramOf<F, A>
  • An atomically modifiable reference to a value

    See more

    Declaration

    Swift

    public final class Atomic<A>
  • Kleisli represents a function with the signature (D) -> Kind<F, A>.

    See more

    Declaration

    Swift

    public final class Kleisli<F, D, A> : KleisliOf<F, D, A>
  • Partial application of the Kleisli type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class KleisliPartial<F, D> : Kind2<ForKleisli, F, D>
  • Witness for the Kleisli<F, D, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForKleisli
  • Witness for the IO<E, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForIO
  • Partial application of the IO type constructor, omitting the last parameters.

    See more

    Declaration

    Swift

    public final class IOPartial<E> : Kind<ForIO, E> where E : Error
  • An IO is a data type that encapsulates and suspends side effects producing values of type A or errors of type E.

    See more

    Declaration

    Swift

    public class IO<E, A> : IOOf<E, A> where E : Error
  • Ref is an asynchronous, concurrent mutable reference in the context of F holding a value of type A. Provides safe concurrent access and modification of its content. Refis a purely functional wrapper over an Atomic<A> in context F that is always initialized to a value.

    See more

    Declaration

    Swift

    public class Ref<F, A>
  • Witness for the Resource<F, A> type. To be used in simulated Higher Data Types.

    Declaration

    Swift

    public final class ForResource
  • Partial application of the Resource type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class ResourcePartial<F> : Kind<ForResource, F> where F : Bracket
  • Resource models resource allocation and releasing. It is specially useful when multiple resources that depend on each other need to be acquired and later released in reverse order. Whn a resource is created, one can make use of the use method to run a computation with the resource. The finalizers are guaranteed to run afterwards in reverse order of acquisition.

    See more

    Declaration

    Swift

    public class Resource<F, A> : ResourceOf<F, A> where F : Bracket
  • A stateful, effectful and recurring schedule of actions.

    A schedule consumes values of type A and based on its internal state of type State, decides to continue or stop. Every decision has a delay and an output of type B.

    See more

    Declaration

    Swift

    public class Schedule<R, A, State, B>
  • Witness for the MaybeK<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForMaybeK
  • MaybeK is a Higher Kinded Type wrapper over RxSwift’s Maybe data type.

    See more

    Declaration

    Swift

    public final class MaybeK<A> : MaybeKOf<A>
  • Witness for the ObservableK<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForObservableK
  • ObservableK is a Higher Kinded Type wrapper over RxSwift’s Observable data type.

    See more

    Declaration

    Swift

    public final class ObservableK<A> : ObservableKOf<A>
  • Witness for the SingleK<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForSingleK
  • SingleK is a Higher Kinded Type wrapper over RxSwift’s SingleK data type.

    See more

    Declaration

    Swift

    public final class SingleK<A> : SingleKOf<A>
  • Witness for the Cokleisli<F, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCokleisli
  • Partial application of the Cokleisli type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class CokleisliPartial<F, I> : Kind2<ForCokleisli, F, I>
  • Cokleisli represents a function with the signature (Kind<F, A>) -> B.

    See more

    Declaration

    Swift

    public class Cokleisli<F, A, B> : CokleisliOf<F, A, B>
  • CokleisliK represents a function with the signature (Kind<F, A>) -> B that is polymorphic on A, where F and B are fixed. Subclasses of CokleisliK need to implement invoke.

    See more

    Declaration

    Swift

    open class CokleisliK<F, B>
  • Witness for the Function0<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForFunction0
  • This data type acts as a wrapper over functions that receive no input and produce a value; namely, constant functions. This wrapper gives these functions capabilities to be used as a Higher Kinded Type and conform to typeclasses that have this requirement.

    See more

    Declaration

    Swift

    public final class Function0<A> : Function0Of<A>
  • Witness for the Function1<I, O> data type. To be used in simulated Higher Kinded Types`.

    Declaration

    Swift

    public final class ForFunction1
  • Partial application of the Function1 type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class Function1Partial<I> : Kind<ForFunction1, I>
  • This data type acts as a wrapper over functions. It receives two type parameters representing the input and output type of the function. The wrapper adds capabilities to use a function as a Higher Kinded Type and conform to typeclasses that have this requirement.

    See more

    Declaration

    Swift

    public final class Function1<I, O> : Function1Of<I, O>
  • Witness for the LazyFunction1<I, O> data type. To be used in simulated Higher Kinded Types`.

    Declaration

    Swift

    public final class ForLazyFunction1
  • Partial application of the LazyFunction1 type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class LazyFunction1Partial<I> : Kind<ForLazyFunction1, I>
  • This data type acts as a wrapper over functions, like Function1. As opposed to Function1, function composition is stack-safe. This means that no matter how many LazyFunction1s you compose, calling their composition won’t cause a stack overflow.

    See more

    Declaration

    Swift

    public final class LazyFunction1<I, O> : LazyFunction1Of<I, O>
  • Witness for the CoT<W, M, A> data type. To be used in simulated Higher Kinded Types

    Declaration

    Swift

    public final class ForCoT
  • Partial application of the CoT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class CoTPartial<W, M> : Kind2<ForCoT, W, M> where W : Comonad
  • CoT gives you the best pairing monad transformer for any Comonad W In other words, an explorer for the state space given by W. It can also provide: - A MonadReader from a ComonadEnv - A MonadWriter from a ComonadTraced - A MonadState from a ComonadStore

    See more

    Declaration

    Swift

    public class CoT<W, M, A> : CoTOf<W, M, A> where W : Comonad
  • Coreader is a special case of CoreaderT / Cokleisli where F is Id, so it is equivalent to functions (A) -> B.

    See more

    Declaration

    Swift

    public class Coreader<A, B> : CoreaderT<ForId, A, B>
  • Witness for the Coyoneda data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForCoyoneda
  • Partial application of the Coyoneda type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class CoyonedaPartial<F> : Kind<ForCoyoneda, F>
  • This type implements the dual version of the Yoneda lemma, stating that F is naturally isomorphic to Coyoneda.

    Coyoneda can be viewed as the arguments that we need for the map function.

    See more

    Declaration

    Swift

    public final class Coyoneda<F, A> : CoyonedaOf<F, A>
  • Witness for the Day<F, G, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForDay
  • Partial application of the Day type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class DayPartial<F, G> : Kind2<ForDay, F, G> where F : Comonad, G : Comonad
  • Day convolution of two Functors. It can be seen as the suspended version of a Pairing between Functors F and G, applied to specific values.

    See more

    Declaration

    Swift

    public final class Day<F, G, A> : DayOf<F, G, A> where F : Comonad, G : Comonad
  • Witness for the DictionaryK<K, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForDictionaryK
  • Partial application of the DictionaryK type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class DictionaryKPartial<K> : Kind<ForDictionaryK, K> where K : Hashable
  • DictionaryK is a Higher Kinded Type wrapper over Swift dictionaries.

    See more

    Declaration

    Swift

    public final class DictionaryK<K, A> : DictionaryKOf<K, A> where K : Hashable
  • Witness for the Endo<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEndo
  • Endo represents an Endomorphism; i.e., a function where the input and output type is the same.

    See more

    Declaration

    Swift

    public final class Endo<A> : EndoOf<A>
  • Witness for the Eval<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEval
  • Eval is a data type that describes a potentially lazy computation that produces a value.

    Eval has three different evaluation strategies: - Now: the computation is evaluated immediately. - Later: the computation is evaluated when it is needed (typically by calling Eval.value()), just once. This value is cached, so subsequent invocations do not trigger additional computations of the value. - Always: the computation is evaluated every time it is needed (typically by calling Eval.value()).

    Now is an eager evaluation strategy, whereas Later and Always are lazy.

    See more

    Declaration

    Swift

    public class Eval<A> : EvalOf<A>
  • Encodes the notion of existential type. Exists<F> is a wrapper around a Kind<F, X> value, where X is some type that is not exposed on Exists signature.

    You provide a value of type Kind<F, X> when constructing an Exists<F>instance but the specific type X that you provide is hidden inside Exists. The only way to interact with the content of Exists<F> is with a function of type Kind<F, X> -> R that is polymorphic on X (represented by the CokleisliK<F, R class). You pass a CokleisliK<F, R> to an Exists<F> and the function is called with the specific type that is hidden inside the Exists. This is done with the run method.

    See more

    Declaration

    Swift

    public final class Exists<F>
  • Witness for the Moore<E, V> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForMoore
  • Partial application of the Moore type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class MoorePartial<E> : Kind<ForMoore, E>
  • Moore represents Moore machines that hold values of type V and handle inputs of type E.

    See more

    Declaration

    Swift

    public final class Moore<E, V> : MooreOf<E, V>
  • Witness for the PairK<F, G, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPairK
  • Partial application of the PairK type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class PairKPartial<F, G> : Kind2<ForPairK, F, G>
  • PairK is a product type for kinds. Represents a type where you hold both a Kind<F, A> and a Kind<G, A>.

    See more

    Declaration

    Swift

    public final class PairK<F, G, A> : PairKOf<F, G, A>
  • Witness for the Pairing<F, G> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPairing
  • Partial application of the Pairing type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PairingPartial<F> : Kind<ForPairing, F> where F : Functor
  • The Pairing type represents a relationship between Functors F and G, where the sums in one can annihilate the products in the other.

    The internals of this type embed a function of the following shape: forall a b c. f a -> g b -> (a -> b -> c) -> c Or equivalently: forall a b. f (a -> b) -> g a -> b

    Swift lacks universal quantifiers, so these types are replaced by Any.

    See more

    Declaration

    Swift

    public class Pairing<F, G> : PairingOf<F, G> where F : Functor, G : Functor
  • Witness for the SetK<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForSetK
  • An unordered collection of unique elements, wrapped to act as a Higher Kinded Type.

    See more

    Declaration

    Swift

    public final class SetK<A> : SetKOf<A> where A : Hashable
  • Witness for the Sum<F, G, V> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForSum
  • Partial application of the Sum type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class SumPartial<F, G> : Kind2<ForSum, F, G>
  • The Sum type models a Comonad that contains two different Comonadic values, where only one of them can be selected at a given moment.

    See more

    Declaration

    Swift

    public final class Sum<F, G, V> : SumOf<F, G, V>
  • Witness for the Trampoline<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForTrampoline
  • The Trampoline type helps us overcome stack safety issues of recursive calls by transforming them into loops.

    See more

    Declaration

    Swift

    public final class Trampoline<A> : TrampolineOf<A>
  • Witness for the Tree<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForTree
  • Tree represents a non-empty tree that allows node to have an arbitrary number of children.

    The Foldable instance walks through the tree in depth-first order.

    See more

    Declaration

    Swift

    public final class Tree<A> : TreeOf<A>
  • Witness for the Yoneda data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForYoneda
  • Partial application of the Yoneda type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class YonedaPartial<F> : Kind<ForYoneda, F> where F : Functor
  • This type implements the covariant form of the Yoneda lemma, stating that F is naturally isomorphic to Yoneda.

    Yoneda can be viewed as the partial application of the map function, where the first argument is fixed:

    map :: (F<A>, (A) -> B) -> F<B> Yoneda :: ((A) -> B) -> F<B>

    See more

    Declaration

    Swift

    public final class Yoneda<F, A> : YonedaOf<F, A> where F : Functor
  • Witness for the Zipper<A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForZipper
  • A Zipper is an array of elements focused on a specific element, which lets us move the focus around the array, and retrieve the elements to the left and right of the focus.

    See more

    Declaration

    Swift

    public final class Zipper<A> : ZipperOf<A>
  • Undocumented

    Declaration

    Swift

    public class First
  • Undocumented

    Declaration

    Swift

    public class Last
  • Wrapper class to represent a constant present first option.

    See more

    Declaration

    Swift

    public final class FirstOption<A>
  • Wrapper class to represent a constant present last option.

    See more

    Declaration

    Swift

    public final class LastOption<A>
  • Witness for the EitherT<F, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEitherT
  • Partial application of the EitherT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class EitherTPartial<F, L> : Kind2<ForEitherT, F, L>
  • The EitherT transformer represents the nesting of an Either value inside any other effect. It is equivalent to Kind<F, Either<A, B>>.

    See more

    Declaration

    Swift

    public final class EitherT<F, A, B> : EitherTOf<F, A, B>
  • Witness for the EnvT<E, W, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForEnvT
  • Partial application of the EnvT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class EnvTPartial<E, W> : Kind2<ForEnvT, E, W>
  • The environment Comonad Transformer. This Comonad Transformer extends the context of a value in the base Comonad with a global environment.

    See more

    Declaration

    Swift

    public final class EnvT<E, W, A> : EnvTOf<E, W, A>
  • Witness for the OptionT<F, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForOptionT
  • Partial application of the OptionT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class OptionTPartial<F> : Kind<ForOptionT, F>
  • The OptionT transformer represents the nesting of an Option value inside any other effect. It is equivalent to Kind<F, Option<A>>.

    See more

    Declaration

    Swift

    public final class OptionT<F, A> : OptionTOf<F, A>
  • Witness for the StoreT<S, W, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForStoreT
  • Partial application of the StoreT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class StoreTPartial<S, W> : Kind2<ForStoreT, S, W>
  • The Store Comonad Transformer. This Comonad Transformer extends the context of a value in the base Comonad so that it depends on a position of the type of the state.

    See more

    Declaration

    Swift

    public final class StoreT<S, W, A> : StoreTOf<S, W, A>
  • Witness for the TracedT<M, W, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForTracedT
  • Partial application of the TracedT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class TracedTPartial<M, W> : Kind2<ForTracedT, M, W>
  • The cowriter Comonad Transformer. This Comonad Transformer extends the context of a value in the base Comonad so that the value depends on a monoidal position.

    See more

    Declaration

    Swift

    public final class TracedT<M, W, A> : TracedTOf<M, W, A>
  • Witness for the WriterT<F, W, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForWriterT
  • Partial application of the WriterT type constructor, omitting the last parameter.

    See more

    Declaration

    Swift

    public final class WriterTPartial<F, W> : Kind2<ForWriterT, F, W>
  • WriterT transformer represents operations that accumulate values through a computation or effect, without reading them.

    See more

    Declaration

    Swift

    public final class WriterT<F, W, A> : WriterTOf<F, W, A>
  • A binding expression is one of the instructions of the form x <- fx in a monad comprehension.

    In a binding expression of the form x <- fx, x is the variable to be bound and fx is the monadic effect that we want to bind to the variable.

    Declaration

    Swift

    public class BindingExpression<F> where F : Monad
  • A bound variable is a variable to be used in a monad comprehesion to bind the produced values by a monadic effect.

    See more

    Declaration

    Swift

    public class BoundVar<F, A> where F : Monad