Better HN
topnewbestaskshowjobs
Log inSign up

jffaufwwasd

4 karma · joined Jun 20, 2025 (1y ago) · 2 submissions

Submissions

comment 1y ago · link · parent

> Having built a few non-trivial projects with Claude Code

Can you clarify what "non-trivial" means here? To me "non-trivial" is writing FoundationDB or Kafka from scratch.

comment 1y ago · link · parent

This is where you should be combining them.

Ok' and Err' as nominal type constructors which are unioned:

    struct Ok<T>(T);
    struct Err<E>(E);

    fn parse_error(input_string: &str) -> Ok Error | Err (ErrorA | ErrorB | ErrorC...)
Or make a sum type

    enum Result<T, E>  {
        Ok(T),
        Err(E),
    }

    fn parse_error(input_string: &str) -> Result<Error, (ErrorA | ErrorB | ErrorC...)>
The error types are unioned for easy composition but you have a top level sum type to differentiate between success and failure.