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

GHC ghc-devs at haskell.org
Tue Sep 2 18:05:46 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:  fusion,
            Resolution:              |  refactoring
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * keywords:   => fusion, refactoring


Comment:

 Indeed, `writeBlocks` ''can'' be written as a `foldM` form, which can
 fuse, at least in theory. It may, however, be a challenge to bend arity
 analysis to my will without inlining more than we should. This may or may
 not be compounded by the fact that in tearing apart `writeBlocks` I
 realized that there's a special case buried within: block buffering with
 normal (non-Windows) end-of-line conventions never actually needs to
 examine the characters it handles. I would venture to guess that we could
 exploit that fact to improve efficiency.

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


More information about the ghc-tickets mailing list