[GHC] #4377: sizedText function for Text.PrettyPrint

GHC cvs-ghc at haskell.org
Sat Oct 9 14:16:27 EDT 2010


#4377: sizedText function for Text.PrettyPrint
---------------------------------+------------------------------------------
    Reporter:  lerkok            |       Owner:                                                    
        Type:  proposal          |      Status:  new                                               
    Priority:  normal            |   Component:  libraries/pretty                                  
     Version:                    |    Keywords:  text, sizedText, pretty printing, Text.PrettyPrint
    Testcase:                    |   Blockedby:                                                    
          Os:  Unknown/Multiple  |    Blocking:                                                    
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown                                      
---------------------------------+------------------------------------------

Comment(by lerkok):

 Thanks for the responses..

 Looks like an appropriate definition would be:

 {{{
 sizedText :: Int -> String -> Doc
 sizedText l s = textBeside_ (Str s) l Empty
 }}}

 Based on Thomas's suggestion to use `textBeside_` and Christians
 suggestion that any padding should be done on the user side if necessary.

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


More information about the Glasgow-haskell-bugs mailing list