[GHC] #15988: Remove Text.Printf and System.Console.GetOpt from base

GHC ghc-devs at haskell.org
Sun Dec 2 20:13:04 UTC 2018


#15988: Remove Text.Printf and System.Console.GetOpt from base
-------------------------------------+-------------------------------------
           Reporter:  andrewthad     |             Owner:  (none)
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:  8.6.3
          Component:  Compiler       |           Version:  8.6.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This was touched on in brief in a recent mailing list thread found at
 https://mail.haskell.org/pipermail/libraries/2018-October/029012.html. I
 propose removing `Text.Printf` and `System.Console.GetOpt` from `base` and
 moving them into their own packages named `printf` and `getopt` that would
 be managed by the haskell github organization. These two libraries, when
 built against newer versions of base, would provide the modules. When
 built against old versions of base, they would simply reexport the
 modules. There would be breakage from doing this, but libraries and
 applications that use these APIs would only need to add a single line to
 `build-depends` to continue being compatible with all versions of `base`.

 The benefits of doing this are small. As a matter of principle, it seems
 unfair that these two APIs are blessed by being a part of base when the
 would likely struggle to compete if they were in ordinary libraries. In
 particular, `printf` is less idiomatic and performs worse that the
 functions from `Numeric` (like `showFFloat`), but its prominent position
 in `base` encourages users to overlook the more type-safe options
 available for formatting numbers.

 More practically, the size of base does occassionally cause problems. In
 https://github.com/haskell/primitive/issues/218#issuecomment-443534850,
 Carter writes

 > base getting bigger actually hurts folk, eg, base recently got big
 enough that dwarf data gnerated by ghc at -g1 is now sooo much that you
 can't do a dwarf annotated build of base on mac OS X! anymore

 Moving these APIs out of `base` makes a small step toward addressing this
 problem.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15988>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list