3 ms·
So you want something like `eitherContramap :: (b -> Either ErrMsg a) -> ValidationRule a -> ValidationRule b` we could define this as follows eitherContr
by belevy 5y ago
So you want something like `eitherContramap :: (b -> Either ErrMsg a) -> ValidationRule a -> ValidationRule b`
we could define this as follows
eitherContramap f rule = ValidationRule $ \b ->
either failure (validate rule) (f b)