# CoT

``public class CoT<W, M, A> : CoTOf<W, M, A> where W : Comonad``

• ``` fix(_:) ```

Safe downcast.

#### Declaration

Swift

``public static func fix(_ value: CoTOf<W, M, A>) -> CoT<W, M, A>``

#### Parameters

 ``` value ``` Value in the higher-kind form.

#### Return Value

Value cast to CoT.

• ``` liftT(_:) ```

Lifts a comonadic query into a CoT.

The original signature of this function is: `(forall s. w s -> a) -> CoT w m a`

#### Declaration

Swift

``public static func liftT(_ f: @escaping (Kind<W, Any/*S*/>) -> A) -> CoT<W, M, A>``

#### Parameters

 ``` f ``` Comonadic query.

#### Return Value

A CoT from the Comonadic query.

• ``` init(_:) ```

Initializes a CoT. It embeds a function with the signature: `forall r. w (a -> m r) -> m r`

#### Declaration

Swift

``public init(_ cow: @escaping /*forall R.*/(Kind<W, (A) -> Kind<M, /*R*/Any>>) -> Kind<M, /*R*/Any>)``

#### Parameters

 ``` cow ``` Inner function of this CoT.
• ``` runT(_:) ```

Runs the inner function.

#### Declaration

Swift

``public func runT<R>(_ w: Kind<W, (A) -> Kind<M, R>>) -> Kind<M, R>``

#### Parameters

 ``` w ``` Argument for the inner function.

#### Return Value

Value in the base Monad context.

• ``` hoistT(_:) ```

Performs a natural transformation on the Comonad of this CoT.

#### Declaration

Swift

``public func hoistT<V>(_ transform: FunctionK<V, W>) -> CoT<V, M, A> where V : Comonad``

#### Parameters

 ``` transform ``` Natural transformation.

#### Return Value

A new CoT with the transformed Comonad.

• ``` lowerT(_:) ```

Runs the inner function with a value that does not runs on the base Monad.

#### Declaration

Swift

``func lowerT<B>(_ input: Kind<W, B>) -> Kind<M, A>``

#### Parameters

 ``` input ``` A value in the Comonad context.

#### Return Value

A value in the base Monad context.

• ``` select(_:_:) ```

#### Declaration

Swift

``````static func select<A, B>(
_ co: Co<W, (A) -> B>,
_ wa: Kind<W, A>) -> Kind<W, B>``````

#### Parameters

 ``` co ``` Monadic actions to explore the Comonad. ``` wa ``` Comonadic space to explore.

#### Return Value

A new Comonadic space resulting from the exploration.

• ``` lift(_:) ```

Lifts a comonadic query into a CoT.

The original signature of this function is: `(forall s. w s -> a) -> Co w a`

#### Declaration

Swift

``static func lift(_ f: @escaping (Kind<W, Any>) -> A) -> Co<W, A>``

#### Parameters

 ``` f ``` Comonadic query.

#### Return Value

A Co from the Comonadic query.

• ``` pair() ```

#### Declaration

Swift

``static func pair() -> Pairing<W, CoPartial<W>>``

#### Return Value

The pairing between the underlying comonad, W, and the monad `Co<w>`.

• ``` run(_:) ```

Runs the inner function.

#### Declaration

Swift

``func run<R>(_ w: Kind<W, (A) -> R>) -> R``

#### Parameters

 ``` w ``` Argument for the inner function.

#### Return Value

A plain value.

• ``` hoist(_:) ```

Performs a natural transformation on the Comonad of this Co.

#### Declaration

Swift

``func hoist<V>(_ transform: FunctionK<V, W>) -> Co<V, A> where V : Comonad``

#### Parameters

 ``` transform ``` Natural transformation.

#### Return Value

A new Co with the transformed Comonad.

• ``` lower(_:) ```

Runs the inner function with a value that does not runs on the base Monad.

#### Declaration

Swift

``func lower<B>(_ input: Kind<W, B>) -> A``

#### Parameters

 ``` input ``` A value in the Comonad context.

#### Return Value

A plain value.