Giter VIP home page Giter VIP logo

tyyppi's Introduction

Tyyppi    Kantox ❤ OSS  Test  Dialyzer

Library bringing erlang typespecs to runtime.

Provides on-the-fly type validation, typed structs with upserts validation and more.

Installation

def deps do
  [
    {:tyyppi, "~> 0.1"}
  ]
end

Changelog

  • 0.12.3 — update to modern stack + eliminate warnings
  • 0.12.2Tyyppi.Value.float
  • 0.12.0Tyyppi.Value.date
  • 0.11.1{Struct,Value}.valid?/1, Struct.errors/1
  • 0.11.0{Struct,Value}.flatten/{1,2}
  • 0.10.0mix tyyppi.dump to dump types to dets or binary for the Stats process
  • 0.9.0Struct.as_value(%Struct{})
  • 0.8.1 — Cosmetics, better dialyzer, Value.string() and various fixes
  • 0.8.0Tyyppi.Valuable behaviour + better docs
  • 0.7.0 — Generators + Collectable + Enumerable + Nested Structs
  • 0.6.0Tyyppi.Value for Struct + Jason.Encoder if Jason is presented + bugfixes
  • 0.5.0Tyyppi.Value + constructors + ~t|| sigil to produce Tyyppi types
  • 0.4.0 — per-field coercions and validations via cast_field/1 and validate_field/1
  • 0.3.0 — use :ets for type information when the process was not started

tyyppi's People

Contributors

am-kantox avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

tyyppi's Issues

Introduce types structs + Access

defmodule MyStruct do
  deftypedstruct foo: {:ok, atom()}, bar: GenServer.on_start()
end

MyStruct.put(%MyStruct{}, :foo, :ok) #⇒ ✓
MyStruct.put(%MyStruct{}, :foo, 42) #⇒ ✗
put_in(%MyStruct{}, [:foo], 42) #⇒ ✗

defoverridable cast_key/1

Generate overridable functions accepting anything returning type for this field, call it from put.

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.