Re: [Haskell-cafe] List of functions

2005-08-31 Thread Dinh Tien Tuan Anh
Something like (untested)... xs - zipWith ($) forkIO (map (\f - f x y) funs) tids - sequence xs what does zipWith ($) do ? _ Be the first to hear what's new at MSN - sign up to our free newsletters!

Re: [Haskell-cafe] List of functions

2005-08-31 Thread Sebastian Sylvan
On 8/31/05, Dinh Tien Tuan Anh [EMAIL PROTECTED] wrote: Something like (untested)... xs - zipWith ($) forkIO (map (\f - f x y) funs) tids - sequence xs what does zipWith ($) do ? $ is function application, so zipWith ($) will zip a list of functions with a list of arguments, by

Re: [Haskell-cafe] List of functions

2005-08-31 Thread Krasimir Angelov
2005/8/31, Sebastian Sylvan [EMAIL PROTECTED]: On 8/31/05, Dinh Tien Tuan Anh [EMAIL PROTECTED] wrote: Something like (untested)... xs - zipWith ($) forkIO (map (\f - f x y) funs) tids - sequence xs what does zipWith ($) do ? $ is function application, so zipWith ($) will

[Haskell-cafe] Re: Haskell poker server

2005-08-31 Thread Kimberley Burchett
Hi Joel, I've been working on a library to parse binary data files (java bytecode in my case), and I ended up writing my own DataReader monad for the purpose of reading binary streams. It offers two main features: * It keeps track of how many bytes you've read. This is necessary for

Re: [Haskell-cafe] Haskell poker server

2005-08-31 Thread Tomasz Zielonka
On Tue, Aug 30, 2005 at 01:31:22PM +0200, Joel Reymont wrote: Can I beg for examples? This is from some old code, slightly polished for presentation - the code for parsing DNS domain name label in DNS packets: parseLabel :: CharParser st Label parseLabel = (? label) $ do len -

[Haskell-cafe] Haskell thread preemption

2005-08-31 Thread Dmitry Vyal
Hello, all. I'm experimenting with concurrent haskell using GHC 6.4. I wrote these fuctions as described in Tackling the Awkward Squad: par_io :: IO a - IO a - IO a par_io t1 t2 = do c - newEmptyMVar :: IO (MVar a) id1 - forkIO $ wrapper c t1 id2 - forkIO $

Re: [Haskell-cafe] embedding prolog in haskell.

2005-08-31 Thread Fergus Henderson
On 18-Aug-2005, Keean Schupke [EMAIL PROTECTED] wrote: I was wondering if anyone has any comments on my implementation of unify? For example can the algorithm be simplified from my nieve attempt? Most importantly is it correct? type Subst = [(Vname,Term)] data Term = Func Fname