Re:Why Does “=” Mean Assignment?
by Tarean on Wednesday April 11, 2018 @01:23AM
(#16808287)
I have mixed feelings on this. On one hand I did want this notation while learning haskell. Partly because there are a bunch of places in haskell's type system where repeating a variable implicitly gives equality constraints.
On the other hand something like
drop _ [] = []
drop x (y:xs)
| x == y = drop x xs
| otherwise = y : drop x xs
is often more readable at a glance to me since I don't have to parse variable names to see control flow structures.
Also, in statically typed languages what happens if equality doesn't work for a value.
On the other hand something like
is often more readable at a glance to me since I don't have to parse variable names to see control flow structures.Also, in statically typed languages what happens if equality doesn't work for a value.