@@ -3,6 +3,7 @@ title: Faking ADTs and GADTs in Languages That Shouldn't Have Them
3
3
categories : Haskell
4
4
tags : functional programming, haskell, purescript, dhall, java
5
5
create-time : 2024/11/12 13:59:35
6
+ date : 2025/04/01 10:29:41
6
7
identifier : faking-adts-and-gadts
7
8
slug : faking-adts-and-gadts
8
9
---
@@ -26,11 +27,19 @@ code][profunctor], the sky's the limit!
26
27
27
28
[ profunctor ] : https://www.reddit.com/r/haskell/comments/9m2o5r/digging_reveals_profunctor_optics_in_mineacraft/
28
29
30
+ This is an "April Fools" joke in the tradition of [ my previous one] [ april ] in
31
+ some of these ways that we are going to twist these other languages might seem
32
+ ill-advised or unconventional ... but hopefully they demonstrate some core
33
+ ideas that can inspire actual practical use in your own adventures :)
34
+
35
+ [ april ] : https://blog.jle.im/entry/verified-instances-in-haskell.html
36
+
37
+
29
38
Normal ADTs
30
39
-----------
31
40
32
- Algebraic Data Types (ADTs) are products and sums; that's why they're
33
- algebraic, after all!
41
+ As a reminder, algebraic Data Types (ADTs) are products and sums; that's why
42
+ they're algebraic, after all!
34
43
35
44
### Product Types
36
45
@@ -99,7 +108,8 @@ public class Transaction {
99
108
}
100
109
```
101
110
102
- [ ^ java ] : I didn't think I'd ever write "java bean" non-ironically on my blog.
111
+ [ ^ java ] : I didn't think I'd ever write "java bean" non-ironically on my blog,
112
+ but there's a first time for everything.
103
113
104
114
And there you go. Nothing too surprising there!
105
115
0 commit comments