Link Search Menu Expand Document

ReaderObservable overview

Added in v0.6.6


Table of contents


Alt

alt

Identifies an associative operation on a type constructor. It is similar to Semigroup, except that it applies to types of kind * -> *.

Signature

export declare const alt: <R, A>(
  that: () => ReaderObservable<R, A>
) => (fa: ReaderObservable<R, A>) => ReaderObservable<R, A>

Added in v0.6.7

Applicative

of

Signature

export declare const of: <R, A>(a: A) => ReaderObservable<R, A>

Added in v0.6.6

Apply

ap

Apply a function to an argument under a type constructor.

Signature

export declare const ap: <R, A>(
  fa: ReaderObservable<R, A>
) => <B>(fab: ReaderObservable<R, (a: A) => B>) => ReaderObservable<R, B>

Added in v0.6.6

Compactable

compact

Signature

export declare const compact: <R, A>(fa: ReaderObservable<R, O.Option<A>>) => ReaderObservable<R, A>

Added in v0.6.7

separate

Signature

export declare const separate: <R, A, B>(
  fa: ReaderObservable<R, E.Either<A, B>>
) => Separated<ReaderObservable<R, A>, ReaderObservable<R, B>>

Added in v0.6.7

Filterable

filter

Signature

export declare const filter: {
  <A, B extends A>(refinement: Refinement<A, B>): <R>(fa: ReaderObservable<R, A>) => ReaderObservable<R, B>
  <A>(predicate: Predicate<A>): <R>(fa: ReaderObservable<R, A>) => ReaderObservable<R, A>
}

Added in v0.6.7

filterMap

Signature

