Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-10-05 Thread John Lato
I think you've misunderstood Robin's point. The problem is that each of these libraries is platform-specific. Writing an api on top of one is work enough, but writing a cross-platform api that binds to the appropriate platform-specific backend is a major undertaking. On Oct 4, 2013 7:12 PM, Alp

Re: [Haskell-cafe] Newclasses

2013-10-03 Thread John Lato
I don't really understand what a newclass is supposed to be. On Thu, Oct 3, 2013 at 2:15 PM, Wvv vite...@rambler.ru wrote: newclass Bind a = Monad a = BMonad a where { (=) = (-) } I think this means that `BMonad` is supposed to be a new class that has both Bind and Monad in scope, the

Re: [Haskell-cafe] Newclasses

2013-10-03 Thread John Lato
to be able to support it. On Thu, Oct 3, 2013 at 7:53 PM, John Lato jwl...@gmail.com wrote: I don't really understand what a newclass is supposed to be. On Thu, Oct 3, 2013 at 2:15 PM, Wvv vite...@rambler.ru wrote: newclass Bind a = Monad a = BMonad a where { (=) = (-) } I think

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-01 Thread John Lato
It's not a solution per se, but it seems to me that there's no need for the Monad superclass constraint on MonadIO. If that were removed, we could just have class LiftIO t where liftIO :: IO a - t a and it would Just Work. On Tue, Oct 1, 2013 at 1:58 AM, Michael Snoyman

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-27 Thread John Lato
Hi Conal, If there is a system like you describe, I'm not aware of it. Part of the problem is the state of the underlying C libraries: gtk+ - possible, but suffers from the drawbacks you mention on OSX and is reportedly difficult to install on windows wx - somehow I've never been able to build

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-24 Thread John Lato
On Tue, Sep 24, 2013 at 11:36 AM, Stijn van Drongelen rhym...@gmail.comwrote: On Tue, Sep 24, 2013 at 5:39 PM, Sven Panne svenpa...@gmail.com wrote: 2013/9/22 Mike Meyer m...@mired.org: On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson s...@scientician.net wrote: Trying to make

Re: [Haskell-cafe] Why superclass' instances are bad idea?

2013-09-24 Thread John Lato
This line instance Monad m = Applicative m where tells the compiler Every type (of the appropriate kind) is an instance of Applicative. And it needs to have a Monad instance as well. That's what Edward means when he said that it means every Applicative is a Monad. Theoretically the

Re: [Haskell-cafe] Monomorphic containers, Functor/Foldable/Traversable WAS: mapM_ for bytestring

2013-09-16 Thread John Lato
On Fri, Sep 13, 2013 at 12:48 AM, Michael Snoyman mich...@snoyman.comwrote: On Thu, Sep 12, 2013 at 2:37 AM, John Lato jwl...@gmail.com wrote: I didn't see this message and replied privately to Michael earlier, so I'm replicating my comments here. Sorry about that, I wrote to you

Re: [Haskell-cafe] Monomorphic containers, Functor/Foldable/Traversable WAS: mapM_ for bytestring

2013-09-16 Thread John Lato
On Mon, Sep 16, 2013 at 4:57 AM, Michael Snoyman mich...@snoyman.comwrote: On Mon, Sep 16, 2013 at 10:34 AM, John Lato jwl...@gmail.com wrote: On Fri, Sep 13, 2013 at 12:48 AM, Michael Snoyman mich...@snoyman.comwrote: On Thu, Sep 12, 2013 at 2:37 AM, John Lato jwl...@gmail.com wrote

Re: [Haskell-cafe] Bytestring map/zipWith rationale

2013-09-12 Thread John Lato
Carter: we don't have both. We have one function from each category. My guess is nobody's ever really needed a really fast zipWith :: (Word8-Word8-Word8) - ByteString - ByteString - ByteString; that's the only reason I can think of for its omission. On Thu, Sep 12, 2013 at 10:45 AM, Carter

Re: [Haskell-cafe] Monomorphic containers, Functor/Foldable/Traversable WAS: mapM_ for bytestring

2013-09-11 Thread John Lato
John. Michael [1] https://github.com/snoyberg/classy-prelude/issues/18 On Wed, Sep 11, 2013 at 11:05 PM, John Lato jwl...@gmail.com wrote: I agree with everything Edward has said already. I went through a similar chain of reasoning a few years ago when I started using ListLike, which

Re: [Haskell-cafe] Unary functions and infix notation

