Moving from Hugs to GHC and getting an error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Moving from Hugs to GHC and getting an error

Adam Wyner
I developed some code in Hugs, but now am moving to GHC.  I had used
Hugs because I wanted to use the Trex module (extensible records), but
this has not been as important as I had thought it would be.

My modules run fine in Hugs, but I get an error message when I try to
run my module in GHC.  The message is:

parse error on input `PropList'

Otherwise the imported modules are interpreted.

In the module, the type declarations are:

type PropList = [String]
type World = Int
type Time = Int
type SOA = Rec (properties :: PropList, time :: Time,
                        world :: World)
type DBSoas = [SOA]

The error occurs just after PropList.

Is there some basic difference between Hugs and GHC that I'm missing?
Where can I get more information about Hugs GHC differences?

Cheers,
Adam
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Moving from Hugs to GHC and getting an error

Neil Mitchell
> type SOA        = Rec (properties :: PropList, time :: Time,
>                         world :: World)

This type definition does not make use of standard Haskell records, I
suspect this is making use of Trex, although I don't know any of Trex.
I would have expected standard Haskell to look like:

type SOA = Rec {properties :: PropList, time :: Time, world :: World}

i.e. using {} instead of ().

Once thats changed, I'm not sure what other Trex features you might
have used in your program.

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe