You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, back when Pair was creates some horrible things were done, just to get that darn of.
Some cruft needs to be cut from Pair:
Remove of
Remove value
Add toArray
add pairToArray transformation
add pairToList transformation
EDIT: After some long, hard thought on this, decided to keep the Semigroup constraint for ap, chain and concat. They do in fact provide much value for things like a cheap Writer (which is just a Product type with a Semigroup in its fst.
The text was updated successfully, but these errors were encountered:
Okay so after starting this change, turns out I will not be adding pairToArray and pairToList and will not add toArray to the Pair. While it is valid in JS, by allowing to move from Pair to Array or List, then we lose some of the benefits of having a List/Array of a single type.
since there will be special handling anyway, it makes sense to let the user use merge to make it a one "action" thing to map and extract into a value they have control over. For example, if they want to create an array like [ fst, snd ], then they can easily do things like this:
So, back when
Pair
was creates some horrible things were done, just to get that darnof
.Some cruft needs to be cut from
Pair
:of
value
AddtoArray
addpairToArray
transformationaddpairToList
transformationEDIT: After some long, hard thought on this, decided to keep the
Semigroup
constraint forap
,chain
andconcat
. They do in fact provide much value for things like a cheapWriter
(which is just a Product type with aSemigroup
in itsfst
.The text was updated successfully, but these errors were encountered: