Hugs parse error in library file

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@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@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

On Thu, Jun 16, 2005 at 10:30:42AM -0700, james pentland wrote:
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)
Add -98 to the Hugs command line: it tells Hugs to recognize extensions beyond Haskell 98, like the forall that Hugs.ST uses.
participants (2)
-
james pentland
-
ross@soi.city.ac.uk