|
|
|
|
|
by IshKebab
3927 days ago
|
|
Off-topic, but why are Haskell's function signatures written like this? function_name :: Param1Type -> Param2Type -> Param3Type -> ReturnType
To me that just makes no sense. There's no way to logically "read" it. The natural way would be "function_name converts a Param1Type into a Param2Type and then ... what?! Is this a chain of functions?"Why not have something sensible like this? function_name :: Param1Type, Param2Type, Param3Type -> ReturnType
|
|
So we can have a function which takes a single parameter which is a tuple :
Or we can have a function which takes a single parameter and returns another function: Using implied operator precedence, the later is written: And has to be distinguished from a function which takes a function as parameter: