diff --git a/std/core-extras.kk b/std/core-extras.kk index 2932635..ef46e1a 100644 --- a/std/core-extras.kk +++ b/std/core-extras.kk @@ -12,6 +12,12 @@ import std/core/undiv extern import c file "inline/core-extras" +// String ordering +pub inline fun str/order2( ^x : string, ^y : string ) : order2 + if x < y then Lt2(x,y) + elif x == y then Eq2(x) + else Gt2(y,x) + // Order two `:maybe` values in ascending order pub fip fun eff/order2( mb1 : maybe, mb2 : maybe, ^?order2 : (a,a) -> e order2 ) : e order2> match mb1