Classes

The following classes are available globally.

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

    Declaration

    Swift

    public final class ForPIso
  • Undocumented

    Declaration

    Swift

    public final class PIsoPartial<S, T, A> : Kind3<ForPIso, S, T, A>
  • Undocumented

    See more

    Declaration

    Swift

    public class PIso<S, T, A, B> : PIsoOf<S, T, A, B>
  • 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 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
  • 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 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>
  • Undocumented

    See more

    Declaration

    Swift

    public class AtFromIso<M, N, O, P, AtType> : At where N == AtType.I, O == AtType.A, P == AtType.S, AtType : At
  • 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>
  • Undocumented

    Declaration

    Swift

    public final class ForIO
  • Undocumented

    See more

    Declaration

    Swift

    public final class IOPartial<E> : Kind<ForIO, E> where E : Error
  • Undocumented

    See more

    Declaration

    Swift

    public class IO<E, A> : IOOf<E, A> where E : Error
  • 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 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 class Kleisli<F, D, A> : KleisliOf<F, D, A>
  • 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>
  • 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>
  • 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 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>
  • 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 class EitherK<F, G, A> : EitherKOf<F, G, A>
  • 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>
  • 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 class Ior<A, B> : IorOf<A, B>
  • 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
  • State is a convenience data type over the StateT transformer, when the effect is Id.

    See more

    Declaration

    Swift

    public class State<S, A> : StateOf<S, 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 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 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 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 class WriterT<F, W, A> : WriterTOf<F, W, A>