Elixir's intersection types

  Рет қаралды 2,193

German Velasco

German Velasco

Күн бұрын

Elixir is exploring the idea of adding types. During ElixirConf 2023, José Valim talked about the need for an intersection type when specifying types for certain Elixir functions. I checked out the research paper to understand more. Here, I show why we need that type.
For more videos, check out www.elixirstreams.com

Пікірлер: 17
@1astery1
@1astery1 8 ай бұрын
Thanks, I was a bit confused, and your video really clarify that!
@germanvelasco
@germanvelasco 8 ай бұрын
So glad to hear that!
@mythrando
@mythrando 7 ай бұрын
Thank you, I was confused as well and this cleared it up very nicely!
@germanvelasco
@germanvelasco 7 ай бұрын
Glad to hear it!
@aarroisi
@aarroisi Ай бұрын
I hope that it will be possible to separate the type per each function clause and automatically make all function clause's types are combined with an "and". It will be a lot cleaner.
@kostasgkoutis8534
@kostasgkoutis8534 8 ай бұрын
That reminds me a lot function overloading
@encapsulatio
@encapsulatio 8 ай бұрын
Where can I see the video presentations they made on the type system at ElixirConf 2023?
@germanvelasco
@germanvelasco 8 ай бұрын
kzbin.info/www/bejne/nZq8k6RqfdKZfaM
@defman21
@defman21 8 ай бұрын
2:48 I haven’t watched the talks yet, but I’d really appreciate if we could provide a type specification for each of the function’s heads: $ integer() -> integer() def negate(x), do: … $ boolean() -> boolean() def negate(x), do: …
@germanvelasco
@germanvelasco 8 ай бұрын
Yeah, that would be nice. I don't know if there'll be limitations around that, but I like that we can at least break it into multiple lines. It makes it read very nicely.
@bo0tzz
@bo0tzz 8 ай бұрын
José mentioned that you can format the type either way - all at the top, or above each head.
@tshakah
@tshakah 8 ай бұрын
My understanding after watching Jose's video was that you could do this
@cwhy
@cwhy 8 ай бұрын
Like your concise videos, and of course Elixir. Gonna be your 667'th subscriber to break the 666 here 😆
@germanvelasco
@germanvelasco 8 ай бұрын
Thanks for looking out for that number! 👀 😂
@ericg3065
@ericg3065 8 ай бұрын
I still don't see why this is necessary. The guard clause clearly indicates what type of data the function accepts. I just hope Elixir doesn't turn into something similar to TypeScript.
@germanvelasco
@germanvelasco 8 ай бұрын
The guard clause specifies data at runtime. Types would do it at compile time. I too am worried about what types will mean for Elixir, but I know José and team are very careful in their approach. So, I think we'll land with something good -- if they land at all.
@ericg3065
@ericg3065 8 ай бұрын
@@germanvelasco Oh now I see. I like the simplicity of $ integer() -> integer(). If they go with this approach I hope it replaces typespecs. It's a lot easier on the eyes. Elixir is not perfect and has flaws like any other language but I love it's simplicity and expressiveness. It's the only language I've been able to understand at a high level. I hate to see that go away by introducing more complexity to the language. Thanks so much for all of your contributions to Elixir and keep up the good work :)
From $erverless To Elixir | Prime Reacts
22:34
ThePrimeTime
Рет қаралды 94 М.
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 30 МЛН
Эффект Карбонаро и бесконечное пиво
01:00
История одного вокалиста
Рет қаралды 6 МЛН
🍕Пиццерия FNAF в реальной жизни #shorts
00:41
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН
Strong Arrows for Elixir Gradual Typing
4:30
German Velasco
Рет қаралды 1 М.
Fast and Efficient Image Processing in Elixir - Kip Cole
44:12
Elixir Australia
Рет қаралды 524
Which to use? and/or vs &&/|| #elixirlang
3:45
German Velasco
Рет қаралды 526
[Erlang'23] Invited Talk: A Type System for Elixir
43:56
ACM SIGPLAN
Рет қаралды 603
Python 3.12 Generic Types Explained
18:27
ArjanCodes
Рет қаралды 57 М.
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 78 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,4 МЛН
i love you subscriber ♥️ #iphone #iphonefold #shortvideo
0:14
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 2,3 МЛН