-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Print text to terminal with colors and effects
--   
--   Please see README.md
@package rainbow
@version 0.30.0.2


-- | All the main types in Rainbow. Using this module you can specify that
--   you want different formatting for 8- and 256-color terminals. Many of
--   the names in this module conflict with the names in <a>Rainbow</a>, so
--   it's probably best to <tt>import</tt> this module <tt>qualified</tt>.
module Rainbow.Types

-- | A color; a <a>Nothing</a> value means that the terminal's default
--   color is used. The type of the <a>Maybe</a> generally will be an
--   <a>Enum8</a> to represent one of 8 colors, or a <a>Word8</a> to
--   represent one of 256 colors.
newtype Color a
Color :: Maybe a -> Color a

-- | A simple enumeration for eight values. Represents eight colors.
data Enum8
E0 :: Enum8
E1 :: Enum8
E2 :: Enum8
E3 :: Enum8
E4 :: Enum8
E5 :: Enum8
E6 :: Enum8
E7 :: Enum8
enum8toWord8 :: Enum8 -> Word8
black :: Enum8
red :: Enum8
green :: Enum8
yellow :: Enum8
blue :: Enum8
magenta :: Enum8
cyan :: Enum8
white :: Enum8
grey :: Word8
brightRed :: Word8
brightGreen :: Word8
brightYellow :: Word8
brightBlue :: Word8
brightMagenta :: Word8
brightCyan :: Word8
brightWhite :: Word8

-- | Text formatting such as bold, italic, etc.
data Format
Format :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Format
[_bold] :: Format -> Bool
[_faint] :: Format -> Bool
[_italic] :: Format -> Bool
[_underline] :: Format -> Bool
[_blink] :: Format -> Bool
[_inverse] :: Format -> Bool
[_invisible] :: Format -> Bool
[_strikeout] :: Format -> Bool
strikeout :: Functor f => (Bool -> f Bool) -> Format -> f Format
invisible :: Functor f => (Bool -> f Bool) -> Format -> f Format
inverse :: Functor f => (Bool -> f Bool) -> Format -> f Format
blink :: Functor f => (Bool -> f Bool) -> Format -> f Format
underline :: Functor f => (Bool -> f Bool) -> Format -> f Format
italic :: Functor f => (Bool -> f Bool) -> Format -> f Format
faint :: Functor f => (Bool -> f Bool) -> Format -> f Format
bold :: Functor f => (Bool -> f Bool) -> Format -> f Format

-- | The foreground and background color, and the <a>Format</a>. This
--   represents all colors and formatting attributes for either an 8- or
--   256-color terminal.
data Style a
Style :: Color a -> Color a -> Format -> Style a
[_fore] :: Style a -> Color a
[_back] :: Style a -> Color a
[_format] :: Style a -> Format
format :: Functor f => (Format -> f Format) -> Style a -> f (Style a)
back :: Functor f => (Color a -> f (Color a)) -> Style a -> f (Style a)
fore :: Functor f => (Color a -> f (Color a)) -> Style a -> f (Style a)

-- | Holds the <a>Style</a> for both 8- and 256-color terminals.
data Scheme
Scheme :: Style Enum8 -> Style Word8 -> Scheme
[_style8] :: Scheme -> Style Enum8
[_style256] :: Scheme -> Style Word8
style256 :: Functor f => (Style Word8 -> f (Style Word8)) -> Scheme -> f Scheme
style8 :: Functor f => (Style Enum8 -> f (Style Enum8)) -> Scheme -> f Scheme

-- | A chunk is some textual data coupled with a description of what color
--   the text is, attributes like whether it is bold or underlined, etc.
--   The chunk knows what foreground and background colors and what
--   attributes to use for both an 8 color terminal and a 256 color
--   terminal.
data Chunk a
Chunk :: Scheme -> a -> Chunk a
[_scheme] :: Chunk a -> Scheme
[_yarn] :: Chunk a -> a

-- | Creates a <a>Chunk</a> with no formatting and with the given text.
chunk :: a -> Chunk a
yarn :: Functor f => (t -> f a) -> Chunk t -> f (Chunk a)
scheme :: Functor f => (Scheme -> f Scheme) -> Chunk a -> f (Chunk a)

