Skip to content

don't re-export Data.Word from Data.Binary #78

@mzero

Description

@mzero

Data.Binary is small enough, and exports names that are unique enough, that it can commonly be simply imported wholesale:

import Data.Binary

However, this also happens to re-export Data.Word, which is surprising, and generates a warning from GHC, if code that uses it also imports Data.Word:

Import Data.Binary
Import Data.Word

yields:

src/Foo.hs:7:1: Warning:
     The import of ‘Data.Word’ is redundant
      except perhaps to import instances from ‘Data.Word’
    To import instances alone, use: import Data.Word()

In a module that uses both Binary and Word explicitly, it makes for poor developer experience to rely on Data.Binary to export the names from Data.Word. If you move the Data.Binary dependent code out of the module, and delete the import - the remaining Data.Word code doesn't compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions