All Projects → justinwoo → Purescript Simple Json

justinwoo / Purescript Simple Json

Licence: mit
A simple Purescript JSON library that uses types automatically

Programming Languages

purescript
368 projects

Labels

Projects that are alternatives of or similar to Purescript Simple Json

Sass Vars Loader
Use Sass variables defined in Webpack config or in external Javascript or JSON files
Stars: ✭ 112 (-4.27%)
Mutual labels:  json
Just Dashboard
📊 📋 Dashboards using YAML or JSON files
Stars: ✭ 1,511 (+1191.45%)
Mutual labels:  json
Fetch Plus
🐕 Fetch+ is a convenient Fetch API replacement with first-class middleware support.
Stars: ✭ 116 (-0.85%)
Mutual labels:  json
Sketch Json
Transform sketch files to json and json to sketch files
Stars: ✭ 113 (-3.42%)
Mutual labels:  json
World Currencies
Currency information in JSON
Stars: ✭ 114 (-2.56%)
Mutual labels:  json
Alembic
⚗️ Functional JSON Parser - Linux Ready 🐧
Stars: ✭ 115 (-1.71%)
Mutual labels:  json
Repurrrsive
Recursive lists to use in teaching and examples, because there is no iris data for lists.
Stars: ✭ 112 (-4.27%)
Mutual labels:  json
Groq
Specification for GROQ - Graph-Relational Object Queries
Stars: ✭ 117 (+0%)
Mutual labels:  json
Mockit
A tool to quickly mock out end points, setup delays and more...
Stars: ✭ 1,534 (+1211.11%)
Mutual labels:  json
Kafka Connect Spooldir
Kafka Connect connector for reading CSV files into Kafka.
Stars: ✭ 116 (-0.85%)
Mutual labels:  json
Marklogic Data Hub
The MarkLogic Data Hub: documentation ==>
Stars: ✭ 113 (-3.42%)
Mutual labels:  json
Symfony Jsonapi
JSON API Transformer Bundle for Symfony 2 and Symfony 3
Stars: ✭ 114 (-2.56%)
Mutual labels:  json
Fleece
A super-fast, compact, JSON-equivalent binary data format
Stars: ✭ 114 (-2.56%)
Mutual labels:  json
Datafiles
A file-based ORM for Python dataclasses.
Stars: ✭ 113 (-3.42%)
Mutual labels:  json
Administrative Divisions Of China
中华人民共和国行政区划:省级(省份直辖市自治区)、 地级(城市)、 县级(区县)、 乡级(乡镇街道)、 村级(村委会居委会) ,中国省市区镇村二级三级四级五级联动地址数据。
Stars: ✭ 11,727 (+9923.08%)
Mutual labels:  json
Webhub
📦前端资源/学习/问题整理中心,请看issue
Stars: ✭ 112 (-4.27%)
Mutual labels:  json
Moyamapper
快速解析模型工具,支持RxSwift。同时支持缓存功能 【相关手册 https://MoyaMapper.github.io 】
Stars: ✭ 115 (-1.71%)
Mutual labels:  json
Easy Canvas
小程序简单绘图,通过 json 方式绘制一张朋友圈分享图
Stars: ✭ 117 (+0%)
Mutual labels:  json
Captagent
100% Open-Source Packet Capture Agent for HEP
Stars: ✭ 116 (-0.85%)
Mutual labels:  json
Zoya
Truly highly composable logging utility
Stars: ✭ 116 (-0.85%)
Mutual labels:  json

Purescript-Simple-JSON

build status documentation status

A simple Foreign/JSON library based on the Purescript's RowToList feature.

Quickstart

Get going quickly with the Quickstart section of the guide: https://purescript-simple-json.readthedocs.io/en/latest/quickstart.html

You may also be interested in this presentation about how Simple-JSON works well with PureScript-Record: https://speakerdeck.com/justinwoo/easy-json-deserialization-with-simple-json-and-record. Note that the slides are based on an older version of the library and on PureScript 0.11.6, and it is not necessary to understand these slides to get started.

Usage

In brief:

type MyJSON =
  { apple :: String
  , banana :: Int
  , cherry :: Maybe Boolean
  }
  
decodeToMyJSON :: String -> Either (NonEmptyList ForeignError) MyJSON
decodeToMyJSON = SimpleJSON.readJSON

See the API Docs or the tests for usage.

There is also a guide for how to use this library on Read the Docs.

Warning: Maybe

This library will decode undefined and null as Nothing and write Nothing as undefined. Please use the Nullable type if you'd like to read and write null instead. Please take caution when using Maybe as this default may not be what you want.

FAQ

How do I use this with Affjax?

Please see this page in the guide: https://purescript-simple-json.readthedocs.io/en/latest/with-affjax.html

How do I change how some fields of my JSON objects are read?

Please see this page in the guide: https://purescript-simple-json.readthedocs.io/en/latest/inferred-record-types.html

How do I work with data Types?

Please see this page in the guide: https://purescript-simple-json.readthedocs.io/en/latest/generics-rep.html

Why won't you accept my Pull Request?

Please read this appeal from another open source author: https://github.com/benbjohnson/litestream#open-source-not-open-contribution

How should I actually use this library?

James Brock has informed me that people still do not understand that this library should be used not as a library. If you do not like any of the behavior in this library or would like to opt out of some behaviors, you should copy this library into your own codebase. Please see that this libraries does not actually contain many lines of code and you should be able to learn how to construct this library from scratch with a few days of reading.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].