-- | Stores colors that may affect 8-color terminals, 256-color terminals,
--   both, or neither.
data Radiant
Radiant :: Color Enum8 -> Color Word8 -> Radiant
[_color8] :: Radiant -> Color Enum8
[_color256] :: Radiant -> Color Word8
color256 :: Functor f => (Color Word8 -> f (Color Word8)) -> Radiant -> f Radiant
color8 :: Functor f => (Color Enum8 -> f (Color Enum8)) -> Radiant -> f Radiant
instance GHC.Generics.Generic Rainbow.Types.Radiant
instance GHC.Show.Show Rainbow.Types.Radiant
instance GHC.Classes.Ord Rainbow.Types.Radiant
instance GHC.Classes.Eq Rainbow.Types.Radiant
instance GHC.Base.Semigroup Rainbow.Types.Radiant
instance GHC.Base.Monoid Rainbow.Types.Radiant
instance Data.Traversable.Traversable Rainbow.Types.Chunk
instance Data.Foldable.Foldable Rainbow.Types.Chunk
instance GHC.Base.Functor Rainbow.Types.Chunk
instance GHC.Generics.Generic (Rainbow.Types.Chunk a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Rainbow.Types.Chunk a)
instance GHC.Show.Show a => GHC.Show.Show (Rainbow.Types.Chunk a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Rainbow.Types.Chunk a)
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Rainbow.Types.Chunk a)
instance GHC.Base.Monoid a => GHC.Base.Monoid (Rainbow.Types.Chunk a)
instance GHC.Base.Semigroup Rainbow.Types.Scheme
instance GHC.Base.Monoid Rainbow.Types.Scheme
instance GHC.Generics.Generic Rainbow.Types.Scheme
instance GHC.Show.Show Rainbow.Types.Scheme
instance GHC.Classes.Ord Rainbow.Types.Scheme
instance GHC.Classes.Eq Rainbow.Types.Scheme
instance GHC.Base.Semigroup (Rainbow.Types.Style a)
instance GHC.Base.Monoid (Rainbow.Types.Style a)
instance Data.Traversable.Traversable Rainbow.Types.Style
instance Data.Foldable.Foldable Rainbow.Types.Style
instance GHC.Base.Functor Rainbow.Types.Style
instance GHC.Generics.Generic (Rainbow.Types.Style a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Rainbow.Types.Style a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Rainbow.Types.Style a)
instance GHC.Show.Show a => GHC.Show.Show (Rainbow.Types.Style a)
instance GHC.Base.Semigroup Rainbow.Types.Format
instance GHC.Base.Monoid Rainbow.Types.Format
instance GHC.Generics.Generic Rainbow.Types.Format
instance GHC.Classes.Ord Rainbow.Types.Format
instance GHC.Classes.Eq Rainbow.Types.Format
instance GHC.Show.Show Rainbow.Types.Format
instance GHC.Generics.Generic Rainbow.Types.Enum8
instance GHC.Enum.Enum Rainbow.Types.Enum8
instance GHC.Enum.Bounded Rainbow.Types.Enum8
instance GHC.Show.Show Rainbow.Types.Enum8
instance GHC.Classes.Ord Rainbow.Types.Enum8
instance GHC.Classes.Eq Rainbow.Types.Enum8
instance Data.Traversable.Traversable Rainbow.Types.Color
instance Data.Foldable.Foldable Rainbow.Types.Color
instance GHC.Base.Functor Rainbow.Types.Color
instance GHC.Generics.Generic (Rainbow.Types.Color a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Rainbow.Types.Color a)
instance GHC.Show.Show a => GHC.Show.Show (Rainbow.Types.Color a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Rainbow.Types.Color a)
instance GHC.Base.Semigroup (Rainbow.Types.Color a)
instance GHC.Base.Monoid (Rainbow.Types.Color a)


-- | This module contains functions that convert a <a>Chunk</a> into
--   <a>ByteString</a>s. Ordinarily everything you need from this module is
--   exported from <a>Rainbow</a>.
module Rainbow.Translate

