on master help sign in
Graphics.Vty.Inline: haddock pass
commit7342cff2adff14bad840261b21b10bf61c5f6288 authorJonathan Daugherty <cygnus@foobox.com> dateSun 22 Jan 2017, 14:44 (10 years ago) parent4284810
1 file changed+14−15
src/Graphics/Vty/Inline.hs+14−15
src/Graphics/Vty/Inline.hs+14−15
@@ -5,10 +5,10 @@
55-- used inline with other output systems.
66--
77-- The changes specified by the InlineM monad are applied to the
8−-- terminals display attributes. These display attributes effect the
8+-- terminal's display attributes. These display attributes affect the
99-- display of all following text output to the terminal file descriptor.
1010--
11−-- For example, in an IO monad the following code with print the text
11+-- For example, in an IO monad the following code will print the text
1212-- \"Not styled. \" Followed by the text \" Styled! \" drawn over a red
1313-- background and underlined.
1414--
@@ -22,11 +22,11 @@
2222-- putStrLn \"Not styled.\"
2323-- @
2424--
25−-- 'putAttrChange' outputs the control codes to the terminal device
26−-- 'Handle'. This is a duplicate of the 'stdout' handle when the
27−-- 'terminalHandle' was (first) acquired. If 'stdout' has since been
28−-- changed then 'putStr', 'putStrLn', 'print' etc.. will output to a
29−-- different 'Handle' than 'putAttrChange'
25+-- 'putAttrChange' emits the control codes to the terminal device
26+-- attached to 'Handle'. This is a duplicate of the 'stdout' handle when
27+-- the 'terminalHandle' was (first) acquired. If 'stdout' has since been
28+-- changed then 'putStr', 'putStrLn', 'print' etc. will output to a
29+-- different 'Handle' than 'putAttrChange'.
3030--
3131-- Copyright 2009-2010 Corey O'Connor
3232module Graphics.Vty.Inline
@@ -50,17 +50,17 @@ import System.IO
5050
5151type InlineM v = State Attr v
5252
53−-- | Set the background color to the provided 'Color'
53+-- | Set the background color to the provided 'Color'.
5454backColor :: Color -> InlineM ()
5555backColor c = modify $ flip mappend ( currentAttr `withBackColor` c )
5656
57−-- | Set the foreground color to the provided 'Color'
57+-- | Set the foreground color to the provided 'Color'.
5858foreColor :: Color -> InlineM ()
5959foreColor c = modify $ flip mappend ( currentAttr `withForeColor` c )
6060
61−-- | Attempt to change the 'Style' of the following text.
61+-- | Attempt to change the 'Style' of the following text..
6262--
63−-- If the terminal does not support the style change no error is
63+-- If the terminal does not support the style change then no error is
6464-- produced. The style can still be removed.
6565applyStyle :: Style -> InlineM ()
6666applyStyle s = modify $ flip mappend ( currentAttr `withStyle` s )
@@ -68,7 +68,7 @@ applyStyle s = modify $ flip mappend ( currentAttr `withStyle` s )
6868-- | Attempt to remove the specified 'Style' from the display of the
6969-- following text.
7070--
71−-- This will fail if applyStyle for the given style has not been
71+-- This will fail if 'applyStyle' for the given style has not been
7272-- previously called.
7373removeStyle :: Style -> InlineM ()
7474removeStyle sMask = modify $ \attr ->
@@ -78,7 +78,7 @@ removeStyle sMask = modify $ \attr ->
7878 SetTo s -> s .&. complement sMask
7979 in attr { attrStyle = SetTo style' }
8080
81−-- | Reset the display attributes
81+-- | Reset the display attributes.
8282defaultAll :: InlineM ()
8383defaultAll = put defAttr
8484
@@ -105,8 +105,7 @@ putAttrChange out c = liftIO $ do
105105 inlineHack dc
106106
107107-- | Apply the provided display attributes changes to the terminal
108−-- output device that was current at the time this was first used.
109−-- Which, for most use cases, is the current terminal.
108+-- output device.
110109--
111110-- This will flush the terminal output.
112111putAttrChange_ :: ( Applicative m, MonadIO m ) => InlineM () -> m ()