This package provides typeclasses for creating typed, generic folds over records.
As an example it also provides few utility functions:
applyTo
applies record of functions to a valuecollect
collect record ofApplicative
to anApplicative
containing record of valueslength
computes amount of fields in recordrMap
maps type constructor over recordrShow
transforms record withShow
-able fields intoArray (Tuple String String)
(types are subject to change)
In order to define a new fold, first define Stepper
datatype which will be a proxy determining
which instance of Step
should be used by Fold
. The Stepper
must implement Step
class.
Please note that the result of step
function must be a Category
for Fold
to work.