
Recent Posts
Recent Comments
Archives
Categories
Meta
Advertisements
Append operation in haskell might be costlier ,if done this way let x = “hello” ++ ” haskell” let y = x ++ ” well done ” to append this way have to traverse whole list each time ,a better … Continue reading
This explains foldl in terms of foldr : https://ratndeo.wordpress.com/2013/01/11/haskellfoldlasfoldr/ Now its time to whisper foldr in terms of foldl : foldr :: (a > b > b) > b > [a] > b foldr f init (x:xs) = foldl f’ … Continue reading
foldl :: (a > b > a) > a > [b] > a foldl f init xs = foldr f’ id xs init where f’ x g z = g ( f z x ) at first definition of f’ … Continue reading
Standard haskell map fxn def : map’ mapper [] = [] map’ mapper (x:xs) = mapper x : map’ mapper xs same map as in terms of foldr : map” mapper = foldr (\x y > mapper x : y … Continue reading