What should I do with Haskell on my computer?

I am learning my first functional programming language, but I have some problems with the initial logistics (the professor basically said: “Somehow it was set up” and did not provide details.)

Anyway, I have Mac OS X version 10.6.8. To get started, I installed GHC in my home directory and found that I can open it using the "ghci" command in the terminal. From there (excuse my complete lack of knowledge), I followed the vague instructions in the curriculum and opened another window with the a1.hs file, which I must change for the job. When I finished defining the function, I typed the command “ghc a1-skeleton.hs” to open the interpreter loaded in it (what will I do, right?), But I got this error:

a1.hs:5:8:
    Could not find module `System'
    It is a member of the hidden package `haskell98-2.0.0.1'.
    Use -v to see a list of the files searched for.

I assume this is similar to the absence of "#include" or something similar in C ++. Do I just need to find / add something to a specific directory?

In addition, since I did not immediately understand what exactly the interpreter does? Is this a program that skips the "compilation" into the procedural language and just tries to immediately follow the instructions in the .hs file?

Thank!

UPDATE :: Code that seems to be the problem:

  2 module Main where
  3 
  4 import Test.HUnit
  5 import System
+5
source share
5 answers

Regarding your minor question:

ghci , ghc , -, . ghci ( ), .

, , -eval- .

+2

, , System - , . , , System.Environment ( , ).

- , , . GHCi , :

Prelude> :browse System.Environment
getArgs :: IO [String]
getEnv :: String -> IO String
getEnvironment :: IO [(String, String)]
getProgName :: IO String
withArgs :: [String] -> IO a -> IO a
withProgName :: String -> IO a -> IO a

import System . , . Hoogle ( , ), , .

, System System.Environment, System.Process System.Exit. , : P.

+8

GHC - , , Haskell Platform - " " " GHC. , , cabal, Haskell. , " ", .

.

+3

ghci -package haskell98 a1-skeleton.hs . , a1-skeleton.hs.

+2

1) haskell, GHC. , , , ghc.

2) ghc - cabal. System Haskell98, . ghc ghci -package (. - ghc)

3), , base Haskell98 Haskell2010.

===

ghci , . /, , .

+1

All Articles