Files
haskell/examples/addressbook.capnp
Ian Denhardt f569041319 Add examples from the tutorial to the examples/ directory.
This will be more handy, and it also makes sure they actually build
(provided we remember to sync them -- it would be good to automate
that). This caught the regressions fixed in the previous two commits.
2019-01-13 19:25:16 -05:00

33 lines
508 B
Cap'n Proto

# addressbook.capnp
@0xcd6db6afb4a0cf5c;
struct Person {
id @0 :UInt32;
name @1 :Text;
email @2 :Text;
phones @3 :List(PhoneNumber);
struct PhoneNumber {
number @0 :Text;
type @1 :Type;
enum Type {
mobile @0;
home @1;
work @2;
}
}
employment :union {
unemployed @4 :Void;
employer @5 :Text;
school @6 :Text;
selfEmployed @7 :Void;
# We assume that a person is only one of these.
}
}
struct AddressBook {
people @0 :List(Person);
}