You are not logged in.
I'm a Haskell noob, and I'm trying to learn a little bit about it. I've followed the instructions on the Wiki as far as setting path goes and that hasn't helped. The issue is that I can't even import System in ghci, which is limiting since I need it to do the project I want to do. I've uninstalled and reinstalled Haskell and Cabal several times to no avail. Any help?
Here's the output from ghc and my path:
jonathan at k-nine in ~ (master jonathan)
$ ghc -v sys.hs INSERT
Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.3
Using binary package database: /usr/lib/ghc-8.0.1/package.conf.d/package.cache
loading package database /usr/lib/ghc-8.0.1/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.0.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.11.0.0
wired-in package ghc mapped to ghc-8.0.1
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags:
loading package database /usr/lib/ghc-8.0.1/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.0.0
wired-in package rts mapped to rts-1.0
wired-in package template-haskell mapped to template-haskell-2.11.0.0
wired-in package ghc mapped to ghc-8.0.1
wired-in package dph-seq not found.
wired-in package dph-par not found.
*** Chasing dependencies:
Chasing modules from: *sys.hs
!!! Chasing dependencies: finished in 3.33 milliseconds, allocated 0.310 megabytes
Stable obj: []
Stable BCO: []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = 2016-07-20 04:37:03.300534899 UTC
ms_mod = Main,
ms_textual_imps = [(Nothing, Prelude), (Nothing, System)]
ms_srcimps = []
}]
*** Deleting temp files:
Deleting:
compile: input file sys.hs
*** Checking old interface for Main:
[1 of 1] Compiling Main ( sys.hs, sys.o )
*** Parser [Main]:
!!! Parser [Main]: finished in 3.33 milliseconds, allocated 0.196 megabytes
*** Renamer/typechecker [Main]:
!!! Renamer/typechecker [Main]: finished in 50.00 milliseconds, allocated 5.767 megabytes
sys.hs:2:1: error:
Failed to load interface for ‘System’
Locations searched:
System.hs
System.lhs
System.hsig
System.lhsig
Upsweep partially successful.
*** Deleting temp files:
Deleting:
link(batch): upsweep (partially) failed OR
Main.main not exported; not linking.
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
jonathan at k-nine in ~ (master jonathan)
$ echo $PATH INSERT
/home/jonathan/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/plan9/bin:/home/jonathan/.gem/ruby/2.3.0/bin:/home/jonathan/.cabal/bin
and the script I'm trying to compile:
jonathan at k-nine in ~ (master jonathan)
$ cat sys.hs INSERT
module Main where
import System
--import System.Process
--import Control.Monad
main :: IO ()
main = putStrLn "Hello world"
--pid <- runCommand "mplayer song.mp3" -- or whatever you want
--replicateM_ 10 $ putStrLn "Doing other stuff"
--waitForProcess pid >>= exitWith
Last edited by yramagicman (2016-07-20 04:45:49)
Offline
I think you cannot import just System. Delete that line and go with System.Process only.
Offline