Skip to content

Commit 041c717

Browse files
committed
add again
1 parent 6700b6c commit 041c717

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

copy/entries/faking-adts-and-gadts.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,6 @@ all branches return the same type. Instead, the best you can do is have an
193193
returning a value. This is a good plan of action for languages like javascript
194194
(sans typescript), or python without types.
195195
196-
<!-- maybe task = idle | performing string -->
197-
198-
```javascript
199-
```
200-
201-
TODO: rewrite in javascript to hint at ffi example later
202-
203196
In languages without context-binding functions, you might also need to add a
204197
closure-simulating context into your visitor:
205198
@@ -691,7 +684,7 @@ For example, if you have this type representing potential data sources:
691684

692685
```haskell
693686
data Source :: Type -> Type where
694-
ByteSource :: Handle -> Source Word
687+
ByteSource :: Handle -> Source Word
695688
StringSource :: FilePath -> Source String
696689

697690
readByte :: Handle -> IO Word
@@ -1315,11 +1308,11 @@ let ternary
13151308
\(handlers : ExprF p) ->
13161309
handlers.ternary (b p handlers) (x p handlers) (y p handlers)
13171310

1318-
let myExpr
1311+
let testVal
13191312
: Expr Natural
13201313
= add (natLit 5) (add (natLit 6) (natLit 7))
13211314

1322-
in eval myExpr -- 18
1315+
in assert : eval testVal === 18
13231316
```
13241317

13251318
If all of this is difficult to parse, try reviewing both the recursive ADT

0 commit comments

Comments
 (0)