Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge IOHK fork #89

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
81ad9e8
add optional Foreign encoding and decoding
shmish111 May 8, 2019
80774b2
remove TODO
shmish111 May 8, 2019
ecd2bd8
use https://github.com/paf31/purescript-foreign-generic/pull/52
shmish111 May 10, 2019
70f1654
Whitespace changes.
krisajenkins May 17, 2019
02de37e
Refactoring the code to use a structured printing library.
krisajenkins May 20, 2019
d9bf17a
Bugfix for Encode/Decode constraints.
krisajenkins May 21, 2019
8eace90
Bugfix for decode/encode instances on recursive types.
krisajenkins May 22, 2019
4ef961c
You can now generate `Eq` instances for something like `Proxy :: Prox…
krisajenkins May 23, 2019
05b5b62
Whitespace changes.
krisajenkins May 23, 2019
72fbe2d
You can now generate a `Show` instance based on `genericShow`.
krisajenkins May 23, 2019
a7069a5
Aeson-compatible encodings for Enums*.
krisajenkins May 24, 2019
02bd099
Bugfix for Encode/Decode constraints.
krisajenkins May 21, 2019
de2574e
You can now generate a `Show` instance based on `genericShow`.
krisajenkins May 23, 2019
b310e6a
Applying hlint suggestions.
krisajenkins Sep 20, 2019
1fc332d
You can now generate `Ord` instances for something like `Proxy :: Pro…
krisajenkins Sep 20, 2019
e68e46d
Bugfix for genericShow.
krisajenkins Jul 11, 2019
1e7ca3d
genericShow now supports parameterised types.
krisajenkins Aug 2, 2019
5e25608
Adding Functor support.
krisajenkins Aug 9, 2019
0c3dd26
fix haddock
shmish111 Sep 13, 2019
0042602
Version 0.13.1.0.
krisajenkins Sep 20, 2019
fb8a038
Updating for PureScript 0.13.
krisajenkins Sep 30, 2019
a76b119
Adding support for Eq1 instances.
krisajenkins Nov 20, 2019
28c3777
Factoring out some duplicated code in the typeclass instance-generation.
krisajenkins Nov 26, 2019
6a92d78
use a newer stackage
shmish111 Feb 5, 2021
755841f
Merge pull request #1 from input-output-hk/eq1
jhbertra Oct 5, 2021
808d12c
run lorri init
jhbertra Oct 5, 2021
62ead0a
Add flake.nix
jhbertra Oct 5, 2021
2276c49
Update import module for genericShow
jhbertra Oct 5, 2021
13381aa
0.14.0.0
jhbertra Oct 5, 2021
c867392
Remove shell params
jhbertra Oct 5, 2021
0cd3f0c
Merge pull request #3 from input-output-hk/jhbertra/ps-014
jhbertra Oct 5, 2021
0240a54
Replace foreign-generic with Argonaut
jhbertra Oct 8, 2021
542274f
Add roundtrip test project
jhbertra Oct 8, 2021
38b502a
Add compile test
jhbertra Oct 8, 2021
6c5c39d
Add Aesone round trip test
jhbertra Oct 12, 2021
44fe87f
Spawn only one process and check warnings
jhbertra Oct 13, 2021
1e0cebf
Remove Proxy from API
jhbertra Oct 13, 2021
1d311a8
Add lenses to test
jhbertra Oct 13, 2021
f9c9fe9
Fix bugs with nested decoders
jhbertra Oct 13, 2021
69f69a5
Simplify test type
jhbertra Oct 13, 2021
12aa42c
Integrate json helpers
jhbertra Oct 20, 2021
2231292
Refactor printing
jhbertra Oct 20, 2021
7bc806f
Merge pull request #4 from input-output-hk/jhbertra/ps-014
jhbertra Oct 20, 2021
e6d4f98
Export everything again
jhbertra Oct 20, 2021
c898b46
Fix problems with inline records in sum types
jhbertra Oct 25, 2021
55c951d
Make sum type encoding better
jhbertra Oct 25, 2021
2953fb1
Update sum type encode/decode
jhbertra Oct 25, 2021
2f91764
Add recursive types to test
jhbertra Oct 25, 2021
35d863b
Merge pull request #5 from input-output-hk/jhbertra/bug-fixes
jhbertra Oct 25, 2021
132a6d1
Fix handling of multi record constructors
jhbertra Oct 27, 2021
27501fe
Fix encoding of nullary constructors
jhbertra Oct 28, 2021
366fc70
Add support for set and map json
jhbertra Oct 28, 2021
569fc66
Update json-helpers dependency
jhbertra Nov 4, 2021
7d3b750
Add ormolu to nix shell
jhbertra Jan 20, 2022
b4c4069
Add support for custom instances
jhbertra Jan 20, 2022
9550caf
Format everything with ormolu
jhbertra Jan 21, 2022
759012a
Add newlines at the end of module files
jhbertra Jan 21, 2022
a62b87c
Fix type extraction for custom instances
jhbertra Jan 21, 2022
47a1f11
Add import lines for custom instances
jhbertra Jan 21, 2022
2b58aa6
Add package namespacing support
paluh Jun 22, 2022
51e8404
Make package namespacing introduction backward compatible.
paluh Jul 7, 2022
7e554e5
Merge pull request #10 from paluh/master
jhbertra Jul 7, 2022
53f4e98
copy Stylish Haskell, Nix Flake config
peterbecich Sep 18, 2023
94c66ef
fix compilation
peterbecich Sep 24, 2023
faf275c
`nix flake update`
peterbecich Sep 4, 2023
b5fbac0
format with Fourmolu and then Stylish Haskell
peterbecich Sep 24, 2023
cf3de1d
WIP merge IOHK fork
peterbecich Sep 25, 2023
35ecb0e
`genericShow` instance provided by IOHK fork
peterbecich Sep 30, 2023
027e5e7
Encode/Decode instances by IOHK using `purescript-bridge-json-helpers`
peterbecich Sep 30, 2023
a57e39e
bump to version 0.16.0.0; delete boilerplate
peterbecich Sep 30, 2023
fba4c7a
generate `DecodeJsonField`
peterbecich Sep 30, 2023
974d7db
delete unused `CodeGenSwitches`
peterbecich Sep 30, 2023
0d5edfe
fix LSP server for RoundTrip test
peterbecich Oct 1, 2023
88f1e31
fix rendered `EncodeJson` and `DecodeJson` instances
peterbecich Oct 1, 2023
d1a613b
extend example to show failing case
peterbecich Oct 1, 2023
5933ef7
fix printing of import list
peterbecich Oct 1, 2023
a2acbbb
fix printing of imports with/without aliases
peterbecich Oct 1, 2023
c9fa2f0
RoundTrip test succeeds with json-helper library
peterbecich Oct 15, 2023
5480bff
RoundTrip tests for both json-helpers and argonaut-aeson-generic
peterbecich Oct 15, 2023
1bc3046
fix dependency notice for `json-helpers`
peterbecich Oct 16, 2023
eadfb27
clean up example
peterbecich Oct 16, 2023
93e6ab7
fix example using argonaut-aeson-generic
peterbecich Oct 16, 2023
47becfb
improve example to show random errors
peterbecich Oct 16, 2023
c7ebbac
fix Stack project
peterbecich Oct 22, 2023
0b5e11f
temporarily disable tests in Nix
peterbecich Oct 22, 2023
bce383f
improve example
peterbecich Oct 22, 2023
c60400c
make Aeson produce `tag` for `Either`
peterbecich Nov 25, 2023
55e265b
working example of encoding/decoding `Either`
peterbecich Nov 26, 2023
920c236
clean-up
peterbecich Nov 26, 2023
ada7742
readme
peterbecich Jan 3, 2024
fc87b4b
update purescript-bridge-json-helpers
peterbecich Jan 3, 2024
1e9c7d9
update github action
peterbecich Jan 3, 2024
2d6a6e2
get tests passing
peterbecich Jan 3, 2024
3be53bf
improve readme
peterbecich Jan 4, 2024
deed0f3
improve readme, clean-up
peterbecich Jan 4, 2024
95e6034
clean-up
peterbecich Jan 13, 2024
17830c1
`nix flake update`
peterbecich Jan 13, 2024
7069895
changelog
peterbecich Jan 13, 2024
7d7c1d8
stylish-haskell and lint
peterbecich Jan 13, 2024
de32d3f
demonstrate `json-helpers` in the `example`
peterbecich Jan 28, 2024
6f5008a
example, generate PureScript before server starts
peterbecich Jan 28, 2024
83a204d
move example to new Spago
flip111 Feb 25, 2024
d56a437
complete upgrade to new Spago@next
peterbecich Feb 25, 2024
5c86b32
Merge pull request #2 from peterbecich/spago-upgrade
peterbecich Feb 25, 2024
8536ddf
update example package set
peterbecich Feb 25, 2024
e1eee18
remove `Show` constraint; there are issues to be fixed
peterbecich Jan 28, 2024
8c389d1
Fix show instances for unused type variables
flip111 Feb 15, 2024
bfb9ebe
Revert eta reduction of show = genericShow
flip111 Feb 25, 2024
becf65e
Merge pull request #1 from flip111/fix-show2
peterbecich Feb 25, 2024
28053d1
extra-source-files
peterbecich Feb 25, 2024
4439ef6
github action tweak
peterbecich Feb 26, 2024
dd3fabf
`nix flake update`
peterbecich Mar 30, 2024
f2e973c
calendar datatype test
peterbecich Mar 31, 2024
72d87b7
use quasiquoter to clean up tests
peterbecich Mar 31, 2024
392e7b4
`Enum` and `Bounded` require `Eq` and `Ord`
peterbecich Apr 1, 2024
8a04045
`nix flake update`, update Spago
peterbecich Jul 5, 2024
1f1b74e
use Spago Workspaces
peterbecich Jul 6, 2024
d18a14d
provide esbuild
peterbecich Jul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
watch_file flake.lock
watch_file flake.nix
use flake
62 changes: 49 additions & 13 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# modified from https://github.com/jgm/pandoc/blob/master/.github/workflows/ci.yml
name: Haskell library and example

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -17,16 +21,12 @@ jobs:
fail-fast: false
matrix:
versions:
- ghc: '8.6.5'
cabal: '3.6'
- ghc: '8.8.4'
cabal: '3.6'
- ghc: '8.10.4'
cabal: '3.6'
- ghc: '9.0.2'
cabal: '3.6'
- ghc: '9.2.4'
cabal: '3.6'
- ghc: '9.4.6'
cabal: '3.6'
# - ghc: '9.6.3'
# cabal: '3.6'
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -58,13 +58,49 @@ jobs:
dist-newstyle
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local

