Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Reverse-a-string/Haskell/reverse-a-string-1.hs
Normal file
1
Task/Reverse-a-string/Haskell/reverse-a-string-1.hs
Normal file
|
|
@ -0,0 +1 @@
|
|||
reverse = foldl (flip (:)) []
|
||||
4
Task/Reverse-a-string/Haskell/reverse-a-string-2.hs
Normal file
4
Task/Reverse-a-string/Haskell/reverse-a-string-2.hs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
accumulatingReverse :: [a] -> [a]
|
||||
accumulatingReverse lst =
|
||||
let rev xs a = foldl (flip (:)) a xs
|
||||
in rev lst []
|
||||
3
Task/Reverse-a-string/Haskell/reverse-a-string-3.hs
Normal file
3
Task/Reverse-a-string/Haskell/reverse-a-string-3.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import Data.Char (isMark)
|
||||
import Data.List (groupBy)
|
||||
myReverse = concat . reverse . groupBy (const isMark)
|
||||
Loading…
Add table
Add a link
Reference in a new issue