The fay-simplejson package

[Tags:bsd3, library]

SimpleJSON library for Fay.

[Skip to Readme]


Dependencies fay-base (>=0.18) [details]
License BSD3
Copyright Li Meng Jun
Author Li Meng Jun
Stability Unknown
Category Web, Fay
Home page
Bug tracker
Source repository head: git clone
Uploaded Sun Oct 30 07:15:11 UTC 2016 by Lupino
Distributions NixOS:
Downloads 42 total (3 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2016-11-18 [all 7 reports]


  • SimpleJSON


Maintainer's Corner

For package maintainers and hackage trustees

Readme for fay-simplejson

Readme for fay-simplejson-

Fay SimpleJSON

SimpleJSON library for Fay.

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RebindableSyntax  #-}

-- Compile with: fay --package fay-simplejson test.hs --pretty

module Test (main) where

import           Data.Text  (Text, fromString)
import           Prelude
import           SimpleJSON

data Test = Test { xKey :: Text, xValue :: Text }

decoder :: Parser
decoder = withDecoder "Test" [ rawRule "xKey"   "key",
                               rawRule "xValue" "value" ]

encoder :: Parser
encoder = withEncoder [ rawRule "key"   "xKey",
                        rawRule "value" "xValue" ]

main :: Fay ()
main = do
  let test = decode "{\"key\": \"test_key\", \"value\": \"test_value\"}" decoder :: Test
  print test
  print $ encode test encoder



cabal install fay-simplejson

Compile your file:

fay --package fay-simplejson MyFile.hs