When newcomers to PureScript see some code for the first time, there's a 90% chance that the first comment will be something like, "What does
$ do?", or "
f <$> a <*> b? Wat?". This library is for people wondering exactly that.
Prelude is fine, but it's a bit... well, monotone. Wouldn't it look better if they were a little more... fabulous? 🦄 Let's look at some of the common operators with more panache. 🎩✨
Below is a table of short explanations. For a more fully-formed write-up (and some explanation as to why these symbols were chosen), see the actual code.
||Map the function to the left over the
||Apply the functor-wrapped function on the left to the functor-wrapped value on the right.|
||Pass the left-hand "inner value" into the right-hand function.|
||Return a function that takes a value, applies it to the right-hand function, and then applies it to the left-hand function.|
||Apply the result of the expression to the left to the expression on the right.|
||"Pre-process" a value for a
||The emoji should tell you this probably isn't the function you want...|
|🆚||-||An alias for the
|♊||-||An alias for the
|💱||-||An alias for the
f <$> a <*> b scarier than
f 🚂(a)🚋(b)🚋(c)? If so, why?
The functions may look unfamiliar, especially the infix symbols, but
they're not that scary. Above are all the common symbols, with enough
of an explanation to get you following along with any code you see.
And, of course, if in doubt, ask the community! Send me a tweet, join an IRC forum, whatever. Get involved. This library's documentation is available on Pursuit, where you'll be able to read some more in-depth explanations of some of what we've seen.
Have I missed anything you think belongs? Send a PR!
With ❤️ 💛 💚 💙 💜 🖤 from Tom 🏁