I am new to Haskell and am currently working on a summer assignment. I am trying to pass a test file to my .hs as an argument from the command line in ghci. Can someone describe how this should happen? Below I have the initial code snippet from my .hs that uses getArgs and readFile to read the file and create a tuple from the data.
import Prelude import System.Environment ( getArgs ) import Data.List import Helpers -- The main method that will be used for testing / command line access main = do args <- getArgs filename <- readFile (head args) checkersState <- readonemoveFile filename
When I: upload this .hs, am I adding the file as an argument following it? For instance:
:load csce322a03p01.hs test01.onemove
I guess that is not the way it gives me the error:
target `test01.onemove' is not a module name or a source file
source share