Describing Data...with free applicative functors (and more)
summary
A Scala library called xenomorph describes data as values and uses free applicative structures plus GADTs, Monocle prisms, Argonaut decoders/encoders and fixed-point recursion (HFix/HFunctor) to derive serializers, decoders and ScalaCheck generators from one schema. It avoids macros, composes primitive sets via coproducts, annotates schemas with a higher-order fix to support JSON Schema metadata, and generates UIs at Pellucid Analytics from schemas. Implementations run acceptably in production; compile-time type ascriptions and incremental development are required.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 5:23Serialization and macros problem
- 8:39Data structure definition
- 12:18Schema concept and primitives
- 17:16Sequences and records with applicatives
- 21:31Free applicatives for records
- 28:21Free applicative for schemas
- 32:28Sum types with alternatives
- 37:41Serializing sum types
- 41:13Decoding and test generation
- 44:30Primitives with type classes
- 48:10Composing primitive sets
- 53:17From data to descriptions
- 55:12Annotated schemas
- 1:01:22H-Fix for recursive schemas
- 1:06:22Simplifying recursion with H-Fix
- 1:13:15Key takeaways
related talks
46mMove Over Free Monads: Make Way for Free Applicatives!
01h 02mPrinciples and tools to cleverly model your data in Scala
51mGoing bananas with recursion schemes for fixed point data types
36mDo it with (free?) arrows!
35mThe Functor, Applicative, Monad talk
33mFunctional Patterns and Gems in Scala
40mA Pragmatic Introduction to Category Theories
34mA Year living Freely
