master
NaiJi ✨ 2 years ago
commit 0d505a3d3c

@ -0,0 +1,3 @@
{
helloWorld = "Hello" + " " + "World";
}

@ -0,0 +1,4 @@
# code goes here
{
v="understood";
}

@ -0,0 +1,8 @@
let
h = "Hello";
w = "World";
s = " ";
in
{
helloWorld = h + s + w;
}

@ -0,0 +1,6 @@
let
h = "Hello";
in
{
helloWorld = "${h} World"; # Modify this line
}

@ -0,0 +1,7 @@
let
h = "Strings";
value = 4;
in
{
helloWorld = "${h} ${toString value} the win!";
}

@ -0,0 +1,8 @@
let
f = "f";
o = "o";
func = a: b: c: a + b + c;
in
{
foo = func f o "o";
}

@ -0,0 +1,8 @@
let
f = "f";
o = "o";
func = {a, b, c}: a + b + c;
in
{
foo = func {a=f; b=o; c="o";};
}

@ -0,0 +1,8 @@
let
min = a: b: if (a > b) then b else a; #modify these
max = a: b: if (a > b) then a else b; #two lines only
in
{
ex0 = min 5 3;
ex1 = max 9 4;
}

@ -0,0 +1,11 @@
let
f = "f";
o = "o";
b = "b";
func = {a ? f, b ? "a", c ? ""}: a+b+c; #only modify this line!
in
rec {
foo = func {b="o"; c=o;}; #must evaluate to "foo"
bar = func {a=b; c="r";}; #must evaluate to "bar"
foobar = func {a=foo;b=bar;}; #must evaluate to "foobar"
}

@ -0,0 +1,11 @@
let
arguments = {a="f"; b="o"; c="o"; d="bar";}; #only modify this line
func = {a, b, c, ...}: a+b+c;
func2 = args@{a, b, c, ...}: a+b+c+args.d;
in
{
#the argument d is not used
foo = func arguments;
#now the argument d is used
foobar = func2 arguments;
}
Loading…
Cancel
Save