2023-10-02 15:04:12 +03:00
|
|
|
> Module Mod_middle
|
|
|
|
|
|
|
|
> Using Mod_def
|
|
|
|
|
|
|
|
```catala-metadata
|
|
|
|
declaration scope S:
|
|
|
|
input x content integer
|
|
|
|
output o1 content Mod_def.S
|
|
|
|
output o2 content money
|
2023-10-09 13:47:02 +03:00
|
|
|
context output o3 content money
|
2023-10-02 15:04:12 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```catala
|
|
|
|
scope S:
|
|
|
|
definition o1 equals output of Mod_def.S
|
2023-10-03 19:19:41 +03:00
|
|
|
definition o2 equals o1.Mod_def.S.sr * 2. + o1.sr / 2.
|
|
|
|
definition o3 equals $44 * (decimal of x)
|
2023-10-02 15:04:12 +03:00
|
|
|
```
|
|
|
|
|
2023-12-05 18:54:14 +03:00
|
|
|
|
|
|
|
|
|
|
|
```catala-test-inline
|
2023-12-05 14:00:15 +03:00
|
|
|
$ catala Typecheck --check-invariants
|
2024-05-03 13:20:09 +03:00
|
|
|
┌─[RESULT]─
|
2024-05-03 16:12:52 +03:00
|
|
|
│ All invariant checks passed
|
2024-05-03 13:20:09 +03:00
|
|
|
└─
|
|
|
|
┌─[RESULT]─
|
2024-05-03 16:12:52 +03:00
|
|
|
│ Typechecking successful!
|
2024-05-03 13:20:09 +03:00
|
|
|
└─
|
2023-12-05 18:54:14 +03:00
|
|
|
```
|
|
|
|
|
2023-10-02 15:04:12 +03:00
|
|
|
```catala-test-inline
|
|
|
|
$ catala typecheck
|
2024-05-03 13:20:09 +03:00
|
|
|
┌─[RESULT]─
|
2024-05-03 16:12:52 +03:00
|
|
|
│ Typechecking successful!
|
2024-05-03 13:20:09 +03:00
|
|
|
└─
|
2023-10-02 15:04:12 +03:00
|
|
|
```
|