4 ms·
You are correct, which is why I said "[I]t's not 100% identical". Although I can read Purescript reasonably well I'm not so proficient writing it (I do most of
by noelwelsh 6y ago
You are correct, which is why I said "[I]t's not 100% identical".
Although I can read Purescript reasonably well I'm not so proficient writing it (I do most of my programming in a different FP language, so I understand the concepts but not the specifics.) I didn't attempt to modify the code I pulled from the example because it would take more time than I have to install Purescript and check my modifications.
It would be simple to add this functionality. This equivalent of the `counterType` would be an algebraic data type, defined looking something like
data counterType = Increment | Decrement
and usage something like
case counterType of
Increment -> ... make increment here ...
Decrement -> ... make decrement here ...