hedn: EDN parsing and encoding

[ bsd3, data, library ] [ Propose Tags ]

A EDN parsing and encoding library.

Based on "specs" published at https://github.com/edn-format/edn.


[Skip to Readme]
Versions [faq] 0.1.3.0, 0.1.4.1, 0.1.5.0, 0.1.5.1, 0.1.5.2, 0.1.6.0, 0.1.7.0, 0.1.8.1, 0.1.8.2, 0.1.9.0, 0.1.9.1, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.0.1 (info)
Change log CHANGELOG.md
Dependencies base (>=4.9 && <5), containers (>=0.5.7 && <0.7), deepseq (>=1.4 && <2), deriving-compat (>=0.3.6 && <0.6), megaparsec (>=7.0 && <9), parser-combinators (>=1.0 && <2), prettyprinter (>=1.2 && <2), scientific (==0.3.*), template-haskell (>=2.11 && <3), text (>=1.2 && <2), time (>=1.6 && <2), uuid-types (>=1.0 && <2), vector (>=0.11 && <1) [details]
License BSD-3-Clause
Copyright (c) 2019 Alexander Bondarenko
Author Alexander Bondarenko
Maintainer aenor.realm@gmail.com
Revised Revision 1 made by AlexanderBondarenko at 2020-06-10T10:52:03Z
Category Data
Source repo head: git clone https://gitlab.com/dpwiz/hedn
Uploaded by AlexanderBondarenko at 2020-03-21T10:39:55Z
Distributions LTSHaskell:0.2.0.1, NixOS:0.3.0.1, Stackage:0.2.0.1
Downloads 8342 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-03-21 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for hedn-0.3.0.1

[back to package description]

Haskell EDN

An EDN parsing and encoding library.

Based on spec and hints published on GitHub.

Hackage: https://hackage.haskell.org/package/hedn

Stackage: https://www.stackage.org/package/hedn

Tutorial: https://dpwiz.gitlab.io/hedn

Examples

AST

(#haskell/edn example/kitchensink ; tagged symbol
 nil ; ugh..
 \space ; character
 "dynamic \"typing\"" ; string
 {:numbers ; keyword
  [42 ; integer
   42.0 ; floating
  ] ; Vector
  :bools
  #{true, false} ; Set (with optional commas)
 } ; Map
) ; List
import qualified Data.EDN as EDN
import qualified Data.Text.IO as Text

main = do
  edn <- Text.readFile "example.edn"
  either error print $ EDN.parseText "example.edn" edn
NoTag
  (List
     [ Tagged "haskell" "edn" (Symbol "example" "kitchensink")
     , NoTag Nil
     , NoTag (Character ' ')
     , NoTag (String "dynamic \"typing\"")
     , NoTag
         (Map
            (fromList
               [ ( NoTag (Keyword "bools")
                 , NoTag
                     (Set (fromList [ NoTag (Boolean False) , NoTag (Boolean True) ]))
                 )
               , ( NoTag (Keyword "numbers")
                 , NoTag (Vec [ NoTag (Integer 42) , NoTag (Floating 42.0) ])
                 )
               ]))
     ])