Skip to content

Instantly share code, notes, and snippets.

@mdg
Created October 1, 2018 19:24
Show Gist options
  • Save mdg/4c52ecb576b3ad235429558710c0673d to your computer and use it in GitHub Desktop.
Save mdg/4c52ecb576b3ad235429558710c0673d to your computer and use it in GitHub Desktop.
diff --git a/T/prefab.lma b/T/prefab.lma
index ad970e2..efb8d8f 100644
--- a/T/prefab.lma
+++ b/T/prefab.lma
@@ -18,28 +18,28 @@ macro fail(ft, msg) ->
macro refail(f) ->
return f
--
## recover from a failure w/ a new valid value
macro unfail(new_val) ->
new_val
--
-func max(a: $T, b: $T): $T ->
+func max<T>(a: T, b: T): T ->
if
|a < b -> b
|else -> a
--
--
-func min(a: $T, b: $T): $T ->
+func min<T>(a: T, b: T): T ->
if
|a < b -> a
|else -> b
--
--
func bool_not(v: Bool): Bool -RUST-
func int_add(a: Int, b: Int): Int -RUST-
func int_sub(a: Int, b: Int): Int -RUST-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment