How to write applicative style code? #1036
tojoqk
started this conversation in
Ideas and Proposals
Replies: 1 comment
-
For method 4, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems that Coalton does not provide a way to write Applicative Style code easier, now. Sometimes Applicative is better than Monad. An example is the Validation type. So, I think we need an easy way to write Applicative Style code.
I have considered how to write Applicative Style code. Which method would you prefer?
Method 1. Write Applicative Style code directly
In this case, Coalton should provide
<*>
function.Method 2. Use
pipe
and flipped<*>
In this case, Coalton should provide flipped
<*>
function.Method 3. Use macro for binary operations
In this case, Coalton should provide
<*>
function andleft-op
syntax.Method 4. Use macro for applicative style
In this case, Coalton should provide
ap-apply
syntax.Beta Was this translation helpful? Give feedback.
All reactions