You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When renaming we want to give class methods and the methods in the instances different ids. Example:
classFunctorfwherefmap::...-- (1)instanceFunctorMaybewherefmap=...-- (2)
f x y z =...fmap...-- (3)
Here the fmaps in (1) and (3) should have the same id, but (2) should have a different id.
This is to be able to type check (2) against a different type than the fmap in (1). Type of (1) is Functor f => (a -> b) -> f a -> f b, while type of (2) is (a -> b) -> Maybe a -> Maybe b.
This much should be working fine and we have some tests. However the right-hand sides of instance methods are probably not renamed correctly. For example:
When renaming we want to give class methods and the methods in the instances different ids. Example:
Here the
fmap
s in (1) and (3) should have the same id, but (2) should have a different id.This is to be able to type check (2) against a different type than the
fmap
in (1). Type of (1) isFunctor f => (a -> b) -> f a -> f b
, while type of (2) is(a -> b) -> Maybe a -> Maybe b
.This much should be working fine and we have some tests. However the right-hand sides of instance methods are probably not renamed correctly. For example:
Here I think the
show
in the right-hand side will have the id (2), but it should have the id (1) otherwise we can't type checkmap show l
.We should start by adding a test.
The text was updated successfully, but these errors were encountered: