External Publication
Visit Post

Why aren't modules prefixed their package name?

Haskell Community [Unofficial] May 1, 2026
Source

Making unprefixed module names the default has allowed for much smoother migrations when modules enter or leave major libraries. Off the top of my head, I can think of package semigroups, which incubated Data.Semigroup and Data.List.NonEmpty before they entered base, and package attoparsec-aeson, which holds aeson’s old attoparsec-based parse.

I think it’s a useful feature, and if you plan to strictly qualify your identifiers including by package name, you might need to think about how to get similar effects in your module system.

I’m a bit surprised by the amount of people who seem to be in favour of “if A depends on B depends on C, then A should be able to import from C” as a general principle. C could be an implementation detail of B, in which case A should have no right to import from C unless it also depends on it directly.

Discussion in the ATmosphere

Loading comments...