From: jim
Date: Sun, 22 Feb 2015 18:01:21 +0000 (-0500)
Subject: add head to list functions
X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=065d0c3acbe4cbbc05a718ce9e9a336e258e9e56
add head to list functions
---
diff --git a/exercises/assignment4.mdwn b/exercises/assignment4.mdwn
index 8bbeffe4..59baf136 100644
--- a/exercises/assignment4.mdwn
+++ b/exercises/assignment4.mdwn
@@ -62,6 +62,7 @@ For instance, `fact 0 ~~> 1`, `fact 1 ~~> 1`, `fact 2 ~~> 2`, `fact 3 ~~>
let empty = \f n. n in
let cons = \x xs. \f n. f x xs in
let empty? = \xs. xs (\y ys. false) true in
+ let head = \xs. xs (\y ys. y) err in
let tail = \xs. xs (\y ys. ys) empty in
let append = Y (\append. \xs zs. xs (\y ys. (cons y (append ys zs))) zs) in
let take_while = Y (\take_while. \p xs. xs (\y ys. (p y) (cons y (take_while p ys)) empty) empty) in