iequ1 / typerefl Goto Github PK
View Code? Open in Web Editor NEWUse Erlang typespecs in the runtime
License: The Unlicense
Use Erlang typespecs in the runtime
License: The Unlicense
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.
Refuse to reflect paradoxical types like
-type foo(A) :: foo(A).
-type bar(A) :: ... | bar(A).
Handle types with free variables, for example:
-type foo :: {_Foo, _Bar}.
Free variables should be replaced with any()
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?
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
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()))
%% ).
Most primitive types can be parsed from string using faster and safer functions like list_to_integer, etc.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.