3 ms·
Anything declared in Elm is immutable so types on constants become way less relevant.
by hashbig 7y ago
Anything declared in Elm is immutable so types on constants become way less relevant.
- crimsonalucard 7y agoType variables are not what you're thinking. add :: Int -> Int -> Int add a b = a + b add2 :: a -> a -> a add2 c d = c + d 1st function adds integers. 2nd function adds anything that can be added. For example: add2 [1,2,3] [4,5,6] evaluates to [1,2,3,4,5,6] The 'a' in the second function is a type variable.