Simple Functional Effects with Tag Unions • Richard Feldman • YOW! 2022

  Рет қаралды 11,215

GOTO Conferences

GOTO Conferences

Күн бұрын

Пікірлер: 20
@paryoticu
@paryoticu Жыл бұрын
Roc is getting an effect system, which will be async-capable and will use continuation-passing-style. Wow, terrific news if I understood correctly. Great presentation as always rtfeldman.
@csbnikhil
@csbnikhil Жыл бұрын
For Rust though, map_err calls can be avoided. But that will come at the cost of writing std::convert::From implementations for each.
@humanlytyped
@humanlytyped Жыл бұрын
35:07 isn't this part a monadic bind?
@pdp11
@pdp11 11 ай бұрын
That's just an artefact of the fact that effects can be encoded by monads.
@angeloceccato
@angeloceccato Жыл бұрын
I like the effect system + the row polimorphism of Roc 😍
@humanlytyped
@humanlytyped Жыл бұрын
This is exactly final encoding vs initial encoding. With algebraic data types, we can pair initial encoding with the interpreter pattern to obtain extensible effects. OOP simulates sum types using ad-hoc polymorphism, so we can pair final encoding and the decorator pattern to obtain extensible effects. I like how Roc automatically extends the tags returned from a function. There is probably an analogue in OCaml, I think it's row polymorphism.
@csbnikhil
@csbnikhil Жыл бұрын
In OCaml, Polymorphic Variants enable Row Polymorphism.
@ShawnShaddock
@ShawnShaddock Жыл бұрын
Great video, Roc sounds really cool!
@MaksimVolkau
@MaksimVolkau Жыл бұрын
Scala3 ZIO in Roc but without the environment, right?
@markhamburg5535
@markhamburg5535 Жыл бұрын
How easy does Roc make it to specify that a piece of code is only allowed to perform some effects but not others? For example, could one specify that when running a database transaction we would allow access to the local file system but not to the network in order to limit task latency while holding a connection open on the database? Presumably this would show up as an explicit type for the third type argument for Task? Would the Roc compiler then present an error at the point where you tried to perform a disallowed task or would it error out at the point where the type was explicitly specified?
@aloussase
@aloussase Жыл бұрын
Do syntax would avoid all those Task.await. Event F# has something like that with computation expressions.
@Mik1604
@Mik1604 Жыл бұрын
How is map_err specifically used for Errors only? It seems to me like something like map_type is much more generic and useful.
@Qrzychu92
@Qrzychu92 Жыл бұрын
it's basically monadic bind (your map_type), but for the error path of the code instead of success
@renghenkow
@renghenkow Жыл бұрын
very similar to what nim has as an effect system
@minecraftermad
@minecraftermad 8 ай бұрын
missed chance to mention zig :)
@JT-mr3db
@JT-mr3db Жыл бұрын
This looks very similar to how Parser combinators work. Parsers returning parsers.
@MarkusBurrer
@MarkusBurrer 10 ай бұрын
Is IT possible to do the same Thing in Rust?
@PhthaloJohnson
@PhthaloJohnson 9 ай бұрын
Yes it is. But I imagine it wont be as ergonomic as this because you would have to implement the Task monad manually everywhere. Most of the functional features of Rust are first class because otherwise using them is not nice. Perhaps if you could derive Task automatically with macros but I'm not a big Rust expert so I don't know.
@walrustrent2001
@walrustrent2001 Жыл бұрын
The non-capabilities seem like capabilities to me. Effects are specific beasts that need to be distinguished from purely functional code as much as possible.
Calling Functions Across Languages • Richard Feldman • GOTO 2023
48:35
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Distributed Pure Functions by Richard Feldman
50:30
TigerBeetle
Рет қаралды 9 М.
Episode 7 - Pure Command Handlers and Sparse Timelines for GWTs
23:03
The Event Modeling and Event Sourcing Podcast
Рет қаралды 122
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 990 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Algebraic Effects from Scratch by Kit Langton
1:22:52
Func Prog Sweden
Рет қаралды 16 М.
Why Static Typing Came Back • Richard Feldman • GOTO 2022
52:01
GOTO Conferences
Рет қаралды 153 М.
[Haskell'23] The Evolution of Effects
1:06:11
ACM SIGPLAN
Рет қаралды 6 М.
"Outperforming Imperative with Pure Functional Languages" by Richard Feldman
34:55
Strange Loop Conference
Рет қаралды 90 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН