GithubHelp home page GithubHelp logo

katydid / katydid-haskell Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 0.0 1.33 MB

An Encoding Agnostic Validation Language

Home Page: https://katydid.github.io/katydid-haskell/

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.26% Haskell 98.74%
haskell validation automata nested-structures schema

katydid-haskell's Introduction

Katydid

Katydid is a toolkit for trees.

GoDoc Build Status

Katydid Logo

Currently there are three tools in the katydid toolkit:

  • Relapse: a regular expression type language for trees that matches up to 1000000s of records per second,
  • A collection of parsers (protobuf, json, xml, reflected go structures, yaml) which are easily extendable, and
  • A collection of encoders (protobuf, json, xml, reflected go structures) which are useful for dynamic transcoding.

more...

katydid-haskell's People

Contributors

awalterschulze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

katydid-haskell's Issues

Missing files for test suite

This usually means you're missing some other-modules info in your .cabal file:

Building test suite 'katydid-test' for katydid-0.1.0.0..
[1 of 1] Compiling Main             ( test/Spec.hs, dist/build/katydid-test/katydid-test-tmp/Main.o )

test/Spec.hs:10:1: error:
    Could not find module ‘ParserSpec’
    Use -v to see a list of the files searched for.
   |
10 | import qualified ParserSpec
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/Spec.hs:11:1: error:
    Could not find module ‘Suite’
    Use -v to see a list of the files searched for.
   |
11 | import qualified Suite
   | ^^^^^^^^^^^^^^^^^^^^^^

test/Spec.hs:12:1: error:
    Could not find module ‘RelapseSpec’
    Use -v to see a list of the files searched for.
   |
12 | import qualified RelapseSpec
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Gadt for expr

Try refactoring to use GADTs if you want. There are examples on the web of such work. I didn't read deep enough to see if this would be easy or not, but my kneejerk reaction to seeing repetition on ADT for expression is to consider GADTs

Fewer type aliases?

Somewhat of a style choice... But I would tend towards not aliasing the types or using a full newtype

Concise use cases

Can you mention a few real world use cases you have in mind for this, and point out where this fits within prior work? I skimmed docs briefly, but I don't have a strong understanding of when I would choose this over other options.

Also, when would I choose this, if I am exclusively dealing with json?

Would I want to use this validating a tree of data expressed as in-memory Haskell data types?

Utilities for tagged types

Ideally, when I have external data, I want to:

  • parse it
  • validate it
  • construct a new value with a type tagged to note it has been validated

Maybe you can address the final step of creating tagged types?

katydid 0.3 build failure with ghc 8.4

Related to the semigroup changes in ghc 8.4.
See also: https://ghc.haskell.org/trac/ghc/wiki/Migration/8.4#SemigroupMonoidsuperclasses

[ 3 of 23] Compiling Expr             ( src/Expr.hs, dist/build/Expr.o )

src/Expr.hs:283:39: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Expr.hs:4:8-11
                             (and originally defined in ‘GHC.Base’)
                          or ‘Expr.<>’, defined at src/Expr.hs:276:1
    |
283 | cmp a b = compare (_hash a) (_hash b) <>
    |                                       ^^

src/Expr.hs:284:33: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Expr.hs:4:8-11
                             (and originally defined in ‘GHC.Base’)
                          or ‘Expr.<>’, defined at src/Expr.hs:276:1
    |
284 |     compare (_name a) (_name b) <>
    |                                 ^^

src/Expr.hs:285:55: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Expr.hs:4:8-11
                             (and originally defined in ‘GHC.Base’)
                          or ‘Expr.<>’, defined at src/Expr.hs:276:1
    |
285 |     compare (length (_params a)) (length (_params b)) <>
    |                                                       ^^

src/Expr.hs:286:11: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Expr.hs:4:8-11
                             (and originally defined in ‘GHC.Base’)
                          or ‘Expr.<>’, defined at src/Expr.hs:276:1
    |
286 |     foldl (<>) EQ (zipWith cmp (_params a) (_params b)) <>
    |           ^^^^

src/Expr.hs:286:57: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Expr.hs:4:8-11
                             (and originally defined in ‘GHC.Base’)
                          or ‘Expr.<>’, defined at src/Expr.hs:276:1
    |
286 |     foldl (<>) EQ (zipWith cmp (_params a) (_params b)) <>
    |                                                         ^^

I was able to reproduce this locally like so:

stack unpack katydid-0.3.0.0 && cd katydid-0.3.0.0
echo 'resolver: nightly-2018-05-06' > stack.yaml
stack build --haddock --test --bench --no-run-benchmarks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.