commercialhaskell / rio

A standard library for Haskell
Other
838 stars 54 forks source link

RIO module exports words :: String -> [String] #221

Open malte-v opened 4 years ago

malte-v commented 4 years ago

I get this error message when importing both RIO and RIO.Text:

Ambiguous occurrence `words'
It could refer to
   either `RIO.words',
          imported from `RIO' at /home/malte/testing/reflex-stack/backend/src/Backend.hs:3:1-27
          (and originally defined in `base-4.13.0.0:Data.OldList')
       or `RIO.Text.words',
          imported from `RIO.Text' at /home/malte/testing/reflex-stack/backend/src/Backend.hs:11:18-22
          (and originally defined in `Data.Text')

Since RIO seems to encourage the use of Text instead of String, I think we should not export the words function from base.

snoyberg commented 4 years ago

The RIO.Text module is intended to be imported qualified. I'm on the fence about whether words should ideally be exported as is from RIO, but given that the naming conflict shouldn't cause a problem with recommended usage, and the overhead of breaking changes, I lean towards leaving as is.