Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
linearize :: (Integral sf, Integral st) => (a -> sf) -> (st -> a -> b) -> [a] -> Either (a, a) (Maybe (a, [b])) Source #
Linearize some list of a
s.
For non-empty lists, the result is a tuple of the first a
, followed by the
linearized a
s (converted to b
). Linearized values are non-negative, so
natural-like types are safe to use for st
.