rubyworks / platypus

Ruby Knows Types
http://rubyworks.github.com/platypus
Other
9 stars 0 forks source link

Lambda signatures #5

Open trans opened 10 years ago

trans commented 10 years ago

Might want to add support for lambda signatures, e.g.

sig ->{ |x| x > 1 }
def f(x)
  x > 1  # always true
end

However, this might not be strictly necessary since pseudo-types could be used (or at least should be able to be used).

type :Gt1 do
  x > 1
end

sig Gt1
def f(x)
  x > 1  # always true
end