Skip to content

Commit

Permalink
toml: refactor and improve documentation (#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
ear7h authored Aug 13, 2021
1 parent 6a1af03 commit 9b43e4b
Show file tree
Hide file tree
Showing 12 changed files with 751 additions and 362 deletions.
2 changes: 1 addition & 1 deletion dhall-toml/dhall-to-toml/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Main where

import Dhall.Toml (dhallToTomlMain)
import Dhall.DhallToToml (dhallToTomlMain)

main :: IO ()
main = dhallToTomlMain
23 changes: 19 additions & 4 deletions dhall-toml/dhall-toml.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Description:
Use this package if you want to convert between dhall expressions and TOML.
You can use this package as a library or an executable:
.
* See "Dhall.Toml" or "Dhall.TomlToDhall" modules if you want to use this
* See "Dhall.DhallToToml" or "Dhall.TomlToDhall" modules if you want to use this
package as a library
* Use @dhall-to-toml@, @toml-to-dhall@ programs from this package if you
want an executable.
.
The "Dhall.Toml" and "Dhall.TomlToDhall" modules also contains instructions
The "Dhall.DhallToToml" and "Dhall.TomlToDhall" modules also contains instructions
for how to use this package
Category: Compiler
Extra-Source-Files:
Expand All @@ -39,9 +39,12 @@ Library
tomland >= 1.3.2.0 && < 1.4 ,
text >= 0.11.1.0 && < 1.3 ,
containers >= 0.5.9 && < 0.7 ,
unordered-containers >= 0.2 && < 0.3
unordered-containers >= 0.2 && < 0.3 ,
prettyprinter >= 1.5.1 && < 1.8
Exposed-Modules:
Dhall.Toml
Dhall.DhallToToml
Dhall.TomlToDhall
Dhall.Toml.Utils
GHC-Options: -Wall
Default-Language: Haskell2010

Expand Down Expand Up @@ -77,3 +80,15 @@ Test-Suite dhall-toml-test
tomland
GHC-Options: -Wall
Default-Language: Haskell2010

Test-Suite doctest
Type: exitcode-stdio-1.0
Hs-Source-Dirs: doctest
Main-Is: Main.hs
Build-Depends:
base ,
directory ,
filepath ,
doctest
GHC-Options: -Wall
Default-Language: Haskell2010
14 changes: 14 additions & 0 deletions dhall-toml/doctest/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Main where

import System.FilePath ((</>))

import qualified System.Directory
import qualified Test.DocTest

main :: IO ()
main = do
pwd <- System.Directory.getCurrentDirectory
prefix <- System.Directory.makeAbsolute pwd
let src = prefix </> "src"
Test.DocTest.doctest [ "--fast", "-i" <> src, src ]

Loading

0 comments on commit 9b43e4b

Please sign in to comment.