Skip to content

errorhandling #16

Open
Open

Description

@StefanHoutzager

Interesting work. Have you looked into "type safe errorhandling"? For example https://dev.to/_gdelgado/type-safe-error-handling-in-typescript-1p4n explains it a bit.

Activity

  1. Lucifier129 commented on Dec 26, 2020

    @Lucifier129
    Collaborator

    Yeah, I have learned Haskell and Rust, but haven't seen the article above before.

  2. uinz commented on Dec 26, 2020

    @uinz
    Contributor

    To be honest, I tend to confuse errors and exceptions at work,but I think they are very different

  3. Lucifier129 commented on Dec 26, 2020

    @Lucifier129
    Collaborator

    @uinz Maybe thinking with the inhabitants of type can help.

    • zero inhabitants type like Void or never or panic, means halt, no program can run.
    • 1 + a inhabitants type like Maybe in Haskell, or Option in Rust, encode the empty or defaults with a specific type
    • a + b inhabitants types like Either in Haskell, or Result in Rust, encode the union of two types.

    Choice the appropriate one to model the problem we are facing in some domains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions