Статья «Profunctor optics, a categorical update» от Эмили Пиллмор, Бартоша Милевского и многих других крутых исследователей:
https://arxiv.org/pdf/2001.07488.pdf
https://arxiv.org/pdf/2001.07488.pdf
There's maniacs. There's psychos. Then, there's this guy:
https://twitter.com/alex_christofi/status/1219564301029138432
https://twitter.com/alex_christofi/status/1219564301029138432
Forwarded from Nick Ivanych
Profunctor optics and traversals
Mario Román
https://arxiv.org/abs/2001.08045
Optics are bidirectional accessors of data structures; they provide a powerful abstraction of many common data transformations.
This abstraction is compositional thanks to a representation in terms of profunctors endowed with an algebraic structure called Tambara module.
There exists a general definition of optic in terms of coends that, after some elementary application of the Yoneda lemma, particularizes in each one of the basic optics.
Traversals used to be the exception; we show an elementary derivation of traversals and discuss some other new derivations for optics.
We relate our characterization of traversals to the previous ones showing that the coalgebras of a comonad that represents and split into shape and contents are traversable functors.
The representation of optics in terms of profunctors has many different proofs in the literature; we discuss two ways of proving it, generalizing both to the case of mixed optics for an arbitrary action.
Categories of optics can be seen as Eilenberg-Moore categories for a monad described by Pastro and Street.
This gives us two different approaches to composition between profunctor optics of different families:
using distributive laws between the monads defining them, and using coproducts of monads.
The second one is the one implicitly used in Haskell programming; but we show that a refinement of the notion of optic is required in order to model it faithfully.
We provide experimental implementations of a library of optics in Haskell and partial Agda formalizations of the profunctor representation theorem.
#paper
Mario Román
https://arxiv.org/abs/2001.08045
Optics are bidirectional accessors of data structures; they provide a powerful abstraction of many common data transformations.
This abstraction is compositional thanks to a representation in terms of profunctors endowed with an algebraic structure called Tambara module.
There exists a general definition of optic in terms of coends that, after some elementary application of the Yoneda lemma, particularizes in each one of the basic optics.
Traversals used to be the exception; we show an elementary derivation of traversals and discuss some other new derivations for optics.
We relate our characterization of traversals to the previous ones showing that the coalgebras of a comonad that represents and split into shape and contents are traversable functors.
The representation of optics in terms of profunctors has many different proofs in the literature; we discuss two ways of proving it, generalizing both to the case of mixed optics for an arbitrary action.
Categories of optics can be seen as Eilenberg-Moore categories for a monad described by Pastro and Street.
This gives us two different approaches to composition between profunctor optics of different families:
using distributive laws between the monads defining them, and using coproducts of monads.
The second one is the one implicitly used in Haskell programming; but we show that a refinement of the notion of optic is required in order to model it faithfully.
We provide experimental implementations of a library of optics in Haskell and partial Agda formalizations of the profunctor representation theorem.
#paper
Крутейший @hmemcpy сделал DevContainer для Haskell: https://github.com/hmemcpy/haskell-hie-devcontainer 💪
Для тех, кто не знал — VSCode умеет запускать рабочее окружение в докер-контейнере. Это позволяет, среди прочего, хорошо изолировать разные версии используемой вами платформы — что в случае хаскеля особенно уместно. Детальнее о том, как это всё работает в VSCode, можно почитать у них в документации.
Для тех, кто не знал — VSCode умеет запускать рабочее окружение в докер-контейнере. Это позволяет, среди прочего, хорошо изолировать разные версии используемой вами платформы — что в случае хаскеля особенно уместно. Детальнее о том, как это всё работает в VSCode, можно почитать у них в документации.
GitHub
GitHub - hmemcpy/haskell-hie-devcontainer: A DevContainer for VSCode, for installing GHC 8.6.5, HIE (Haskell IDE Engine) and the…
A DevContainer for VSCode, for installing GHC 8.6.5, HIE (Haskell IDE Engine) and the required plugins - GitHub - hmemcpy/haskell-hie-devcontainer: A DevContainer for VSCode, for installing GHC 8.6...
Весьма внезапная новость — порт изначально скаловской либы на хаскель. 47 Degrees котики :3
Forwarded from bravit-about
Акция с моей книжкой на сайте Маннинга — отличный повод вспомнить про свой канал в телеграме. Если кому-то надо, то по коду dotd020220au дают скидку 50% на Haskell in Depth и заодно на великолепные Get Programming with Haskell и Type-driven development with Idris. https://www.manning.com/dotd
Manning Publications
Deal of the Day
Manning is an independent publisher of computer books, videos, and courses.
За прошедшие выходные я реализовал на TypeScript и опубликовал подход к кодированию алгебраических графов, применяемый в хаскельной библиотеке alga.
Мой репозиторий по предложению автора Alga, Андрея Мохова, был перенесен в организацию Algebraic Graphs, чему я очень рад.
Ставьте звездочки, подписывайтесь, пробуйте использовать, создавайте issues с обратной связью, вот это всё.
Мой репозиторий по предложению автора Alga, Андрея Мохова, был перенесен в организацию Algebraic Graphs, чему я очень рад.
Ставьте звездочки, подписывайтесь, пробуйте использовать, создавайте issues с обратной связью, вот это всё.
GitHub
GitHub - algebraic-graphs/typenoscript: Algebraic graphs implementation in TypeScript
Algebraic graphs implementation in TypeScript. Contribute to algebraic-graphs/typenoscript development by creating an account on GitHub.
Интересная статья о причинах, по которым Discord перевел один из своих сервисов с Go на Rust: https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f
TL;DR: Go запускает свой GC каждые две минуты вне зависимости от роста кучи, в то время как Rustнормальный язык программирования не содержит GC как сущности, вместо этого полагаясь на аффинные типы.
TL;DR: Go запускает свой GC каждые две минуты вне зависимости от роста кучи, в то время как Rust
Medium
Why Discord is switching from Go to Rust
Rust is becoming a first class language in a variety of domains. At Discord, we’ve seen success with Rust on the client side and server…
Обнаружил, что мой доклад «Программирование на уровне типов на TypeScript: выжимаем из компилятора все соки» с эпамовского ITSubbotnik еще в начале декабря выложили на YouTube. Если вдруг кто-то хотел послушать, но не получилось быть на митапе вживую, то теперь есть возможность наверстать упущенное 🙂
Ну и напомню, что слайды и примеры доступны в репозитории на Гитхабе: https://github.com/YBogomolov/talk-typelevel-ts
Ну и напомню, что слайды и примеры доступны в репозитории на Гитхабе: https://github.com/YBogomolov/talk-typelevel-ts
YouTube
Программирование на уровне типов на TypeScript: выжимаем из компилятора все соки | Юрий Богомолов
Из моего доклада вы узнаете о нюансах системы типов TypeScript, которые позволяют сделать первые шаги в сторону формальной верификации программ.
Первая часть доклада посвящена тому, как можно заставить компилятор делать дополнительные проверки корректности…
Первая часть доклада посвящена тому, как можно заставить компилятор делать дополнительные проверки корректности…