Closed texastoland closed 5 years ago
MonadError
Direct port from PureScript Prelude (that's a good criteria for inclusion) with tests for any relevant laws from the ErrorControl article. That version isn't idiomatic OCaml and will be superseded by algebraic effects. I could see it in a future version of bs-effects however. See more in https://github.com/janestreet/ppx_let/issues/8#issuecomment-419695038.
ErrorControl
MonadZero
Direct port from PureScript Prelude. The primary use case is filtering list/array comprehensions.
let factors n -> let%bind a = 0 -- n let%bind b = 0 -- a let%bind () = guard(a * b == n) (a, b)
Unfoldable
--
Direct port from purescript-unfoldable (related to Foldable in bs-abstract). PureScript implements a generic range for Unfoldable1 and .. operator for specialized versions. It might be nice to specialize for arrays and lists but we should benchmark if so. Belt also implements range for arrays (but not lists). The operator (inspired by Batteries) is simply let (--) = Belt.Array.range.
Foldable
range
Unfoldable1
..
let (--) = Belt.Array.range
MonadError
Direct port from PureScript Prelude (that's a good criteria for inclusion) with tests for any relevant laws from the
ErrorControl
article. That version isn't idiomatic OCaml and will be superseded by algebraic effects. I could see it in a future version of bs-effects however. See more in https://github.com/janestreet/ppx_let/issues/8#issuecomment-419695038.MonadZero
Direct port from PureScript Prelude. The primary use case is filtering list/array comprehensions.
Unfoldable
and generic--
Direct port from purescript-unfoldable (related to
Foldable
in bs-abstract). PureScript implements a genericrange
forUnfoldable1
and..
operator for specialized versions. It might be nice to specialize for arrays and lists but we should benchmark if so. Belt also implementsrange
for arrays (but not lists). The operator (inspired by Batteries) is simplylet (--) = Belt.Array.range
.