Classes

The following classes are available globally.

  • 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> : GetterOf<S, A>
  • Witness for the Getter<S, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForGetter
  • Partial application of the Getter type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class GetterPartial<S> : Kind<ForGetter, S>
  • 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> : FoldOf<S, A>
  • Witness for the Fold<S, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForFold
  • Partial application of the Fold type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class FoldPartial<S> : Kind<ForFold, S>
  • 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>
  • 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.

    See more

    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.

    See more

    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.

    See more

    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.

    See more

    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>
  • Witness for the PIso<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPIso
  • Partial application of the PIso type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PIsoPartial<S, T, A> : Kind3<ForPIso, S, T, A>
  • 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> : PIsoOf<S, T, A, B>
  • Witness for the PLens<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPLens
  • Partial application of the PLens type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PLensPartial<S, T, A> : Kind3<ForPLens, S, T, A>
  • 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> : PLensOf<S, T, A, B>
  • Witness for the POptional<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPOptional
  • Partial application of the POptional type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class POptionalPartial<S, T, A> : Kind3<ForPOptional, S, T, A>
  • An Optional is an optic that allows to see into a structure and getting, setting or modifying an optional focus.

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

    A POptional 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 POptional (if present) or the original value.

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

    See more

    Declaration

    Swift

    public class POptional<S, T, A, B> : POptionalOf<S, T, A, B>
  • Witness for the PPrism<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPPrism
  • Partial application of the PPrism type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PPrismPartial<S, T, A> : Kind3<ForPPrism, S, T, A>
  • 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> : PPrismOf<S, T, A, B>
  • Witness for the PSetter<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPSetter
  • Partial application of the PSetter type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PSetterPartial<S, T, A> : Kind3<ForPSetter, S, T, A>
  • 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> : PSetterOf<S, T, A, B>
  • Witness for the PTraversal<S, T, A, B> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForPTraversal
  • Partial application of the PTraversal type constructor, omitting the last parameter.

    Declaration

    Swift

    public final class PTraversalPartial<S, T, A> : Kind3<ForPTraversal, S, T, A>
  • 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> : PTraversalOf<S, T, A, B>
  • 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 MaybeK<A> data type. To be used in simulated Higher Kinded Types.

    See more

    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 SingleK<A> data type. To be used in simulated Higher Kinded Types.

    See more

    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>
  • Witness for the Function0<A> data type. To be used in simulated Higher Kinded Types.

    See more

    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>
  • 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 Kleisli<F, D, A> data type. To be used in simulated Higher Kinded Types.

    Declaration

    Swift

    public final class ForKleisli
  • 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>
  • 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>
  • 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 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.

    Declaration

    Swift

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

    See more

    Declaration

    Swift

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

    See more

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