Adding the operators counterpart #67
Replies: 6 comments 1 reply
-
We're definitely interested in closing the gap here. Prelude's been our fast/loose space to experiment, whereas Overture currently represents an introductory culmination of some core concepts. One vision of the future from here. I think we'd like to refine/simplify Prelude to the point where it's just a combination of @_exported import Overture
@_exported import Opera It might take awhile to get there, though. In the meantime, having an extra module in here that just defines the operators could work. Then it's a matter of changing |
Beta Was this translation helpful? Give feedback.
-
I might be missing something, but what's |
Beta Was this translation helpful? Give feedback.
-
Ah, sorry to be confusing! That's just a theoretical name for a module that provides symbol operators 😄 |
Beta Was this translation helpful? Give feedback.
-
I see! 😅 In any case, for now, I will provide my own operators on top of Overture then. |
Beta Was this translation helpful? Give feedback.
-
Going to move to a discussion for any further...discussion. Thanks Rui! 👁️🗨️ |
Beta Was this translation helpful? Give feedback.
-
For anyone interested in operators for the current You can check out the tests for some examples. Because I'm re-exporting Overture, you can take the following: import Overture
let inc: (Int) -> Int = { $0 + 1 }
let double: (Int) -> Int = { $0 * 2 }
let incAndDouble = pipe(inc, double) and turn it into this: import Rhapsody
let inc: (Int) -> Int = { $0 + 1 }
let double: (Int) -> Int = { $0 * 2 }
let incAndDouble = inc >>> double You can still use any Overture functions like |
Beta Was this translation helpful? Give feedback.
-
Small intro, before getting to the point:
From some of tweets @stephencelis sent and the overall idea of this library, is to make FP more accessible. There is also this tweet:
There is indeed a big difference between them, both in terms of size, but also necessary knowledge to use one over the other.
What I propose is to provide the operators counterparts of these functions (e.g.
pipe
,composition
). When anOverture
user feels confident about using operators, he/she can still useOverture
to make that switch, instead of importingPrelude
.In my particular case, I use a very small subset of what
Prelude
provides, soOverture
actually makes sense for my use case. Not having operators, is upsetting.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions