Module

Effect.Aff.Compat

This module provides compatability functions for constructing Affs which are defined via the FFI.

#EffectFnCb

#fromEffectFnAff

fromEffectFnAff :: EffectFnAff ~> Aff

Lift a FFI definition into an Aff. EffectFnAff makes use of EffectFn so Effect thunks are unnecessary. A definition might follow this example:

exports._myAff = function (onError, onSuccess) {
  var cancel = doSomethingAsync(function (err, res) {
    if (err) {
      onError(err);
    } else {
      onSuccess(res);
    }
  });
  return function (cancelError, onCancelerError, onCancelerSuccess) {
    cancel();
    onCancelerSuccess();
  };
};
foreign import _myAff :: EffectFnAff String

myAff :: Aff String
myAff = fromEffectFnAff _myAff

Re-exports from Effect.Uncurried

#EffectFn3

data EffectFn3 :: Type -> Type -> Type -> Type -> Type

Instances

#EffectFn2

data EffectFn2 :: Type -> Type -> Type -> Type

Instances

#EffectFn1

data EffectFn1 :: Type -> Type -> Type

Instances

#runEffectFn3

runEffectFn3 :: forall a b c r. EffectFn3 a b c r -> a -> b -> c -> Effect r

#runEffectFn2

runEffectFn2 :: forall a b r. EffectFn2 a b r -> a -> b -> Effect r

#runEffectFn1

runEffectFn1 :: forall a r. EffectFn1 a r -> a -> Effect r

#mkEffectFn3

mkEffectFn3 :: forall a b c r. (a -> b -> c -> Effect r) -> EffectFn3 a b c r

#mkEffectFn2

mkEffectFn2 :: forall a b r. (a -> b -> Effect r) -> EffectFn2 a b r

#mkEffectFn1

mkEffectFn1 :: forall a r. (a -> Effect r) -> EffectFn1 a r

Modules