summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-24 10:19:04 +0300
committerdefanor <defanor@uberspace.net>2017-12-24 10:22:25 +0300
commitc26ec2c9e869155c7d99485a4745d0da12c9a6a9 (patch)
treebed72d547ff03989a52f58d1540d8a5d8a5708f1
parent2581f4b9a61d8ca4c782269886c30b3cc433d85d (diff)
downloadcoalpit-c26ec2c9e869155c7d99485a4745d0da12c9a6a9.zip
coalpit-c26ec2c9e869155c7d99485a4745d0da12c9a6a9.tar.gz
coalpit-c26ec2c9e869155c7d99485a4745d0da12c9a6a9.tar.bz2
Document the 'Usage' type.
-rw-r--r--Coalpit/Core.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Coalpit/Core.hs b/Coalpit/Core.hs
index 0e10757..e166af9 100644
--- a/Coalpit/Core.hs
+++ b/Coalpit/Core.hs
@@ -50,14 +50,26 @@ import Network.URI (URI, parseURIReference, uriToString)
import Coalpit.Parsing
+-- | Usage description: can be translated into help messages or
+-- documentation formats.
data Usage = UConstructor String
+ -- ^ Data constructor.
| URecursive String
+ -- ^ Constructor of a recursive data structure (its second
+ -- appearance in the tree).
| USelector String Usage
+ -- ^ Record selector.
| UOptional Usage
+ -- ^ Optional element.
| USum Usage Usage
+ -- ^ Sum.
| UProduct Usage Usage
+ -- ^ Product.
| UUnit
+ -- ^ Unit.
| UType String
+ -- ^ Type name, e.g. \"INT\".
+ deriving (Show)
-- | Printing and parsing options.
data Options = Options { fieldSeparator :: Char