Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement type expressions #12

@c3d

Description

@c3d

Implement type expressions as documented.

The most important types are:

  • T1 or T2, e.g. for T or error (aka mayfail T)
  • T1 and T2, mostly for traits, e.g. number and ordered
  • not T, mostly for rules that exclude a given set of type, e.g. ln X:not positive is error "Log of negative"

Internally, the compiler currently generates very basic union types using the | operator.

Ideally, we would be able to implement all this in the library only, once the type interface (issue #11) is properly defined. For example:

type T1 or T2 is
    contains Value is T1.contains Value or T2.contains Value

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions