Prepend the value to a monoid for use in right-to-left reduction
Append the value to a monoid for use in left-to-right reduction
Unfold to the left using this value as initial seed.
Unfold to the left using this value as initial seed.
Example:
0.unfoldl(i => if (i < 5) just((i+1, i.toString)) else empty[(Int, String)]).to[List] = List(4, 3, 2, 1, 0)
Unfold to the right using this value as initial seed Example:
Unfold to the right using this value as initial seed Example:
0.unfoldr(i => if (i < 5) just((i.toString, i+1)) else empty[(String, Int)]).to[List] = List(0, 1, 2, 3, 4)
Convert the value into a monoid