aboutsummaryrefslogtreecommitdiff
path: root/examples/34-generic-structs/src/HelloWorld.shed
blob: f5a2f013f6c46bd4eafd30737c2045c98ee53cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub fun main() ! Io -> Unit {
    val messageParts = getMessageParts();
    print!(messageParts.part1);
    print!(messageParts.part2);
}

struct Parts[T1, T2](
    .part1: T1,
    .part2: T2,
) {
}

fun getMessageParts() -> Parts[String, String] {
    Parts[String, String](.part1 = "hello, ", .part2 = "world\n")
}