[Haskell-beginners] Replace instances of module

Pv aquagnu at gmail.com
Mon Jan 8 13:20:20 UTC 2018


Hello, all.

Is it possible to import all types except some of instances and to
re-defined hiding instances, so resulting (new) module will be the same
types, mostly the same instances, but some of instances will be
replaced?

I tried to import all hiding interesting type, then to import
interesting type without instances, but when I redefine its instances I
get error about duplication of them:

  import Old hiding (MyType)
  import Old (MyType)

  instance ... MyType where <-- error!!

Interesting that in Old module I'm exporting MyType without instances:

  module (... , MyType, ...) where

Goal is to replace some instances and may be some types instead of
copy-paste all module (something like patching or inheritance of
module).


===
Best regards, Paul


More information about the Beginners mailing list