-- | Items that can be rendered. <a>render</a> returns a difference list.
class Renderable a
render :: Renderable a => a -> [ByteString] -> [ByteString]
single :: Char -> [ByteString] -> [ByteString]
escape :: [ByteString] -> [ByteString]
csi :: [ByteString] -> [ByteString]
sgr :: ([ByteString] -> [ByteString]) -> [ByteString] -> [ByteString]
params :: Show a => [a] -> [ByteString] -> [ByteString]
sgrSingle :: Word -> [ByteString] -> [ByteString]
sgrDouble :: Word -> Word -> [ByteString] -> [ByteString]
normalDefault :: [ByteString] -> [ByteString]
bold :: [ByteString] -> [ByteString]
faint :: [ByteString] -> [ByteString]
italic :: [ByteString] -> [ByteString]
underline :: [ByteString] -> [ByteString]
blink :: [ByteString] -> [ByteString]
inverse :: [ByteString] -> [ByteString]
invisible :: [ByteString] -> [ByteString]
strikeout :: [ByteString] -> [ByteString]
foreBlack :: [ByteString] -> [ByteString]
foreRed :: [ByteString] -> [ByteString]
foreGreen :: [ByteString] -> [ByteString]
foreYellow :: [ByteString] -> [ByteString]
foreBlue :: [ByteString] -> [ByteString]
foreMagenta :: [ByteString] -> [ByteString]
foreCyan :: [ByteString] -> [ByteString]
foreWhite :: [ByteString] -> [ByteString]
foreDefault :: [ByteString] -> [ByteString]
backBlack :: [ByteString] -> [ByteString]
backRed :: [ByteString] -> [ByteString]
backGreen :: [ByteString] -> [ByteString]
backYellow :: [ByteString] -> [ByteString]
backBlue :: [ByteString] -> [ByteString]
backMagenta :: [ByteString] -> [ByteString]
backCyan :: [ByteString] -> [ByteString]
backWhite :: [ByteString] -> [ByteString]
backDefault :: [ByteString] -> [ByteString]
fore256 :: Word8 -> [ByteString] -> [ByteString]
back256 :: Word8 -> [ByteString] -> [ByteString]
foreColor8 :: Enum8 -> [ByteString] -> [ByteString]
backColor8 :: Enum8 -> [ByteString] -> [ByteString]
renderFormat :: Format -> [ByteString] -> [ByteString]
renderStyle8 :: Style Enum8 -> [ByteString] -> [ByteString]
renderStyle256 :: Style Word8 -> [ByteString] -> [ByteString]
toByteStringsColors0 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]
toByteStringsColors8 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]
toByteStringsColors256 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]

-- | Spawns a subprocess to read the output of <tt>tput colors</tt>. If
--   this says there are at least 256 colors are available, returns
--   <a>toByteStringsColors256</a>. Otherwise, if there are at least 8
--   colors available, returns <a>toByteStringsColors8</a>. Otherwise,
--   returns <a>toByteStringsColors0</a>.
--   
--   If any IO exceptions arise during this process, they are discarded and
--   <a>toByteStringsColors0</a> is returned.
byteStringMakerFromEnvironment :: Renderable a => IO (Chunk a -> [ByteString] -> [ByteString])

-- | Like <a>byteStringMakerFromEnvironment</a> but also consults a
--   provided <tt>Handle</tt>. If the <tt>Handle</tt> is not a terminal,
--   <a>toByteStringsColors0</a> is returned. Otherwise, the value of
--   <a>byteStringMakerFromEnvironment</a> is returned.
byteStringMakerFromHandle :: Renderable a => Handle -> IO (Chunk a -> [ByteString] -> [ByteString])

-- | Convert a list of <a>Chunk</a> to a list of <a>ByteString</a>. The
--   length of the returned list may be longer than the length of the input
--   list.
--   
--   So, for example, to print a bunch of chunks to standard output using
--   256 colors:
--   
--   <pre>
--   module PrintMyChunks where
--   
--   import qualified Data.ByteString as BS
--   import Rainbow
--   
--   myChunks :: [Chunk String]
--   myChunks = [ chunk "Roses" &amp; fore red, chunk "\n",
--                chunk "Violets" &amp; fore blue, chunk "\n" ]
--   
--   myPrintedChunks :: IO ()
--   myPrintedChunks = mapM_ BS.putStr
--                   . chunksToByteStrings toByteStringsColors256
--                   $ myChunks
--   </pre>
--   
--   To use the highest number of colors that this terminal supports:
--   
--   <pre>
--   myPrintedChunks' :: IO ()
--   myPrintedChunks' = do
--     printer &lt;- byteStringMakerFromEnvironment
--     mapM_ BS.putStr
--       . chunksToByteStrings printer
--       $ myChunks
--   </pre>
chunksToByteStrings :: (Chunk a -> [ByteString] -> [ByteString]) -> [Chunk a] -> [ByteString]

