lloydmeta / frunk

Funktional generic type-level programming in Rust: HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid and friends.
https://beachape.com/frunk/
MIT License
1.24k stars 56 forks source link

[Examples] Add examples of how to map over generic and labelled representations #192

Closed lloydmeta closed 3 years ago

lloydmeta commented 3 years ago
❯ cargo run --example generic
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/generic`
Joe
First name: bo
Last name: peep
age: 30
❯ cargo run --example labelled
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/labelled`
Blow
ExternalPerson {
    age: 10,
    address: ExternalAddress {
        name: "somewhere out there",
        phone: ExternalPhoneNumber {
            main: 1234,
        },
    },
    name: "John",
}
first_name: bo
last_name: peep
age: 30