Not only will we need to give our initial state to a Redux store, we will also need to be able to reset our state at any time by dispatching an action. We can get the best of both worlds by having a function that will return an object with all of our…
We have the ability to select a single random card from a pile of twelve cards, but we would like to pull a total of nine. Not only that, we would like to match the same transition functions we have been writing all along. Lucky for use there are thr…
Using Naive JS: const {modify, get} = require('crocks/State'); const K = require('crocks/combinators/constant'); const B = require('crocks/combinators/composeB'); const assign = require('crocks/helpers/assign'); const prop = require('crocks/Maybe/pro…
When we start to accumulate functions that all work on a given datatype, we end up creating a bunch of boilerplate code in almost every function to handle the changes we need to make to our records’ values. This can lead to not only undesirable boile…
Functor composition is a powerful concept that arises when we have one Functor nested in another Functor. It becomes even more powerful when both of those are Chains, allowing us to apply each Functor’s special properties and effects for a given comp…
While sometimes outside input can have influence on how a given stateful transaction transitions, there are many times where the current state at the time of a transaction. We can see the power of this type of transaction by seeing what it would take…
Recently, I am learning Working with ADT. Got some extra thought about State Monad. Basiclly how to thinking in State. First, we need to know the type of State: State returns Pair with Unit on the left, and state on the right: State(state => Pair(Uni…
The true power of the State ADT really shows when we start combining our discrete, stateful transactions. We start looking at another construction helper named of, used to lift any given value of any type into the resultant. We also explore another i…
For example we have a component, it needs to call 'react-redux' connect function. import { compose, curry, option, propPath } from '../js/helper' const FilterButton = ({ active, onClick }) => { const classes = classnames('filterButton', { 'filterButt…
Stateful computations require the ability for their state to change overtime. We take a look on one way to replace the state portion of our stateful datatype with a value. We explore the mechanics of how this can be accomplished and introduce the put…