lib: Add documentation for ReportSpec.
This commit is contained in:
		
							parent
							
								
									260283e2f1
								
							
						
					
					
						commit
						c5abefc72f
					
				| @ -210,11 +210,18 @@ rawOptsToReportOpts rawopts = do | |||||||
|           } |           } | ||||||
|     return reportopts |     return reportopts | ||||||
| 
 | 
 | ||||||
|  | -- | The result of successfully parsing a ReportOpts on a particular | ||||||
|  | -- Day. Any ambiguous dates are completed and Queries are parsed, | ||||||
|  | -- ensuring that there are no regular expression errors. Values here | ||||||
|  | -- should be used in preference to re-deriving them from ReportOpts. | ||||||
|  | -- If you change the query_ in ReportOpts, you should call | ||||||
|  | -- `reportOptsToSpec` to regenerate the ReportSpec with the new | ||||||
|  | -- Query. | ||||||
| data ReportSpec = ReportSpec | data ReportSpec = ReportSpec | ||||||
|   { rsOpts      :: ReportOpts |   { rsOpts      :: ReportOpts  -- ^ The underlying ReportOpts used to generate this ReportSpec | ||||||
|   , rsToday     :: Day |   , rsToday     :: Day         -- ^ The Day this ReportSpec is generated for | ||||||
|   , rsQuery     :: Query |   , rsQuery     :: Query       -- ^ The generated Query for the given day | ||||||
|   , rsQueryOpts :: [QueryOpt] |   , rsQueryOpts :: [QueryOpt]  -- ^ A list of QueryOpts for the given day | ||||||
|   } deriving (Show) |   } deriving (Show) | ||||||
| 
 | 
 | ||||||
| instance Default ReportSpec where def = defreportspec | instance Default ReportSpec where def = defreportspec | ||||||
| @ -227,7 +234,7 @@ defreportspec = ReportSpec | |||||||
|     , rsQueryOpts = [] |     , rsQueryOpts = [] | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| -- | Generate a ReportSpec from a set of ReportOpts on a given day | -- | Generate a ReportSpec from a set of ReportOpts on a given day. | ||||||
| reportOptsToSpec :: Day -> ReportOpts -> Either String ReportSpec | reportOptsToSpec :: Day -> ReportOpts -> Either String ReportSpec | ||||||
| reportOptsToSpec day ropts = do | reportOptsToSpec day ropts = do | ||||||
|     (argsquery, queryopts) <- parseQuery day $ querystring_ ropts |     (argsquery, queryopts) <- parseQuery day $ querystring_ ropts | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user