From 7031a9ea16438ec8546fc043999dfbc8410d0fee Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 13 Dec 2022 21:29:30 +0200 Subject: Rename divide to split --- mendeleev.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mendeleev.hs') 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') -- cgit v1.2.3