
27 Jan
2016
27 Jan
'16
3:41 a.m.
Thank you Guillaume fun deps are new for me too. quoting from the above wiki link: -- Read as: "container" type determines "elem" type. class Extract container elem | container -> elem where extract :: container -> elem The functional dependency "container -> elem" promises that we won't declare multiple instances with the same "container" type. Without the functional dependency, both instances above would be allowed, and the type of v would be potentially ambiguous. Even if only one instance is defined, the type system will not figure it out without the functional dependency.