Re: [Haskell] Re: Streams: the extensible I/O library

Hello Peter, Monday, February 06, 2006, 10:24:01 PM, you wrote: moving to nescafe :) PS> > You can find further information about the library at the PS> > page http://haskell.org/haskellwiki/Library/Streams and PS> > download it as http://freearc.narod.ru/Streams.tar.gz PS> Is there any chance of running this code on a non-Windows PS> system? I tried to compile the example programs, but failed PS> for lack of a System.Win32 module. I might be able to port PS> the code, but I figured it would be wise to ask first. of course, it should work under other systems! it's my fault and you can fix this just by adding #ifdef around this import: #if defined(mingw32_HOST_OS) || defined(__MINGW32__) || defined(_MSC_VER) import System.Win32 #endif btw, my "wc" has about the same speed as yours :) thank you for the first bug-report! i re-uploaded the fixed version just now :) -- Best regards, Bulat mailto:bulatz@HotPOP.com

Hey Bulat, I tried removing the "import System.Win32", but unfortunately it only got me so far: | Examples$ ghc -i.. -O2 -funbox-strict-fields --make wc.hs -o wc | Chasing modules from: wc.hs | [ 1 of 16] Compiling System.FD ( ../System/FD.hs, ../System/FD.o ) | | /tmp/ghc9376_0.hc:6:16: io.h: No such file or directory | /tmp/ghc9376_0.hc: In function `SystemziFD_zdwccall_entry': | | /tmp/ghc9376_0.hc:1670:0: | warning: implicit declaration of function `_eof' | /tmp/ghc9376_0.hc: In function `SystemziFD_zdwccall1_entry': | | /tmp/ghc9376_0.hc:1951:0: | warning: implicit declaration of function `filelength' | /tmp/ghc9376_0.hc: In function `SystemziFD_zdwccall2_entry': | | /tmp/ghc9376_0.hc:2055:0: | warning: implicit declaration of function `tell' | [abort] I also downloaded the new release archive, just to be sure. but it doesn't contain a file "io.h" either. Is that a system header? The problem seems to be _eof.
btw, my "wc" has about the same speed as yours :)
I expected nothing less. All your code I've seen so far has been exceptionally clever. I'm quite curious to try it out. Peter

Hello Peter, Tuesday, February 07, 2006, 4:05:55 AM, you wrote: PS> | Examples$ ghc -i.. -O2 -funbox-strict-fields --make wc.hs -o wc btw, in my programs (and in this lib) i explicitly unbox all the strict fields with simple types because automatic unboxing can lead to losed sharing of complex datastructures PS> | Chasing modules from: wc.hs PS> | [ 1 of 16] Compiling System.FD ( ../System/FD.hs, ../System/FD.o ) PS> | PS> | /tmp/ghc9376_0.hc:6:16: io.h: No such file or directory PS> | /tmp/ghc9376_0.hc: In function `SystemziFD_zdwccall_entry': it should be replaced by HsBase.h, i erroneously thinks that io.h is available on Unix systems. HsBase.h determines itself where we can find all definitions of these low-level functions PS> | warning: implicit declaration of function `_eof' it should be "eof" PS> | warning: implicit declaration of function `filelength' it should be found via HsBase.h, is not? PS> | warning: implicit declaration of function `tell' ditto PS> I also downloaded the new release archive, just to be sure. but PS> it doesn't contain a file "io.h" either. Is that a system header? yes, in mingw :) i attached updated FD.hs. but if filelength/tell cannot be found through HsBase.h, i don't know what to do. at least, System.Posix.Internals does the same: #include "ghcconfig.h" #include "HsBaseConfig.h" foreign import ccall unsafe "HsBase.h read" c_read :: CInt -> Ptr CChar -> CSize -> IO CSsize foreign import ccall unsafe "HsBase.h write" c_write :: CInt -> Ptr CChar -> CSize -> IO CSsize it is possible that devil is in the including of those two additional files. try to add it. otherwise, we should wait until Simon be up :) -- Best regards, Bulat mailto:bulatz@HotPOP.com
participants (2)
-
Bulat Ziganshin
-
Peter Simons