I was looking through some game code written in Haskell using the GLUT library and this operator keeps popping out everywhere. The worst part is it's completely ungooglable and I can't seem to grep out the definition of it anywhere.
Could someone point out where it is defined and what does it actually do?
("dollar equals" in the title is for future Google'ability)
The dollar sign, $ , is a controversial little Haskell operator. Semantically, it doesn't mean much, and its type signature doesn't give you a hint of why it should be used as often as it is. It is best understood not via its type but via its precedence.
The ++ operator is the list concatenation operator which takes two lists as operands and "combines" them into a single list.
in goes along with let to name one or more local expressions in a pure function.
"The period is a function composition operator. In general terms, where f and g are functions, (f . g) x means the same as f (g x).
It is un-googleable, but not un-hoogleable!
In the StateVar package, the following is defined:
class HasSetter s where -- class of all writable state variables.
($=) :: s a -> a -> IO ()
Write a new value into a state variable.
So it is the 'write' operator for settable (mutable) values. Particularly as used in OpenGL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With