strega-nil / stregaml

Experimenting with a language implementation in ocaml
Apache License 2.0
33 stars 0 forks source link

Polymorphism #12

Open strega-nil opened 5 years ago

strega-nil commented 5 years ago

syntax: type Array[T: type, N: UInt]

func iter_map[
  T: type,
  U: type,
  E: effect,
](
  lst: List[T],
  f: func(T) E -> U,
)
  Yield[Int32] | E
{
  ...
}
strega-nil commented 5 years ago

Additionally, implicit polymorphism:

func iter_map(lst: List['t], f: func('t) 'e -> 'u)
  Yield[Int32] | 'e
{
  ...
}