Thank you all.
But there are two things that remain obscure:
First, there is my situation: int the main thread, I call to some C
functions binded through FFI. All of them are marked 'unsafe', except one,
which is internally supposed to make pauses with 'usleep'.
I then execute in another haskell
By purest coincidence I just wrote the exact same function (the simple
mergeAll', not the VIP one). Well, extensionally the same...
intensionally mine is 32 complicated lines and equivalent to the 3
line mergeAll'. I even thought of short solution by thinking that
pulling the first element destro
Sean Leather wrote:
> (...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
> (...) f g x y = f (g x y)
> Does anybody else care about this? What are some alternative
> solutions?
Here is a different solution:
http://okmij.org/ftp/Haskell/polyvariadic.html#polyvar-comp
f:: a1->a2-> -
Hello Yves,
Thursday, February 18, 2010, 2:10:42 AM, you wrote:
> Okay! So under UNIX, haskell threaded runtime uses pthreads, if I well
> understood.
not exactly. it still uses lightweight (green) threads, but starts
additional OS threads as required to keep N haskell threads running.
it's very
On Wed, Feb 17, 2010 at 6:58 AM, Heinrich Apfelmus
wrote:
> Ah, I meant to use the union' from your previous message, but I think
> that doesn't work because it doesn't have the crucial property that the case
>
>union (VIP x xs) ys = ...
>
> does not pattern match on the second argument.
Ah
On Wed, Feb 17, 2010 at 3:54 PM, Jeremy Shaw wrote:
> On Wed, Feb 17, 2010 at 1:27 PM, Bardur Arantsson wrote:
>
>>
>> (Obviously, if people are using sendfile with something other than
>>> happstack,
>>> it does not help them, but it sounds like trying to fix things in
>>>
>> > sendfile is mis
I haven't seen anybody mentioning «Joy of Cats» by Adámek, Herrlich &
Strecker:
It is available online, and is very well-equipped with thorough
explanations, examples, exercises & funny illustrations, I would say
best of university lecture style: http://katmat.math.uni-bremen.de/acc/.
(Actua
On Wed, Feb 17, 2010 at 3:17 AM, Jeremy O'Donoghue
wrote:
> You're probably correct about the dependencies. I have never tried to
> compile wxHaskell against GHC 6.12.1
>
> I'm waiting for Haskell Platform to be released to make the required
> changes since (working primarily on Windows) I just do
On Wed, Feb 17, 2010 at 6:58 AM, Heinrich Apfelmus
wrote:
> Ah, I meant to use the union' from your previous message, but I think
> that doesn't work because it doesn't have the crucial property that the case
>
> union (VIP x xs) ys = ...
>
> does not pattern match on the second argument.
A
Okay! So under UNIX, haskell threaded runtime uses pthreads, if I well
understood.
To sum up, in order to achieve what I want, I have no other choice than
compiling with '-threading' and importing as 'safe' the functions which can
make a 'sleep'.
Thanks!
Ben Franksen wrote:
>
> Yves Parès wro
On Sunday 14 February 2010 17:02:36 Henk-Jan van Tuyl wrote:
> The symbols that are not specified in a library can be found here:
>http://www.haskell.org/haskellwiki/Keywords
> Hoogle used to show links to this page, when a keyword was searched, but
> not anymore.
>
This isn't Haskell 98 only
Hi Sean
Thanks for the comment.
David Menendez pointed out on the other thread that they generalize
nicely to functors:
http://www.haskell.org/pipermail/haskell-cafe/2009-December/071428.html
Typographically they are a pun on ML's composition operator (o), if
you don't define o - (aka 'monocle'
Interesting. Do you have any details on this? It seems like it would be hard
to express system of linear inequalities as a finite system of linear
equations.
Thanks,
Dan
2010/2/17 Matthias Görgens
> > As far as I can see, you'd use that for systems of linear equalities, but
> > for systems of l
Yves Parès wrote:
> I've also discovered something interesting: when I link with the
> 'threaded' runtime, but let the program use only one core (with '+RTS
> -N1'), the problem disappears. How comes?
> The whole thing remains a mystery, because I think what I'm trying to do
> is quite common...
>
Alberto Ruiz wrote:
> I think that GSL does not include linear programming solvers, but in the
> GSL home page there is a reference to the GLPK package:
>
> http://www.gnu.org/software/glpk/glpk.html
>
> I have not used it, but it would be very nice to have a simple Haskell
> interface to GLPK
On Wed, Feb 17, 2010 at 1:27 PM, Bardur Arantsson wrote:
>
> (Obviously, if people are using sendfile with something other than
>> happstack,
>> it does not help them, but it sounds like trying to fix things in
>>
> > sendfile is misguided anyway.)
>
>>
>>
> How so? As a user I expect sendfile t
On Wed, Feb 17, 2010 at 16:48, Stephen Tetley wrote:
> On 17 February 2010 15:41, Mike Dillon wrote:
> > That signature is the `oo` "specs" combinator in Data.Aviary:
>
Nice!
I wouldn't recommend writing code that depends on Data.Aviary, but
> some of the combinators are often worth copy/pasti
> As far as I can see, you'd use that for systems of linear equalities, but
> for systems of linear inequalities with a linear objective function, it's
> not suitable. I may be wrong though :)
There's a linear [1] reduction from one problem to the other and vice versa.
[1] The transformation itse
On Wed, Feb 17, 2010 at 07:34:07PM +0200, Eugene Dzhurinsky wrote:
> Hopefully, someone could help me in overcoming my ignorance :)
I realized that I can share the same Chan instance over all invocations in
main, and wrap internal function into withCurlDo to ensure only one IO action
gets executed
> What i want to know is if there is already
> something like this (and suggestions for improvement of course).
>
...
> Sometimes i find myself needing to associate a constant with a type
> or, more precisely, with a type class instance.
>
I'm not sure if this is what you're looking for, but it
Jeremy Shaw wrote:
On Wed, Feb 17, 2010 at 2:36 AM, Taru Karttunen wrote:
So for sendfile, instead of threadWaitWrite we could do:
r <- timeout (60 * 10^6) threadWaitWrite
case r of
Nothing -> ... -- timed out
(Just ()) -> ... -- keep going
For sendfile, a timeout of 1 second would
On Wed, Feb 17, 2010 at 05:11:45PM +0100, Roel van Dijk wrote:
> On Wed, Feb 17, 2010 at 3:27 PM, Felipe Lessa wrote:
> > In release (l. 142) Nothing is put into mv
> >
> > then do Lock.release lock
> > putMVar mv Nothing
>
> I'm not sure if th
Am Mittwoch 17 Februar 2010 18:59:42 schrieb Ozgur Akgun:
> Ooops I thought the inner lists are possibly of infinite size.
>
Both, I think.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ooops I thought the inner lists are possibly of infinite size.
On 17 February 2010 17:16, Daniel Fischer wrote:
> Am Mittwoch 17 Februar 2010 17:46:38 schrieb Ozgur Akgun:
> > > The easiest solution is simply to define
> > >
> > >unionAll = nub . mergeAll
> > >where
> > >-- s
Hello, all!
Can somebody please explain, what is the best way of using CURL with several
threads? I wrote simple client, which tries to authenticate against HTTP
server. With running this client, it starts to eat memory insanely (and I know
this code is far, far away of even being close to be call
Am Mittwoch 17 Februar 2010 17:46:38 schrieb Ozgur Akgun:
> > The easiest solution is simply to define
> >
> >unionAll = nub . mergeAll
> >where
> >-- specialized definition of nub
> >nub = map head . groupBy (==)
>
> Talking about the easiest solution, I guess this is
On Wed, Feb 17, 2010 at 2:36 AM, Taru Karttunen wrote:
> Excerpts from Bardur Arantsson's message of Tue Feb 16 23:48:14 +0200 2010:
> > > This cannot be fixed in the sendfile library, it is a
> > > feature of TCP that connections may linger for a long
> > > time unless explicit timeouts are used
> The easiest solution is simply to define
>
>unionAll = nub . mergeAll
>where
>-- specialized definition of nub
>nub = map head . groupBy (==)
>
>
Talking about the easiest solution, I guess this is a quite easy way of
defining unionAll as well: http://gist.github.com
begin Stephen Tetley quotation:
> On 17 February 2010 16:05, Mike Dillon wrote:
> ...
>
> > Are you kidding me? I love writing code like this:
> >
> > o = bunting bunting cardinal thrush blackbird
> >
> > :)
>
> Hi Mike
>
> Thanks! - it took me a surprising amount of time to get from thi
On 17 February 2010 16:05, Mike Dillon wrote:
...
> Are you kidding me? I love writing code like this:
>
> o = bunting bunting cardinal thrush blackbird
>
> :)
Hi Mike
Thanks! - it took me a surprising amount of time to get from this
(where I cheated and used an online 'combinator calcul
On Wed, Feb 17, 2010 at 3:27 PM, Felipe Lessa wrote:
> In acquire (l. 111), if the lock was already acquired it goes by
>
> | otherwise → do putMVar mv mb
> Lock.acquire lock
>
> So it puts back the information about the owner of the RLock and
> waits for its rel
begin Stephen Tetley quotation:
> On 17 February 2010 15:41, Mike Dillon wrote:
> > That signature is the `oo` "specs" combinator in Data.Aviary:
>
> Hi Mike
>
> Thanks - indeed, I was just looking up the thread that covered them a
> month or two ago:
>
> http://www.haskell.org/pipermail/haskel
Am Mittwoch 17 Februar 2010 16:31:16 schrieb Sean Leather:
> I find myself often writing this pattern:
>
> someFun x y z = ...
>
>
>
> fun y z = runFun $ someFun someDefault y z
>
>
> or, alternatively:
>
> fun y = runFun . someFun someDefault y
>
>
> The second option approaches the ideal pointfre
On 17 February 2010 15:41, Mike Dillon wrote:
> That signature is the `oo` "specs" combinator in Data.Aviary:
Hi Mike
Thanks - indeed, I was just looking up the thread that covered them a
month or two ago:
http://www.haskell.org/pipermail/haskell-cafe/2009-December/071392.html
I wouldn't recom
Hi,
This literate haskell file was intended to be a quick question about a
problem i have been pondering, but it developed into a short
presentation instead. What i want to know is if there is already
something like this (and suggestions for improvement of course).
>{-#LANGUAGE GeneralizedNewtype
That signature is the `oo` "specs" combinator in Data.Aviary:
> fun = runFun `oo` someFun someDefault
-md
begin Sean Leather quotation:
> I find myself often writing this pattern:
>
> someFun x y z = ...
>
>
>
> fun y z = runFun $ someFun someDefault y z
> >
>
> or, alternatively:
>
> fun
Sean Leather wrote:
I find myself often writing this pattern:
someFun x y z = ...
fun y z = runFun $ someFun someDefault y z
or, alternatively:
fun y = runFun . someFun someDefault y
I very often write this too (wanting function composition, but with a
two-argument f
I find myself often writing this pattern:
someFun x y z = ...
fun y z = runFun $ someFun someDefault y z
>
or, alternatively:
fun y = runFun . someFun someDefault y
>
The second option approaches the ideal pointfreeness (or pointlessness if
you prefer), but I'd like to go farther:
(...) ::
Hi Alex,
this looks very very interesting, gimme some time to figure it. I hope
you'll take questions later ...
Günther
Am 16.02.10 22:34, schrieb Alexander Solla:
On Feb 16, 2010, at 12:48 PM, Alexander Solla wrote:
(Accumulator String)s are (Accumulator value)s for any value. So you
ca
Hello,
Thanks for the release!
On Wed, Feb 17, 2010 at 03:10:38PM +0100, Roel van Dijk wrote:
> * RLock: A lock which can be acquired multiple times by the same
> thread. Also known as a reentrant mutex.
In acquire (l. 111), if the lock was already acquired it goes by
| otherwise →
Hello,
We would like to announce the release of concurrent-extra [1]. A
library which offers a few extra synchronization primitives. These
primitives are found in the standard libraries of languages like Java
and Python, but not in Haskell.
Quick overview:
* Lock: Enforce exclusive access to a r
Hi
I agree with the sentiments below.
I subscribe to particular lists because of their specialism. The URL
referred to had a tenuous Haskell connection, and definitely not work
the bandwidth consumed. I'm having a difficult enough time trying to
master Haskell without that form of diversion. Enou
Leon Smith wrote:
> Heinrich Apfelmus wrote:
>> I see no obvious deficiencies. :) Personally, I'd probably structure it like
>>
>> http://www.haskell.org/haskellwiki/Prime_numbers#Implicit_Heap
>
> This variant, based on the wiki article, is cleaner, slightly
> simpler, appears to be just as
You're probably correct about the dependencies. I have never tried to
compile wxHaskell against GHC 6.12.1
I'm waiting for Haskell Platform to be released to make the required
changes since (working primarily on Windows) I just don't have time to
create a complete GHC 6.12 installation with most o
I've also discovered something interesting: when I link with the 'threaded'
runtime, but let the program use only one core (with '+RTS -N1'), the
problem disappears. How comes?
The whole thing remains a mystery, because I think what I'm trying to do is
quite common...
Yves Parès wrote:
>
> Ther
2010/2/17 Neil Brown :
> You don't need to do use ThreadId: MVar has an Eq instance, so you could
> make your Lock type derive an Eq instance, and then you can just compare the
> Locks to remove it after the timeout occurs (e.g. using delete to take it
> out of the list; it should be quite near the
Roel van Dijk wrote:
2010/2/16 Neil Brown :
I had a look at the code for Event (both versions) and Lock (but not the
others just yet) and it seemed fine. If you do lots of calls to waitTimeout
before a set you will accumulate old locks in the list, but that won't cause
any error that I can s
2010/2/16 Simon Marlow :
> You might want to take a look at the concurrency part of the GHC test suite:
>
> http://darcs.haskell.org/testsuite/tests/ghc-regress/concurrent/should_run/
>
> Not that we've really solved the problem you're talking about, but you might
> get some ideas.
The method of t
Hello folks,
is there an example (simpe or not) for the use of Data.Random.RVarT with an
underlying monad other than Identity, e.g. StateT, ReaderT etc.?
Thx
Torsten
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman
2010/2/16 Neil Brown :
> I had a look at the code for Event (both versions) and Lock (but not the
> others just yet) and it seemed fine. If you do lots of calls to waitTimeout
> before a set you will accumulate old locks in the list, but that won't cause
> any error that I can see, so it would onl
I think that GSL does not include linear programming solvers, but in the
GSL home page there is a reference to the GLPK package:
http://www.gnu.org/software/glpk/glpk.html
I have not used it, but it would be very nice to have a simple Haskell
interface to GLPK (or other similar library) in hma
Excerpts from Bardur Arantsson's message of Tue Feb 16 23:48:14 +0200 2010:
> > This cannot be fixed in the sendfile library, it is a
> > feature of TCP that connections may linger for a long
> > time unless explicit timeouts are used.
>
> The problem is that the sendfile library *doesn't* wake
>
52 matches
Mail list logo