Module

Control.Promise

Package
purescript-aff-promise
Repository
nwolverson/purescript-aff-promise

#Promise Source

data Promise :: Type -> Type

Type of JavaScript Promises (with particular return type) Effects are not traced in the Promise type, as they form part of the Eff that results in the promise.

#fromAff Source

fromAff :: forall a eff. Aff eff a -> Eff eff (Promise a)

Convert an Aff into a Promise.

#toAff Source

toAff :: forall a eff. Promise a -> Aff eff a

Convert a Promise into an Aff. When the promise rejects, we attempt to coerce the error value into an actual JavaScript Error object. We can do this with Error objects or Strings. Anything else gets a "dummy" Error object.

#toAffE Source

toAffE :: forall a eff. Eff eff (Promise a) -> Aff eff a

Utility to convert an Eff returning a Promise into an Aff (i.e. the inverse of fromAff)