Module

WAGS.Control.Thunkable

Package
purescript-wags
Repository
mikesol/purescript-wags

#Thunkable Source

data Thunkable a

Thunkable is the Trampoline moand with some extra typeclasses like Alt and Plus and some extra utility methods for thunking.

Constructors

Instances

#isWait Source

isWait :: forall a. Thunkable a -> Boolean

Returns true if the Thunkable is a Wait, else false.

#isHere Source

isHere :: forall a. Thunkable a -> Boolean

Returns true if the Thunkable is a Here, else false.

#runThunkable Source

runThunkable :: forall a. Thunkable a -> a

Runs a thunkable to produce an a. Same as runTrampoline.

#runThunkableWithCount Source

runThunkableWithCount :: forall a. Thunkable a -> Tuple Int a

Runs a thunkable to produce an a, counting how many "thunks" were needed.

#thunkThunkable Source

thunkThunkable :: forall a. Thunkable a -> Thunkable a

Thunks a thunkable once, producing a new thunkable. Same as runFree.

#monadifyThunkable Source

monadifyThunkable :: forall m. Monad m => Thunkable ~> m

A natural transformation from Thunkable to any monad m. Same as foldFree.

#intercalateThunkable Source

intercalateThunkable :: forall m. Monad m => m Unit -> Thunkable ~> m

A natural transformation from Thunkable to any monad m that inserts m Unit in between thunks.

#affifyThunkable Source

affifyThunkable :: Thunkable ~> Aff

A natural transformation from Thunkable to Aff that guarantees the Wait operation will resume on the next tick of a browser or node event loop.

#Waitable Source

class Waitable f  where

Waitable is a something that can be told to wait.

Members

  • wait :: forall a. a -> f a

Instances