2013-09-06 Thread John Lato
The observation that this only applies to functions with a polymorphic return type is key. id :: a - a This can be instantiated at id' :: (a-b) - (a-b) id' :: (a-b) - a - b-- these are the same What this means is that id is a function with arity-2 whenever the first argument is

Re: [Haskell-cafe] sequence causing stack overflow on pretty small lists

2013-08-27 Thread John Lato
IMHO it's perfectly reasonable to expect sequence/replicateM/mapM to be able to handle a list of ~1e6 elements in the Unescapable Monad (i.e. IO). All the alternate implementations in the world won't be as handy as Prelude.sequence, and no amount of documentation will prevent people from running

Re: [Haskell-cafe] catching IO errors in a monad transformer stack

2013-07-22 Thread John Lato
version of catch: catch :: Exception e = m a - (e - m a) - m a On Sun, Jul 21, 2013 at 6:30 PM, John Lato jwl...@gmail.com wrote: I think most people use monad-control these days for catching exceptions in monad stacks (http://hackage.haskell.org/package/monad-control-0.3.2.1). The very

Re: [Haskell-cafe] catching IO errors in a monad transformer stack

2013-07-21 Thread John Lato
I think most people use monad-control these days for catching exceptions in monad stacks (http://hackage.haskell.org/package/monad-control-0.3.2.1). The very convenient lifted-base package ( http://hackage.haskell.org/package/lifted-base) depends on it and exports a function

Re: [Haskell-cafe] Wrapping all fields of a data type in e.g. Maybe

2013-07-16 Thread John Lato
The suggestion of parameterizing on a functor would be good, however there's another approach I've often seen (although it's not quite what you've asked for). You can leave your config datatype alone, but instead of making it a monoid have your configuration parsers return functions with the type

Re: [Haskell-cafe] ordNub

2013-07-15 Thread John Lato
In my tests, using unordered-containers was slightly slower than using Ord, although as the number of repeated elements grows unordered-containers appears to have an advantage. I'm sure the relative costs of comparison vs hashing would affect this also. But both are dramatically better than the

Re: [Haskell-cafe] ordNub

2013-07-15 Thread John Lato
On Tue, Jul 16, 2013 at 10:31 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 16 July 2013 11:46, John Lato jwl...@gmail.com wrote: In my tests, using unordered-containers was slightly slower than using Ord, although as the number of repeated elements grows unordered

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-11 Thread John Lato
I agree that how the exception was thrown is more interesting than the type. I feel like there should be a way to express the necessary information via the type system, but I'm not convinced it's easy (or even possible). Another issue to be aware of is that exceptions can be thrown from pure

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-10 Thread John Lato
I think 'shouldBeCaught' is more often than not the wrong thing. A whitelist of exceptions you're prepared to handle makes much more sense than excluding certain operations. Some common whitelists, e.g. filesystem exceptions or network exceptions, might be useful to have. I like Ertugrul's

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-10 Thread John Lato
On Wed, Jul 10, 2013 at 5:02 PM, Erik Hesselink hessel...@gmail.com wrote: On Wed, Jul 10, 2013 at 10:39 AM, John Lato jwl...@gmail.com wrote: I think 'shouldBeCaught' is more often than not the wrong thing. A whitelist of exceptions you're prepared to handle makes much more sense than

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-10 Thread John Lato
though. It wouldn't fix this issue, but it would add a lot more flexibility to exceptions. On Wed, Jul 10, 2013 at 6:44 PM, Michael Snoyman mich...@snoyman.comwrote: On Wed, Jul 10, 2013 at 1:01 PM, John Lato jwl...@gmail.com wrote: On Wed, Jul 10, 2013 at 5:02 PM, Erik Hesselink hessel

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-02 Thread John Lato
paratribulati...@free.fr wrote: John Lato wrote: Now, I have found another behavior difficult to understand for me: runQ $ lift u ListE [LitE (CharL 'u') runQ $ [| u |] LitE (StringL u) So we have similar behaviors for lift and [||]. We can check it in a splice: $( [| u

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-30 Thread John Lato
On Mon, Jul 1, 2013 at 6:01 AM, TP paratribulati...@free.fr wrote: o...@okmij.org wrote: pr :: Name - ExpQ pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |] The example is indeed problematic. Let's consider a simpler one: foo :: Int - ExpQ foo n = [|n + 1|] The

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-05 Thread John Lato
On Wed, Jun 5, 2013 at 3:56 PM, Roman Cheplyaka r...@ro-che.info wrote: * Ivan Lazar Miljenovic ivan.miljeno...@gmail.com [2013-06-05 17:47:40+1000] On 5 June 2013 17:34, Roman Cheplyaka r...@ro-che.info wrote: * Jason Dagit dag...@gmail.com [2013-06-04 21:00:25-0700] My preferred

Re: [Haskell-cafe] FRP memory leaks

2013-06-05 Thread John Lato
Which FRP frameworks have you been looking at? In my experience, the most publicized leaks have been time leaks, which are a particular type of memory leak related to switching. However, the presence of time leaks mostly arises in terms of the FRP implementation. Arrowized FRP (e.g. Yampa,

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-05 Thread John Lato
I agree that preprocessing code shouldn't be hsc2hs specific. I prefer c2hs myself. But hsc2hs is distributed with ghc, which makes it as official as a good many other parts of modern Haskell. I also agree that making cabal-ghci work nicely would be ideal, but I don't think it can be done

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread John Lato
On Wed, Jun 5, 2013 at 10:15 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 5 June 2013 12:02, silly silly8...@gmail.com wrote: I was wondering today, why hasn't hsc2hs been merged with ghc so that it would be possible to add a {-# LANGUAGE ForeignFunctionInterface

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread John Lato
in to ghci instead of accessing ghci via cabal (or cabal-dev). cabal seems like a better location, and it's aware of several preprocessors already. On Wed, Jun 5, 2013 at 12:00 PM, Jason Dagit dag...@gmail.com wrote: On Tue, Jun 4, 2013 at 8:45 PM, John Lato jwl...@gmail.com wrote: On Wed

Re: [Haskell-cafe] Design of extremely usable programming language libraries

2013-05-28 Thread John Lato
Not sure what you mean here — attoparsec does support unlimited lookahead, in the sense that a parser may fail arbitrarily late in the input stream, and backtrack to any previous state. Although attoparsec is a poor choice for programming language parsing, primarily because of the error

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread John Lato
On Thu, May 2, 2013 at 5:30 PM, Ertugrul Söylemez e...@ertes.de wrote: To express this question in a broader context: Are you leaving a broken tool and replacing it with a new shiny one? So I read the original post, and it really wasn't clear to me what exact changes were causing the

Re: [Haskell-cafe] Numerics and Warnings

2013-04-10 Thread John Lato
The issue with this example is that you have genericTake :: Integral a = a - [b] - [b] where the 'a' is converted to an Int without being checked for overflow. IMHO type defaulting is irrelevant for this one problem; evaluating take 44 foobar has exactly the same

Re: [Haskell-cafe] introducing Maybe at managing level

2013-03-28 Thread John Lato
In FP, I think this sort of problem is generally handled via algebraic data types rather than exceptions. In particular this directly addresses the issue of exceptions don't necessarily shout themselves out, since the compiler warns you if you've missed a case. They sound mathy, but algebraic

Re: [Haskell-cafe] Compiled program using OpenGL fails to trigger GPU switch on Mac, but works in GHCi

2013-03-17 Thread John Lato
Hello, Unfortunately I don't have much to add. On Wed, Mar 13, 2013 at 9:51 PM, Jesper Särnesjö sarne...@gmail.com wrote: Hi everybody, This started out on haskell-beginners, as a question about poor performance for a Haskell program using OpenGL. Thanks to a few good suggestions there,

Re: [Haskell-cafe] Open-source projects for beginning Haskell students?

2013-03-12 Thread John Lato
There's the doctest package: http://hackage.haskell.org/package/doctest, which looks pretty good and has a number of users (35 direct reverse deps). It has support for cabal test integration, although I would like to see better integration with other test tools. But that can be added in the test

Re: [Haskell-cafe] File I/O benchmark help (conduit, io-streams and Handle)

2013-03-09 Thread John Lato
On Fri, Mar 8, 2013 at 6:36 PM, Simon Marlow marlo...@gmail.com wrote: 1GB/s for copying a file is reasonable - it's around half the memory bandwidth, so copying the data twice would give that result (assuming no actual I/O is taking place, which is what you want because actual I/O will swamp

Re: [Haskell-cafe] File I/O benchmark help (conduit, io-streams and Handle)

2013-03-08 Thread John Lato
I'd like to point out that it's entirely possible to get good performance out of a handle. The iteratee package has had both FD and Handle-based IO for a while, and I've never observed any serious performance differences between the two. Also, if I may be so bold, Michael's supercharged copy

Re: [Haskell-cafe] File I/O benchmark help (conduit, io-streams and Handle)

2013-03-07 Thread John Lato
I would have expected sourceFileNoHandle to make the most difference, since that's one location (write) where you've obviously removed a copy. Does sourceFileNoHandle allocate less? Incidentally, I've recently been making similar changes to IO code (removing buffer copies) and getting similar

Re: [Haskell-cafe] Future of MonadCatchIO

2013-03-03 Thread John Lato
On Mon, Mar 4, 2013 at 12:07 AM, Ertugrul Söylemez e...@ertes.de wrote: Arie Peterson ar...@xs4all.nl wrote: Would anyone have a problem with a deprecation of MonadCatchIO-transformers, and a failure to update it to work with a base without 'block' and 'unblock'? Yes. This is a

Re: [Haskell-cafe] Future of MonadCatchIO

2013-03-03 Thread John Lato
Also I've seen at least one article about the incorrectness of monad-control. That's one further reason I like to avoid it. I'd appreciate a link if anyone could manage to find it. I haven't seen any criticisms of monad-control. Oddly, I just stumbled across

Re: [Haskell-cafe] edge: compile testing

2012-12-16 Thread John Lato
From: Christopher Howard christopher.how...@frigidcode.com On 12/14/2012 07:05 PM, Clark Gaebel wrote: Unacceptable argument type in foreign declaration Thanks for giving it a try. Could you send off a bug report to the OpenAL Haskell module maintainer? sven.pa...@aedion.de (I might

Re: [Haskell-cafe] Motion to unify all the string data types

2012-11-11 Thread John Lato
From: Francesco Mazzoli f...@mazzo.li At Sat, 10 Nov 2012 15:16:30 +0100, Alberto G. Corona wrote: There is a ListLike package, which does this nice abstraction. but I don't know if it is ready for and/or enough complete for serious usage. I?m thinking into using it for the same

Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread John Lato
From: Alfredo Di Napoli alfredo.dinap...@gmail.com Subject: [Haskell-cafe] A clarification about what happens under the hoodwith foldMap I'm sure I'm missing a point, but the minimum definition for a Foldable instance is given in terms of foldMap, so I get the cake for free,

Re: [Haskell-cafe] Either Monad and Laziness

2012-09-17 Thread John Lato
Subject: Re: [Haskell-cafe] Either Monad and Laziness On 9/14/12 5:16 PM, Eric Velten de Melo wrote: But now I'm kinda lost. Is there an easy way to explain the difference between: -iteratee -conduit -enumerator I tend to group them into three families. 'iteratee' and 'enumerator' are

Re: [Haskell-cafe] Haskell-Cafe Digest, Vol 106, Issue 38

2012-06-26 Thread John Lato
Message: 12 Date: Wed, 27 Jun 2012 00:19:30 +0200 From: Tillmann Rendel ren...@informatik.uni-marburg.de Subject: Re: [Haskell-cafe] Martin Odersky on What's wrong with        Monads Cc: haskell-cafe@haskell.org Message-ID: 4fea3572.5060...@informatik.uni-marburg.de Content-Type:

Re: [Haskell-cafe] Haskell-Cafe Digest, Vol 106, Issue 38

2012-06-26 Thread John Lato
On Wed, Jun 27, 2012 at 9:15 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 27/06/2012, at 12:51 PM, John Lato wrote: data Tree a = Leaf a | Branch (Tree a) ( Tree a)  deriving (Foldable, Show) While I am familiar with deriving (Show), I am not familiar with deriving (Foldable), which

Re: [Haskell-cafe] Google Summer of Code - Lock-free data

2012-03-29 Thread John Lato
Slightly related: I think it would be interesting to compare a Disruptor-based concurrency communications mechanism and compare it to e.g. TChans 1. Disruptor - http://code.google.com/p/disruptor/ From: Ryan Newton rrnew...@gmail.com I think so. Atomically reading and writing a single memory

[Haskell-cafe] difficulty building (some) TH packages with ghc-7.4.1

2012-03-26 Thread John Lato
Hello, I've run into an odd problem when building certain packages that use Template Haskell with GHC-7.4.1. For example, RepLib: $ cabal --version cabal-install version 0.13.3 using version 1.14.0 of the Cabal library $ cabal install -O2 -w ~/.ghc-7.4.1/bin/ghc RepLib --reinstall Resolving

Re: [Haskell-cafe] Open-source projects for beginning Haskell students?

2012-03-23 Thread John Lato
From: Heinrich Apfelmus apfel...@quantentunnel.de Tom Murphy wrote:      If you want to do Haskell audio synthesis, you could also use hsc3 (good start here: http://slavepianos.org/rd/ut/hsc3-texts/). With hsc3 you can start on serious audio synthesis with only a few lines of Haskell. In my

Re: [Haskell-cafe] Clarifying a mis-understanding about regions (and iteratees)

2012-02-23 Thread John Lato
ResourceT really addresses a different problem. Specifically, the issue of how to guarantee that finalizers will run in the context of short-circuiting monadic effects. It does this by providing a single region (not nested regions as Oleg describes) as the base of the monad stack, ensuring that

[Haskell-cafe] How to increase performance using concurrency for sequential producer-consumer problem

2012-02-14 Thread John Lato
I would use bounded STM channels (from the stm-chans package) for communication; this would keep the producer from getting too far ahead of the converters. You'd need to tag items as they're produced (an Integer should be fine) also, and keep track of the tags. A TVar should suffice for that.

Re: [Haskell-cafe] ANN: stm-conduit-0.2.1

2012-02-13 Thread John Lato
Message: 6 Date: Sun, 12 Feb 2012 01:47:40 -0500 From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] ANN: stm-conduit-0.2.1 To: Haskell Cafe haskell-cafe@haskell.org Message-ID: 4f37608c.3090...@freegeek.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed On

[Haskell-cafe] interest in Irish Haskell User's Group?

2012-01-24 Thread John Lato
Hello, Some other Haskellers and I have been discussing starting an Irish Haskell User's Group. I think we're close to critical mass, and need just a few more interested people to give it a run. To that end, I'd appreciate hearing from anyone who would be interested in attending or

Re: [Haskell-cafe] How to terminate the process group of a process created with createProcess?

2012-01-12 Thread John Lato
From: Brandon Allbery allber...@gmail.com On Wed, Jan 11, 2012 at 16:26, Andr? Scholz andre.sch...@uni-bremen.dewrote: (on unix) creating a process A which spawns itself a subprocess B and terminating process A before it finishes leaves process B as a process on its own. This is because

Re: [Haskell-cafe] GHC exceeding command line length limit with split-objs - and a possible fix

2012-01-11 Thread John Lato
I used https://github.com/kennethreitz/osx-gcc-installer/downloads to get a real gcc on Lion. Biggish download, but it worked. I've also seen reports of success by self-compiling gcc, or by installing XCode 4 on top of an existing XCode 3 installation. John L. From: Eugene Kirpichov

Re: [Haskell-cafe] typeclass and functional dependency problem

2012-01-10 Thread John Lato
From: Martin DeMello martindeme...@gmail.com Subject: [Haskell-cafe] typeclass and functional dependency problem I'm writing a Gtk2hs app, and I have several custom widgets that are composite objects represented by records, one field of which is a container widget. I am trying to write a

[Haskell-cafe] Haskell meta-programming

2011-12-21 Thread John Lato
From: Heinrich Apfelmus apfel...@quantentunnel.de * Meta-programming / partial evaluation. When designing a DSL, it is often the case that you know how to write an optimizing compiler for your DSL because it's usually a first-order language. However, trying to squeeze that into GHC rules is

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread John Lato
From: Christoph Breitkopf chbreitk...@googlemail.com Hi, I recently asked about what interfaces to implement for a new data type. Following the rule that the last 10% of work take the second 90% of time, some other questions have come up. If anyone wants to look at the code in question:

Re: [Haskell-cafe] containers-deepseq?

2011-11-29 Thread John Lato
Message: 22 Date: Tue, 29 Nov 2011 12:18:41 +0200 From: Michael Snoyman mich...@snoyman.com Subject: Re: [Haskell-cafe] containers-deepseq? By the way, this is the part of situation that cabal-src is coming to solve, and it *is* solved... except that the result is a lot of re-compiling.

Re: [Haskell-cafe] A Mascot

2011-11-23 Thread John Lato
From: Michael Orlitzky mich...@orlitzky.com On 11/22/11 16:52, heathmatlock wrote: Wasn't planning on it, but I saw some emails on the topic, so I worked on what I presented earlier: Anyway, creative design-by-committee is doomed, so my advice is to ignore this and all other advice =) +1

Re: [Haskell-cafe] German names for kinds and sorts

2011-11-14 Thread John Lato
hierarchy, particularly as you go higher up the structure. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] what happens to ()'s from Core?

2011-10-05 Thread John Lato
Hello, I'm working on a small EDSL, and I think I've finally managed to get GHC to compile it to good core. Basically, it allows for the creation of expressions like: g = 0.5*x + 0.1*y which is then compiled to a tuple (related work: CCA, stream fusion) exists s. (s, s - Double -

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-21 Thread John Lato
From: Casey McCann c...@uptoisomorphism.net        CAJ5riwLLu=wAFXm8VPnqRG2Daxxgf=upgxzchydmebgngix...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 20, 2011 at 8:20 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: However, nowadays I tend to think that

Re: [Haskell-cafe] mapM is supralinear?

2011-09-21 Thread John Lato
On Wed, Sep 21, 2011 at 1:57 PM, Tim Docker t...@dockerz.net wrote: On 09/09/2011, at 8:19 PM, John Lato wrote: Agreed.  Whenever I'd like to use mapM (or any other function for which a *M_ is available), I've found the following rules helpful: 1.  If I can guarantee the list is short (~ n

Re: [Haskell-cafe] mapM is supralinear?

2011-09-09 Thread John Lato
From: Daniel Fischer daniel.is.fisc...@googlemail.com On Friday 09 September 2011, 00:41:11, Roman Cheplyaka wrote: * Ertugrul Soeylemez e...@ertes.de [2011-09-07 16:20:03+0200] In general it's a bad idea to use mapM over IO. Could you explain why? Take it with a grain of salt, there's

Re: [Haskell-cafe] a minor bug (memory leak) in ListLike package

2011-08-24 Thread John Lato
Thanks for reporting this. I understand the problem, however I don't want to bloat the interface even more with a bunch of strict versions of functions. Even so, the current implementation is definitely the worst possible option as it has the slow performance of building thunks without the

Re: [Haskell-cafe] a minor bug (memory leak) in ListLike package

2011-08-24 Thread John Lato
On Wed, Aug 24, 2011 at 7:47 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: I was just trying to remember some of the tricks Daniel Peebles (aka {co}pumpkin) used to do in #haskell with Data.List.genericLength. I've never really used ListLike, but was just trying to guess why the

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Lato
Message: 17 Date: Wed, 24 Aug 2011 17:02:49 +0300 From: Michael Snoyman mich...@snoyman.com Subject: [Haskell-cafe] Lifting an enumerator To: Haskell Cafe haskell-cafe@haskell.org Cc: John Millikin jmilli...@gmail.com Message-ID:        

Re: [Haskell-cafe] Problems building lambdabot on osx

2011-08-09 Thread John Lato
From: Brandon Allbery allber...@gmail.com On Mon, Aug 8, 2011 at 21:38, Adam Turoff adam.tur...@gmail.com wrote: First, there's the issue with linking against libiconv, which is solved this way:        cabal install --extra-lib-dirs=/usr/lib That leaves a whole mess of link errors

Re: [Haskell-cafe] [iteratee] empty chunk as special case of input

2011-07-13 Thread John Lato
Hi Sergey, iteratee (the package) uses a null chunk to signify that no further stream data is available within the iteratee, that is, at some point the stream has been entirely consumed. Therefore, if any of the composed iteratees haven't run to completion, they need to get more data from an

Re: [Haskell-cafe] [iteratee] empty chunk as special case of input

2011-07-13 Thread John Lato
responsible for a slightly convoluted implementation of enumFromCallbackCatch. I'll have to expend more brain cells on it, I think. John L. On Thu, Jul 14, 2011 at 1:15 AM, John Lato jwl...@gmail.com wrote: Hi Sergey, iteratee (the package) uses a null chunk to signify that no further stream data

Re: [Haskell-cafe] Call for GUI examples - Functional Reactive Programming

2011-07-09 Thread John Lato
From: Chris Smith cdsm...@gmail.com On Fri, 2011-07-08 at 08:08 +0200, Heinrich Apfelmus wrote: Do you know any *small GUI programs* that you would *like* to see *implemented with Functional Reactive Programming?* This isn't really a specific application, but what I'd like to see most

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread John Lato
Message: 23 Date: Wed, 06 Jul 2011 10:14:56 +0100 From: Simon Marlow marlo...@gmail.com Subject: Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread? To: Jason Dagit dag...@gmail.com, cvs-...@haskell.org,Haskell Cafe

Re: [Haskell-cafe] Diagnose stack space overflow

2011-07-04 Thread John Lato
From: Logo Logo sarasl...@gmail.com Hi, For the following error: Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize -RTS' to increase it. I want to find out the culprit function and rewrite it tail-recursively. Is there a way to find out which function is causing this

Re: [Haskell-cafe] Patterns for processing large but finite streams

2011-07-01 Thread John Lato
From: Eugene Kirpichov ekirpic...@gmail.com Subject: [Haskell-cafe] Patterns for processing large but finite streams To: Haskell Cafe haskell-cafe@haskell.org Message-ID: banlktikdsvq2wv4wjr+qmuvksoav0kt...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm

Re: [Haskell-cafe] Patterns for processing large but finite streams

2011-07-01 Thread John Lato
After the list discussion, I'm surprised nobody mentioned Max Rabkin/Conal Elliott's blog posts on folds and zips. http://squing.blogspot.com/2008/11/beautiful-folding.html http://conal.net/blog/posts/enhancing-a-zip/ They develop a formalism for zipping functions on lists. Iteratee's `zip` set

Re: [Haskell-cafe] Data.Enumerator.List.concatMap is to Data.Iteratee.?

2011-06-27 Thread John Lato
From: David Place d...@vidplace.com Hi: I've been studying iteratee IO. Is there a function in the iteratee package that is analogous to Data.Enumerator.List.concatMap? Iteratee's 'Data.Iteratee.Iteratee.convStream', or the more general 'Data.Iteratee.Iteratee.unfoldConvStream', would

Re: [Haskell-cafe] Iteratee IO examples

2011-06-25 Thread John Lato
From: Eric Rasmussen ericrasmus...@gmail.com Hi, Examples are very helpful to me too -- thank you for sharing. I'm especially curious to see if there are any examples that allow you to use or convert non-iteratee-based functions. I have only just begun reading about iteratees and might

Re: [Haskell-cafe] Iteratee IO examples

2011-06-25 Thread John Lato
On Sat, Jun 25, 2011 at 10:18 PM, wren ng thornton w...@freegeek.orgwrote: On 6/25/11 6:51 AM, John Lato wrote: Honestly I'm quite dis-satisfied with the current state of code which depends on iteratee/enumerator. It's nearly all written in a very low-level style, i.e. directly writing

Re: [Haskell-cafe] Maybe use advice

2011-06-07 Thread John Lato
Is it necessary (helpful) to use 'rewrite'? Nearly every time I've tried it, in the end 'transform' has been a better choice. Then you wouldn't need the 'Just's at all, and it should work fine. John From: Lyndon Maydwell maydw...@gmail.com (missed including cafe) f :: [Modification] -

Re: [Haskell-cafe] Maybe use advice

2011-06-07 Thread John Lato
matrix transform for Diagrams and rewrite everything in terms of that. This would be useful for shear transforms anyway, which I believe are currently inexpressible in Diagrams. John Lato On Tue, Jun 7, 2011 at 10:12 AM, Lyndon Maydwell maydw...@gmail.com wrote: The fixpoint nature of rewrite

Re: [Haskell-cafe] [iteratee] how to do nothing .. properly

2011-06-05 Thread John Lato
$ iter4 s - I.stream2list return (b,s) print5 = enumPure1Chunk [1..10] (iter5) = run = print Thanks a lot! Sergey 2011/6/2 John Lato jwl...@gmail.com: Hi Sergey, I've got an explanation; quite surprisingly it's a bug in enumPure1Chunk. Even though it is an odd case, I'm surprised

Re: [Haskell-cafe] [iteratee] how to do nothing .. properly

2011-06-02 Thread John Lato
Hi Sergey, I can't explain this; maybe it's a bug in enumWith? I'll look into it. Thanks, John Message: 20 Date: Thu, 2 Jun 2011 02:46:32 +0400 From: Sergey Mironov ier...@gmail.com Subject: [Haskell-cafe] [iteratee] how to do nothing .. properly To: haskell-cafe@haskell.org Message-ID:

Re: [Haskell-cafe] [iteratee] how to do nothing .. properly

2011-06-02 Thread John Lato
on enumPure1Chunk, unfortunately. Thanks very much for reporting this. John L On Thu, Jun 2, 2011 at 10:02 AM, Sergey Mironov ier...@gmail.com wrote: Ok. I've checked iteratee-0.8.3.0 and 0.8.4.0. Results are same. Sergey 2011/6/2 John Lato jwl...@gmail.com: Hi Sergey, I can't explain

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-06-01 Thread John Lato
, but with the small chunksize Data.HashMap has a significant advantage. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-06-01 Thread John Lato
On Wed, Jun 1, 2011 at 12:55 AM, Aleksandar Dimitrov aleks.dimit...@googlemail.com wrote: On Tue, May 31, 2011 at 11:30:06PM +0100, John Lato wrote: None of these leak space for me (all compiled with ghc-7.0.3 -O2). Performance was pretty comparable for every version, although

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread John Lato
, although Aleksander's original did seem to have a very small edge. As someone already pointed out, keep in mind that this will use a lot of memory anyway, unless there's a lot of repetition of words. I'd be happy to help track down a space leak in iteratee, but for now I'm not seeing one. Best, John

Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-30 Thread John Lato
From: michael rice nowg...@yahoo.com I think this is fixed in the gtk2hs source tree, have you tried building from the repo? cabal install gtk2hs-buildtools darcs get --lazy http://code.haskell.org/gtk2hs/ cd gtk2hs chmod +x bootstrap.sh ./bootstrap.sh John Lato Is this worth chasing

Re: [Haskell-cafe] uniplate (was: code review?)

2011-05-30 Thread John Lato
Hi Neil, thanks for the response. On Mon, May 30, 2011 at 8:48 PM, Neil Mitchell ndmitch...@gmail.com wrote: Hi John, While I'm on the topic, I recently wrote a tool that wanted to traverse deep data structures as produced by haskell-src-exts. ?I wound up with about 50 lines of case

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-26 Thread John Lato
On Tue, May 24, 2011 at 1:28 AM, John Lato jwl...@gmail.com wrote: You can use gtkglext to get OpenGL support. With the official release of gtkglext-1.2.0 there's a bit of hacking involved (that was probably me you're referring to), but it looks like the repo head has native Quartz. With any

Re: [Haskell-cafe] uniplate (was: code review?)

2011-05-25 Thread John Lato
exist? I was importing Data.Generics.Uniplate.Direct FWIW. Thanks, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-24 Thread John Lato
package. I might have some time to try this later today; I'll report back if I get results. John Lato On Tue, May 24, 2011 at 6:01 AM, Conal Elliott co...@conal.net wrote: Last I tried, there wasn't native support for OpenGL with gtk, and I need OpenGL. Then more recently, I heard of some

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-23 Thread John Lato
Glade though. My biggest problem with wx is that there's no support for building 64-bit wx applications on OS X. If that were fixed I might prefer it. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] ANNOUNCE: iterIO-0.1 - iteratee-based IO with pipe operators

2011-05-09 Thread John Lato
for pure functions, so this is possibly a performance win. Although it makes something like the mutable-iter package very difficult to implement... John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread John Lato
From: Edward Kmett ekm...@gmail.com On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale g...@sefer.org wrote: I'm sure there are countless other natural examples of semigroups in the wild, and that the typical non-trivial ones will benefit from an optimized sconcat. Sold! (modulo the

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread John Lato
On Wed, May 4, 2011 at 1:25 PM, Edward Kmett ekm...@gmail.com wrote: On Wed, May 4, 2011 at 7:40 AM, John Lato jwl...@gmail.com wrote: From: Edward Kmett ekm...@gmail.com On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale g...@sefer.org wrote: I'm sure there are countless other natural

Re: [Haskell-cafe] Iteratee: manyToOne

2011-04-29 Thread John Lato
of data, the safest is probably to run the whole thing in a 'take'. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Iteratee: manyToOne

2011-04-29 Thread John Lato
On Fri, Apr 29, 2011 at 12:20 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Fri, Apr 29, 2011 at 6:32 AM, John Lato jwl...@gmail.com wrote: If you do this, the user needs to take care to order the iteratees so that the last iteratee has small leftovers. Consider: manyToOne

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-26 Thread John Lato
Joining slightly late... From: John Millikin jmilli...@gmail.com John Lato's iteratee package is based on IterateeMCPS.hs[1]. I used IterateeM.hs for enumerator, because when I benchmarked them the non-CPS version was something like 10% faster on most operations. Based on tests I did

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-26 Thread John Lato
On Tue, Apr 26, 2011 at 6:32 PM, John Millikin jmilli...@gmail.com wrote: On Tuesday, April 26, 2011 7:19:25 AM UTC-7, John Lato wrote: I'd be interested to see the results of a shootout between iteratee and enumerator. I would expect them to be basically equivalent most of the time

  1   2   3   4   >