-- | Writes a <a>Chunk</a> to standard output. Spawns a child process to
--   read the output of <tt>tput colors</tt> to determine how many colors
--   to use, for every single chunk. Therefore, this is not going to win
--   any speed awards. You are better off using <a>chunksToByteStrings</a>
--   and the functions in <a>Data.ByteString</a> to print your
--   <a>Chunk</a>s if you are printing a lot of them.
putChunk :: Renderable a => Chunk a -> IO ()

-- | Writes a <a>Chunk</a> to standard output, and appends a newline.
--   Spawns a child process to read the output of <tt>tput colors</tt> to
--   determine how many colors to use, for every single chunk. Therefore,
--   this is not going to win any speed awards. You are better off using
--   <a>chunksToByteStrings</a> and the functions in <a>Data.ByteString</a>
--   to print your <a>Chunk</a>s if you are printing a lot of them.
putChunkLn :: Renderable a => Chunk a -> IO ()
instance Rainbow.Translate.Renderable Data.Text.Internal.Text
instance Rainbow.Translate.Renderable Data.Text.Internal.Lazy.Text
instance Rainbow.Translate.Renderable Data.ByteString.Internal.ByteString
instance Rainbow.Translate.Renderable Data.ByteString.Lazy.Internal.ByteString
instance Rainbow.Translate.Renderable GHC.Base.String


-- | Rainbow handles colors and special effects for text. The basic
--   building block of Rainbow is the <a>Chunk</a>. The <a>Chunk</a>
--   contains both text and formatting information such as colors, bold,
--   underlining, etc.
--   
--   When printed, each <a>Chunk</a> starts off with a clean slate, so if
--   you want special formatting such as any color, bold, etc, then you
--   must specify it for every <a>Chunk</a>. The appearance of one
--   <a>Chunk</a> does not affect the appearance of the next <a>Chunk</a>.
--   This makes it easy to reason about how a particular <a>Chunk</a> will
--   look.
--   
--   Rainbow supports 256-color terminals. You have full freedom to specify
--   different attributes and colors for 8 and 256 color terminals; for
--   instance, you can have text appear red on an 8-color terminal but blue
--   on a 256-color terminal.
--   
--   Here are some basic examples:
--   
--   <pre>
--   <a>putChunkLn</a> $ <a>chunk</a> "Some blue text" <a>&amp;</a> <a>fore</a> <a>blue</a>
--   <a>putChunkLn</a> $ <a>chunk</a> "Blue on red background"
--                 <a>&amp;</a> <a>fore</a> <a>blue</a> <a>&amp;</a> <a>back</a> <a>red</a>
--   <a>putChunkLn</a> $ <a>chunk</a> "Blue on red, foreground bold"
--                  <a>&amp;</a> <a>fore</a> <a>blue</a> <a>&amp;</a> <a>back</a> <a>red</a> <a>&amp;</a> <a>bold</a>
--   </pre>
--   
--   You can also specify output for 256-color terminals. To use these
--   examples, be sure your TERM environment variable is set to something
--   that supports 256 colors (like <tt>xterm-256color</tt>) before you
--   start GHCi.
--   
--   <pre>
--   <a>putChunkLn</a> $ <a>chunk</a> "Blue on 8, bright green on 256" <a>&amp;</a>
--      <a>fore</a> (<a>blue</a> <a>&lt;&gt;</a> <a>brightGreen</a>)
--   
--   <a>putChunkLn</a> $ <a>chunk</a> "Blue on 8, red on 256" <a>&amp;</a>
--      <a>fore</a> (<a>blue</a> <a>&lt;&gt;</a> <a>only256</a> <a>red</a>)
--   </pre>
--   
--   Each <a>Chunk</a> affects the formatting only of that <a>Chunk</a>. So
--   to print things in different colors, make more than one <a>Chunk</a>:
--   
--   <pre>
--   <a>mapM_</a> <a>putChunkLn</a>
--      [ <a>chunk</a> "Roses" <a>&amp;</a> <a>fore</a> <a>red</a>
--      , <a>chunk</a> "Violets" <a>&amp;</a> <a>fore</a> <a>blue</a> ]
--   </pre>
--   
--   The above examples use <a>putChunkLn</a>, but that function will be
--   inefficient if you are printing many <a>Chunk</a>s. For greater
--   efficiency see <a>chunksToByteStrings</a>.
--   
--   The functions in this module, <a>Rainbow</a>, will likely be enough
--   for most uses, but for more flexibility you can use
--   <a>Rainbow.Types</a>. Use of <a>Rainbow.Types</a> will require some
--   familiarity with the <tt>lens</tt> library.
module Rainbow

