Lab 4 html file

50 views
Skip to first unread message

orestis lamprousis

unread,
Dec 11, 2014, 7:39:08 PM12/11/14
to chalmer...@googlegroups.com
Hi,
i have a problem compiling my code to create the html file needed. By issuing the command hastec --output-html main-is Calculator.hs nothing happens. I include main-is because i get the error message that main cannot be found. Thank you in advance

Leif Schelin

unread,
Dec 12, 2014, 12:49:02 AM12/12/14
to chalmer...@googlegroups.com
If main cannot be found it seems like Haste is not installed correctly? Did you do haste-boot after the install?

orestis lamprousis

unread,
Dec 12, 2014, 7:08:37 AM12/12/14
to chalmer...@googlegroups.com
Yes i  do haste-boot but for every terminal session i need first to export cabal to my path by issuing the command export PATH=$PATH:~/.cabal/bin. Maybe i need to reinstall haste.

Simon Huber

unread,
Dec 12, 2014, 7:57:31 AM12/12/14
to orestis lamprousis, chalmer...@googlegroups.com
Have you tried the hello world example of
http://www.cse.chalmers.se/edu/course/TDA555/haste.html
?

There should be no need for "main-is". (Does your Calculator.hs
actually have a "main"?)

Cheers,
Simon
> --
> You received this message because you are subscribed to the Google Groups
> "2014 Functional Programming TDA 452/ DIT142" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chalmers-fp-1...@googlegroups.com.
> To post to this group, send email to chalmer...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/chalmers-fp-14/159f4b60-090d-472d-921c-68f0b1b6421e%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

David Sands

unread,
Dec 12, 2014, 9:48:46 AM12/12/14
to FP
> No when i try to explicitly set main:: IO () it throws an exception that because of the eventhandler at the > end of the file it is main:: IO Bool instead of main::IO()

OK, so we found the problem. You can only compile something of type main::IO(). 

The event handler should not be at the end of the main do block. 

Maybe the examples from here might help:  http://www.cse.chalmers.se/edu/course/TDA555/haste.html


David Sands

unread,
Dec 13, 2014, 6:52:23 AM12/13/14
to FP

Problem resolved.    Anyway this is what worked, in case you come across similar issues:

> It is working eventually. I had to include -main-is Calculator.main to the command line in order to locate the main function 

Could it have been that main was not defined in the compiled module but imported?

--
You received this message because you are subscribed to the Google Groups "2014 Functional Programming TDA 452/ DIT142" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chalmers-fp-1...@googlegroups.com.
To post to this group, send email to chalmer...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages