module Error where

import GHC.ExplicitCallStack.Stack
import Control.Exception

error' :: String -> a
error' msg = throwStack (\s -> ErrorCall (msg ++ "\n" ++ (show s)))

map' :: (a -> b) -> [a] -> [b]
map' f [] = []
map' f (x:xs) = f x : map' f xs

head' :: [a] -> a
head' [] = error' "head: empty list"
head' (x:_) = x
