Тёмный

Elixir's intersection types 

German Velasco
Подписаться 1,5 тыс.
Просмотров 2,2 тыс.
50% 1

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

Наука

Опубликовано:

 

28 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@1astery1
@1astery1 9 месяцев назад
Thanks, I was a bit confused, and your video really clarify that!
@germanvelasco
@germanvelasco 9 месяцев назад
So glad to hear that!
@mythrando
@mythrando 8 месяцев назад
Thank you, I was confused as well and this cleared it up very nicely!
@germanvelasco
@germanvelasco 8 месяцев назад
Glad to hear it!
@kostasgkoutis8534
@kostasgkoutis8534 9 месяцев назад
That reminds me a lot function overloading
@aarroisi
@aarroisi 2 месяца назад
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.
@encapsulatio
@encapsulatio 9 месяцев назад
Where can I see the video presentations they made on the type system at ElixirConf 2023?
@germanvelasco
@germanvelasco 9 месяцев назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-giYbq4HmfGA.html
@defman21
@defman21 9 месяцев назад
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 9 месяцев назад
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 9 месяцев назад
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 9 месяцев назад
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 9 месяцев назад
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 9 месяцев назад
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 9 месяцев назад
@@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 :)
Далее
Olive can see you 😱
01:00
Просмотров 19 млн
From $erverless To Elixir | Prime Reacts
22:34
Просмотров 97 тыс.
All Rust string types explained
22:13
Просмотров 151 тыс.
Should you learn Elixir in 2024?
6:34
Просмотров 79 тыс.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
Просмотров 97 тыс.
Это спасёт камеру iPhone
0:32
Просмотров 91 тыс.