Skip to content

Commit 2c00cf7

Browse files
committed
feat(core): add union type (sum type)
1 parent c29ff9d commit 2c00cf7

File tree

12 files changed

+295
-297
lines changed

12 files changed

+295
-297
lines changed
File renamed without changes.

docs/Definition/01-overloading.md

Lines changed: 0 additions & 102 deletions
This file was deleted.

docs/Terms/02-application.md

Lines changed: 0 additions & 164 deletions
This file was deleted.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# Dependent Type
1+
# Dependent Pi (Function) Type
2+
3+
<script type="module" src="/javascripts/editor.js"></script>
4+
<link rel="stylesheet" href="/static/styles.css">
25

36
Dependent types generalize function types by allowing the result type to depend on the input value. This capability enables richer type systems where the type returned by a function can vary based on its argument.
47

58
## Syntax
69

710
Dependent types are expressed in terms of $\Pi$-types (Pi-types), which describe functions where the return type is dependent on the actual input value. The syntax for dependent function types in Saki is:
811

9-
```scala
12+
```
1013
PiTypeSymbol ::= ‘forall’ | ‘Π’ | ‘∀’
1114
DepFuncType ::= PiTypeSymbol ‘(’ Ident ‘:’ Term ‘)’ ‘->’ Term
1215
```

0 commit comments

Comments
 (0)