
Am 07.05.2014 10:49, schrieb Joachim Breitner:
Hi,
Am Mittwoch, den 07.05.2014, 08:33 +0200 schrieb Henning Thielemann:
Am 07.05.2014 01:03, schrieb John Lato:
I don't really care one way or the other how this is resolved, but does it strike anyone else that current practices must be remarkably fragile for such a minor change (which doesn't even change exported names!) to supposedly cause so much breakage?
With qualified imports there would be no breakage ...
However, names in mtl and thus transformers were not designed for qualified import. :-(
would it?
/tmp $ echo 'module Foo where newtype Foo = Foo {unFoo :: ()}' > Foo.hs /tmp $ echo 'module Bar where import qualified Foo (Foo(..)) ; bar = Foo.unFoo' > Bar.hs
With qualified import I mean import qualified Foo as Foo Importing qualified with explicit import list is somehow done twice, because Foo.unFoo cannot clash with other identifiers, unless you use the abbreviation Foo twice.
/tmp $ ghc -c Foo.hs; ghc -c Bar.hs /tmp $ echo 'module Foo where newtype Foo = Foo (); unFoo (Foo x) = x ' > Foo.hs /tmp $ ghc -c Foo.hs; ghc -c Bar.hs
Bar.hs:1:57: Not in scope: `Foo.unFoo'