1

I've been learning haskell for the pask few days, and I find it to be very interesting though I'm not used to pure functional paradigm.

I've been trying to make my first "real" program (after helloworld, fizzbuzz & co), which is to make a Snake game in haskell. To do it, I'd like to clean the console and to print new things in it (I'm on Windows).

I've found this to help me: How do I clear the terminal screen in Haskell?

So I updated cabal with "cabal update". Then I created my folder "Snake", and cd into it. Then I did "cabal sandbox init", followed by "cabal install ansi-terminal", and created the following file :

import Data.List
import System.IO
import System.Console.ANSI

main = do
    putStrLn ("Test")
    clearScreen
    test <- getInput
    putStrLn ("You entered " ++ (show(test)))

When I do "ghc --make Snake.hs", it returns the error "Failed to load interface for 'System.Console.ANSI'"

What exactly am I missing?

Community
  • 1
  • 1
Zawarudio
  • 85
  • 1
  • 16
  • 1
    This doesn't directly answer your question, but as a beginner, you'll likely have an easier time using an alternative to `cabal`: `stack`. [This](https://haskell-lang.org/get-started) is a good starting point. – sjakobi Mar 16 '17 at 00:17
  • 1
    I did try my way around stack, and I could do what I wanted. Thanks! – Zawarudio Mar 16 '17 at 19:08

0 Answers0