Advertisement
Guest User

Deforestation2

a guest
Jan 25th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Data.Char
  2. import Data.List
  3.  
  4. func = map toUpper . filter (/= 'a')
  5.  
  6. func' xs = map toUpper $ filter (/= 'a') xs
  7.  
  8. func'' xs = case filter (/= 'a') xs of
  9.                                    [] -> []
  10.                                    x:xs -> toUpper x : map toUpper xs
  11.  
  12. func''' xs = case (case xs of
  13.                            [] -> []
  14.                            x:xs -> case x /= 'a' of
  15.                                                  True -> x : filter (/= 'a') xs
  16.                                                  False -> filter (/= 'a') xs) of
  17.                                                                               [] -> []
  18.                                                                               x:xs -> toUpper x : map toUpper xs
  19.  
  20. func'''' xs = case xs of
  21.                       [] -> case [] of
  22.                                     [] -> []
  23.                                     x:xs -> toUpper x : map toUpper xs
  24.                       x:xs -> case (case x /= 'a' of True -> x : filter (/= 'a') xs
  25.                                                      False -> filter (/= 'a') xs) of
  26.                                                                                   [] -> []
  27.                                                                                   x:xs -> toUpper x : map toUpper xs
  28.  
  29. func''''' xs = case xs of
  30.                       [] -> []
  31.                       x:xs -> case x /= 'a' of
  32.                                             True -> case x : filter (/= 'a') xs of
  33.                                                                                 [] -> []
  34.                                                                                 x:xs -> toUpper x : map toUpper xs
  35.                                             False -> case filter (/= 'a') xs of
  36.                                                                              [] -> []
  37.                                                                              x:xs -> toUpper x : map toUpper xs
  38.                    
  39. func'''''' xs = case xs of
  40.                        [] -> []
  41.                        x:xs -> case x /= 'a' of
  42.                                              True -> toUpper x : map toUpper (filter (/= 'a') xs)
  43.                                              False -> case filter (/= 'a') xs of
  44.                                                                               [] -> []
  45.                                                                               x:xs -> toUpper x : map toUpper xs
  46.  
  47. answer xs = case xs of [] -> []
  48.                       x:xs -> case x /= 'a' of
  49.                                             True -> toUpper x : answer xs
  50.                                             False -> answer xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement