Skip to content

Simplify Result(T) #4

@ghost

Description

So, if Result(T) is interface, why not just create two

type ok(type T) T
// Implement Result(T)

type err(type T) error
// Implement Result(T)

types implementing Result(T)?

  • More similar to Rust's Result(T) (you can add type ok(T), err(T) constraint to prohibit any other implementations)
  • Ok's size is equal to T and Err's size is equal to error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions