RosettaCodeData/Task/Inverted-syntax/Koka/inverted-syntax.koka

15 lines
291 B
Plaintext

fun (=:)(c: c, v: local-var<h, c>): <local<h>> ()
v := c
fun (?)(c: c, b: bool): e maybe<c>
if b then Just(c) else Nothing
fun main()
var x := 4
6 =: std/core/types/byref(x)
x.println
val res = "Yes" ? True
match res
Just(a) -> println(a)
Nothing -> throw("Nothing")