Re:Crystal: Fast as C, Slick as Ruby
by bjz_ on Monday August 08, 2016 @01:03AM
(#12245603)
I know you can do stuff like:
I'm more talking about type parameters on functions, and also constraining by behaviors and protocols. For example the typespec for Elixir's Stream.map/2 (http://elixir-lang.org/docs/stable/elixir/Stream.html#map/2):
Note all the other similarly unspecific type definitions. In a parametrically polmorphic lang, you could do something like:
And perhaps even intersections of behaviours and protocols:
('scuse the Elixir syntax...)
[ Parent
| on HN ]
There are no comments on this comment yet.