import Data.Char (digitToInt)

asIntFold ('-' : s) = -1 * asIntFold s
asIntFold s         = foldl (times_10) 0 (map digitToInt s)
    where times_10 a b = a * 10 + b

concatFoldr a  = foldr (\x y -> x ++ y) [] a

--takeCompare _ [] = ([], [])
--takeCompare _ (a: []) = ([a], [])
--takeCompare f (a: b: xs) = 
--   if (f a b) then [a] ++ (takeCompare f (b: xs))
--   else [a]
--


