diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-12-13 21:29:30 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-12-13 21:31:37 +0200 |
commit | 7031a9ea16438ec8546fc043999dfbc8410d0fee (patch) | |
tree | dcacd809130a4536da31ee582c71856824cacf40 /mendeleev.hs | |
parent | 1ac772400a6a3aea8d006ac46337440600017e4b (diff) | |
download | mendeleev-7031a9ea16438ec8546fc043999dfbc8410d0fee.tar.gz |
Rename divide to split
Diffstat (limited to 'mendeleev.hs')
-rw-r--r-- | mendeleev.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mendeleev.hs b/mendeleev.hs index cfd6ac5..351003c 100644 --- a/mendeleev.hs +++ b/mendeleev.hs @@ -26,9 +26,9 @@ search c = takeWhile start . dropWhile (not . start) start (x:_) = toLower x == c' c' = toLower c -divide :: String -> [(String, String)] -divide [] = [] -divide (x:xs) = +split :: String -> [(String, String)] +split [] = [] +split (x:xs) = if null res then [("?", xs)] else res @@ -47,7 +47,7 @@ divide (x:xs) = _ -> r' advance :: ([String], String) -> [([String], String)] -advance (els, rest) = map collect $ divide rest +advance (els, rest) = map collect $ split rest where collect (el, rest') = (el : els, rest') |