[Haskell-cafe] Haskore

David Curran david.curran at gmail.com
Fri Sep 22 05:40:31 EDT 2006

I have been trying to learn haskell (tip over the vending machine) for
a while and eventually decided the Haskore music library might be a
good way to start understating the language.

I am using windows and hugs98. The IOExtensions.hs file will not work
under windows. Any ideas on how to make it work or is this library
*nix only?
-- Replacement for IOExtensions.hs of hugs for ghc
-- Implements only the functions necessary for Haskore!
-- Does not work under Windows (where there is a difference between
-- binary and text files)
-- Suitable for use with Hugs 98

module IOExtensions(
	openBinaryFile, readBinaryFile
	) where

import System( getArgs )
import IO( Handle, IOMode(WriteMode), openFile, hPutStr, hClose )
import IOExts

openBinaryFile         :: FilePath -> IOMode -> IO Handle
openBinaryFile path mode = openFileEx path (BinaryMode mode)

writeBinaryFile   	 :: FilePath -> String -> IO ()
writeBinaryFile = writeFile                     -- this does not work
on Windows!!!

readBinaryFile    	 :: FilePath -> IO String
readBinaryFile = readFile                       -- this does not work
on Windows!!!

It chews up lies and spits out the gristle of truth

More information about the Haskell-Cafe mailing list