Just two handy Transformers...well Transformations...
When working through a couple example of how to filter and transform without using reduce on Arrays and Lists, I found that a lot of value could be adding with some maybeToX transformations. The basically will take a Maybe to either a List or an Array. A Just instance will return a single element structure, containing the value in the original Just. While a Nothing returns an empty structure.
When used with chain this can be used to filter and transform a structures values in one go, without having to set up a mapReduce with alt to get the same result.
In addition to adding these functions and their documentation, Also added a couple links to the Result NTs and cleaned up some specs that suffered from :policeman:-y :spaghetti: artifacts.
Coverage remained the same at 100.0% when pulling 17a85ff990bc5714fb412aa89ba4d313fcc60998 on feat/maybe-list-nt into fb312d870580809a8aaf335185960f80785c3d10 on master.
Coverage remained the same at 100.0% when pulling c839a5d456b9656af87269dd9bd59189597847e2 on feat/maybe-list-nt into fb312d870580809a8aaf335185960f80785c3d10 on master.
Just two handy Transformers...well Transformations...
When working through a couple example of how to filter and transform without using reduce on
Array
s andList
s, I found that a lot of value could be adding with somemaybeToX
transformations. The basically will take aMaybe
to either aList
or anArray
. AJust
instance will return a single element structure, containing the value in the originalJust
. While aNothing
returns an empty structure.When used with
chain
this can be used to filter and transform a structures values in one go, without having to set up amapReduce
withalt
to get the same result.In addition to adding these functions and their documentation, Also added a couple links to the
Result
NTs and cleaned up some specs that suffered from :policeman:-y :spaghetti: artifacts.