Skip to content

Commit 9b43e4b

Browse files
authored
toml: refactor and improve documentation (#2263)
1 parent 6a1af03 commit 9b43e4b

File tree

12 files changed

+751
-362
lines changed

12 files changed

+751
-362
lines changed

dhall-toml/dhall-to-toml/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Main where
22

3-
import Dhall.Toml (dhallToTomlMain)
3+
import Dhall.DhallToToml (dhallToTomlMain)
44

55
main :: IO ()
66
main = dhallToTomlMain

dhall-toml/dhall-toml.cabal

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Description:
1313
Use this package if you want to convert between dhall expressions and TOML.
1414
You can use this package as a library or an executable:
1515
.
16-
* See "Dhall.Toml" or "Dhall.TomlToDhall" modules if you want to use this
16+
* See "Dhall.DhallToToml" or "Dhall.TomlToDhall" modules if you want to use this
1717
package as a library
1818
* Use @dhall-to-toml@, @toml-to-dhall@ programs from this package if you
1919
want an executable.
2020
.
21-
The "Dhall.Toml" and "Dhall.TomlToDhall" modules also contains instructions
21+
The "Dhall.DhallToToml" and "Dhall.TomlToDhall" modules also contains instructions
2222
for how to use this package
2323
Category: Compiler
2424
Extra-Source-Files:
@@ -39,9 +39,12 @@ Library
3939
tomland >= 1.3.2.0 && < 1.4 ,
4040
text >= 0.11.1.0 && < 1.3 ,
4141
containers >= 0.5.9 && < 0.7 ,
42-
unordered-containers >= 0.2 && < 0.3
42+
unordered-containers >= 0.2 && < 0.3 ,
43+
prettyprinter >= 1.5.1 && < 1.8
4344
Exposed-Modules:
44-
Dhall.Toml
45+
Dhall.DhallToToml
46+
Dhall.TomlToDhall
47+
Dhall.Toml.Utils
4548
GHC-Options: -Wall
4649
Default-Language: Haskell2010
4750

@@ -77,3 +80,15 @@ Test-Suite dhall-toml-test
7780
tomland
7881
GHC-Options: -Wall
7982
Default-Language: Haskell2010
83+
84+
Test-Suite doctest
85+
Type: exitcode-stdio-1.0
86+
Hs-Source-Dirs: doctest
87+
Main-Is: Main.hs
88+
Build-Depends:
89+
base ,
90+
directory ,
91+
filepath ,
92+
doctest
93+
GHC-Options: -Wall
94+
Default-Language: Haskell2010

dhall-toml/doctest/Main.hs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Main where
2+
3+
import System.FilePath ((</>))
4+
5+
import qualified System.Directory
6+
import qualified Test.DocTest
7+
8+
main :: IO ()
9+
main = do
10+
pwd <- System.Directory.getCurrentDirectory
11+
prefix <- System.Directory.makeAbsolute pwd
12+
let src = prefix </> "src"
13+
Test.DocTest.doctest [ "--fast", "-i" <> src, src ]
14+

0 commit comments

Comments
 (0)