ReadonlyTuple
Instances
- Bifunctor
- Comonad
- Foldable
- Functor
- Semigroupoid
- Traversable
- getApplicative
- getApply
- getChain
- getChainRec
- getMonad
Error handling
Extract
Folding
Mapping
Traversing
Type lambdas
Utilities
Instances
Bifunctor
Signature
export declare const Bifunctor: Bifunctor2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Comonad
Signature
export declare const Comonad: Comonad2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Foldable
Signature
export declare const Foldable: Foldable2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Functor
Signature
export declare const Functor: Functor2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Semigroupoid
Signature
export declare const Semigroupoid: Semigroupoid2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Traversable
Signature
export declare const Traversable: Traversable2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
getApplicative
Signature
export declare function getApplicative<M>(M: Monoid<M>): Applicative2C<URI, M>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
getApply
Signature
export declare function getApply<S>(S: Semigroup<S>): Apply2C<URI, S>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
getChain
Signature
export declare function getChain<S>(S: Semigroup<S>): Chain2C<URI, S>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
getChainRec
Signature
export declare function getChainRec<M>(M: Monoid<M>): ChainRec2C<URI, M>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
getMonad
Signature
export declare function getMonad<M>(M: Monoid<M>): Monad2C<URI, M>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Error handling
mapLeft
Alias of mapSnd
.
Signature
export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(fa: readonly [A, E]) => readonly [A, G]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Extract
extract
Signature
export declare const extract: <E, A>(wa: readonly [A, E]) => A
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Folding
foldMap
Signature
export declare const foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => <E>(fa: readonly [A, E]) => M
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
reduce
Signature
export declare const reduce: <A, B>(b: B, f: (b: B, a: A) => B) => <E>(fa: readonly [A, E]) => B
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
reduceRight
Signature
export declare const reduceRight: <A, B>(b: B, f: (a: A, b: B) => B) => <E>(fa: readonly [A, E]) => B
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Mapping
bimap
Map a pair of functions over the two type arguments of the bifunctor.
Signature
export declare const bimap: <E, G, A, B>(
mapSnd: (e: E) => G,
mapFst: (a: A) => B,
) => (fa: readonly [A, E]) => readonly [B, G]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
flap
Signature
export declare const flap: <A>(a: A) => <E, B>(fab: readonly [(a: A) => B, E]) => readonly [B, E]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
map
Alias of mapFst
.
Signature
export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: readonly [A, E]) => readonly [B, E]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
mapFst
Map a function over the first component of a ReadonlyTuple
.
This is the map
operation of the Functor
instance.
Signature
export declare const mapFst: <A, B>(f: (a: A) => B) => <E>(fa: readonly [A, E]) => readonly [B, E]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
mapSnd
Map a function over the second component of a ReadonlyTuple
.
This is the mapLeft
operation of the Bifunctor
instance.
Signature
export declare const mapSnd: <E, G>(f: (e: E) => G) => <A>(fa: readonly [A, E]) => readonly [A, G]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Traversing
sequence
Signature
export declare const sequence: Traversable2<URI>['sequence']
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
traverse
Signature
export declare const traverse: PipeableTraverse2<URI>
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Type lambdas
URI
Signature
export type URI = typeof URI
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
URI
Signature
export declare const URI = 'ReadonlyTuple'
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
Utilities
compose
Signature
export declare const compose: <A, B>(ab: readonly [B, A]) => <C>(bc: readonly [C, B]) => readonly [C, A]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
duplicate
Signature
export declare const duplicate: <E, A>(wa: readonly [A, E]) => readonly [readonly [A, E], E]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
extend
Signature
export declare const extend: <E, A, B>(f: (wa: readonly [A, E]) => B) => (wa: readonly [A, E]) => readonly [B, E]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
fst
Signature
export declare function fst<A, E>(ea: readonly [A, E]): A
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
readonlyTuple
readonlyTuple
This instance is deprecated, use small, specific instances instead. For example if a function needs a Functor
instance, pass RT.Functor
instead of RT.readonlyTuple
Signature
export declare const readonlyTuple: Semigroupoid2<URI> &
Bifunctor2<URI> &
Comonad2<URI> &
Foldable2<URI> &
Traversable2<URI>
Details
- Added in 0.1.0
- Deprecated
License
- MIT – Copyright (c) 2017-present Giulio Canti
snd
Signature
export declare function snd<A, E>(ea: readonly [A, E]): E
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti
swap
Signature
export declare const swap: <A, E>(ea: readonly [A, E]) => readonly [E, A]
Details
- Added in 0.1.0
License
- MIT – Copyright (c) 2017-present Giulio Canti