Module

Run.Halogen

Package
purescript-run-halogen
Repository
sigilion/purescript-run-halogen

#_halogen Source

_halogen :: SProxy "halogen"

#HALOGEN Source

type HALOGEN state action slots output m = FProxy (HalogenF state action slots output m)

#runHalogen Source

runHalogen :: forall m output slots action state. (Run (halogen :: HALOGEN state action slots output m)) ~> (HalogenM state action slots output m)

de-variant an effect stack containing only the halogen effect, so that it can be used for query/action evaluation

#handleStateHalogen Source

handleStateHalogen :: forall r m output slots action state. Functor m => (State state) ~> (Run (halogen :: HALOGEN state action slots output m | r))

Inner NT for runStateHalogen

#runStateHalogen Source

runStateHalogen :: forall a r m output slots action state. Functor m => Run (halogen :: HALOGEN state action slots output m, state :: STATE state | r) a -> Run (halogen :: HALOGEN state action slots output m | r) a

Convert State effects to use the state of the halogen component.

#_effect Source

_effect :: SProxy "effect"

#runEffectHalogen Source

runEffectHalogen :: forall a r m output slots action state. MonadEffect m => Run (effect :: EFFECT, halogen :: HALOGEN state action slots output m | r) a -> Run (halogen :: HALOGEN state action slots output m | r) a

Lifts the "effect" effect into HalogenF, so that you can use runHalogen

#_aff Source

_aff :: SProxy "aff"

#runAffHalogen Source

runAffHalogen :: forall a r m output slots action state. MonadAff m => Run (aff :: AFF, halogen :: HALOGEN state action slots output m | r) a -> Run (halogen :: HALOGEN state action slots output m | r) a

Lifts the "aff" effect into HalogenF, so that you can use runHalogen

#query Source

query :: forall _1 a slot output' query slots label m output action state. Cons label (Slot query output' slot) _1 slots => IsSymbol label => Ord slot => SProxy label -> slot -> query a -> HalogenF state action slots output m (Maybe a)

The query function from Halogen.Query.HalogenM without the Free wrapper, so it can be put into a variant.

#handleChildHalogen Source

handleChildHalogen :: forall _1 output' f slots label r m output action state. Cons label (Slot f output' Unit) _1 slots => Functor m => IsSymbol label => SProxy label -> f ~> (Run (except :: FAIL, halogen :: HALOGEN state action slots output m | r))

Inner NT for runChildHalogen

#runChildHalogen Source

runChildHalogen :: forall a r' _1 output' f slots label r m output action state. Cons label (Slot f output' Unit) _1 slots => Cons label (FProxy f) (except :: FAIL, halogen :: HALOGEN state action slots output m | r) r' => Functor m => IsSymbol label => SProxy label -> Run r' a -> Run (except :: FAIL, halogen :: HALOGEN state action slots output m | r) a

For certain effects in the Run effect stack it can be useful to evaluate it using a component with the effect algebra as its query algebra, and using the effect id as the component slot id (with Unit as the index). runChildHalogen automates that.

Modules
Run.Halogen