haskell - Syntax for importing methods of type classes -
i noticed ghc doesn't complain if import (or export) methods of type classes directly:
import prelude (signum)
as opposed using "constructor" syntax:
import prelude (num(signum))
because of this, assumed former syntax ok , went it. however, ran odd issue frominteger
, former syntax doesn't work -- ghc accept silently, complain later frominteger
never exported in first place. did happen stumble upon unspecified behavior in language?
here's minimal test case:
-- a.hs module (frominteger) import prelude (frominteger) -- b.hs module b import prelude () import f = frominteger
Comments
Post a Comment