Prints out type/spec information
(If Haskell has :t, why can't we have it, too?)
iex(15)> t Enum.t/0
@type(t() :: Enum.Iterator.t())
iex(16)> t Enum.all?/2
@spec(all?(t(), fun(element()) do
This is really nice.
Implement a simple version of the t helper for the interactive shell …
…(prints out type/spec information)
Also implements corresponding helper functions in Kernel.Typespec
I love this! Who is working on Googlex? ;) http://www.haskell.org/hoogle/
I believe the code is good, there is just one concern. Today, all in Kernel.Typespec is related to typespecs when a module is being defined. Those new function play directly with the abstract beam code and I wouldn't put them together. Some options are:
Provide __info__(:spec), __info__(:type) and others that would retrieve those from the beam transparently
Create a module specifically for working with beam files and retrieving information from it
PS: @yrashk you don't need to do these changes yourselves, I would just like to figure it out so I can merge and move it to the proper place.
I tend to favour 2) but this is just a small set of helpers over beam_lib, highly related to typespecs only. I believe it might very well belong to Kernel.Typespec as this is related to Kernel.Typespec.to_binary/1
Can we merge this ASAP? Ever since I wrote it I keep missing while debugging typespec related issues in other branches
(and... may be we can merge first, relocate functions [if necessary at all] later?)
We can re-introduce Typespec module if you want?