Benefit of importing specific parts of a Haskell module

前端 未结 2 1617
眼角桃花
眼角桃花 2021-01-12 16:03

Except from potential name clashes -- which can be got around by other means -- is there any benefit to importing only the parts from a module that you need:



        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-12 16:56

    No, it's only for the purpose of preventing name clashes. The other mechanism for preventing name clashes - namely import qualified - results in more verbose (less readable) code.

    It wouldn't make the binary smaller - consider that functions in a given module all reference each other, usually, so they need to be compiled together.

提交回复
热议问题