Re: Does SOE run on Unix?

Alastair Reid <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
> 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                 [email protected]  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.