[GHC] #9542: GHC-IO-Handle-Text.hPutStr' and writeBlocks look like they need refactoring

GHC ghc-devs at haskell.org
Tue Sep 2 15:59:03 UTC 2014


#9542: GHC-IO-Handle-Text.hPutStr' and writeBlocks look like they need refactoring
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  task        |           Status:  new
              Priority:  normal      |        Milestone:
             Component:              |          Version:  7.8.2
  libraries/base                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 There are probably actually some list fusion opportunities in this area
 these days. `hPutChars` is apparently low-performance anyway, but I think
 it might as well be written

 {{{#!hs
 hPutChars :: Handle -> [Char] -> IO ()
 hPutChars handle = mapM_ (hPutChar handle)
 }}}

 More importantly, I would conjecture that we can probably fuse
 `writeBlocks`. Call Arity seems to allow a fusing `foldM`, and
 `writeBlocks` seems to have that general structure. The devil may have
 details, of course.

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


More information about the ghc-tickets mailing list