sanctuary-js / sanctuary-def

Run-time type system for JavaScript
MIT License
294 stars 23 forks source link

Catch breaking of monad laws with chain() #166

Closed dakom closed 7 years ago

dakom commented 7 years ago

Consider this example:

S.chain(S.Left, S.Just("x"));

This is illegal due to the mismatched types, but Sanctuary returns a Left("x") instead of throwing an error

davidchambers commented 7 years ago

This used to work. I believe #152 introduced the regression.