diff --git a/07/Main.hs b/07_haskell/Main.hs similarity index 100% rename from 07/Main.hs rename to 07_haskell/Main.hs diff --git a/07/Second.hs b/07_haskell/Second.hs similarity index 69% rename from 07/Second.hs rename to 07_haskell/Second.hs index c4ee758..c63f011 100644 --- a/07/Second.hs +++ b/07_haskell/Second.hs @@ -20,8 +20,15 @@ len' :: [a] -> Integer len' xs = helper 0 xs -inv :: [a] -> [a] -inv _ = _ +inv :: [a] -> [a] -> [a] +inv acc (x:xs) = inv (x : acc) xs +inv acc [] = acc + +rev :: [a] -> [a] +rev xs = inv [] xs + +-- 1 : 2 : 3 : [] +-- 3 : 2 : 1 : [] getF :: Name -> Maybe Name