Giter Club home page Giter Club logo

typerefl's People

Contributors

6293 avatar dddhuang avatar iequ1 avatar k32 avatar savonarola avatar terry-xiaoyu avatar zmstone 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

Watchers

 avatar  avatar  avatar  avatar

typerefl's Issues

Use typerefl to create proper generators

It would be really nice to be able to piggyback on typerefl transform to be able to create proper generators. Should not be very hard, except for small nasty details like size control and so on.

Make calls to the external types lazy

Currently the full term is created when the type function is called. It may be very deep and leads to a lot of duplication. It should be possible to make all calls to the types lazy. Also it will remove the special handling of recursive types

Check function arity

Even though it's impossible to check function return type and arguments in the runtime., it's still possible to at least check function arity

Let's think more about "strings"

When I tried to smart-convert a list of characters to a binary() type using typerefl:from_string(typerefl:binary(), "abc") and expecting <<"abc">>, but it yielded an atom abc.

What I really want is a string in binary format, not to transform something like "<<87, 0>>" to erlang bytes <<87, 0>>, but the type binary() cannot express the meaning accurately.

I understand the type string() has already been used so we cannot change it for backward compatibility, so how about adding a new type bstring() for that?

Free type variables

Handle types with free variables, for example:

-type foo :: {_Foo, _Bar}.

Free variables should be replaced with any()

Ugly type descriptions are generated for parametrized types

print_type_tests.erl:

%% TODO: Correct printing
%% bar_test() ->
%%   ?assertMatch( "print_type_tests:bar() when\n"
%%                 "  print_type_tests:bar() :: print_type_tests:foo(bar) | bar,\n"
%%                 "  print_type_tests:foo(A) :: {foo, A}."
%%               , lists:flatten(typerefl:print(bar()))
%%               ).

Check paradoxical types

Refuse to reflect paradoxical types like

-type foo(A) :: foo(A).

-type bar(A) :: ... | bar(A).

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.