diff --git a/rfcs/generic-functions.md b/rfcs/generic-functions.md index 954d9b95..6f85519a 100644 --- a/rfcs/generic-functions.md +++ b/rfcs/generic-functions.md @@ -8,7 +8,7 @@ Extend the syntax and semantics of functions to support explicit generic functio Currently Luau allows generic functions to be inferred but not given explicit type annotations. For example -``` +```lua function id(x) return x end local x: string = id("hi") local y: number = id(37) @@ -107,4 +107,4 @@ We did originally consider Rank-1 types, but the problem is that's not backward- We could introduce syntax for generic types without changing the semantics, but then there'd be a gap between the syntax (where the types `() -> (a) -> a` and `() -> (a) -> a` are different) and the semantics (where they are not). As noted above, this isn't sound. -Rather than using Rank-N types, we could use SML-style polymorphism, but this would need something like the [value restriction](http://users.cis.fiu.edu/~smithg/cop4555/valrestr.html) to be sound. \ No newline at end of file +Rather than using Rank-N types, we could use SML-style polymorphism, but this would need something like the [value restriction](http://users.cis.fiu.edu/~smithg/cop4555/valrestr.html) to be sound.