https://github.com/r8vnhill/algebraic-data-types-kt
Kotlin examples demonstrating algebraic data types (data class and enum class) as part of the DIBS course on software library design.
https://github.com/r8vnhill/algebraic-data-types-kt
algebraic-data-types data-class dibs-course educational enum-class gradle jvm kotlin software-library type-safe
Last synced: 24 days ago
JSON representation
Kotlin examples demonstrating algebraic data types (data class and enum class) as part of the DIBS course on software library design.
- Host: GitHub
- URL: https://github.com/r8vnhill/algebraic-data-types-kt
- Owner: r8vnhill
- License: bsd-2-clause
- Created: 2025-06-20T19:17:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-12T21:45:53.000Z (11 months ago)
- Last Synced: 2025-07-12T22:24:37.208Z (11 months ago)
- Topics: algebraic-data-types, data-class, dibs-course, educational, enum-class, gradle, jvm, kotlin, software-library, type-safe
- Language: Kotlin
- Homepage: https://dibs.ravenhill.cl
- Size: 36.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# π¦ Algebraic Data Types in Kotlin


[](https://opensource.org/licenses/BSD-2-Clause)

[](https://dibs.ravenhill.cl)
[]()
[](https://dibs.ravenhill.cl)
This repository accompanies the lessons on algebraic data types from the **DIBS** course (Design and Implementation of Software Libraries).
It includes runnable Kotlin examples demonstrating how to model both **product types** (with `data class`) and **sum types** (with `enum class` and `sealed`) in idiomatic and safe ways.
>[!note]
> While the course is taught in Spanish, **all code and project content is in English** to encourage accessibility and reuse.
## π Table of Contents
- [π¦ Algebraic Data Types in Kotlin](#-algebraic-data-types-in-kotlin)
- [π Table of Contents](#-table-of-contents)
- [π Related Lessons](#-related-lessons)
- [π§βπ» Getting Started](#-getting-started)
- [Requirements](#requirements)
- [Clone the Repository](#clone-the-repository)
- [π‘οΈ License](#οΈ-license)
- [π DIBS Website](#-dibs-website)
## π Related Lessons
Explore the full lessons on the DIBS course site:
* π [Product types with `data class`](https://dibs.ravenhill.cl/docs/type-fundamentals/algebraic-data-types/records-2/kt/)
* π [Sum types with `enum class`](https://dibs.ravenhill.cl/docs/type-fundamentals/algebraic-data-types/enums/kt/)
* π [Advanced modeling with enumerations](https://dibs.ravenhill.cl/docs/type-fundamentals/algebraic-data-types/idiom-enum/kt)
* π [Sum types with `sealed interface`](https://dibs.ravenhill.cl/docs/type-fundamentals/algebraic-data-types/sealed-interfaces/kt)
Each lesson includes motivation, idiomatic use cases, and annotated code examples designed to help you apply ADTs in real Kotlin libraries.
More lessons will be linked as the course progresses.
## π§βπ» Getting Started
### Requirements
- Java 11 or newer
- [Gradle](https://gradle.org/) (optional β a wrapper is included)
- Recommended: [IntelliJ IDEA](https://www.jetbrains.com/idea/)
> For installation help, see the [setup guide](https://dibs.ravenhill.cl/docs/installation).
### Clone the Repository
```bash
git clone https://github.com/r8vnhill/algebraic-data-types-kt.git
cd algebraic-data-types-kt
```
## π‘οΈ License
This project is licensed under the **[BSD 2-Clause License](./LICENSE)**.
You may use, adapt, and share this code freely for personal, academic, or educational purposes, as long as attribution is given.
## π DIBS Website
The full course β *DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software* β is available at:
π [https://dibs.ravenhill.cl](https://dibs.ravenhill.cl)
There you'll find complete lessons, slides, exercises, and complementary resources (in Spanish).