Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (6 sloc) 214 Bytes
-- P11 Modified run-length encoding.
data Entry a = Value a | Sequence Int a deriving Show
f1 :: [(Int, a)] -> [Entry a]
f1 = map toEntry
where toEntry (1, x) = Value x
toEntry (n, x) = Sequence n x