Compare commits

..

25 commits

Author SHA1 Message Date
e986f0fc1d
docs(design): split into function and instruction 2024-01-18 20:17:59 +01:00
41e21bac16
repo: add helpful comment to justfile 2024-01-18 20:17:59 +01:00
a9b69094cc
repo: expand on CONTRIBUTING.md about PRs 2024-01-18 20:17:59 +01:00
47f6025963
repo: switch to nu for just 2024-01-18 20:17:58 +01:00
9a2f982d40
docs: use weak pagebreaks for automatic pagebreaks 2024-01-18 20:17:58 +01:00
5f95f36214
docs: place strategic pagebreaks automatically 2024-01-18 20:17:58 +01:00
ef7ab3e239
docs(design): explain individual lines of input ex 2024-01-18 20:17:58 +01:00
fe96a17551
docs: justify main text 2024-01-18 20:17:58 +01:00
35695537bd
docs(design): rename command -> instruction 2024-01-18 20:17:58 +01:00
cbbe2c3253
docs: only highlight standalone terms 2024-01-18 20:17:58 +01:00
221ca09961
docs: move config from design to template 2024-01-18 20:17:58 +01:00
bebf2a97a4
docs(design): add graph ir repr and explain a bit 2024-01-18 20:17:57 +01:00
b9ea83b1c6
docs(design): get rid of ast 2024-01-18 20:17:57 +01:00
6bd07b639b
docs(design): add larger source example 2024-01-18 20:17:57 +01:00
9233b0e339
docs(contributing): add penpot 2024-01-18 20:17:57 +01:00
b30cbb4d7b
docs(design): actually write some content 2024-01-18 20:17:57 +01:00
32b547f9fa
meta: set up some signs 2024-01-18 20:17:57 +01:00
3746726245
docs: rework template and add stages framework 2024-01-18 20:17:57 +01:00
6217a984a2
repo: make typst compilation more generic 2024-01-18 20:17:57 +01:00
388827a50e
docs: add readme 2024-01-18 20:17:56 +01:00
efdfb5705e
actually write things 2024-01-18 20:17:56 +01:00
70256a7bfc Merge pull request 'write initial type signature notation proposal' (#5) from schrottkatze/iowo:type-notation into main
Reviewed-on: #5
Reviewed-by: multisn8 <forgejo-schrottkatze@multisamplednight.com>
2024-01-11 14:55:56 +00:00
b91e697449 add example for multiple generics 2024-01-11 10:55:25 +01:00
e1dc5ce132 doc: change code from inline to blocks 2024-01-11 10:48:43 +01:00
22a655fd24 write initial type signature notation proposal 2024-01-10 12:45:41 +01:00

View file

@ -0,0 +1,38 @@
#import "../template.typ": conf
#show: conf
= Type/signature notation
Operator signature that takes two unnamed arbitrary numbers of the same type and returns another:
```iowo
Op<T: Num> [ T T ] -> T
```
Operator signature that takes any color and any number type, and returns a color again:
```iowo
Op<C: Color, M: Num> [ C M ] -> C
```
Operator that takes a 32 bit signed integer and returns another:
```iowo
Op i32 -> i32
```
Operator that does the same with a generic arbitrary number type:
```iowo
Op<T: Num> T -> T
```
One dimensional list of 32 bit signed integers:
```iowo
[i32]
```
Due to inference, you'll also be able to use that in some mathematical operations with integers:
`[i32] + i32` is a valid operation, for example (of course, you can't add types.) But that wouldn't add the second one to the list, but rather add the single i32 to all values in the left hand side list). That would also work with more dimensional arrays and dynamic streams like videos.