# - name: Set up a PureScript toolchain
# uses: purescript-contrib/setup-purescript@main
# with: # https://github.com/purescript-contrib/setup-purescript#specify-versions
# spago: "latest"
# purescript: "0.15.13"

- name: Set up new Spago
run: npm install -g spago@next purescript

- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
path: |
.spago
output
test/RoundTripArgonautAesonGeneric/app/output
test/RoundTripJsonHelpers/app/output

- name: Install dependencies
run: |
cabal update
cabal build all --dependencies-only --enable-tests --disable-optimization
- name: Build
cabal update
cabal build all --dependencies-only --enable-tests --disable-optimization
- name: Build Haskell
run: |
cabal build all --enable-tests --disable-optimization 2>&1 | tee build.log
- name: Build PureScript Argonaut test project
run: |
cd test/RoundTripArgonautAesonGeneric/app
spago build
- name: Build PureScript JsonHelpers test project
run: |
cabal build all --enable-tests --disable-optimization 2>&1 | tee build.log
cd test/RoundTripJsonHelpers/app
spago build
- name: Test
run: |
cabal test all --disable-optimization
# There are two PureScript projects which the Haskell tests build and run.
# The first build produces warnings which cause the Haskell tests to fail;
# pre-building these two projects clears these warnings.
cd test/RoundTripArgonautAesonGeneric/app
spago build
cd ../../../
cd test/RoundTripJsonHelpers/app
spago build
cd ../../../
cabal test all --disable-optimization
11 changes: 7 additions & 4 deletions .github/workflows/nix-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- run: nix build
# - run: nix flake check
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: "Check `nix develop` shell"
run: nix develop --check
- run: nix build
- run: nix flake check
18 changes: 11 additions & 7 deletions .github/workflows/purescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with: # https://github.com/purescript-contrib/setup-purescript#specify-versions
purescript: "0.15.4"
# - name: Set up a PureScript toolchain
# uses: purescript-contrib/setup-purescript@main
# with: # https://github.com/purescript-contrib/setup-purescript#specify-versions
# spago: "latest"
# purescript: "0.15.13"

