4 ms·
> Well, in an actual functional programming language like PureScript or Haskell we can: > > sum :: [Int] -> Int > sum = foldl (+) 0 > > The list canno
by yokohummer7 10y ago
> Well, in an actual functional programming language like PureScript or Haskell we can:
>
> sum :: [Int] -> Int
> sum = foldl (+) 0
>
> The list cannot be undefined, cannot be null.
Yes it can?
main = putStr "The result is: " >> print (sum undefined)
The result is:
Program error: Prelude.undefined
So by the same logic Haskell doesn't have pure functions, either?