This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* argonaut codecs * arbitrary instances * parsers * comments, foreachE * updated ejson dep
- Loading branch information
1 parent
aee7669
commit aef9ce4
Showing
32 changed files
with
2,848 additions
and
1,299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
module SqlSquare | ||
( module AST | ||
( Sql | ||
, encodeJson | ||
, decodeJson | ||
, arbitrarySqlOfSize | ||
, module Sig | ||
, module Lenses | ||
, module Constructors | ||
, module Parser | ||
) where | ||
|
||
import SqlSquare.AST as AST | ||
import Prelude | ||
|
||
import Data.Argonaut as J | ||
import Data.Either (Either) | ||
import Data.Functor.Mu (Mu) | ||
import Data.Json.Extended as EJ | ||
|
||
import Matryoshka (cata, anaM) | ||
|
||
import SqlSquare.Signature as Sig | ||
import SqlSquare.Lenses as Lenses | ||
import SqlSquare.Constructors as Constructors | ||
import SqlSquare.Parser as Parser | ||
|
||
import Test.StrongCheck.Gen as Gen | ||
|
||
type Sql = Mu (Sig.SqlF EJ.EJsonF) | ||
|
||
print ∷ Sql → String | ||
print = cata $ Sig.printSqlF EJ.renderEJsonF | ||
|
||
encodeJson ∷ Sql → J.Json | ||
encodeJson = cata $ Sig.encodeJsonSqlF EJ.encodeJsonEJsonF | ||
|
||
decodeJson ∷ J.Json → Either String Sql | ||
decodeJson = anaM $ Sig.decodeJsonSqlF EJ.decodeJsonEJsonF | ||
|
||
arbitrarySqlOfSize ∷ Int → Gen.Gen Sql | ||
arbitrarySqlOfSize = anaM $ Sig.arbitrarySqlF EJ.arbitraryEJsonF |
Oops, something went wrong.