-
Notifications
You must be signed in to change notification settings - Fork 21
add ?~> and ?:= combinators #11
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
Conversation
These combinators are not necessary since |
It has different behaviour, for this example it would result in: {
"color": "#ff0000",
"backgroundColor": null
} |
Ah, I see, so this is |
My goal was to preserve semantic, in Javascript, there is a difference between I've seen similar combinators in original argonaut https://github.com/argonaut-io/argonaut/blob/master/src/main/scala/argonaut/Json.scala#L159. |
OK, looks good. Can you add another example to README.md on how to use these combinators? |
OK, I will wait for #10 |
Before this gets merged, I was thinking about these operators the other day. Maybe it would make sense to keep the same combinator names as the scala version, including changing the names of the combinators that are already there. It would probably be less jarring to people coming here from there. They should all be valid in ps. |
That sounds good to me. |
I'm not quite familiar with haskell infix operator naming conventions, as I got the idea from sources question mark should be placed next to (?xx) :: forall a. Maybe a -> a -> a
(xx?) :: forall a. a -> Maybe a -> a
(?xx?) :: forall a. a -> Maybe a -> Maybe a -> a There is (?>>=) :: forall a b. Maybe a -> String -> Either String a What do you think? @jdegoes @joneshf So changes are |
Probably prefixing with |
@kanterov Can you resolve conflicts? |
Closing as resolved by purescript-contrib/purescript-argonaut-codecs#38 |
Example usage
If
backgroundColor
isNothing
, it results into