- name: Set up new Spago
run: npm install -g spago@next purescript

- name: Cache PureScript dependencies
uses: actions/cache@v2
Expand All @@ -38,10 +42,10 @@ jobs:
spago install

- name: Build source
run: spago build --no-install
run: spago build

- name: Bundle app
run: spago bundle-app --to static/index.js
run: spago bundle --bundle-type app --outfile static/index.js

- name: Run tests
run: spago test --no-install
run: spago test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ cabal.sandbox.config
dist
dist-*
shell.nix
stack.yaml
.dir-locals.el
.psc-ide-port

Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog for purescript-bridge

## 0.16.0.0 (unreleased)
* merge https://github.com/input-output-hk/purescript-bridge
* support https://github.com/input-output-hk/purescript-bridge-json-helpers
* `CodeGenSwitches` no longer used
* `Proxy` no longer used
* `Printer` uses `Leijen.Text` instead of `Text`
* `genericShow` PureScript instance from IOHK
* I think the same as https://github.com/eskimor/purescript-bridge/pull/85
* PR 85 has been replaced with IOHK's implementation
* some unit tests replaced with IOHK's tests
* all printer imports are combined into one function `instanceToImportLines` instead of being divided between two modules
* excellent `RoundTrip` tests implemented by IOHK
* greatly improves test coverage for both Argonaut and `json-helpers` and exposes issues
93 changes: 80 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,99 @@
# purescript-bridge


