Link Search Menu Expand Document

ObservableOption overview

Added in v0.6.14


Table of contents


Apply

ap

Apply a function to an argument under a type constructor.

Signature

export declare const ap: <A>(fa: ObservableOption<A>) => <B>(fab: ObservableOption<(a: A) => B>) => ObservableOption<B>

Added in v0.6.14

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) => (fa: ObservableOption<A>) => ObservableOption<B>

Added in v0.6.14

Monad

chain

Signature

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

Added in v0.6.14

combinators

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: <A>(onNone: () => ObservableOption<A>) => (ma: ObservableOption<A>) => ObservableOption<A>

Added in v0.6.14

apFirst

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

Derivable from Apply.

Signature

export declare const apFirst: <B>(fb: ObservableOption<B>) => <A>(fa: ObservableOption<A>) => ObservableOption<A>

Added in v0.6.14

apSecond

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

Derivable from Apply.

Signature

export declare const apSecond: <B>(fb: ObservableOption<B>) => <A>(fa: ObservableOption<A>) => ObservableOption<B>

Added in v0.6.14

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: <A, B>(
  f: (a: A) => ObservableOption<B>
) => (ma: ObservableOption<A>) => ObservableOption<A>

Added in v0.6.14

flatten

Derivable from Monad.

Signature

export declare const flatten: <A>(mma: ObservableOption<ObservableOption<A>>) => ObservableOption<A>

Added in v0.6.14

constructors

fromIO

Signature

export declare const fromIO: <A = never>(ma: IO<A>) => ObservableOption<A>

Added in v0.6.14

fromObservable

Signature

export declare const fromObservable: <A = never>(ma: Observable<A>) => ObservableOption<A>

Added in v0.6.14

fromTask

Signature

export declare const fromTask: <A>(fa: Task<A>) => ObservableOption<A>

Added in v0.6.14

none

Signature

export declare const none: ObservableOption<never>

Added in v0.6.14

some

Signature

export declare const some: <A>(a: A) => ObservableOption<A>

Added in v0.6.14

tryCatch

Signature

export declare const tryCatch: <A>(a: Observable<A>) => ObservableOption<A>

Added in v0.6.14

destructors

fold

Signature

export declare const fold: <A, B>(
  onNone: () => Observable<B>,
  onSome: (a: A) => Observable<B>
) => (ma: ObservableOption<A>) => Observable<B>

Added in v0.6.14

getOrElse

Signature

export declare const getOrElse: <A>(onNone: () => Observable<A>) => (ma: ObservableOption<A>) => Observable<A>

Added in v0.6.14

instances

Alt

Signature

export declare const Alt: Alt1<'ObservableOption'>

Added in v0.6.14

Applicative

Signature

export declare const Applicative: Applicative1<'ObservableOption'>

Added in v0.6.14

Apply

Signature

export declare const Apply: Apply1<'ObservableOption'>

Added in v0.6.14

Functor

Signature

export declare const Functor: Functor1<'ObservableOption'>

Added in v0.6.14

Monad

Signature

export declare const Monad: Monad1<'ObservableOption'>

Added in v0.6.14

MonadIO

Signature

export declare const MonadIO: MonadIO1<'ObservableOption'>

Added in v0.6.14

MonadObservable

Signature

export declare const MonadObservable: MonadObservable1<'ObservableOption'>

Added in v0.6.14

MonadTask

Signature

export declare const MonadTask: MonadTask1<'ObservableOption'>

Added in v0.6.14

URI

Signature

export declare const URI: 'ObservableOption'

Added in v0.6.14

URI (type alias)

Signature

export type URI = typeof URI

Added in v0.6.14

model

ObservableOption (interface)

Signature

export interface ObservableOption<A> extends Observable<O.Option<A>> {}

Added in v0.6.14

utils

Do

Signature

export declare const Do: ObservableOption<{}>

Added in v0.6.14

bind

Signature

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

Added in v0.6.14

bindTo

Signature

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

Added in v0.6.14

filterOrElse

Derivable from MonadThrow.

Signature

export declare const filterOrElse: {
  <A, B extends A>(refinement: Refinement<A, B>): (ma: ObservableOption<A>) => ObservableOption<B>
  <A>(predicate: Predicate<A>): (ma: ObservableOption<A>) => ObservableOption<A>
}

Added in v0.6.14

fromOption

Derivable from MonadThrow.

Signature

export declare const fromOption: <A>(ma: O.Option<A>) => ObservableOption<A>

Added in v0.6.14

fromPredicate

Derivable from MonadThrow.

Signature

export declare const fromPredicate: {
  <A, B extends A>(refinement: Refinement<A, B>): (a: A) => ObservableOption<B>
  <A>(predicate: Predicate<A>): (a: A) => ObservableOption<A>
}

Added in v0.6.14

of

Signature

export declare const of: <A>(a: A) => ObservableOption<A>

Added in v0.6.14