Haskell: functions and values -


i beginner in haskell , have problem def of functions in haskell. values functions in haskell, right? (+3) 3 = 6 (+3) (+3) mean. (+3) counts value ?

(+3) (+3) type error and, therefore, won't compile.

the type of (+3) int -> int, means when applying int, int. means you can apply values of type int!

so, can't apply (+3) value of type int -> int, values of type int.

so yes, (+3) value, not of right type apply function expects value of type int.

int can't unified int -> int because have different type constructor, makes them different types, pointed out @danielwagner. outermost constructor of int -> int -> while outermost constructor of int int. sufficient 2 types have different outermost constructor considering them different.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -