/usr/share/doc/libghc-configfile-doc/html/Data-ConfigFile-Monadic.html is in libghc-configfile-doc 1.1.4-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.ConfigFile.Monadic</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-ConfigFile-Monadic.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-ConfigFile-Monadic.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ConfigFile-1.1.4: Configuration file reading & writing</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.ConfigFile.Monadic</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Overview</a></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:simpleAccess">simpleAccess</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:interpolatingAccess">interpolatingAccess</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:readfile">readfile</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/libghc-missingh-doc/html/System-IO-HVFS.html#t:FilePath">FilePath</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a>)</li><li class="src short"><a href="#v:readhandle">readhandle</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-IO-Handle.html#t:Handle">Handle</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a>)</li><li class="src short"><a href="#v:readstring">readstring</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li><li class="src short"><a href="#v:has_section">has_section</a> :: <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:options">options</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m [<a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a>]</li><li class="src short"><a href="#v:has_option">has_option</a> :: <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:items">items</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m [(<a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>)]</li><li class="src short"><a href="#v:set">set</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li><li class="src short"><a href="#v:setshow">setshow</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m) => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> a -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li><li class="src short"><a href="#v:remove_option">remove_option</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li><li class="src short"><a href="#v:add_section">add_section</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li><li class="src short"><a href="#v:remove_section">remove_section</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></li></ul></div><div id="interface"><h1 id="g:1">Overview</h1><div class="doc"><p>This module reexports a slightly different version of the standard API which makes it more convenient for chaining monadically. Everywhere a <code><a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></code> was the first argument in a function in the standard API, it is now the last. This lets you rewrite </p><pre>do let cp = emptyCP
cp <- add_section cp "sect1"
cp <- set cp "sect1" "opt1" "foo"
cp <- set cp "sect1" "opt2" "bar"
options cp "sect1"</pre><p>as</p><pre>return emptyCP >>=
add_section "sect1" >>=
set "sect1" "opt1" "foo" >>=
set "sect1" "opt2" "bar" >>=
options "sect1"</pre><p>which may be more elegant in some cases. A future development might be to chain the <code><a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a></code> implicitly with a state monad, which would be yet more elegant.</p></div><div class="top"><p class="src"><a id="v:simpleAccess" class="def">simpleAccess</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Data-ConfigFile-Monadic.html#simpleAccess" class="link">Source</a> <a href="#v:simpleAccess" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:interpolatingAccess" class="def">interpolatingAccess</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Data-ConfigFile-Monadic.html#interpolatingAccess" class="link">Source</a> <a href="#v:interpolatingAccess" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:readfile" class="def">readfile</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/libghc-missingh-doc/html/System-IO-HVFS.html#t:FilePath">FilePath</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a>) <a href="src/Data-ConfigFile-Monadic.html#readfile" class="link">Source</a> <a href="#v:readfile" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:readhandle" class="def">readhandle</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-IO-Handle.html#t:Handle">Handle</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a>) <a href="src/Data-ConfigFile-Monadic.html#readhandle" class="link">Source</a> <a href="#v:readhandle" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:readstring" class="def">readstring</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#readstring" class="link">Source</a> <a href="#v:readstring" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:has_section" class="def">has_section</a> :: <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-ConfigFile-Monadic.html#has_section" class="link">Source</a> <a href="#v:has_section" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:options" class="def">options</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m [<a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a>] <a href="src/Data-ConfigFile-Monadic.html#options" class="link">Source</a> <a href="#v:options" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:has_option" class="def">has_option</a> :: <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-ConfigFile-Monadic.html#has_option" class="link">Source</a> <a href="#v:has_option" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:items" class="def">items</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m [(<a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>)] <a href="src/Data-ConfigFile-Monadic.html#items" class="link">Source</a> <a href="#v:items" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:set" class="def">set</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#set" class="link">Source</a> <a href="#v:set" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:setshow" class="def">setshow</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m) => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> a -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#setshow" class="link">Source</a> <a href="#v:setshow" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:remove_option" class="def">remove_option</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:OptionSpec">OptionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#remove_option" class="link">Source</a> <a href="#v:remove_option" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:add_section" class="def">add_section</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#add_section" class="link">Source</a> <a href="#v:add_section" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:remove_section" class="def">remove_section</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> <a href="Data-ConfigFile-Types.html#t:CPError">CPError</a> m => <a href="Data-ConfigFile-Types.html#t:SectionSpec">SectionSpec</a> -> <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> -> m <a href="Data-ConfigFile-Types.html#t:ConfigParser">ConfigParser</a> <a href="src/Data-ConfigFile-Monadic.html#remove_section" class="link">Source</a> <a href="#v:remove_section" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|