Administrator approval is now required for registering new accounts. If you are registering a new account, and are external to the University, please ask the repository owner to contact ServiceLine to request your account be approved. Repository owners must include the newly registered email address, and specific repository in the request for approval.

Commit 4ffbb4a8 authored by pm3g19's avatar pm3g19
Browse files

Implemented stripping of csv strings

parent 2d4d5e50
......@@ -2,6 +2,7 @@ import Types
import Debug
import Eval
import System.IO
import ReadCSV
parse :: String -> Program
parse = notImplemented
......@@ -34,10 +35,6 @@ evalFinal = evalFull []
showFinal :: Expr -> IO ()
showFinal = notImplemented
--------------------------------------------
--------------------------------------------
loadInputFile :: SymbolName -> IO Expr
loadInputFile name = do
......@@ -46,8 +43,12 @@ loadInputFile name = do
return output
where
toRecord stringList = Record $ map String stringList
toRecord stringList = Record $ map ((String).stripLeadingAndTrailingWhitespace) stringList
stripLeadingAndTrailingWhitespace = stripTrailingWhitespace.dropWhile (==' ')
stripTrailingWhitespace (' ':xs) = let remainder = stripTrailingWhitespace xs in
if null remainder then [] else ' ':remainder
readCSV :: FilePath -> IO [[String]]
readCSV = notImplemented
\ No newline at end of file
stripTrailingWhitespace (x:xs) = x : stripTrailingWhitespace xs
stripTrailingWhitespace [] = []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment