Module

React.Explore.Sum

Package
purescript-react-explore
Repository
paf31/purescript-react-explore

#Sum Source

data Sum f g a

The Sum of two comonads, which allows us to be in one state or the other at a time, remembering the other state. We can also move from one state to the other using the moveLeft and moveRight actions.

Constructors

Instances

#moveLeft Source

moveLeft :: forall g f. Comonad f => Co (Sum f g) Unit

Move to the left state.

#moveRight Source

moveRight :: forall g f. Comonad g => Co (Sum f g) Unit

Move to the right state.

#liftLeft Source

liftLeft :: forall a g f. Co f a -> Co (Sum f g) a

Lift an action to act on the left state.

#liftRight Source

liftRight :: forall a g f. Co g a -> Co (Sum f g) a

Lift an action to act on the right state.

#combine Source

combine :: forall w2 w1. Comonad w1 => Comonad w2 => Component w1 -> Component w2 -> Component (Sum w1 w2)

Combine two components, starting in the left state.