Hey, I'm sorry I got an error message here, but I tried everything I could and nothing seems relevant. This code generates an error:
import System.Environment
import System.Directory
import System.IO
import Data.List
data Node = PathNode String Float Float [String] | NoNode deriving (Show)
main = do
(filename:args) <- getArgs
load filename
load :: String -> IO ()
load fileName = do
contents <- readFile fileName
let pathStrings = lines contents
first = head pathStrings
args = lines first
path = createNode args
putStr path
createNode [String] -> Node
createNode (name:x:y:paths) = PathNode name x y paths
createNode [] = NoNode
I know that this is due to alignment, but I correctly aligned all the calls in the "load" function. What am I doing wrong?
Thanks -A
source
share