The values of a product type typically contain several values, called fields. All values of that type have the same combination of field types. The set of all possible values of a product type is the set-theoretical product, i.e. the Cartesian product, of the sets of all possible values of its field types.
The values of a sum type are typically grouped into several classes, called variants. A value of a variant type is usually created with a quasi-functional entity called a constructor. Each variant has its own constructor, which takes a specified number of arguments with specified types.
The set of all possible values of a sum type is the set-theoretical sum, i.e. the disjoint union, of the sets of all possible values of its variants. Enumerated types are a special case of sum types in which the constructors take no arguments, as exactly one value is defined for each type.
Algebraic data types for fun and profit by Clément Delafargue
As domain driven design practitioners, we have to design datastructures a lot. Often we have to encode our knowledge into a not-so-expressive type system. That's when the trouble starts: our types don't represent exactly what we have.
Algebraic Data Types (or ADTs) are a very powerful tool and help a lot when it comes to design our data types. Moreover, they share interesting properties with addition and multiplication (hence their name).
In this short talk, I'll show you how to use them in scala and javascript, and how their mathematical properties can give you intuition and easy (re)factoring.
Clément Delafargue is the CTO of Clever Cloud. A graduate from École Centrale de Nantes, he has been developing web projects since 2002. He enjoys working both on frontend and backend, as well a...
published: 10 Nov 2016
Algebraic Data Types in 10 Minutes – Daniel Rogozin
In this video, we introduce you to some of the basic data types in Haskell. We have a look at some examples of algebraic data types, pattern matching, and field labels.
FP merch that doesn't suck 👇
https://shop.serokell.io/
Follow on social media:
https://twitter.com/serokell
https://twitter.com/p_morphism
Learn more about us:
https://serokell.io/
https://github.com/serokell
Contact us:
[email protected]
Timestamps:
0:00 Intro
0:32 Sum types
1:51 Product types
3:31 Polymorphic data types
5:32 Field labels
8:23 Maybe
9:44 Either
published: 08 Dec 2021
Algebraic Data Types (ADT) in Scala | Rock the JVM
Written version: http://blog.rockthejvm.com/algebraic-data-types/
This video requires only basic experience with #Scala, although you can transfer the ideas in this video to other languages as well.
In this video we'll explore Algebraic Data Types (or ADTs). We'll look at what kind of problem they solve (data modeling), what kind of ADTs we can have and how they look like, and give some practical advantages of structuring your data as ADTs such that your Scala code is composable, maintainable and easily testable.
Follow Rock the JVM on:
LinkedIn: https://linkedin.com/company/rockthejvm
Twitter: https://twitter.com/rockthejvm
Blog: https://rockthejvm.com/blog
-------------------------------------------------------------------------
Home: https://rockthejvm.com
--------------------------...
published: 20 Jan 2021
11: Algebraic Data Types - Abstraction and Design in Computation
Chapter 11: Algebraic data types - Abstraction and Design in Computation
https://book.cs51.io
–
Video by Brian Yu
https://brianyu.me
published: 02 Feb 2023
Algebraic Data Types + Pattern Matching = Elegant and readable Java code By Balkrishna Rawool
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Project Amber is bringing lot of exciting features to Java. Records, sealed types and many pattern matching features are few important ones. Sealed types and records are the mechanisms to create sum- and product-types respectively. These are two important forms of ADT (Algebraic Data Types). Using ADT along with pattern-matching, we can create APIs that are hard to misuse and create programs that are easier to read.
All in all, in the talk we start with a problem statement and a list of requirements and then we create an implementation step-by-step by introducing requirements one by one. While we do that we make use of records, sealed t...
published: 04 Oct 2023
Marius Jurgelėnas - Algebraic Data Types
Algebraic Data Types (ADTs) are types composed of other types. There are two classes of them - product and sum types. Although there is a better support in JavaScript for product types, we can also use sum types as well. In this lightning talk, Marius, briefly explains what these different ADTs are and how can we use them to better model and think about our data.
Slides: https://slides.com/mariusju/adts#/
published: 04 Jun 2019
Algebraic Data Types | OCaml Programming | Chapter 3 Video 17
More about records vs. variants, and how variants can combine "one of" vs "each of" data.
Textbook: https://cs3110.github.io/textbook
published: 21 Jun 2021
The Algebra of Algebraic Data Types
published: 24 Dec 2012
Total data Types in java(@TeluguPeoples)
Day4
Data Types in n java and its sizes and range
published: 09 Nov 2024
Leveraging (algebraic data) types to make your UI rock solid - Matthias Le Brun | JSHeroes 2023
As we always want to push the envelope and manage more and more on the front-end, our UI code code grew in complexity in the last few years. All of our modern applications deal with three big challenges: optionality (is my data there or not?), fallibility (did my operation succeed?) and asynchronicity (when do I have my data?). Inspired by how typed functional languages treat those, we’ll see how we can leverage TypeScript to deal with them and make a whole category of issues disappear, so that we can focus on the essential parts: making great, accessible interfaces.
As domain driven design practitioners, we have to design datastructures a lot. Often we have to encode our knowledge into a not-so-expressive type system. That'...
As domain driven design practitioners, we have to design datastructures a lot. Often we have to encode our knowledge into a not-so-expressive type system. That's when the trouble starts: our types don't represent exactly what we have.
Algebraic Data Types (or ADTs) are a very powerful tool and help a lot when it comes to design our data types. Moreover, they share interesting properties with addition and multiplication (hence their name).
In this short talk, I'll show you how to use them in scala and javascript, and how their mathematical properties can give you intuition and easy (re)factoring.
Clément Delafargue is the CTO of Clever Cloud. A graduate from École Centrale de Nantes, he has been developing web projects since 2002. He enjoys working both on frontend and backend, as well as learning new languages and tech stacks. He's particulary interested in functional programming.
[QBN-7622]
As domain driven design practitioners, we have to design datastructures a lot. Often we have to encode our knowledge into a not-so-expressive type system. That's when the trouble starts: our types don't represent exactly what we have.
Algebraic Data Types (or ADTs) are a very powerful tool and help a lot when it comes to design our data types. Moreover, they share interesting properties with addition and multiplication (hence their name).
In this short talk, I'll show you how to use them in scala and javascript, and how their mathematical properties can give you intuition and easy (re)factoring.
Clément Delafargue is the CTO of Clever Cloud. A graduate from École Centrale de Nantes, he has been developing web projects since 2002. He enjoys working both on frontend and backend, as well as learning new languages and tech stacks. He's particulary interested in functional programming.
[QBN-7622]
In this video, we introduce you to some of the basic data types in Haskell. We have a look at some examples of algebraic data types, pattern matching, and field...
In this video, we introduce you to some of the basic data types in Haskell. We have a look at some examples of algebraic data types, pattern matching, and field labels.
FP merch that doesn't suck 👇
https://shop.serokell.io/
Follow on social media:
https://twitter.com/serokell
https://twitter.com/p_morphism
Learn more about us:
https://serokell.io/
https://github.com/serokell
Contact us:
[email protected]
Timestamps:
0:00 Intro
0:32 Sum types
1:51 Product types
3:31 Polymorphic data types
5:32 Field labels
8:23 Maybe
9:44 Either
In this video, we introduce you to some of the basic data types in Haskell. We have a look at some examples of algebraic data types, pattern matching, and field labels.
FP merch that doesn't suck 👇
https://shop.serokell.io/
Follow on social media:
https://twitter.com/serokell
https://twitter.com/p_morphism
Learn more about us:
https://serokell.io/
https://github.com/serokell
Contact us:
[email protected]
Timestamps:
0:00 Intro
0:32 Sum types
1:51 Product types
3:31 Polymorphic data types
5:32 Field labels
8:23 Maybe
9:44 Either
Written version: http://blog.rockthejvm.com/algebraic-data-types/
This video requires only basic experience with #Scala, although you can transfer the ideas in...
Written version: http://blog.rockthejvm.com/algebraic-data-types/
This video requires only basic experience with #Scala, although you can transfer the ideas in this video to other languages as well.
In this video we'll explore Algebraic Data Types (or ADTs). We'll look at what kind of problem they solve (data modeling), what kind of ADTs we can have and how they look like, and give some practical advantages of structuring your data as ADTs such that your Scala code is composable, maintainable and easily testable.
Follow Rock the JVM on:
LinkedIn: https://linkedin.com/company/rockthejvm
Twitter: https://twitter.com/rockthejvm
Blog: https://rockthejvm.com/blog
-------------------------------------------------------------------------
Home: https://rockthejvm.com
-------------------------------------------------------------------------
Written version: http://blog.rockthejvm.com/algebraic-data-types/
This video requires only basic experience with #Scala, although you can transfer the ideas in this video to other languages as well.
In this video we'll explore Algebraic Data Types (or ADTs). We'll look at what kind of problem they solve (data modeling), what kind of ADTs we can have and how they look like, and give some practical advantages of structuring your data as ADTs such that your Scala code is composable, maintainable and easily testable.
Follow Rock the JVM on:
LinkedIn: https://linkedin.com/company/rockthejvm
Twitter: https://twitter.com/rockthejvm
Blog: https://rockthejvm.com/blog
-------------------------------------------------------------------------
Home: https://rockthejvm.com
-------------------------------------------------------------------------
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Proj...
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Project Amber is bringing lot of exciting features to Java. Records, sealed types and many pattern matching features are few important ones. Sealed types and records are the mechanisms to create sum- and product-types respectively. These are two important forms of ADT (Algebraic Data Types). Using ADT along with pattern-matching, we can create APIs that are hard to misuse and create programs that are easier to read.
All in all, in the talk we start with a problem statement and a list of requirements and then we create an implementation step-by-step by introducing requirements one by one. While we do that we make use of records, sealed types and pattern matching in Java to create elegant solution with highly readable code.
BALKRISHNA RAWOOL
Balkrishna is currently working at ING Bank as an IT Chapter Lead and he has been in the software industry for 18 years. He enjoys crafting elegant solutions while solving complex challenges. Although he has been working with Java for many years, he finds latest developments in Java quite exciting. He has passion for continuous learning and genuine desire to sharing knowledge. He is currently leading a team that is building a Credit Decisioning Engine for business-customers. Previously, he has served many clients in financial services sector while working at a technology consulting company. In his free time, he enjoys playing chess. The analytical thinking and foresight used in chess is something he finds useful in software development.
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Project Amber is bringing lot of exciting features to Java. Records, sealed types and many pattern matching features are few important ones. Sealed types and records are the mechanisms to create sum- and product-types respectively. These are two important forms of ADT (Algebraic Data Types). Using ADT along with pattern-matching, we can create APIs that are hard to misuse and create programs that are easier to read.
All in all, in the talk we start with a problem statement and a list of requirements and then we create an implementation step-by-step by introducing requirements one by one. While we do that we make use of records, sealed types and pattern matching in Java to create elegant solution with highly readable code.
BALKRISHNA RAWOOL
Balkrishna is currently working at ING Bank as an IT Chapter Lead and he has been in the software industry for 18 years. He enjoys crafting elegant solutions while solving complex challenges. Although he has been working with Java for many years, he finds latest developments in Java quite exciting. He has passion for continuous learning and genuine desire to sharing knowledge. He is currently leading a team that is building a Credit Decisioning Engine for business-customers. Previously, he has served many clients in financial services sector while working at a technology consulting company. In his free time, he enjoys playing chess. The analytical thinking and foresight used in chess is something he finds useful in software development.
Algebraic Data Types (ADTs) are types composed of other types. There are two classes of them - product and sum types. Although there is a better support in Java...
Algebraic Data Types (ADTs) are types composed of other types. There are two classes of them - product and sum types. Although there is a better support in JavaScript for product types, we can also use sum types as well. In this lightning talk, Marius, briefly explains what these different ADTs are and how can we use them to better model and think about our data.
Slides: https://slides.com/mariusju/adts#/
Algebraic Data Types (ADTs) are types composed of other types. There are two classes of them - product and sum types. Although there is a better support in JavaScript for product types, we can also use sum types as well. In this lightning talk, Marius, briefly explains what these different ADTs are and how can we use them to better model and think about our data.
Slides: https://slides.com/mariusju/adts#/
As we always want to push the envelope and manage more and more on the front-end, our UI code code grew in complexity in the last few years. All of our modern a...
As we always want to push the envelope and manage more and more on the front-end, our UI code code grew in complexity in the last few years. All of our modern applications deal with three big challenges: optionality (is my data there or not?), fallibility (did my operation succeed?) and asynchronicity (when do I have my data?). Inspired by how typed functional languages treat those, we’ll see how we can leverage TypeScript to deal with them and make a whole category of issues disappear, so that we can focus on the essential parts: making great, accessible interfaces.
As we always want to push the envelope and manage more and more on the front-end, our UI code code grew in complexity in the last few years. All of our modern applications deal with three big challenges: optionality (is my data there or not?), fallibility (did my operation succeed?) and asynchronicity (when do I have my data?). Inspired by how typed functional languages treat those, we’ll see how we can leverage TypeScript to deal with them and make a whole category of issues disappear, so that we can focus on the essential parts: making great, accessible interfaces.
As domain driven design practitioners, we have to design datastructures a lot. Often we have to encode our knowledge into a not-so-expressive type system. That's when the trouble starts: our types don't represent exactly what we have.
Algebraic Data Types (or ADTs) are a very powerful tool and help a lot when it comes to design our data types. Moreover, they share interesting properties with addition and multiplication (hence their name).
In this short talk, I'll show you how to use them in scala and javascript, and how their mathematical properties can give you intuition and easy (re)factoring.
Clément Delafargue is the CTO of Clever Cloud. A graduate from École Centrale de Nantes, he has been developing web projects since 2002. He enjoys working both on frontend and backend, as well as learning new languages and tech stacks. He's particulary interested in functional programming.
[QBN-7622]
In this video, we introduce you to some of the basic data types in Haskell. We have a look at some examples of algebraic data types, pattern matching, and field labels.
FP merch that doesn't suck 👇
https://shop.serokell.io/
Follow on social media:
https://twitter.com/serokell
https://twitter.com/p_morphism
Learn more about us:
https://serokell.io/
https://github.com/serokell
Contact us:
[email protected]
Timestamps:
0:00 Intro
0:32 Sum types
1:51 Product types
3:31 Polymorphic data types
5:32 Field labels
8:23 Maybe
9:44 Either
Written version: http://blog.rockthejvm.com/algebraic-data-types/
This video requires only basic experience with #Scala, although you can transfer the ideas in this video to other languages as well.
In this video we'll explore Algebraic Data Types (or ADTs). We'll look at what kind of problem they solve (data modeling), what kind of ADTs we can have and how they look like, and give some practical advantages of structuring your data as ADTs such that your Scala code is composable, maintainable and easily testable.
Follow Rock the JVM on:
LinkedIn: https://linkedin.com/company/rockthejvm
Twitter: https://twitter.com/rockthejvm
Blog: https://rockthejvm.com/blog
-------------------------------------------------------------------------
Home: https://rockthejvm.com
-------------------------------------------------------------------------
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Project Amber is bringing lot of exciting features to Java. Records, sealed types and many pattern matching features are few important ones. Sealed types and records are the mechanisms to create sum- and product-types respectively. These are two important forms of ADT (Algebraic Data Types). Using ADT along with pattern-matching, we can create APIs that are hard to misuse and create programs that are easier to read.
All in all, in the talk we start with a problem statement and a list of requirements and then we create an implementation step-by-step by introducing requirements one by one. While we do that we make use of records, sealed types and pattern matching in Java to create elegant solution with highly readable code.
BALKRISHNA RAWOOL
Balkrishna is currently working at ING Bank as an IT Chapter Lead and he has been in the software industry for 18 years. He enjoys crafting elegant solutions while solving complex challenges. Although he has been working with Java for many years, he finds latest developments in Java quite exciting. He has passion for continuous learning and genuine desire to sharing knowledge. He is currently leading a team that is building a Credit Decisioning Engine for business-customers. Previously, he has served many clients in financial services sector while working at a technology consulting company. In his free time, he enjoys playing chess. The analytical thinking and foresight used in chess is something he finds useful in software development.
Algebraic Data Types (ADTs) are types composed of other types. There are two classes of them - product and sum types. Although there is a better support in JavaScript for product types, we can also use sum types as well. In this lightning talk, Marius, briefly explains what these different ADTs are and how can we use them to better model and think about our data.
Slides: https://slides.com/mariusju/adts#/
As we always want to push the envelope and manage more and more on the front-end, our UI code code grew in complexity in the last few years. All of our modern applications deal with three big challenges: optionality (is my data there or not?), fallibility (did my operation succeed?) and asynchronicity (when do I have my data?). Inspired by how typed functional languages treat those, we’ll see how we can leverage TypeScript to deal with them and make a whole category of issues disappear, so that we can focus on the essential parts: making great, accessible interfaces.
The values of a product type typically contain several values, called fields. All values of that type have the same combination of field types. The set of all possible values of a product type is the set-theoretical product, i.e. the Cartesian product, of the sets of all possible values of its field types.
The values of a sum type are typically grouped into several classes, called variants. A value of a variant type is usually created with a quasi-functional entity called a constructor. Each variant has its own constructor, which takes a specified number of arguments with specified types.
The set of all possible values of a sum type is the set-theoretical sum, i.e. the disjoint union, of the sets of all possible values of its variants. Enumerated types are a special case of sum types in which the constructors take no arguments, as exactly one value is defined for each type.