I am having trouble with the groupBy function I want to split at the number. Helpful if someone can point out where I am going wrong
Input "aba3dac4d"
Desired Output ["aba", "3dac", "4d"]
But I get the output when I execute code
groupBy groupBy0' "aba3dac4d"
["aba", "3dac4d"] Here is the code
import Data.List
groupBy0'::Char->Char->Bool
groupBy0' x y
| x `elem` ['a'..'z'] && y `elem` ['0'..'9'] = False
| x `elem` ['0'..'9'] && y `elem` ['a'..'z'] = True
| x `elem` ['a'..'z'] && y `elem` ['a'..'z'] = True
| x `elem` ['0'..'9'] && y `elem` ['0'..'9'] = True
| otherwise = False
See Question&Answers more detail:os