Re: [Haskell-cafe] Sample rate inference

2004-11-11 Thread Koji Nakahara
for sending the same mail. I didn't notice you set Reply to. -- Koji Nakahara ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Arrows (Re: [Haskell-cafe] Sample rate inference)

2004-11-11 Thread Koji Nakahara
On Fri, 12 Nov 2004 01:10:06 +0900 Koji Nakahara [EMAIL PROTECTED] wrote: On Thu, 11 Nov 2004 10:49:13 +0100 (MEZ) Henning Thielemann [EMAIL PROTECTED] wrote: The computation sample rate should be propagated through the network as follows: If in a component of equal sample rate some

Re: [Haskell-cafe] Making MVar and Chan Instances of Typeable

2004-11-05 Thread Koji Nakahara
. I could write You can write: instance Typeable a = Typeable (MVar a) where typeOf (x :: MVar a) = mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf (undefined::a)] Hope it helps, Koji Nakahara ___ Haskell-Cafe mailing list [EMAIL

Re: [Haskell-cafe] executable scripts?

2004-10-23 Thread Koji Nakahara
the most obvious (to me) test with Hugs and it doesn't work. #!/usr/local/bin/runhugs will do the trick. See hugs(1). Haskell does really good job for me where perl had been used! -- Koji Nakahara ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http

Re: [Haskell-cafe] existential type problem

2004-10-15 Thread Koji Nakahara
. (MonadTrans t, Monad (t m)) = Foo (forall a. t m a - m a) (t m Int) prog :: Foo IO - IO Int prog (Foo run op) = run $ do lift $ putStrLn Running prog op test = prog (Foo (flip evalStateT 0) get) -- Koji Nakahara ___ Haskell-Cafe

Re: [Haskell-cafe] Generalized list-comprehension

2004-01-31 Thread Koji Nakahara
Hi, Another solution: f m n = concat $ take m $ tail xs where xs = [[]]:map (\x - concatMap (\y - map (y:) x) [1..n]) xs f 3 4 gives your f 4. Hope it helps, Koji Nakahara On Sat, 31 Jan 2004 07:35:38 -0800 (PST) Ron de Bruijn [EMAIL PROTECTED] wrote: Hi there, I have written

Re: [Haskell-cafe] Generalized list-comprehension

2004-01-31 Thread Koji Nakahara
: xs = [[]]:[[ y:z | y - [1..n], z - x] | x - xs] Hope it helps, Koji Nakahara On Sun, 1 Feb 2004 15:22:01 +0900 Koji Nakahara [EMAIL PROTECTED] wrote: Hi, Another solution: f m n = concat $ take m $ tail xs where xs = [[]]:map (\x - concatMap (\y - map (y:) x) [1..n]) xs f

Re: Stack usage with a state monad

2003-12-30 Thread Koji Nakahara
') = runState m s in s `seq` runState (k a) s' -- force evaluation of the state m k = m = \_ - k -- Koji Nakahara ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Common subexpressions are not optimized to single one?

2003-12-03 Thread Koji Nakahara
= g x in func h h in order to make the program run faster. But ,in the first place, is it meaningful to write let h = g x in func h h in order to avoid re-evaluation of g x, on the assumption that h is CAF? Thanks. -- Koji Nakahara ___ Haskell-Cafe

Common subexpressions are not optimized to single one?

2003-12-02 Thread Koji Nakahara
want to use some C functions from haskell each of which is not pure but the result of their sequential combination is pure. I'm planning to write some functions like g above(but more complex and actually pure) and considering the optimization of the code using them. Thanks in advance. Koji

Re: Help: Stack-overflow and tail-recursive functions

2003-06-20 Thread Koji Nakahara
On Fri, 20 Jun 2003 07:54:50 -0700 Hal Daume [EMAIL PROTECTED] wrote: mine didn't either, until I increased the 200 to around 1500...it's probably OS/memory specific. Only 600 causes the stack overflow in my environment(FreeBSD, 640MB). Interestingly, on GHCi, the program shows the elements

listArray and stack overflow (Re: Help: Stack-overflow and tail-recursive functions)

2003-06-19 Thread Koji Nakahara
I did some experiments and now suspect that the culprit is the infinite list. When I replace rmat with rmat n = listArray ((1,1),(n,n)) [1..] -- no longer random , print (m ! (300, 300)) where m = rmat 800 fails again. However, if I use a finite list as the second argument of listArray: rmat