Slide 18
Slide 18 text
HASKELL 101
PYTHON
def concat(A, B):
current = A
while current.next != None:
current = current.next
current.next = B
return A
18
concat Empty b = b
concat a Empty = a
concat (Cons x xs) b
= Cons x (concat xs b)
HASKELL
TEST
assertEq(concat('','bar'), 'bar')
assertEq(concat('foo',''), 'foo')
assertEq(concat(‘foo’,'bar'), 'foobar')