Proposal for a flipped infix version of map
wild-lotus opened this issue · comments
Carlos commented
What do you think of a convenience flipped infix version of map
?
(?>) : Maybe a -> (a -> b) -> Maybe b
(?>) maybe f =
Maybe.map f maybe
I find it useful for example to query maybe records :
maybeRecord : Maybe { a : a }
maybeRecord = ...
maybeRecord ?> .a
Christopher Wilson commented
I think it seems pretty reasonable. Any other opinions?
In any case, it's worth making a PR.
Chadtech commented
Whats the use case where this would be useful?
Seems like as easily as you would write maybeRecord ?> .id
you could write Maybe.map .id maybeRecord
Sky Rose commented
No longer possible with 0.19's restrictions on infix functions.