You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
397 B
Haskell
17 lines
397 B
Haskell
8 years ago
|
module Reverse where
|
||
|
|
||
|
main :: IO ()
|
||
|
main = print $ rvrs "Curry is awesome"
|
||
|
|
||
|
rvrs :: String -> String
|
||
|
rvrs x = wAwesome ++ wIs ++ wCurry
|
||
|
where
|
||
|
wCurry = take currySize x
|
||
|
wIs = drop currySize . reverse . drop awesomeSize . reverse $ x
|
||
|
wAwesome = reverse . take awesomeSize . reverse $ x
|
||
|
currySize = 5
|
||
|
awesomeSize = 7
|
||
|
|
||
|
rvrs' :: String -> String
|
||
|
rvrs' = unwords . reverse . words
|