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
Post a Comment