-- | A chunk is some textual data coupled with a description of what color
--   the text is, attributes like whether it is bold or underlined, etc.
--   The chunk knows what foreground and background colors and what
--   attributes to use for both an 8 color terminal and a 256 color
--   terminal.
data Chunk a

-- | Creates a <a>Chunk</a> with no formatting and with the given text.
chunk :: a -> Chunk a

-- | Bold. What actually happens when you use Bold is going to depend on
--   your terminal. For example, xterm allows you actually use a bold font
--   for bold, if you have one. Otherwise, it might simulate bold by using
--   overstriking. Another possibility is that your terminal might use a
--   different color to indicate bold. For more details (at least for
--   xterm), look at xterm (1) and search for <tt>boldColors</tt>.
--   
--   If your terminal uses a different color for bold, this allows an
--   8-color terminal to really have 16 colors.
bold :: Chunk a -> Chunk a
faint :: Chunk a -> Chunk a
italic :: Chunk a -> Chunk a
underline :: Chunk a -> Chunk a
blink :: Chunk a -> Chunk a
inverse :: Chunk a -> Chunk a
invisible :: Chunk a -> Chunk a
strikeout :: Chunk a -> Chunk a

-- | Stores colors that may affect 8-color terminals, 256-color terminals,
--   both, or neither.
data Radiant

-- | Change the foreground color for both 8- and 256-color terminals.
fore :: Radiant -> Chunk a -> Chunk a

-- | Change the background color for both 8- and 256-color terminals.
back :: Radiant -> Chunk a -> Chunk a
black :: Radiant
red :: Radiant
green :: Radiant
yellow :: Radiant
blue :: Radiant
magenta :: Radiant
cyan :: Radiant
white :: Radiant
grey :: Radiant
brightRed :: Radiant
brightGreen :: Radiant
brightYellow :: Radiant
brightBlue :: Radiant
brightMagenta :: Radiant
brightCyan :: Radiant
brightWhite :: Radiant
color256 :: Word8 -> Radiant

-- | Ensures that a <a>Radiant</a> affects only a 256-color terminal. For
--   instance, to make text that is blue on an 8-color terminal but red on
--   a 256-color terminal:
--   
--   <pre>
--   <a>putChunkLn</a> $ <tt>chunk</tt> "Blue on 8, red on 256" &amp;
--      <a>fore</a> (<a>blue</a> &lt;&gt; <a>only256</a> <a>red</a>)
--   </pre>
only256 :: Radiant -> Radiant

-- | Items that can be rendered. <a>render</a> returns a difference list.
class Renderable a
toByteStringsColors0 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]
toByteStringsColors8 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]
toByteStringsColors256 :: Renderable a => Chunk a -> [ByteString] -> [ByteString]

-- | Spawns a subprocess to read the output of <tt>tput colors</tt>. If
--   this says there are at least 256 colors are available, returns
--   <a>toByteStringsColors256</a>. Otherwise, if there are at least 8
--   colors available, returns <a>toByteStringsColors8</a>. Otherwise,
--   returns <a>toByteStringsColors0</a>.
--   
--   If any IO exceptions arise during this process, they are discarded and
--   <a>toByteStringsColors0</a> is returned.
byteStringMakerFromEnvironment :: Renderable a => IO (Chunk a -> [ByteString] -> [ByteString])

-- | Like <a>byteStringMakerFromEnvironment</a> but also consults a
--   provided <tt>Handle</tt>. If the <tt>Handle</tt> is not a terminal,
--   <a>toByteStringsColors0</a> is returned. Otherwise, the value of
--   <a>byteStringMakerFromEnvironment</a> is returned.
byteStringMakerFromHandle :: Renderable a => Handle -> IO (Chunk a -> [ByteString] -> [ByteString])

-- | Convert a list of <a>Chunk</a> to a list of <a>ByteString</a>. The
--   length of the returned list may be longer than the length of the input
--   list.
--   
--   So, for example, to print a bunch of chunks to standard output using
--   256 colors:
--   
--   <pre>
--   module PrintMyChunks where
--   
--   import qualified Data.ByteString as BS
--   import Rainbow
--   
--   myChunks :: [Chunk String]
--   myChunks = [ chunk "Roses" &amp; fore red, chunk "\n",
--                chunk "Violets" &amp; fore blue, chunk "\n" ]
--   
--   myPrintedChunks :: IO ()
--   myPrintedChunks = mapM_ BS.putStr
--                   . chunksToByteStrings toByteStringsColors256
--                   $ myChunks
--   </pre>
--   
--   To use the highest number of colors that this terminal supports:
--   
--   <pre>
--   myPrintedChunks' :: IO ()
--   myPrintedChunks' = do
--     printer &lt;- byteStringMakerFromEnvironment
--     mapM_ BS.putStr
--       . chunksToByteStrings printer
--       $ myChunks
--   </pre>
chunksToByteStrings :: (Chunk a -> [ByteString] -> [ByteString]) -> [Chunk a] -> [ByteString]

-- | Writes a <a>Chunk</a> to standard output. Spawns a child process to
--   read the output of <tt>tput colors</tt> to determine how many colors
--   to use, for every single chunk. Therefore, this is not going to win
--   any speed awards. You are better off using <a>chunksToByteStrings</a>
--   and the functions in <a>Data.ByteString</a> to print your
--   <a>Chunk</a>s if you are printing a lot of them.
putChunk :: Renderable a => Chunk a -> IO ()

-- | Writes a <a>Chunk</a> to standard output, and appends a newline.
--   Spawns a child process to read the output of <tt>tput colors</tt> to
--   determine how many colors to use, for every single chunk. Therefore,
--   this is not going to win any speed awards. You are better off using
--   <a>chunksToByteStrings</a> and the functions in <a>Data.ByteString</a>
--   to print your <a>Chunk</a>s if you are printing a lot of them.
putChunkLn :: Renderable a => Chunk a -> IO ()

-- | <a>&amp;</a> is a reverse application operator. This provides
--   notational convenience. Its precedence is one higher than that of the
--   forward application operator <a>$</a>, which allows <a>&amp;</a> to be
--   nested in <a>$</a>.
--   
--   <pre>
--   &gt;&gt;&gt; 5 &amp; (+1) &amp; show
--   "6"
--   </pre>
(&) :: () => a -> (a -> b) -> b
infixl 1 &

-- | 8-bit unsigned integer type
data Word8

-- | A space-efficient representation of a <a>Word8</a> vector, supporting
--   many efficient operations.
--   
--   A <a>ByteString</a> contains 8-bit bytes, or by using the operations
--   from <a>Data.ByteString.Char8</a> it can be interpreted as containing
--   8-bit characters.
data ByteString

-- | An associative operation.
(<>) :: Semigroup a => a -> a -> a
infixr 6 <>

-- | The class of monoids (types with an associative binary operation that
--   has an identity). Instances should satisfy the following laws:
--   
--   <ul>
--   <li><pre>x <a>&lt;&gt;</a> <a>mempty</a> = x</pre></li>
--   <li><pre><a>mempty</a> <a>&lt;&gt;</a> x = x</pre></li>
--   <li><tt>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
--   y) <a>&lt;&gt;</a> z</tt> (<a>Semigroup</a> law)</li>
--   <li><pre><a>mconcat</a> = <a>foldr</a> '(&lt;&gt;)'
--   <a>mempty</a></pre></li>
--   </ul>
--   
--   The method names refer to the monoid of lists under concatenation, but
--   there are many other instances.
--   
--   Some types can be viewed as a monoid in more than one way, e.g. both
--   addition and multiplication on numbers. In such cases we often define
--   <tt>newtype</tt>s and make those instances of <a>Monoid</a>, e.g.
--   <tt>Sum</tt> and <tt>Product</tt>.
--   
--   <b>NOTE</b>: <a>Semigroup</a> is a superclass of <a>Monoid</a> since
--   <i>base-4.11.0.0</i>.
class Semigroup a => Monoid a

-- | Identity of <a>mappend</a>
mempty :: Monoid a => a
