diff --git a/slides.md b/slides.md index 82b6241..72cb74d 100644 --- a/slides.md +++ b/slides.md @@ -120,6 +120,7 @@ asignar a una variable devolver en un return usarlo en una lambda + anidar un switch dentro de un case de otro switch eso significa que tiene que ser exhaustivo --> --- @@ -339,45 +340,26 @@ * AKA ADTs (algebraic data types). * Viene de las matemáticas. * Recursivo. +* Productos y sumas de tipos. + `a + b` `a * b` +* Tienen propiedades algebraicas. + + --- # Otros lenguajes con soporte ADTs -* JVM: Scala, Kotlin, Clojure +* JVM: + * Scala, Kotlin * Rust * C# -* Otros lenguajes funcionales Haskell, F#, OCaml, Lisp, Elixir... - ---- - -# ADTs - -* Productos y sumas de tipos. - `a + b` `a * b` -* Cardinalidad. -* Tienen propiedades algebraicas. - - - ---- - -# ADTs - -* Propiedades algebraicas: - * Identidad: - `a + 0 <=> a` `a * 1 <=> a` - * Distributiva: - `(a * b) + (a * c) <=> a * (b + c)` - * Conmutativa: - `a * b <=> b * a` `a + b <=> b + a` - * Asociativa: - `a + b + c <=> a + (b + c)` `a * b * c <=> a * (b * c)` - - +* TypeScript +* Otros lenguajes funcionales: + * Haskell, F#, OCaml --- @@ -879,6 +861,8 @@ + + --- # Derived Record Creation @@ -971,7 +955,7 @@ --- -# Articulos / Videos +# Artículos / Videos - [Data Oriented Programming](https://www.infoq.com/articles/data-oriented-programming-java/) Brian Goetz - [Data Oriented Programming with Java 21](https://www.youtube.com/watch?v=8FRU_aGY4mY) Nicolai Parlog @@ -984,32 +968,6 @@ - reduce cognitive load. - pattern exhaustiveness. - algebraic data types: - - algegraic: because it has properties like an algebra - - product type - tuples, records, pairs, struts - in java record - cartesian product a * b - cardinality - - sum type - enum - sealed classes and interfaces - a + b - - exponential types are functions - - tree of products and sums - - distributibity - (a * b) + (a * c) <=> a * (b + c) - - commutatibity - a * b <=> b * a - a + b <=> b + a - - identity: - - Unit Type just one value - - associatibity: - a + b + c <=> a + (b + c) - a * b * c <=> a * (b * c) - - currying: - (a, b) -> c <=> a -> b -> c - meta: - target audience - manage expectations