Re: Removing latency spikes. Garbage collector related?

2015-09-29 Thread John Lato
d? > > And from the answers I'm assuming you believe it is the GC that is > most likely causing these spikes. I've never profiled Haskell code, so > I'm not used to seeing what the effects of the GC actually are. > > On 28 September 2015 at 19:31, John Lato <jwl...@gmail.com> wrot

Re: Removing latency spikes. Garbage collector related?

2015-09-28 Thread John Lato
Try Greg's recommendations first. If you still need to do more investigation, I'd recommend that you look at some samples with either threadscope or dumping the eventlog to text. I really like ghc-events-analyze, but it doesn't provide quite the same level of detail. You may also want to dump

Re: template haskell vs. -prof

2015-01-23 Thread John Lato
I agree that mixing template haskell with -prof can be tricky. It's easier if you turn off dynamic linking entirely. As for multi-line string literals, I also think that an explicit syntax would be nice. Until then, I usually use: unlines [ Line 1 , Line 2 ] which ends

Re: template haskell vs. -prof

2015-01-23 Thread John Lato
On 21:23, Fri, Jan 23, 2015 Evan Laforge qdun...@gmail.com wrote: On Sat, Jan 24, 2015 at 2:38 AM, John Lato jwl...@gmail.com wrote: I agree that mixing template haskell with -prof can be tricky. It's easier if you turn off dynamic linking entirely. But that's the thing, I do turn of dynamic

Re: What to do when garbage collector is slow?

2014-12-23 Thread John Lato
Can't try your code now, but have you tried using threadscope? Just a thought, but maybe the garbage collection is blocked waiting for a thread to finish. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: What to do when garbage collector is slow?

2014-12-23 Thread John Lato
Ah, just took a look. I think my suggestion is unlikely to be correct. On 08:40, Tue, Dec 23, 2014 John Lato jwl...@gmail.com wrote: Can't try your code now, but have you tried using threadscope? Just a thought, but maybe the garbage collection is blocked waiting for a thread to finish

Re: GHC 7.8.3 thread hang

2014-11-11 Thread John Lato
The blocked on black hole message is very suspicious. It means that thread 7 is blocked waiting for another thread to evaluate a thunk. But in this case, it's thread 7 that created that thunk and is supposed to be doing the evaluating. This is some evidence that Gregory's theory is correct and

Re: Thread behavior in 7.8.3

2014-10-30 Thread John Lato
, Adding -C0.005 makes it much better. Using -C0.001 makes it behave more like -N4. Thanks. This saves my project, as I need to deploy on a single core Atom and was stuck. Mike On Oct 29, 2014, at 5:12 PM, John Lato jwl...@gmail.com wrote: By any chance do the delays get shorter

Re: Thread behavior in 7.8.3

2014-10-29 Thread John Lato
By any chance do the delays get shorter if you run your program with `+RTS -C0.005` ? If so, I suspect you're having a problem very similar to one that we had with ghc-7.8 (7.6 too, but it's worse on ghc-7.8 for some reason), involving possible misbehavior of the thread scheduler. On Wed, Oct

Re: Thread behavior in 7.8.3

2014-10-29 Thread John Lato
Atom and was stuck. Mike On Oct 29, 2014, at 5:12 PM, John Lato jwl...@gmail.com wrote: By any chance do the delays get shorter if you run your program with `+RTS -C0.005` ? If so, I suspect you're having a problem very similar to one that we had with ghc-7.8 (7.6 too, but it's worse on ghc

Re: __GLASGOW_HASKELL__=708?

2014-09-25 Thread John Lato
The value 708 is correct. From the user's guide, http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor : _GLASGOW_HASKELL__ For version x.y.z of GHC, the value of __GLASGOW_HASKELL__ is the integer xyy (if y is a single digit, then a leading zero is added,

Re: Future of DYNAMIC_GHC_PROGRAMS?

2014-05-24 Thread John Lato
On May 24, 2014 11:48 AM, Simon Marlow marlo...@gmail.com wrote: On 19/05/2014 13:51, harry wrote: harry wrote I need to build GHC 7.8 so that Template Haskell will work without shared libraries (due to a shortage of space). I understand that this can be done by turning off

