
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 1.47 KB | hits: 11 | expires: Never
Haskell IO Function -> Type Match Error
getVectorData vector1 = do
putStrLn "Enter dimension and coefficient separated by a space: Enter "Done" to move on to next vector: "
appData <- getLine
if appData == "done" then
putStrLn "That's it"
else do
createVectorTuple (words appData) : vector1
getVectorData vector1
createVectorTuple :: [String] -> (String, Float)
createVectorTuple vectorData = ((head vectorData) , (read (last vectorData) :: Float))
> ERROR file:.MainApp.hs:13 - Type error in final generator
*** Term : getVectorData vector1
*** Type : IO ()
*** Does not match : [a]
getVectorData vector1 = do
putStrLn "Enter dimension and coefficient separated by a space: Enter "Done" to move on to next vector: "
appData <- getLine
if appData == "done" then
putStrLn "That's it"
else do
createVectorTuple (words appData) : vector1
(createVectorTuple (words appData)) : vector1
getVectorData vector1
let vector2 = createVectorTuple (words appData) : vector1
getVectorData vector2
else
getVectorData $ createVectorTuple (words appData) : vector1
else do
let vector1 = createVectorTuple (words appData)
getVectorData vector1
if appData == "done" then do
putStrLn "That's it"
return vector1
else getVectorData (createVectorTuple (words appData) : vector1)