doc: switch to literate idris
Switch entire project over to literate markdown files
This commit is contained in:
parent
0ba73aa1fd
commit
94bbe93db9
11 changed files with 712 additions and 319 deletions
|
@ -1,12 +1,24 @@
|
|||
# Effects utilities
|
||||
|
||||
Contains utility functions extending the functionality of the `eff` package.
|
||||
|
||||
```idris
|
||||
module Util.Eff
|
||||
|
||||
import Control.Eff
|
||||
import Text.ANSI
|
||||
|
||||
-----------------------
|
||||
-- Logging Utilities --
|
||||
-----------------------
|
||||
%default total
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
Use the `WriterL "log" String` effect like a logging library. We'll provide a few "log levels" as verbs for the effect, but no filtering is done, when logging is enabled, all logs are always displayed, however the log level is indicated with a colored tag.
|
||||
|
||||
<!-- idris
|
||||
namespace Logging
|
||||
-->
|
||||
```idris
|
||||
export
|
||||
info : Has (WriterL "log" String) fs => String -> Eff fs ()
|
||||
info str =
|
||||
|
@ -24,3 +36,4 @@ namespace Logging
|
|||
warn str =
|
||||
let tag = show . bolden . show . colored Yellow $ "[WARN]"
|
||||
in tellAt "log" (tag ++ ": " ++ str ++ "\n")
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue