[Haskell-cafe] Question related to Multi Param Type Classes

Ryan Ingram ryani.spam at gmail.com
Mon May 5 14:51:41 EDT 2008


On 5/5/08, Brandon S. Allbery KF8NH <allbery at ece.cmu.edu> wrote:
> 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


More information about the Haskell-Cafe mailing list