pufuwozu/roy — Issue #79: Top-level type signatures
Author: eegg
Created: 2011-12-13 20:46:10+00:00
State: open

I think the current type information we can provide in Roy code is of two forms: type aliases and function parameters, as demonstrated by

type Person = {firstName: String, lastName: String}
let getName (x: Person) = x.firstName ++ " " ++ x.lastName

However, we apparently can't provide independent signatures/declarations. We should be able to write

type Person = {firstName: String, lastName: String}
getName: Person → String
let getName p = p.firstName ++ " " ++ p.lastName

This functionality should mostly provide the ability to declare global/external types—we prefix the type declaration with an `external` keyword, e.g.

external alert: String → ()
let alertPersonName p = alert (getName p)