Coder Social home page Coder Social logo

dynosaur's People

Contributors

filosganga avatar keirlawson avatar kubukoz avatar marko-asplund avatar systemfw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dynosaur's Issues

`Defer[Schema]`, `Invariant[Schema]` instances

We should be able to provide a cats.Defer instance - this would enable usage of Defer[Schema].fix, which would be convenient for recursion (no lazy val, a little harder to mess up).

Edit: of course I didn't check it all the way through, recursive is exactly like fix. Still think the instance might be helpful, though.

Also, Invariant[Schema].

Why does an optional field not allow for null value?

I have a use case with dynamo where in a large dataset, we sometimes modify the schema by adding an attribute to support a new feature, but our process for adding the attribute is eventual so over the course of 24 hours, the old records get updated. The field is nullable by design of the feature, but because our update is eventual, there is a period when I need the field to be optional and nullable.

The documentation here seems to indicate this is not possible. Can this be changed?

Fail on the non-exhausted oneOf schema

Maybe we can find a way to fail on compilation if user provided non-exhaustive ADT legs

sealed trait Foo
case class A extends Foo
case class B extends Foo
case class C extends Foo

val schema : Schema[Foo] = Schema.oneOf[Foo]{alt =>
val schemaA : Schema[A] = ???
val schemaB : Schema[B] = ???

alt(schemaA) |+| alt(schemaB) // fail to compile here, because missing schemaC
}

More verbose error messages in `oneOf`

I like the simplicity of the current error model (just a string is sometimes exactly what you want), but currently if a union fails to decode, you get virtually no information.

Combining the errors somehow would be great to have. Some ideas:

  • Either -> EitherNel (probably the most intrusive change)
  • ReadError as an ADT
  • just combining the strings to a larger string in the decoding logic for alternatives

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.