X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek1_kapulet_advanced.mdwn;h=06a20438d78ac1a639c329d6622125fa71834f45;hp=2137d114a5afeb4fdb27dcdce05fc194fcc8997b;hb=4e5741cd8c63a133973ab4eaf3d78d9a31ff401c;hpb=e1da88a2a09a97c8c0c3e6a09e59cc34a0cd5558;ds=sidebyside diff --git a/topics/week1_kapulet_advanced.mdwn b/topics/week1_kapulet_advanced.mdwn index 2137d114..06a20438 100644 --- a/topics/week1_kapulet_advanced.mdwn +++ b/topics/week1_kapulet_advanced.mdwn @@ -173,6 +173,8 @@ We've already come across the `id` function, namely λ `x. x`. Other common functions are `fst`, which takes two arguments and returns the first of them; `snd`, which takes two arguments and returns the second of them; and `swap`, which takes two arguments and returns them both but with their positions swapped. A fourth function is `dup`, which takes one argument and returns it twice. These functions can be defined like this: + + let fst (x, y) = x; snd (x, y) = y;