Module

Pha.Action

Package
purescript-pha
Repository
gbagan/purescript-pha

#Action Source

type Action st effs = Action' st effs Unit

#Action' Source

type Action' st effs a = Run (getState :: GETSTATE st, setState :: SETSTATE st | effs) a

#getState Source

getState :: forall st r. Run (getState :: GETSTATE st | r) st

return the current state

#setState Source

setState :: forall st r. (st -> st) -> Run (setState :: SETSTATE st | r) Unit

evaluate a function over the current state and set the result to the state

#setState' Source

setState' :: forall effs st. (st -> st) -> Run (getState :: GETSTATE st, setState :: SETSTATE st | effs) st

same as setState except it returns the current state after applying the function

#GETSTATE Source

type GETSTATE st = FProxy (GetState st)

#SETSTATE Source

type SETSTATE st = FProxy (SetState st)

#GetState Source

data GetState st a

Constructors

Instances

#SetState Source

data SetState st a

Constructors

Instances