Re: [Haskell-cafe] Extending Type Classes

2013-08-26 Thread Simon Peyton-Jones
See http://ghc.haskell.org/trac/ghc/wiki/DefaultSuperclassInstances | -Original Message- | From: Haskell-Cafe [mailto:haskell-cafe-boun...@haskell.org] On Behalf | Of Henning Thielemann | Sent: 26 August 2013 20:07 | To: Frantisek Farka | Cc: Haskell Cafe | Subject: Re: [Haskell-cafe] Exte

[Haskell-cafe] Template Haskell

2013-08-26 Thread Jose A. Lopes
Hi, Is it possible to retrieve all definitions contained in a module using Template Haskell ? Thanks, Jose -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer:

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

2013-08-26 Thread Niklas Hambüchen
Thanks for your examples. On 27/08/13 13:59, Albert Y. C. Lai wrote: > The correct fix is to raise the stack cap, not to avoid using the stack. > > Indeed, ghci raises the stack cap so high I still haven't fathomed where > it is. This is why you haven't seen a stack overflow in ghci for a long >

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

2013-08-26 Thread Albert Y. C. Lai
On 13-08-26 04:46 AM, Niklas Hambüchen wrote: Effectively, sequence is a partial function. (Note: We are not trying to obtain a lazy list of random numbers, use any kind of streaming or the likes. We want the list in memory and use it.) We noticed that this problem did not happen if sequence we

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

2013-08-26 Thread Niklas Hambüchen
Maybe an unlimited stack size should be the default? As far as I understand, the only negative effect would be that some programming mistakes would not result in a stack overflow. However, I doubt the usefulness of that: * It already depends a lot on the optimisation level * If you do the same th

Re: [Haskell-cafe] definition of the term "combinator"

2013-08-26 Thread Kristopher Micinski
I've always stuck to the definition of a closed lambda term (the Y, U, S, K, etc... combinators, for example). The colloquial usage generally implies something like "a higher order function that does something interesting (and possibly DSL-y)." Kris On Sat, Aug 24, 2013 at 12:09 AM, damodar kul

Re: [Haskell-cafe] Extending Type Classes

2013-08-26 Thread Henning Thielemann
The problem of refinement of type classes annoys me from time to time when I work on the NumericPrelude. It is an experimental type class hierarchy for mathematical types. Sometimes a new data type T shall be implemented and it turns out that you can implement only a part of all methods of a

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

2013-08-26 Thread Bryan O'Sullivan
On Mon, Aug 26, 2013 at 1:46 AM, Niklas Hambüchen wrote: > This is because sequence is implemented as > > sequence (m:ms) = do x <- m > xs <- sequence ms > return (x:xs) > > and uses stack space when used on some [IO a]. > This problem is

Re: [Haskell-cafe] TypeLits & Typeable

2013-08-26 Thread Iavor Diatchki
Hi guys, Yep, we know about this and, I believe, the plan is to add custom rules to the constraint solver to solve `Typable n` constraints (where n is a number or symbol). Just for the record, the other design choice was to add instance `Typeable (n :: Symbol)`, but that conflicted with some of

Re: [Haskell-cafe] Proposal: Hackage's packages should be seperated by buildable

2013-08-26 Thread Heinrich Apfelmus
He-chien Tsai wrote: I'm sick for checking whether package is obsolete or not. I think packages build failed long time ago should be collected and moved to another page until someone fix them, or hackage pages should have a filter for checking obsolete packages. People are working on it. htt

Re: [Haskell-cafe] ordNub

2013-08-26 Thread Niklas Hambüchen
On 14/07/13 20:20, Niklas Hambüchen wrote: > As you might not know, almost *all* practical Haskell projects use it, > and that in places where an Ord instance is given, e.g. happy, Xmonad, > ghc-mod, Agda, darcs, QuickCheck, yesod, shake, Cabal, haddock, and 600 > more (see https://github.com/nh2/h

Re: [Haskell-cafe] xmonad (+ mate) evince problem?

2013-08-26 Thread Johannes Waldmann
Problem solved: with "mate", use "atril" instead of "evince". (I think it is a gtk2/tgk3 issue and it's got nothing to do with xmonad.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2013-08-26 Thread Niklas Hambüchen
As an example that this actually makes problems in production code, I found this in the wildlife: https://github.com/ndmitchell/shake/blob/e0e0a43/Development/Shake/Database.hs#L394 -- Do not use a forM here as you use too much stack space bad <- (\f -> foldM f [] (Map.toList status)) $ \

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

2013-08-26 Thread Niklas Hambüchen
On #haskell we recently had a discussion about the following: import System.Random list <- replicateM 100 randomIO :: IO [Int] I would think that this gives us a list of a million random Ints. In fact, this is what happens in ghci. But with ghc we get: Stack space overflow: current

Re: [Haskell-cafe] TypeLits & Typeable

2013-08-26 Thread José Pedro Magalhães
Hi Nicolas, It's not intentional, but Iavor is aware of this, and we want to change it. I'm CC-ing him as he might know more about what the current plan is. Cheers, Pedro On Sat, Aug 24, 2013 at 3:20 PM, Nicolas Trangez wrote: > Hello Cafe, > > I was playing around with TypeLits in combinatio

Re: [Haskell-cafe] Conduit : is it possible to write this function?

2013-08-26 Thread Erik de Castro Lopo
Michael Snoyman wrote: > You can build this up using the >=< operator[1] in stm-conduit, something > like: > > eitherSrc :: MonadResourceBase m > => Source (ResourceT m) a -> Source (ResourceT m) b -> Source > (ResourceT m) (Either a b) > eitherSrc src1 src2 = do > join $ lift $