MuniHac 2022 - Friday, October 7 - Joachim Breitner: Getting recursive definitions off their bottoms
Haskell claims to be a declarative language, where you just write down some equations, and suddenly the variables contain the solution to these equations. This works even with recursive equations, but only in some cases: defining recursive functions, of course, but also cyclic data structures. One can even apply so-called knot-tying tricks, where a lazy data structure is filled with values that refer to that data structure! For example, one can very elegantly calculate the reachable nodes in a graph.
… until the graph is cyclic, and suddenly our nice elegant Haskell program silently runs in circles and will not produce an answer.
This is unfortunate: The involved equations, although recursive, do nicely declaratively describe the solution we want! So let’s make it happen!
We’ll see types (Booleans, Sets) that seem to behave just like the normal ones, but recursive definition somehow magically produce the expected result. And all that in pure code, no monads anywhere! We’ll see a few use cases that can suddenly be solved much more elegantly.
Then we’ll look under the hood of this (arguably) safe API, won’t be deterred by unsafePerformIO, and find some very imperative, monad-infested, concurrency-worried code that implements a form of “propagator”. We’ll notice that there is plenty we can do to improve their performance, but won’t actually go there. Instead, we’ll turn back to the “pure” interface and discuss together if that is still really “pure”, and what does that mean anyways.
Видео MuniHac 2022 - Friday, October 7 - Joachim Breitner: Getting recursive definitions off their bottoms канала TNG Technology Consulting GmbH
… until the graph is cyclic, and suddenly our nice elegant Haskell program silently runs in circles and will not produce an answer.
This is unfortunate: The involved equations, although recursive, do nicely declaratively describe the solution we want! So let’s make it happen!
We’ll see types (Booleans, Sets) that seem to behave just like the normal ones, but recursive definition somehow magically produce the expected result. And all that in pure code, no monads anywhere! We’ll see a few use cases that can suddenly be solved much more elegantly.
Then we’ll look under the hood of this (arguably) safe API, won’t be deterred by unsafePerformIO, and find some very imperative, monad-infested, concurrency-worried code that implements a form of “propagator”. We’ll notice that there is plenty we can do to improve their performance, but won’t actually go there. Instead, we’ll turn back to the “pure” interface and discuss together if that is still really “pure”, and what does that mean anyways.
Видео MuniHac 2022 - Friday, October 7 - Joachim Breitner: Getting recursive definitions off their bottoms канала TNG Technology Consulting GmbH
Показать
Комментарии отсутствуют
Информация о видео
7 октября 2022 г. 18:38:25
01:03:45
Другие видео канала
![Big Techday 23: Glean: Query your Code [EN] - Simon Marlow, Meta Research](https://i.ytimg.com/vi/eFglEyb-KfM/default.jpg)
![MuniHac 2020: Duncan Coutts - Contravariant Logging: How to add logging without getting grumpy](https://i.ytimg.com/vi/qzOQOmmkKEM/default.jpg)
![Big Techday 22: Mindblowing P2P Stealth App [EN] - Mathias Buus Madsen, Holepunch Inc](https://i.ytimg.com/vi/QWWHKLyCFTU/default.jpg)
![MuniHac 2020: Andrew Lelechenko - Polynomials in Haskell](https://i.ytimg.com/vi/NAs3ExQZUjA/default.jpg)
![vBTD13: Startup by Accident - Teja Philipp](https://i.ytimg.com/vi/2QEkf2SBAVM/default.jpg)
![Trailer vBTD13: Künstliche Intelligenz in der Chemie: Computer und Wissenschaftler Hand in Hand](https://i.ytimg.com/vi/wdrxNMEMte4/default.jpg)
![MuniHac 2022 - Saturday, October 8 - Krzysztof Gogolewski: Quines and metaprogramming](https://i.ytimg.com/vi/Rnji4rZT51s/default.jpg)
![Semantic fingerprinting: Democratising natural language processing](https://i.ytimg.com/vi/iZlUj6TKl70/default.jpg)
![BTD11: Hilfe, Kind im Brunnen - Systematisch technische Schulden abbauen](https://i.ytimg.com/vi/t5UjySfIDZ4/default.jpg)
![Quantum vs Classical Optimization: A Status Update on the Arms Race](https://i.ytimg.com/vi/CcZPcKbLn1o/default.jpg)
![Tale of two Cities: the Future of Applied Smart Cities on Cities and Towns - Barcelona and Beasain](https://i.ytimg.com/vi/cB6PXfl0P3c/default.jpg)
![BTD12: Building a Useful Chatbot: Beyond the ML and NLP, Dr. Andreea Hossmann](https://i.ytimg.com/vi/ROH7N6yQNoE/default.jpg)
![Hyperloop: Designing and Building the Future of Transportation](https://i.ytimg.com/vi/9lFQKYoh5E4/default.jpg)
![Die Zukunft der Hardware-Entwicklung - Brauchen wir neue Systemkonzepte für Künstliche Intelligenz?](https://i.ytimg.com/vi/NjwSKP8ypOI/default.jpg)
![BTD21: Brain Computer Interfaces Demystified [DE] - Förtsch, Mayer, Endres, TNG](https://i.ytimg.com/vi/1DX6xaH8oD4/default.jpg)
![BTD21: IoT Device Data Processing at KONUX from Zero to One [EN] - Marc Gaines, KONUX GmbH](https://i.ytimg.com/vi/a5wOp3sFbio/default.jpg)
![MuniHac 2020: Nicolas Wu - Persistence makes a Difference](https://i.ytimg.com/vi/n76Qtqj2Vwg/default.jpg)
![BTD12: Building a Self-Driving RC Car, Bert Jan Schrijver](https://i.ytimg.com/vi/vWZZ-c8hDTg/default.jpg)
![Big Techday 23: Generative Data Calibrates the Sky [EN] - Dr Tamás Varga, LMU Munich](https://i.ytimg.com/vi/-jvkoLUZ70U/default.jpg)
![BTD21: Have you secured your DevOps recently? [EN] - Dr. Benjamin Goose, Dr. Christoph Niehoff, TNG](https://i.ytimg.com/vi/Ibon3sLaI5k/default.jpg)