diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-12-11 20:19:39 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-12-11 20:19:39 +0000 |
| commit | 1e2c50a6aa2a01bb93c5e13e23c9b33860407862 (patch) | |
| tree | 41e49156840262df3519a67083cb6b75dc572bda /examples | |
| parent | 6bcb6101f1d578c82460752b6bc8a3ba0627551a (diff) | |
Use positional fields in examples
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/17-sums/src/HelloWorld.shed | 4 | ||||
| -rw-r--r-- | examples/31-generic-sums/src/HelloWorld.shed | 4 | ||||
| -rw-r--r-- | examples/32-generic-structs-and-sums-inferred-type-args/src/HelloWorld.shed | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/17-sums/src/HelloWorld.shed b/examples/17-sums/src/HelloWorld.shed index 58177d9f..435353bc 100644 --- a/examples/17-sums/src/HelloWorld.shed +++ b/examples/17-sums/src/HelloWorld.shed @@ -1,11 +1,11 @@ -struct Some(.value: String) {} +struct Some(value: String) {} struct None() {} sumtype Option = Some | None; pub fun main() ! Io -> Unit { - printOption!(Some(.value = "hello, world!")); + printOption!(Some("hello, world!")); printOption!(None()); } diff --git a/examples/31-generic-sums/src/HelloWorld.shed b/examples/31-generic-sums/src/HelloWorld.shed index 314546b5..e10456bd 100644 --- a/examples/31-generic-sums/src/HelloWorld.shed +++ b/examples/31-generic-sums/src/HelloWorld.shed @@ -1,11 +1,11 @@ -struct Some[T](.value: T) {} +struct Some[T](value: T) {} struct None() {} sumtype Option[T] = Some[T] | None; pub fun main() ! Io -> Unit { - printOption!(Some[String](.value = "hello, world!")); + printOption!(Some[String]("hello, world!")); printOption!(None()); } diff --git a/examples/32-generic-structs-and-sums-inferred-type-args/src/HelloWorld.shed b/examples/32-generic-structs-and-sums-inferred-type-args/src/HelloWorld.shed index 5a58f8e4..79cd1eb8 100644 --- a/examples/32-generic-structs-and-sums-inferred-type-args/src/HelloWorld.shed +++ b/examples/32-generic-structs-and-sums-inferred-type-args/src/HelloWorld.shed @@ -1,11 +1,11 @@ -struct Some[T](.value: T) {} +struct Some[T](value: T) {} struct None() {} sumtype Option[T] = Some[T] | None; pub fun main() ! Io -> Unit { - printOption!(Some(.value = "hello, world!")); + printOption!(Some("hello, world!")); printOption!(None()); } |
