enumerate

Run Settings
LanguageHaskell
Language Version
Run Command
-- enumerate = (f 1) -- where -- f _ [] = [] -- f i (y:ys) = (i, y) : f (i+1) ys enumerate :: [String]->[(Int,String)] enumerate = aux 1 aux :: Int->[String]->[(Int, String)] aux _ [] = [] aux i (x:xs) = [(i, x)] ++ aux (i+1) xs main = print $ enumerate ["banana", "potato", "ice"]
Editor Settings
Theme
Key bindings
Full width
Lines