
5 May
2008
5 May
'08
2:51 p.m.
On 5/5/08, Brandon S. Allbery KF8NH
The functional dependency "MyString m c | m -> c" tells GHC that any specific "m" determines a specific "c". It doesn't matter what the type is here, since it's not used in the definition of compareStr; but it must be possible to know that the same "c" is being used in both arguments. Given this, it can fix "MyString m c" knowing only "m" and as a result the function typechecks.
Although this still makes it impossible to call zEquals for the same reason; you need a dependency in both directions for it to make sense. -- ryan