Everyday Optics

所在平台: Udemy

课程主页: https://www.udemy.com/course/everyday-optics/

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:日常光学 课程概述:光学的使用需谨慎。在本课程中,我们将探讨光学如何帮助我们读取和修改不同数据结构的部分,例如记录字段、联合体变体或容器元素。此课程并不是对光学的简单概览,而是重点讨论光学的优点、使用时机以及在生产代码中的应用方法。许多人对光学感到恐惧并选择回避,或是过于热爱以至于在所有情况下都使用它们。我们将讨论光学的常见使用方式,包括:使用光学处理简单记录(不推荐)、使用(通用)镜头处理简单和嵌套记录、在特定数据和库中应用光学(如lens-aeson、amazonka),以及在复杂数据和深层嵌套记录中适当使用光学。 本课程将回顾光学,介绍最流行的编码方式、光学解决的问题、命名约定、具体库及技术。此外,我们还将学习如何用光学处理JSON数据。但我们不会讨论:Joker与Twan van Laarhoven之间的较量。 本课程适合以下人群: - 希望开始使用光学的人; - 想将光学引入生产代码中的人员; - 需要理解如何选择光学库的人; - 想找到处理Haskell记录的优雅方式的人; - 希望找到自己使用光学舒适区的人。 本课程不适合以下人群: - 希望获得另一个光学概述的人; - 希望获得构建光学库的理论解释的人; - 想使用和理解花哨运算符的人; - 希望在所有情况下使用光学的人。 在课程中,我们将涵盖几点库:lens、generic-lens、optics、lens-aeson。我们期待您熟悉Haskell及其一些扩展,如OverloadedStrings。课程中将使用DataKinds、DeriveGeneric、DuplicateRecordFields等扩展,每次启用或深入探讨时会给出简要解释。您无需提前了解这些扩展,但如果愿意,可以参考我们的扩展课程。

课程评论(0条)

课程详情

Optics should be used, but they should be used with awareness.Optics allow us to read and modify parts of different data structures, such as fields of records, variants of unions, or elements of containers.This course is not a generic overview of optics - instead, we'll focus on why optics are fantastic, when to use them, when not to use them, and how to use them in the production code.Most people either fear and avoid them or love them so much that they use them for everything. We're going to cover the most common ways of using optics:Use optics to work with simple records (bad idea).Use (generic) lenses to work with simple and nested records.Use optics with specific data and libraries (e.g. lens-aeson, amazonka).Use optics here and there for complex data and deeply nested records.This course will review optics, cover the most popular encodings, the problems optics solve, naming conventions, concrete libraries, and techniques. We'll also learn how to use optics to work with JSON. But we'll not discuss who will win in a fight: Joker from profunctors or Twan van Laarhoven.This course is for people who:want to actually start using optics;want to introduce optics to their production code;want to understand how to choose an optic library;want to find an ergonomic way to deal with Haskell records;or want to find their comfort zone of using optics.This course is not for people who:want another optics overview;want another theoretical explanation on how to build an optic library;want to use and understand fancy operators;or want to use optics for everything.Throughout the course, we're going to cover a few libraries:lensgeneric-lensopticslens-aesonWe expect that you are familiar with Haskell and a few extensions, such as OverloadedStrings. We'll use DataKinds, DeriveGeneric, DuplicateRecordFields, FlexibleContexts, FunctionalDependencies, NamedFieldPuns, OverloadedLabels, RecordWildCards, TemplateHaskell, TypeApplications, and a few others. We'll give a one-two sentence explanation when we enable each extension or dive deeper when it's crucial. So you don't have to know them in advance for this course. But if you want to - see our course on extensions.

课程标签

0人关注该课程

主题相关的课程