Skip to content

Consider splitting Nothing<T> into None<T> and Nil<T> #42

Open
@amikheychik

Description

@amikheychik

The key feature of the Maybe monad implementation is its strict typing. For example, the type of just().value is always T.

But the type of nothing().value and nil().value is null | undefined, even internally these two functions create Nothing with either undefined or null.

This can be improved by making the Nothing class abstract and introducing two concrete classes Nil and None with null and undefined values only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    package:maybeIssues for the @perfective/common/maybe package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions