[Haskell-cafe] Hugs parse error in library file

james pentland james_pentland at yahoo.com
Thu Jun 16 13:30:42 EDT 2005


i am working on ch 15, School of Expression.

unfortunately, 

import Memo

causes an Hugs error (see below).

also, memoB in ch 15 calls memo1, but there is no
memo1 in 

h:\Program Files\Hugs98\libraries\Hugs\Memo.hs

this module contains
memoN     :: Int -> (a -> b) -> (a -> b)
memoN         = mkMemo eql hash

of course, it should be easy enough to write
memo1     :: (a -> b) -> (a -> b)
memo1     = memoN 1

Memo.hs imports ST, which is where Hugs reports a
parse error.

h:\Program Files\Hugs98\libraries\Hugs\ST.hs
contains at line 50

newtype ST s a = ST (forall r. (a -> r) -> r)

what is the workaround?




pentland at thetis /ntd/lo
$ hugs
Hugs session for:
H:\Program Files\Hugs98\libraries\Hugs\Prelude.hs
H:\Program Files\Hugs98\libraries\Prelude.hs
H:\Program Files\Hugs98\libraries\Hugs\Base.hs
Type :? for help
Hugs.Base> :v
-- Hugs Version 20050113
Hugs.Base> :load xva
ERROR "H:\Program
Files\Hugs98\libraries\Hugs\ST.hs":50 - Syntax error
in type expression (unexpected `.')
Animation>



pentland at thetis /ntd/lo
$ cat xva.hs
import Animation (picToGraphic)
import Shape
import Picture
import Memo
import SOEGraphics hiding (Region, Event)
import qualified SOEGraphics as G (Region, Event)

import Draw (xWin,yWin,intToFloat)
import Win32Misc (timeGetTime)
-- import Word (word32ToInt)
import Channel

type Time = Float
type UserAction = G.Event

newtype Behavior a
  = Behavior (([Maybe UserAction],[Time]) -> [a])

newtype Event a
  = Event (([Maybe UserAction],[Time]) -> [Maybe a])

time :: Behavior Time
time = Behavior (\(_,ts) -> ts)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Haskell-Cafe mailing list