This PR defines Map and Seq constructors for Freer in an attempt to enable optimization by analyzing subsequent values.
A few of the mechanisms operating over Seq are defined by rewriting the Seq as a Then; this includes the Traversable instance (because this would require splitting the Seq up into separate values, necessarily parameterized by different types), and also project & therefore iterFreer. Unfortunately, this means that sequenceA . sequenceA /= id (which in fairness is generally the case, e.g. for Maybe), project . embed /= id, &c.
This PR defines
Map
andSeq
constructors forFreer
in an attempt to enable optimization by analyzing subsequent values.A few of the mechanisms operating over
Seq
are defined by rewriting theSeq
as aThen
; this includes theTraversable
instance (because this would require splitting theSeq
up into separate values, necessarily parameterized by different types), and alsoproject
& thereforeiterFreer
. Unfortunately, this means thatsequenceA . sequenceA /= id
(which in fairness is generally the case, e.g. forMaybe
),project . embed /= id
, &c.