1

I've tried setting up Haste using the official installation guide. Trying to compile a Hello World produces the following error:

Compiling Main into .
Linking haste-compiler/test.js
Linking Main
Linking GHC.Types
Linking GHC.IO.Handle.Text
hastec: /Users/vhsmaia/.haste/jsmods/base/GHC/IO/Handle/Text.jsmod: openBinaryFile: does not exist (No such file or directory)

I've then tried to compile the portable version. The error is now:

hastec: user error (Haste needs to be rebooted; please run haste-boot

Running haste-boot does not amend the error.

MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
  • How did you perform the first installation? – Alex Siri Jan 04 '14 at 17:41
  • I just followed the steps IIRC, but I had another error. I guess everything is messed up now. – MaiaVictor Jan 04 '14 at 17:49
  • can you post the file you're trying to compile? – Alex Siri Jan 04 '14 at 17:58
  • main = putStrLn "Hello, World!" – MaiaVictor Jan 04 '14 at 18:00
  • Is the file `/Users/vhsmaia/.haste/jsmods/base/GHC/IO/Handle/Text.jsmod` there? – Alex Siri Jan 04 '14 at 18:29
  • No, that's the point, I have no idea why not. jsmods only has ghc-prim inside it. – MaiaVictor Jan 04 '14 at 18:31
  • I'm a bit late to the party, but is your problem fixed with the latest Haste version (0.2.11)? It sounds like `haste-boot` somehow failed in a highly non-robust way (it used to do that until 0.2.10 or so). If it still fails with 0.2.11, you should get the error while running `haste-boot` instead of afterwards. I don't have a Mac, so testing Haste on OSX is a bit hard. – valderman Feb 05 '14 at 14:45

1 Answers1

0

I think the problem you have, is that hastec expects your module to have a Main module. Try renaming your file to Main.hs and add a module Main where declaration to the top of the file.

Alex Siri
  • 2,856
  • 1
  • 19
  • 24
  • 2
    I installed `ghc` and `haskell-platform` using `brew`, and then `hastec` using `cabal` and it worked fine, the file is there. Maybe you can try that. – Alex Siri Jan 04 '14 at 18:42