This repository was archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.html
More file actions
4 lines (4 loc) · 14.3 KB
/
Copy pathConfig.html
File metadata and controls
4 lines (4 loc) · 14.3 KB
1
2
3
4
<!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>Config</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">Progen-cli</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Config</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Contains metadata for the application as well as values needed for Progen to run.</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><span class="keyword">data</span> <a href="#t:Dotfile">Dotfile</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:ConfigError">ConfigError</a></li><li class="src short"><a href="#v:handleConfigResult">handleConfigResult</a> :: Maybe <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> Either <a href="Config.html#t:ConfigError" title="Config">ConfigError</a> <a href="Config.html#t:GenConfig" title="Config">GenConfig</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:GenConfig">GenConfig</a></li><li class="src short"><a href="#v:dotfileName">dotfileName</a> :: String</li><li class="src short"><a href="#v:mkDotfile">mkDotfile</a> :: Last RelDir -> Last (Map String RelDir) -> Last (Maybe Char) -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></li><li class="src short"><a href="#v:mkConfig">mkConfig</a> :: <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> String -> Maybe <a href="Config.html#t:GenConfig" title="Config">GenConfig</a></li></ul></details></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Dotfile" class="def">Dotfile</a> <a href="#t:Dotfile" class="selflink">#</a></p><div class="doc"><p>It represents the data coming from the configuration file. More data can be needed but may not be configurable.
The Dotfile is used to create a GenConfig which will be used by the application.</p></div><div class="subs instances"><details id="i:Dotfile" open="open"><summary>Instances</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Dotfile:Show:1"></span> Show <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></span> <a href="#t:Dotfile" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:Dotfile:Show:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: Int -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> ShowS</p><p class="src"><a href="#v:show">show</a> :: <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> String</p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Config.html#t:Dotfile" title="Config">Dotfile</a>] -> ShowS</p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Dotfile:Generic:2"></span> Generic <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></span> <a href="#t:Dotfile" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:Dotfile:Generic:2"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> Rep <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> :: Type -> Type</p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> Rep <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> x</p><p class="src"><a href="#v:to">to</a> :: Rep <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> x -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Dotfile:Semigroup:3"></span> Semigroup <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></span> <a href="#t:Dotfile" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:Dotfile:Semigroup:3"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-60--62-">(<>)</a> :: <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></p><p class="src"><a href="#v:sconcat">sconcat</a> :: NonEmpty <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></p><p class="src"><a href="#v:stimes">stimes</a> :: Integral b => b -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Dotfile:FromJSON:4"></span> FromJSON <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></span> <a href="#t:Dotfile" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:Dotfile:FromJSON:4"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseJSON">parseJSON</a> :: Value -> Parser <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></p><p class="src"><a href="#v:parseJSONList">parseJSONList</a> :: Value -> Parser [<a href="Config.html#t:Dotfile" title="Config">Dotfile</a>]</p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Dotfile:Rep:5"></span> <span class="keyword">type</span> Rep <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></span> <a href="#t:Dotfile" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:Dotfile:Rep:5"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="src"><span class="keyword">type</span> Rep <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> = D1 (MetaData "Dotfile" "Config" "main" False) (C1 (MetaCons "Dotfile" PrefixI True) (S1 (MetaSel (Just "templates") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last RelDir)) :*: (S1 (MetaSel (Just "output") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last (Map String RelDir))) :*: S1 (MetaSel (Just "filenameSeparator") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last (Maybe Char))))))</div></details></td></tr></table></details></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ConfigError" class="def">ConfigError</a> <a href="#t:ConfigError" class="selflink">#</a></p><div class="doc"><p>Encompasses all possible errors in the Config module</p></div><div class="subs instances"><details id="i:ConfigError" open="open"><summary>Instances</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:ConfigError:Show:1"></span> Show <a href="Config.html#t:ConfigError" title="Config">ConfigError</a></span> <a href="#t:ConfigError" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:ConfigError:Show:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: Int -> <a href="Config.html#t:ConfigError" title="Config">ConfigError</a> -> ShowS</p><p class="src"><a href="#v:show">show</a> :: <a href="Config.html#t:ConfigError" title="Config">ConfigError</a> -> String</p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Config.html#t:ConfigError" title="Config">ConfigError</a>] -> ShowS</p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:handleConfigResult" class="def">handleConfigResult</a> :: Maybe <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> Either <a href="Config.html#t:ConfigError" title="Config">ConfigError</a> <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> <a href="#v:handleConfigResult" class="selflink">#</a></p><div class="doc"><p>Transform maybe config to an Either of the correct Domain error or the valid Config</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:GenConfig" class="def">GenConfig</a> <a href="#t:GenConfig" class="selflink">#</a></p><div class="doc"><p>This is the configuration used by the application wtih all the metadata needed to generate code.</p></div><div class="subs instances"><details id="i:GenConfig" open="open"><summary>Instances</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:GenConfig:Eq:1"></span> Eq <a href="Config.html#t:GenConfig" title="Config">GenConfig</a></span> <a href="#t:GenConfig" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:GenConfig:Eq:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> Bool</p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> Bool</p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:GenConfig:Show:2"></span> Show <a href="Config.html#t:GenConfig" title="Config">GenConfig</a></span> <a href="#t:GenConfig" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><details id="i:id:GenConfig:Show:2"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Config.html">Config</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: Int -> <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> ShowS</p><p class="src"><a href="#v:show">show</a> :: <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> -> String</p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Config.html#t:GenConfig" title="Config">GenConfig</a>] -> ShowS</p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:dotfileName" class="def">dotfileName</a> :: String <a href="#v:dotfileName" class="selflink">#</a></p><div class="doc"><p>Name for the dotfile where the configuration will be read from</p></div></div><div class="top"><p class="src"><a id="v:mkDotfile" class="def">mkDotfile</a> <a href="#v:mkDotfile" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: Last RelDir</td><td class="doc"><p>Templates directory path relative to the root.</p></td></tr><tr><td class="src">-> Last (Map String RelDir)</td><td class="doc"><p>Configuration for the output. Keys are matched on the names of the templates, the values are relative directory paths inside the root.</p></td></tr><tr><td class="src">-> Last (Maybe Char)</td><td class="doc"><p>Character used to separate the template filename and make use of suffix.</p></td></tr><tr><td class="src">-> <a href="Config.html#t:Dotfile" title="Config">Dotfile</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Factory function for constructing a Dotfile</p></div></div><div class="top"><p class="src"><a id="v:mkConfig" class="def">mkConfig</a> :: <a href="Config.html#t:Dotfile" title="Config">Dotfile</a> -> String -> Maybe <a href="Config.html#t:GenConfig" title="Config">GenConfig</a> <a href="#v:mkConfig" class="selflink">#</a></p><div class="doc"><p>Factory to make a GenConfig from a JSONString. It will attempt to construct a Dotfile from its values
and then combine it with a default config. The result will be the GenConfig that will be returned.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>mkConfig "{ \"root\": \"/dummy/project\", \"templates\": \".progen/templates\", \"filenameSeparator\": \".\", \"output\": { \"component\": \"./components\" }}"
</code></strong></pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.22.0</p></div></body></html>