New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flipped infix withDefault (?) operator from Maybe.Extra (aka the existential operator) #206

Closed
rehno-lindeque opened this Issue Apr 2, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@rehno-lindeque
Contributor

rehno-lindeque commented Apr 2, 2015

Following @evancz's comments here https://github.com/circuithub/elm-array-extra/pull/1#issuecomment-88966985 I thought there should be an issue here for discussion.

The question that remains appears to be what precedence the ? operator should have. Here's how it is defined in Maybe.Extra at the moment:

{-| Flipped, infix version of `withDefault`.
    head [] ? 0 == 0
-}
(?) : Maybe a -> a -> a
mx ? x = withDefault x mx

Anecdotaly, the default operator precedence for new operators has worked pretty well for me so far if that's any help...

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Oct 28, 2015

Member

Let's move this to #216

Member

evancz commented Oct 28, 2015

Let's move this to #216

@evancz evancz closed this Oct 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment