// types.el — Type definitions and pattern matching.
//
// Demonstrates:
//   - type (struct) definitions
//   - enum definitions with payloads
//   - match expressions with enum patterns

// A user-defined struct type.
// Every field is typed; the type name maps to an Engram graph node.
type User {
    id: Uuid
    name: String
    email: String
}

// An enum with a payload variant.
enum Status {
    Active
    Inactive
    Pending(String)
}

// A function that takes a Status and returns a human-readable string.
fn describe_status(s: Status) -> String {
    return match s {
        Status::Active   => "user is active"
        Status::Inactive => "user is inactive"
        Status::Pending(reason) => "pending: " + reason
    }
}

// Sealed blocks protect sensitive values even in debug builds.
// The runtime enforces that values in sealed blocks are never
// observable through a debugger or memory dump.
sealed {
    let api_key: String = "sk-prod-12345"
}

let status: Status = Status::Pending("email not verified")
let description: String = describe_status(status)
