tony-lang / spec

Formal syntax specification of the Tony programming language
https://tony-lang.github.io/docs/reference/syntax
MIT License
0 stars 0 forks source link

Factory refinement types #17

Open jonhue opened 3 years ago

jonhue commented 3 years ago

Allow refinement types to act as factory and be instantiated in different circumstances with varying parameters.

# define as
type GreaterThan<a>(x :: a) := [y ~ a | y > x]

# use as
GreaterThan<Number>(5)

Can only be instantiated with literals.

Also allow instantiated parametric types on the right hand side.

jonhue commented 3 years ago

depends on tony-lang/spec#16