write initial type signature notation proposal #5
1 changed files with 17 additions and 7 deletions
|
@ -1,21 +1,31 @@
|
||||||
#import "../template.typ": conf
|
#import "../template.typ": conf
|
||||||
#show: doc => conf(
|
#show: conf
|
||||||
doc
|
|
||||||
)
|
|
||||||
|
|
||||||
= Type/signature notation
|
= Type/signature notation
|
||||||
multisamplednight marked this conversation as resolved
|
|||||||
|
|
||||||
Operator signature that takes two unnamed arbitrary numbers of the same type and returns another:
|
Operator signature that takes two unnamed arbitrary numbers of the same type and returns another:
|
||||||
`Op<T: Num> [ T T ] -> T`
|
|
||||||
|
```iowo
|
||||||
|
Op<T: Num> [ T T ] -> T
|
||||||
multisamplednight
commented
Should be full codeblocks.
Should be full codeblocks.
```diff
-`Op<T: Num> [ T T ] -> T`
+```iowo
+Op<T: Num> [ T T ] -> T
+```
```
|
|||||||
|
```
|
||||||
|
|
||||||
Operator that takes a 32 bit signed integer and returns another:
|
Operator that takes a 32 bit signed integer and returns another:
|
||||||
`Op i32 -> i32`
|
|
||||||
|
```iowo
|
||||||
|
Op i32 -> i32
|
||||||
|
```
|
||||||
|
|
||||||
Operator that does the same with a generic arbitrary number type:
|
Operator that does the same with a generic arbitrary number type:
|
||||||
`Op<T: Num> T -> T`
|
|
||||||
|
```iowo
|
||||||
|
Op<T: Num> T -> T
|
||||||
|
```
|
||||||
|
|
||||||
One dimensional list of 32 bit signed integers:
|
One dimensional list of 32 bit signed integers:
|
||||||
`[i32]`
|
|
||||||
|
```iowo
|
||||||
|
[i32]
|
||||||
|
```
|
||||||
|
|
||||||
Due to inference, you'll also be able to use that in some mathematical operations with integers:
|
Due to inference, you'll also be able to use that in some mathematical operations with integers:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue
Can be simplified.
Also I suggest adding a title and subtitle once #2 is merged.