Moiz Merchant - Functional Error Handling in Python - λC 2018
I had the privilege of working on a functional Scala codebase a few years ago. During my 18-month adventure, I was introduced to error handling concepts from the depths of category theory. My first acquaintance was Option: value or no value, a container allowing me to deal with null values with a clean interface. Then came Try, slaying my utter disgust of exception abuse. Lastly, I stumbled onto Scalaz's \/ (a right-biased Either). What a wonderful world I had been introduced to, error handled managed in a sane and clean way. Life was good.
Fast-forward 3 years: back into the land of Python. My second assignment at the new gig was to implement a fixed-length parser for an incoming file format. Easy, I thought to myself. Reaching down into my tool belt, my hands came up empty. Huh? I no longer had the magical ninja weapons to tame my errors. Sadness filled me. Refusing to accept my fate, I became resolute on forging my own tools.
The result is a tiny Pythonic library (inspired by Scalaz), implementing Option, Try, and Either. My goal is to keep the code as close to idiomatic Python as possible while still implementing the code in a functional way. The code should integrate seamlessly into existing Python without looking out of place like many other implementations I ran into. Python's many functional faces made this all possible: using Python's generator comprehension to implement a Haskell-like do construct, class construction to implement a Try constructor which returned the proper child type of Success/Failure on exception, and various operators available to implement aliases for swap and getOrElse.
Future goals include expanding functional abstractions/implementations and thinking about the usefulness of high abstractions.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Moiz Merchant - Functional Error Handling in Python - λC 2018», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.