Nice, every language should have a Result/Either Monad.
Why not make it a functor too and add map()?
ok(1) |> map(fn v -> v + 1 end)
# ok(2)
Of course you can also make it a bifunctor by implementing bimap().
And what about filter()?
Why not make it a functor too and add map()?
ok(1) |> map(fn v -> v + 1 end)
# ok(2)
Of course you can also make it a bifunctor by implementing bimap().
And what about filter()?
Honestly it was made just to scratch an itch I had for a while.