Re: [Haskell-cafe] Monad fold

2013-04-16 Thread Arseniy Alekseyev
Hi! Although foldM won't make things much nicer, it can be used here as well: someA = \a - foldM (flip id) a list Cheers! Arseniy On 16 April 2013 13:35, Christopher Howard christopher.how...@frigidcode.com wrote: So, I'm doing something like this foldl (=) someA list :: Monad m = m a

Re: [Haskell-cafe] Grok Monad Transformers - some help needed

2012-01-01 Thread Arseniy Alekseyev
 I don't know what to actually do with this after putting it in a *.lhs file. You can :load *.lhs into ghci the same way you load .hs-files. I'm not sure why you were getting the ambiguous type errors. I didn't: test1 :: StateT Integer Identity (Integer, Integer) test2 :: StateT [Char] Identity

Re: [Haskell-cafe] Parallel Karatsuba - A Weird speed up value greater than 4 on an Intel Quadcore CPU!

2011-12-24 Thread Arseniy Alekseyev
Hi. You may need to make sure that the CPU frequency scaling does not do anything funny. (like only boosting the frequency to the maximum when the parallel program is running) Arseniy. 24.12.2011, в 19:49, Burak Ekici ekcbu...@hotmail.com написал(а): Dear List, I am trying to parallelize

Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread Arseniy Alekseyev
Of course it is not possible! Take a simple composition of reader and Maybe functors for an example: miszero :: (b - Maybe a) - Bool I'm pretty sure (b - Maybe a) for a is a MonadPlus, but you can't implement miszero for it. Arseniy. On 3 December 2011 16:55, edgar klerks

Re: [Haskell-cafe] mapM is supralinear?

2011-09-27 Thread Arseniy Alekseyev
1 and the next GC runs not sooner than when H reaches H_0*q where H_0 is the heap size remaining after the last collection. On 27 September 2011 10:02, Malcolm Wallace malcolm.wall...@me.com wrote: On 26 Sep 2011, at 23:14, Arseniy Alekseyev wrote: Garbage collection takes amortized O(1) per

Re: [Haskell-cafe] mapM is supralinear?

2011-09-27 Thread Arseniy Alekseyev
...@me.com wrote: On 27 Sep 2011, at 11:23, Arseniy Alekseyev wrote: Malcolm, one should amortize the cost of the collection over the amount of free space allocated rather than recovered They are the same thing.  You can only allocate from the space that has been recovered.  It is true

Re: [Haskell-cafe] mapM is supralinear?

2011-09-26 Thread Arseniy Alekseyev
Garbage collection takes amortized O(1) per allocation, doesn't it? On 26 September 2011 18:00, Lennart Augustsson lenn...@augustsson.net wrote: You seem to ignore garbage collection. On Sat, Sep 24, 2011 at 6:40 AM, Arseniy Alekseyev arseniy.alekse...@gmail.com wrote: Apparently

Re: [Haskell-cafe] mapM is supralinear?

2011-09-23 Thread Arseniy Alekseyev
Apparently it doesn't, and it seems to be fixed now. Does anyone know what exactly the bug was? Because this seems like a serious bug to me. I've run into it myself today and wasn't happy. Linear algorithms should work in linear time however much memory they allocate (modulo cache thrashing of

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread Arseniy Alekseyev
If your functions have the same type, then you can easily collect them in a data structure, say list, and fold that. For example: function :: String - (String - String) function f1 = f1 function f2 = f2 function f3 = f3 runAUserSpecifiedComposition :: String - F runAUserSpecifiedComposition =

Re: [Haskell-cafe] different results after compilation

2011-08-24 Thread Arseniy Alekseyev
The reason may be that you are not printing the result in your program. runhaskell script prints the result of the main computation by default. The compiled programs don't do that. You'll have to call print in your program to achieve the same. On 24 August 2011 13:45, Комар Максим m...@mtw.ru