export declare const filterMap: <A, B>(
  f: (a: A) => O.Option<B>
) => <R>(fa: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.7

partition

Signature

export declare const partition: {
  <A, B extends A>(refinement: Refinement<A, B>): <R>(
    fa: ReaderObservable<R, A>
  ) => Separated<ReaderObservable<R, A>, ReaderObservable<R, B>>
  <A>(predicate: Predicate<A>): <R>(
    fa: ReaderObservable<R, A>
  ) => Separated<ReaderObservable<R, A>, ReaderObservable<R, A>>
}

Added in v0.6.7

partitionMap

Signature

export declare const partitionMap: <A, B, C>(
  f: (a: A) => E.Either<B, C>
) => <R>(fa: ReaderObservable<R, A>) => Separated<ReaderObservable<R, B>, ReaderObservable<R, C>>

Added in v0.6.7

Functor

map

map can be used to turn functions (a: A) => B into functions (fa: F<A>) => F<B> whose argument and return types use the type constructor F to represent some computational context.

Signature

export declare const map: <A, B>(f: (a: A) => B) => <R>(fa: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.6

Monad

chain

Signature

export declare const chain: <R, A, B>(
  f: (a: A) => ReaderObservable<R, B>
) => (ma: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.6

chainW

Less strict version of chain.

Signature

export declare const chainW: <A, R2, B>(
  f: (a: A) => ReaderObservable<R2, B>
) => <R1>(ma: ReaderObservable<R1, A>) => ReaderObservable<R1 & R2, B>

Added in v0.6.12

combinators

apFirst

Combine two effectful actions, keeping only the result of the first.

Derivable from Apply.

Signature

export declare const apFirst: <R, B>(
  fb: ReaderObservable<R, B>
) => <A>(fa: ReaderObservable<R, A>) => ReaderObservable<R, A>

Added in v0.6.6

apSecond

Combine two effectful actions, keeping only the result of the second.

Derivable from Apply.

Signature

export declare const apSecond: <R, B>(
  fb: ReaderObservable<R, B>
) => <A>(fa: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.6

chainFirst

Composes computations in sequence, using the return value of one computation to determine the next computation and keeping only the result of the first.

Derivable from Monad.

Signature

export declare const chainFirst: <R, A, B>(
  f: (a: A) => ReaderObservable<R, B>
) => (ma: ReaderObservable<R, A>) => ReaderObservable<R, A>

Added in v0.6.6

chainIOK

Signature

export declare const chainIOK: <A, B>(f: (a: A) => IO<B>) => <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.6

chainTaskK

Signature

export declare const chainTaskK: <A, B>(
  f: (a: A) => Observable<B>
) => <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>

Added in v0.6.6

flatten

Derivable from Monad.

Signature

export declare const flatten: <R, A>(mma: ReaderObservable<R, ReaderObservable<R, A>>) => ReaderObservable<R, A>

Added in v0.6.6

fromIOK

Signature

export declare const fromIOK: <A extends unknown[], B>(f: (...a: A) => IO<B>) => <R>(...a: A) => ReaderObservable<R, B>

Added in v0.6.6

fromObservableK

Signature

export declare const fromObservableK: <A extends unknown[], B>(
  f: (...a: A) => Observable<B>
) => <R>(...a: A) => ReaderObservable<R, B>

Added in v0.6.6

local

Signature

export declare const local: <R2, R1>(f: (f: R2) => R1) => <A>(ma: ReaderObservable<R1, A>) => ReaderObservable<R2, A>

Added in v0.6.6

constructors

ask

Signature

export declare const ask: <R>() => ReaderObservable<R, R>

Added in v0.6.6

asks

Signature

export declare const asks: <R, A = never>(f: (r: R) => A) => ReaderObservable<R, A>

Added in v0.6.6

fromIO

Signature

export declare const fromIO: <E, A>(fa: IO<A>) => ReaderObservable<E, A>

Added in v0.6.6

fromObservable

Signature

export declare const fromObservable: <E, A>(fa: Observable<A>) => ReaderObservable<E, A>

Added in v0.6.6

fromOption

Signature

export declare const fromOption: <R, A>(o: O.Option<A>) => ReaderObservable<R, A>

Added in v0.6.6

fromReader

Signature

export declare const fromReader: <R, A = never>(ma: R.Reader<R, A>) => ReaderObservable<R, A>

Added in v0.6.6

fromReaderTask

Signature

export declare const fromReaderTask: <R, A>(ma: ReaderTask<R, A>) => ReaderObservable<R, A>

Added in v0.6.9

fromTask

Signature

export declare const fromTask: <E, A>(fa: Task<A>) => ReaderObservable<E, A>

Added in v0.6.6

instances

Alt

Signature

export declare const Alt: Alt2<'ReaderObservable'>

Added in v0.6.12

Alternative

Signature

export declare const Alternative: Alternative2<'ReaderObservable'>

Added in v0.6.12

Applicative

Signature

export declare const Applicative: Applicative2<'ReaderObservable'>

Added in v0.6.12

Apply

Signature

export declare const Apply: Apply2<'ReaderObservable'>

Added in v0.6.12

Compactable

Signature

export declare const Compactable: Compactable2<'ReaderObservable'>

Added in v0.6.12

Filterable

Signature

export declare const Filterable: Filterable2<'ReaderObservable'>

Added in v0.6.12

Functor

Signature

export declare const Functor: Functor2<'ReaderObservable'>

Added in v0.6.12

Monad

Signature

export declare const Monad: Monad2<'ReaderObservable'>

Added in v0.6.12

MonadIO

Signature

export declare const MonadIO: MonadIO2<'ReaderObservable'>

Added in v0.6.12

MonadObservable

Signature

export declare const MonadObservable: MonadObservable2<'ReaderObservable'>

Added in v0.6.12

MonadTask

Signature

export declare const MonadTask: MonadTask2<'ReaderObservable'>

Added in v0.6.12

URI

Signature

export declare const URI: 'ReaderObservable'

Added in v0.6.6

URI (type alias)

Signature

export type URI = typeof URI

Added in v0.6.6

getMonoid

Signature

export declare const getMonoid: <R, A>() => Monoid<ReaderObservable<R, A>>

Added in v0.6.6

readerObservable

Signature

export declare const readerObservable: Monad2<'ReaderObservable'> &
  Alternative2<'ReaderObservable'> &
  Filterable2<'ReaderObservable'> &
  MonadObservable2<'ReaderObservable'>

Added in v0.6.6

model

ReaderObservable (interface)

Signature

export interface ReaderObservable<R, A> {
  (r: R): Observable<A>
}

Added in v0.6.6

utils

Do

Signature

export declare const Do: ReaderObservable<unknown, {}>

Added in v0.6.12

bind

Signature

export declare const bind: <K extends string, R, A, B>(
  name: Exclude<K, keyof A>,
  f: (a: A) => ReaderObservable<R, B>
) => (fa: ReaderObservable<R, A>) => ReaderObservable<R, { [P in K | keyof A]: P extends keyof A ? A[P] : B }>

Added in v0.6.11

bindTo

Signature

export declare const bindTo: <K extends string, R, A>(
  name: K
) => (fa: ReaderObservable<R, A>) => ReaderObservable<R, { [P in K]: A }>

Added in v0.6.11

bindW

Signature

export declare const bindW: <K extends string, R2, A, B>(
  name: Exclude<K, keyof A>,
  f: (a: A) => ReaderObservable<R2, B>
) => <R1>(
  fa: ReaderObservable<R1, A>
) => ReaderObservable<R1 & R2, { [P in K | keyof A]: P extends keyof A ? A[P] : B }>

Added in v0.6.12

run

Signature

export declare const run: <R, A>(ma: ReaderObservable<R, A>, r: R) => Promise<A>

Added in v0.6.6

toReaderTask

Signature

export declare const toReaderTask: <R, A>(ma: ReaderObservable<R, A>) => ReaderTask<R, A>

Added in v0.6.6

toReaderTaskOption

Signature

export declare const toReaderTaskOption: <R, A>(ma: ReaderObservable<R, A>) => ReaderTask<R, O.Option<A>>

Added in v0.6.15

zero

Signature

export declare const zero: <E, A>() => ReaderObservable<E, A>

Added in v0.6.12