[![Haskell library and example](https://github.com/eskimor/purescript-bridge/actions/workflows/haskell.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/haskell.yml) [![Purescript example](https://github.com/eskimor/purescript-bridge/actions/workflows/purescript.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/purescript.yml) [![Nix Flake](https://github.com/eskimor/purescript-bridge/actions/workflows/nix-flake.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/nix-flake.yml)


[![Haskell library and example](https://github.com/eskimor/purescript-bridge/actions/workflows/haskell.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/haskell.yml) [![PureScript example](https://github.com/eskimor/purescript-bridge/actions/workflows/purescript.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/purescript.yml) [![Nix Flake](https://github.com/eskimor/purescript-bridge/actions/workflows/nix-flake.yml/badge.svg)](https://github.com/eskimor/purescript-bridge/actions/workflows/nix-flake.yml)

Translate your Haskell types to PureScript types. It should in theory work for almost all Haskell types, including type constructors!
You just have to instantiate it with dummy parameters from e.g. "Language.PureScript.Bridge.TypeParameters".

Data type translation is fully and easily customizable by providing your own `BridgePart` instances!

The latest version of this project requires **Purescript 0.15**.
The latest version of this project requires **PureScript 0.15**.

## JSON encoding / decoding
### Haskell
Use [`aeson`](http://hackage.haskell.org/package/aeson)'s generic encoding/decoding with default options

### PureScript
There are three PureScript libraries which can interface with Aeson through PureScript bridge. The second, `purescript-argonaut-aeson-generic`, has issues.

For compatible JSON representations:
#### [`input-output-hk/purescript-bridge-json-helpers`](https://github.com/input-output-hk/purescript-bridge-json-helpers.git)

Enable this on the Haskell side with `Language.PureScript.Bridge.SumType.jsonHelpers`.


* this library is demonstrated by the `example`; see `./example/readme.md`.
* see `./test/RoundTripJsonHelpers` for an additional example
* sample Dhall config (for [spago-legacy](https://github.com/purescript/spago-legacy)):
```
, json-helpers =
{ dependencies =
[ "aff"
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "bifunctors"
, "contravariant"
, "control"
, "effect"
, "either"
, "enums"
, "foldable-traversable"
, "foreign-object"
, "maybe"
, "newtype"
, "ordered-collections"
, "prelude"
, "profunctor"
, "psci-support"
, "quickcheck"
, "record"
, "spec"
, "spec-quickcheck"
, "transformers"
, "tuples"
, "typelevel-prelude"
]
, repo =
"https://github.com/input-output-hk/purescript-bridge-json-helpers.git"
, version = "486db9ee62882baa42cca24f556848c5f6bec565"
}
```
#### [`purescript-argonaut-aeson-generic >=0.4.1`](https://pursuit.purescript.org/packages/purescript-argonaut-aeson-generic/0.4.1) ([GitHub](https://github.com/coot/purescript-argonaut-aeson-generic))

* On Haskell side:
* Use [`aeson`](http://hackage.haskell.org/package/aeson)'s generic encoding/decoding with default options
* On Purescript side:
* Use [`purescript-argonaut-aeson-generic >=0.4.1`](https://pursuit.purescript.org/packages/purescript-argonaut-aeson-generic/0.4.1) ([GitHub](https://github.com/coot/purescript-argonaut-aeson-generic))
* Or use [`purescript-foreign-generic`](https://pursuit.purescript.org/packages/purescript-foreign-generic).
* [This branch](https://github.com/paf31/purescript-foreign-generic/pull/76) is updated for Purescript 0.15.
Enable this on the Haskell side with `Language.PureScript.Bridge.SumType.argonautAesonGeneric`.

**TODO**: [resolve incompatibility between Argonaut and Aeson](https://github.com/purescript-contrib/purescript-argonaut-codecs/issues/115)

**Additional requirement**: [`peterbecich/purescript-argonaut-codecs`](https://github.com/peterbecich/purescript-argonaut-codecs.git)
* commit `04abb3eb24a4deafe125be0eb23e2786c642e66b`
* this library is demonstrated by the `example`; see `./example/readme.md`.
* see `./test/RoundTripArgonautAesonGeneric` for additional example
* note that some types have been disabled from the `RoundTripArgonautAesonGeneric` test
* `RoundTripJsonHelpers` tests more types
* the types tested can be expanded when the incompatibility issue is resolved
* sample Dhall config:
```
, argonaut-codecs =
{ dependencies = [ "console" ]
, repo = "https://github.com/peterbecich/purescript-argonaut-codecs.git"
, version = "04abb3eb24a4deafe125be0eb23e2786c642e66b"
}
```
* forked from [`purescript-contrib/purescript-argonaut-codecs`](https://github.com/purescript-contrib/purescript-argonaut-codecs)

#### [`paf31/purescript-foreign-generic`](https://github.com/paf31/purescript-foreign-generic)

See `ForeignObject` in `Language.PureScript.Bridge.SumType`.

This may need to be fixed.

The test coverage is less than the other two libraries.

## Documentation

Usage of this library is documented in `Language.Purescript.Bridge`, with `writePSTypes` you should have everything to get started. Documentation can be found [here](https://www.stackage.org/nightly/package/purescript-bridge).

There is an example; see `./example/readme.md`.

## Status

It works for my use case and is used in production. PRs for more `PSType`s definitions and bridges are very welcome!
Expand Down
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
packages:
.
example/.

tests: true
14 changes: 14 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Regenerate everything
reset && stack run generate-purescript && mv src/Argonaut/* example/src/Argonaut && mv src/JsonHelpers/* example/src/JsonHelpers; cd example && spago bundle --bundle-type app --outfile static/index.js; cd ..

# Regenerate purescript files
reset && cd example && spago bundle --bundle-type app --outfile static/index.js; cd ..

# Roundtrip server example

## Tab 1
stack run example

## Tab 2
cd example/static
parcel serve index.html
23 changes: 12 additions & 11 deletions example/app/GeneratePurescript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ module Main where
import Control.Lens
import Data.Text (pack)
import Language.PureScript.Bridge
import Language.PureScript.Bridge.CodeGenSwitches (ForeignOptions (ForeignOptions),
genForeign,
useGenRep)

import ArgonautTypes
import JsonHelpersTypes
import qualified MyLib
import Types

frontEndRoot :: String
frontEndRoot = "src"
import Types (myBridge)

-- https://discourse.purescript.org/t/latest-and-greatest-haskell-purescript-serialization/1640/6
main :: IO ()
main = do
writePSTypesWith
(useGenRep <> genForeign (ForeignOptions False False))
frontEndRoot
writePSTypesWithNamespace
(Just . PackageName $ pack "Argonaut")
"src"
(buildBridge myBridge)
myArgonautTypes
writePSTypesWithNamespace
(Just . PackageName $ pack "JsonHelpers")
"src"
(buildBridge myBridge)
myTypes
myJsonHelpersTypes
19 changes: 18 additions & 1 deletion example/app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
module Main where

import ArgonautTypes
import Control.Lens
import Data.Text (pack)
import JsonHelpersTypes
import Language.PureScript.Bridge
import qualified MyLib (main)
import Types

main :: IO ()
main = do
putStrLn "Hello, Haskell!"
-- generate PureScript before server starts
writePSTypesWithNamespace
(Just . PackageName $ pack "Argonaut")
"src"
(buildBridge myBridge)
myArgonautTypes
writePSTypesWithNamespace
(Just . PackageName $ pack "JsonHelpers")
"src"
(buildBridge myBridge)
myJsonHelpersTypes

MyLib.main
9 changes: 7 additions & 2 deletions example/example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-type: Simple
extra-source-files: CHANGELOG.md

library
exposed-modules: MyLib, Types
exposed-modules: MyLib, Types, ArgonautTypes, JsonHelpersTypes
hs-source-dirs: src
build-depends: base >=4.8 && <5
, aeson >= 1.5.5.0
Expand All @@ -23,12 +23,17 @@ library
, text
, warp
, purescript-bridge
, QuickCheck
default-language: Haskell2010

executable example
main-is: Main.hs
hs-source-dirs: app
build-depends: base >=4.8 && <5, example
build-depends: base >=4.8 && <5
, example
, purescript-bridge
, text
, lens
default-language: Haskell2010

executable generate-purescript
Expand Down
Loading
Loading