Hello,
Hello,
I disagree with your example.
Functional dependencies are not used to pick types, they are used to
> 1. Check that an instance is consistent with itself. For example, this
> should be rejected:
>
> instance C a b
>
> because it allows C Int Bool and C Int Char which violate the functional
> dependency.
pick instances.
class C a b | a → b where
k ∷ a
f ∷ a → Maybe b
The functional dependency allows you to have a method such as k that
doesn't use all the arguments of the class.
I expect to be able to make a instance that works for any b.
instance C Int b where
k = 2
f _ = Nothing
Etienne Laurin