4 ms·
What would an error look like if I misused $ or &? And yes, compilers hold a user’s hand in most languages (including PHP with type hints :) ).
by dmitriid 7y ago
What would an error look like if I misused $ or &?
And yes, compilers hold a user’s hand in most languages (including PHP with type hints :) ).
- lalaithion 7y ago• Couldn't match expected type ‘([Integer] -> [Integer]) -> [b]’ with actual type ‘[Integer]’ • Possible cause: ‘map’ is applied to too many arguments In the second argument of ‘(&)’, namely ‘map (* 2) [1, 2, 3]’ In the second argument of ‘($)’, namely ‘map (+ 2) & map (* 2) [1, 2, 3]’ In the expression: map (+ 2) $ map (+ 2) & map (* 2) [1, 2, 3]
- dmitriid 7y agoIn my opinion this doesn’t help much.
- mbrodersen 7y agoOf course not. You have to learn how the type system works to get it.