Re: vector and GeneralizedNewtypeDeriving

2014-05-14 Thread John Lato
(depending on the timeline for that release), but I'll get to it eventually. (Or, if you feel this is more critical in the larger picture, shout more loudly on the ticket and perhaps I can squeeze it in before 7.8.3.) Thanks, Richard On May 13, 2014, at 9:39 PM, John Lato jwl...@gmail.com

Re: vector and GeneralizedNewtypeDeriving

2014-05-14 Thread John Lato
: On Wed, May 14, 2014 at 7:02 PM, John Lato jwl...@gmail.com wrote: I would have expected this would have affected a lot users, but as I haven't heard many complaints (and nobody else said anything here!) maybe the impact is smaller than I thought. I think people just haven't migrated much

vector and GeneralizedNewtypeDeriving

2014-05-13 Thread John Lato
Hello, Prior to ghc-7.8, it was possible to do this: module M where import qualified Data.Vector.Generic.Base as G import qualified Data.Vector.Generic.Mutable as M import Data.Vector.Unboxed.Base -- provides MVector and Vector newtype Foo = Foo Int deriving (Eq, Show, Num, M.MVector

Re: vector and GeneralizedNewtypeDeriving

2014-05-13 Thread John Lato
Not by anything I've tried yet, no. On Tue, May 13, 2014 at 10:40 PM, Carter Schonwald carter.schonw...@gmail.com wrote: can you get the deriving to work on a newtype instance MVector s Foo = ? On Tue, May 13, 2014 at 9:39 PM, John Lato jwl...@gmail.com wrote: Hello, Prior

Re: how to compile non-dynamic ghc-7.8.2 ?

2014-04-29 Thread John Lato
Hi Simon, Thanks very much for this response. I believe you're correct; ghc -e 'System.Environment.getEnvironment' segfaults with my ghc build. John On Tue, Apr 29, 2014 at 10:36 AM, Simon Marlow marlo...@gmail.com wrote: On 25/04/2014 02:15, John Lato wrote: Hello, I'd like to compile

Re: how to compile non-dynamic ghc-7.8.2 ?

2014-04-27 Thread John Lato
at 9:47 AM, Carter Schonwald carter.schonw...@gmail.com wrote: @john, what version of cabal-install were you using? (i realize you're probably using the right one, but worth asking :) ) On Fri, Apr 25, 2014 at 12:25 PM, John Lato jwl...@gmail.com wrote: On Apr 25, 2014 5:36 AM, Bertram

Re: how to compile non-dynamic ghc-7.8.2 ?

2014-04-25 Thread John Lato
On Apr 25, 2014 5:36 AM, Bertram Felgenhauer bertram.felgenha...@googlemail.com wrote: John Lato wrote: I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added DYNAMIC_GHC_PROGRAMS = NO I've had success with setting

how to compile non-dynamic ghc-7.8.2 ?

2014-04-24 Thread John Lato
Hello, I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added DYNAMIC_GHC_PROGRAMS = NO to mk/build.mk, and did ./configure ./make. ghc builds and everything seems to work (cabal installed a bunch of packages, ghci seems to

Re: Eta Reduction

2014-04-01 Thread John Lato
I think this is a great idea and should become a top priority. I would probably start by switching to a type-class-based seq, after which perhaps the next step forward would become more clear. John L. On Apr 1, 2014 2:54 AM, Dan Doel dan.d...@gmail.com wrote: In the past year or two, there have

Re: [Haskell-cafe] Eta Reduction

2014-04-01 Thread John Lato
:17 AM, John Lato jwl...@gmail.com wrote: I think this is a great idea and should become a top priority. I would probably start by switching to a type-class-based seq, after which perhaps the next step forward would become more clear. John L. On Apr 1, 2014 2:54 AM, Dan Doel dan.d

Re: [Haskell-cafe] Eta Reduction

2014-04-01 Thread John Lato
needed in the language for bang patterns. :( -Edward On Apr 1, 2014, at 5:26 PM, John Lato jwl...@gmail.com wrote: Hi Edward, Yes, I'm aware of that. However, I thought Dan's proposal especially droll given that changing seq to a class-based function would be sufficient to make eta

Re: Parallel building multiple targets

2014-01-23 Thread John Lato
On Jan 23, 2014 1:28 AM, Simon Marlow marlo...@gmail.com wrote: On 23/01/14 03:52, John Lato wrote: However, these are all rather obviously fixable as part of the build system. For me, the worst problems have to do with cleaning. If you're using a Makefile, typically you want to leave

Re: Parallel building multiple targets

2014-01-22 Thread John Lato
On Wed, Jan 22, 2014 at 12:25 AM, Simon Marlow marlo...@gmail.com wrote: On 05/01/2014 23:48, John Lato wrote: (FYI, I expect I'm the source of the suggestion that ghc -M is broken) First, just to clarify, I don't think ghc -M is obviously broken. Rather, I think it's broken in subtle

Re: Parallel building multiple targets

2014-01-05 Thread John Lato
(FYI, I expect I'm the source of the suggestion that ghc -M is broken) First, just to clarify, I don't think ghc -M is obviously broken. Rather, I think it's broken in subtle, unobvious ways, such that trying to develop a make-based project with ghc -M will fail at various times in a non-obvious

Re: Parallel building multiple targets

2014-01-05 Thread John Lato
On Sun, Jan 5, 2014 at 3:54 PM, Erik de Castro Lopo mle...@mega-nerd.comwrote: John Lato wrote: ghc --make doesn't allow building several binaries in one run, however if you use cabal all the separate runs will use a shared build directory, so subsequent builds will be able to take

Re: memory ordering

2014-01-01 Thread John Lato
One point I'm getting from this discussion is that perhaps not much time has been spent considering these issues in ghc backends. If so, it's probably a good thing to work through it now. For myself, I guess the only option I have now is to measure using loadLoadBarrier and see if it's better or

Re: memory ordering

2013-12-30 Thread John Lato
Hi Edward, Thanks very much for this reply, it answers a lot of questions I'd had. I'd hoped that ordering would be preserved through C--, but c'est la vie. Optimizing compilers are ever the bane of concurrent algorithms! stg/SMP.h does define a loadLoadBarrier, which is exposed in Ryan

Re: memory ordering

2013-12-22 Thread John Lato
believe that it's implemented properly (although I have no reason to believe it's wrong either). Perhaps I'm just overly paranoid. John Lato On Fri, Dec 20, 2013 at 9:05 AM, Carter Schonwald carter.schonw...@gmail.com wrote: Hey John, so you're wanting atomic reads and writes? I'm pretty sure

memory ordering

2013-12-19 Thread John Lato
Hello, I'm working on a lock-free algorithm that's meant to be used in a concurrent setting, and I've run into a possible issue. The crux of the matter is that a particular function needs to perform the following: x - MVector.read vec ix position - readIORef posRef and the algorithm is only

RE: Giving function a larger arity

2013-11-11 Thread John Lato
Originally I thought Plan B would make more sense, but if Plan A were implemented could this one-shot type annotation be unified with the state hack? I'm envisioning something like RULES, where if the type matches ghc knows it's a one-shot lambda. I think it would be better to not do any analysis

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] [Haskell-cafe] ANNOUNCE: posix-paths, for faster file system operations

2013-08-21 Thread John Lato
On Wed, Aug 21, 2013 at 2:21 AM, John Wiegley jo...@fpcomplete.com wrote: Niklas Hambüchen m...@nh2.me writes: It implements a large portion of System.Posix.FilePath using ByteString based RawFilePaths instead of String based FilePaths Was there a reason you didn't base your work on the

Re: Liberalising IncoherentInstances

2013-07-29 Thread John Lato
+1 to the original proposal and Edward's suggestion of emitting a warning. I've occasionally wanted this behavior from IncoherentInstances as well. On Mon, Jul 29, 2013 at 3:01 PM, Edward Kmett ekm...@gmail.com wrote: I'll probably never use it, but I can't see any real problems with the

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: Release plans

2013-03-20 Thread John Lato
On Thu, Mar 21, 2013 at 8:08 AM, Ian Lynagh i...@well-typed.com wrote: We've had long discussions about snapshot releases, and the tricky part is that while we would like people to be able to try out new GHC features, we don't want to add to the burden of library maintainers by requiring

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: GHC 7.8 release?

2013-02-10 Thread John Lato
While I'm notionally in favor of decoupling API-breaking changes from non-API breaking changes, there are two major difficulties: GHC.Prim and Template Haskell. Should a non-API-breaking change mean that GHC.Prim is immutable? If so, this greatly restricts GHC's development. If not, it means

Re: GHC 7.8 release?

2013-02-07 Thread John Lato
I agree with Ian. Mid-February is very soon, and there's a lot of stuff that seems to just be coming in now. That doesn't leave much time for testing to get 7.8 out in sync with the platform. Although my perspective is a bit colored by the last release. Testing the 7.6.1 RC took several weeks

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,

memory fragmentation with ghc-7.6.1

2012-09-20 Thread John Lato
Hello, We've noticed that some applications exhibit significantly worse memory usage when compiled with ghc-7.6.1 compared to ghc-7.4, leading to out of memory errors in some cases. Running one app with +RTS -s, I see this: ghc-7.4 525,451,699,736 bytes allocated in the heap 53,404,833,048

Re: memory fragmentation with ghc-7.6.1

2012-09-20 Thread John Lato
nice with C? I'd be curious to understand the change too, though per se pinned memory (a la storable or or bytestring) will by definition cause memory fragmentation in a gc'd lang as a rule, (or at least one like Haskell). -Carter On Thu, Sep 20, 2012 at 8:59 PM, John Lato jwl...@gmail.com

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: build failures when hiding non-visible imports

2012-08-20 Thread John Lato
From: Brandon Allbery allber...@gmail.com On Sat, Aug 18, 2012 at 9:10 PM, Carter Schonwald carter.schonw...@gmail.com wrote: meaning: flags for treating it as a warning vs as an error? (pardon, i'm over thinking ambiguity in phrasing). if thats the desired difference, that sounds good

build failures when hiding non-visible imports

2012-08-16 Thread John Lato
Hello, One of the issues I've noticed with ghc-7.6 is that a number of packages fail due to problematic import statements. For example, any module which uses import Prelude hiding (catch) now fails to build with the error Module `Prelude' does not export `catch' Of course fixing this

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: parallel garbage collection performance

2012-06-25 Thread John Lato
Thanks very much for this information. My observations match your recommendations, insofar as I can test them. Cheers, John On Mon, Jun 25, 2012 at 11:42 PM, Simon Marlow marlo...@gmail.com wrote: On 19/06/12 02:32, John Lato wrote: Thanks for the suggestions.  I'll try them and report back

parallel garbage collection performance

2012-06-18 Thread John Lato
Hello, I have a program that is intermittently experiencing performance issues that I believe are related to parallel GC, and I was hoping to get some advice on how I might improve it. Essentially, any given execution is either slow or fast (the same executable, without recompiling), most often

Re: parallel garbage collection performance

2012-06-18 Thread John Lato
Lippmeier b...@ouroborus.net wrote: On 19/06/2012, at 24:48 , Tyson Whitehead wrote: On June 18, 2012 04:20:51 John Lato wrote: Given this, can anyone suggest any likely causes of this issue, or anything I might want to look for?  Also, should I be concerned about the much larger

[Haskell] announce: language-objc

2012-06-12 Thread John Lato
. The Objective-C extensions are rather less well tested at this time. Feedback and comments are welcome. Cheers, John Lato ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: default instance for IsString

2012-04-25 Thread John Lato
that string literals would be treated as the provided monomorphic type, on a per-module basis? John Lato ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

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] Displaying trees in Haskell

2012-03-08 Thread John Lato
are also available although I don't know as much about them. HTH, John Lato ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

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

Re: parallelizing ghc

2012-01-26 Thread John Lato
From: Evan Laforge qdun...@gmail.com On Wed, Jan 25, 2012 at 11:42 AM, Ryan Newton rrnew...@gmail.com wrote: package list for me. ?The time is going to be dominated by linking, which is single threaded anyway, so either way works. What is the state of incremental linkers? ?I thought those

  1   2   3   4   5   >