splits sep xs = case eat sep xs [] of 
                  (s,[]) -> [s]
                  (s,ss) -> s : splits sep ss
    where 
      eat sep [] acc = (acc,[])
      eat sep (x:xs) acc | x == sep  = (acc,xs)
                         | otherwise = eat sep xs (acc ++ [x])
               

-- -----------------------------------------------------------------------------
splits sep xs = case eat sep xs [] of 
                  (s,[]) -> [s]
                  (s,ss) -> s : splits sep ss
    where 
      eat sep [] acc = (acc,[])
      eat sep (x:xs) acc | x == sep  = (acc,xs)
                         | otherwise = eat sep xs (acc ++ [x])
               

-- -----------------------------------------------------------------------------
splits sep xs = case eat sep xs [] of 
                  (s,[]) -> [s]
                  (s,ss) -> s : splits sep ss
    where 
      eat sep [] acc = (acc,[])
      eat sep (x:xs) acc | x == sep  = (acc,xs)
                         | otherwise = eat sep xs (acc ++ [x])
               

-- -----------------------------------------------------------------------------