How do I get going with Haskell on my computer?

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm learning my first functional programming language but having some trouble with the initial logistics (the professor basically said, "get it set up somehow" and didn't provide much detail.)

Anyway, I have Mac OS X version 10.6.8. To start out, I installed GHC in my home directory and found that I could open it with the command "ghci" in terminal. From there (exccom/tag/use">use my utter lack of knowledge), I followed the vague instructions in the syllabus and opened another window with the a1.hs file I am to modify for an assignment. When I was done defining a function, I typed the command "ghc a1-skeleton.hs" to open the interpreter with that loaded into it (that's what I would be doing, right?) but 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'm guessing this is like missing an "#include" or something similar in a language like C++. Do I just need to find/add something to a particular directory?

Also, since I didn't catch on right away with this stuff, what exactly does the interpreter do? Is it a program that skips 'compiling' in the procedural language sense and just tries to follow the commands in a .hs file straight away?

Thanks!

UPDATE:: The code that seems to be the com/tag/issue">issue:

  2 module Main where
  3 
  4 import Test.HUnit
  5 import System
profilepic.png
manpreet 2 years ago

Regarding your minor question:

ghci also does compilation, but unlike the non-interactive ghc it doesn't create efficient machine code, but instead compiles to a simpler internal bytecode which is then directly interpreted. Basically ghci is optimized for doing quick compilation (as you would want for quick development) rather than making the result run fast.

In addition it contains other useful stuff for interactive use such as a read-eval-print loop and a debugger.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.