Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Brian Beckman: The Zen of Stateless State - The State Monad

Автор: jasonofthel33t

Загружено: 2014-03-23

Просмотров: 49650

Описание:

Concurrency is a problem that faces all developers as we move to the age of ManyCore processor architectures. Managing state is an important aspect of programming generally and for parallel programming especially. The great Brian Beckman demonstrates three ways of labeling a binary tree with unique integer node numbers: (1) by hand, (2) non-monadically, but functionally, by threading an updating counter state variable through function arguments, and (3) monadically, by using a partially generalized state-monad implementation to handle the threading via composition. Of course during this lesson from one of the masters of mathematical programming, we wind through various conversational contexts, but always stay true to the default topic in a stateful monadic way (watch/listen to this piece to understand what this actually means Smiley)

This is another great conversation with astrophysicist and programming master Brian Beckman. Brian is one of the true human treasures of Microsoft. If you don't get mondas, this is a great primer. Even if you don't care about monadic data types, this is worth your time, especially if you write code for a living. This is part 1 of a 2 part series.

See Part 2 here.

Included with this interview is a .zip file containing all of the code and diagrams Brian shows us (including both Haskell and C#). (http://mschnlnine.vo.llnwd.net/d1/ch9...) To understand the State Monad program, it may be best to start with Main, seeing how the various facilities are used, then backtrack through the code learning first the non-monadic tree labeler, starting with the function Label, then finally the monadic tree labeler, starting with the function MLabel.

Below, you will find several exercises for generalizing the constructions further. Brian will monitor this thread so start your coding engines!!


Exercise 2: go from labeling a tree to doing a constrained$0 container computation, as in WPF. Give everything a$0 bounding box, and size subtrees to fit inside their$0 parents, recursively.

Exercise 3: promote @return and @bind into an abstract$0 class "M" and make "SM" a subclass of that.

Exercise 4 (HARD): go from binary tree to n-ary tree.

Exercise 5: Abstract from n-ary tree to IEnumerable; do everything in LINQ! (Hint: SelectMany).

Exercise 6: Go look up monadic parser combinators and implement an elegant parser library on top of your new$0 state monad in LINQ.

Exercise 7: Verify the Monad laws, either abstractly$0 (pencil and paper), or mechnically, via a program, for the state monad.

Exercise 8: Design an interface for the operators @return and @bind and rewrite the state monad so that it implements this interface. See if you can enforce the monad laws (associativity of @bind, left identity of @return, right identity of @return) in the interface implementation.

Exercise 9: Look up the List Monad and implement it so that it implements the same interface.

Exercise 10: deconstruct this entire example by using destructive updates (assignment) in a discipline way that treats the entire CLR and heap memory as an "ambient monad." Identify the @return and @bind operators in this monad, implement them explicitly both as virtual methods and as interface methods.

Brian Beckman: The Zen of Stateless State - The State Monad

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Brian Beckman: Don't fear the Monad

Brian Beckman: Don't fear the Monad

Эксперты обмениваются мнениями: Рич Хики и Брайан Бекман — Inside Clojure

Эксперты обмениваются мнениями: Рич Хики и Брайан Бекман — Inside Clojure

Синьор 1С: 10 привычек, без которых ты не вырастешь

Синьор 1С: 10 привычек, без которых ты не вырастешь

Adventure with Types in Haskell - Simon Peyton Jones (Lecture 1)

Adventure with Types in Haskell - Simon Peyton Jones (Lecture 1)

Erik Meijer: Functional Programming

Erik Meijer: Functional Programming

The Value of Values with Rich Hickey

The Value of Values with Rich Hickey

William Byrd on

William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]

Simon Peyton-Jones: Escape from the ivory tower: the Haskell journey

Simon Peyton-Jones: Escape from the ivory tower: the Haskell journey

Category Theory 10.1: Monads

Category Theory 10.1: Monads

Running a startup on Haskell

Running a startup on Haskell

Brian Beckman: Monads, Monoids, and Mort

Brian Beckman: Monads, Monoids, and Mort

@rae: IO is just the state monad passing the real world

@rae: IO is just the state monad passing the real world

ВСЕ, ЧТО ВЫ НЕ ЗНАЛИ ОБ АТОМЕ И ЯДЕРНОЙ ЭНЕРГИИ

ВСЕ, ЧТО ВЫ НЕ ЗНАЛИ ОБ АТОМЕ И ЯДЕРНОЙ ЭНЕРГИИ

What is a Monad? - Computerphile

What is a Monad? - Computerphile

[Haskell'23] The Evolution of Effects

[Haskell'23] The Evolution of Effects

Monad Transformer State - Michael Snoyman

Monad Transformer State - Michael Snoyman

"Categories for the Working Hacker" by Philip Wadler

No Nonsense Monad & Functor - The foundation of Functional Programming by César Tron-Lozai

No Nonsense Monad & Functor - The foundation of Functional Programming by César Tron-Lozai

George Wilson - The Extended Functor Family

George Wilson - The Extended Functor Family

Why Isn't Functional Programming the Norm? – Richard Feldman

Why Isn't Functional Programming the Norm? – Richard Feldman

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com