Does SOE run on Unix?

Alastair Reid alastair@reid-consulting-uk.ltd.uk
05 Nov 2002 21:46:41 +0000


> Several of the programs in Paul Hudak's Haskell text will run under
> Windows, but fail with Solaris or Linux because Win32Misc isn't
> available.  It looks like only timeGetTime is imported from
> Win32Mics.  Is this an oversight with a simple fix?  Has anybody
> done the fix?  Or is this just the tip of the iceberg with a
> hopeless mess just out of sight?

All the examples in SOE run on Unix.

When I ported HGL/SOE to Unix, I ran into exactly this problem and
provided the following shim to get round it:
  
  module Win32Misc( timeGetTime ) where
  import GraphicsCore( getTime )
  import Word( Word32 )
  
  timeGetTime :: IO Word32
  timeGetTime = do
    t <- getTime
    return $ fromInteger (t `mod` 1000000000)
  
The story is that if you want to write clean-looking code, you'll use 

  GraphicsCore.getTime :: IO Integer

but if you're working your way through the SOE book, you can use Win32Misc
which is available as part of the HGL distribution.

--
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/