September 2017
Beginner to intermediate
396 pages
9h 46m
English
import Prelude hiding (reverse)
reverse :: [a] -> [a]
This function takes a list of any type, a, and returns the reversed list.
reverse :: [a] -> [a] reverse xs = reverse' xs [] where reverse' :: [a] -> [a] -> [a] reverse' [] rs = rs reverse' (x:xs) rs = reverse' xs (x:rs)
Note that we have a written ...
Read now
Unlock full access