3 ms·
Nice simple demo Sridatta! Nobody likes the tilde-arrow lift syntax! The last line could be rewritten as follows. Does anybody think it's better or worse? I te
by johnpmayer 13y ago
Nice simple demo Sridatta!
Nobody likes the tilde-arrow lift syntax! The last line could be rewritten as follows. Does anybody think it's better or worse? I tend to prefer it, though many don't like it.
main = lift2 display Window.dimensions <| lift renderState gameState
main = display <~ Window.dimensions ~ (renderState <~ gameState)
Signals exhibit the characteristics of an applicative functor, after all, so pure functions of any arity can be lifted without needing to think if you're using lift2, lift3, etc.
- groovy2shoes 13y agoI really like the tilde syntax for lift. I make good use of it in my own code. From a notational point of view, I like how it reflects that the Signals are, in a sense, being piped into my functions.
- wheatBread 13y agoI never use it in examples, but mainly because of feedback that I get. When I use them, beginners tell me they can't figure out what's going on. When I don't use them, no one tells me things! :) So for a beginner text, I think it's reasonable.