Re: [Haskell-cafe] SYB with class: Bug in Derive.hs module

2012-09-04 Thread Andrea Vezzosi
I've pushed the discussed changes to the repo[1], it'd be good if you (and other users) could test them before they get to hackage. [1] darcs get http://patch-tag.com/r/Saizan/syb-with-class/ -- Andrea ___ Haskell-Cafe mailing list Haskell-Cafe@haskell

Re: [Haskell-cafe] SYB with class: Bug in Derive.hs module

2012-09-03 Thread Andrea Vezzosi
On Mon, Sep 3, 2012 at 2:53 PM, Roman Cheplyaka wrote: > * Andrea Vezzosi [2012-09-03 12:50:03+0200] >> > [...] >> >> This is pretty similar to what ended up being a ghc bug, fixed in 7.0 though: >> http://hackage.haskell.org/trac/ghc/ticket/3731 > > The dif

Re: [Haskell-cafe] SYB with class: Bug in Derive.hs module

2012-09-03 Thread Andrea Vezzosi
Data ctx Foo where ... > > What's the proper way to fix it? >From a few tests it seems we no longer need the circular context hack in ghc-7.4.1 to get the instance to typecheck, so we could side-step the issue entirely by removing it from the generated code. -- Andrea Vezzosi _

Re: [Haskell-cafe] Set monad

2011-01-09 Thread Andrea Vezzosi
On Sun, Jan 9, 2011 at 7:45 AM, Sebastian Fischer wrote: > [...] > Only conversion to the underlying Set type requires an Ord constraint. >     getSet :: Ord a => Set a -> S.Set a >     getSet a = a >>- S.singleton this unfortunately also means that duplicated elements only get filtered out at th

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-16 Thread Andrea Vezzosi
On Thu, May 13, 2010 at 8:13 PM, wren ng thornton wrote: > Andrea Vezzosi wrote: >> >> On Thu, May 13, 2010 at 10:51 AM, wren ng thornton >> wrote: >>> >>> Andrea Vezzosi wrote: >>>> >>>> wren ng thornton  wrote: >>

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-13 Thread Andrea Vezzosi
On Thu, May 13, 2010 at 10:51 AM, wren ng thornton wrote: > Andrea Vezzosi wrote: >> >> wren ng thornton  wrote: >>> >>> With this change [1] I can't notice any difference for your benchmark[2]. >>> Then again, all the runTest calls take 0 msec and I

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-12 Thread Andrea Vezzosi
On Wed, May 12, 2010 at 7:50 AM, wren ng thornton wrote: > wren ng thornton wrote: >> >> Here's one big difference: >> newtype ErrCPS e m a = ErrCPS { runErrCPS ::    forall r . (e -> m r) --  error handler    -> (a -> m r) --  success handler    -> m r } >> >> The analogous ve

Re: [Haskell-cafe] SYB <> very, very mysteriously

2010-01-24 Thread Andrea Vezzosi
On Mon, Dec 7, 2009 at 3:38 PM, David Fox wrote: > On Sat, Dec 5, 2009 at 2:38 AM, Andrea Vezzosi wrote: >> On Fri, Dec 4, 2009 at 8:51 PM, Jeremy Shaw wrote: >>> I have stripped things down to the bare minimum, and test under GHC 6.10, >>> GHC 6.12, Linux, and Mac O

Re: [Haskell-cafe] SYB <> very, very mysteriously

2009-12-05 Thread Andrea Vezzosi
On Fri, Dec 4, 2009 at 8:51 PM, Jeremy Shaw wrote: > I have stripped things down to the bare minimum, and test under GHC 6.10, > GHC 6.12, Linux, and Mac OS X. Results are consistent. > > In the following code, > >  1. if you load the code into ghci and evaluate e it will hang, but > (defaultValue

Re: [Haskell-cafe] Re: GHC: compile using multiple cores?

2009-04-09 Thread Andrea Vezzosi
The main bottleneck right now is that each ghc process has to read the package.conf, which afaiu is done with Read and it's awfully slow, especially if you have many packages installed. I've started seeing total time improvements when approaching ~300% CPU usage and only the extralibs installed. O

Re: [Haskell-cafe] cabal haddock and Paths_Xxx

2009-04-08 Thread Andrea Vezzosi
Which version of Cabal are you using? It should be fixed with Cabal-1.6.0.2, check cabal --version to make sure it's not using an older one. On Mon, Apr 6, 2009 at 8:32 PM, Martijn van Steenbergen wrote: > Hello, > > cabal generates a Paths_Xxx file for me which I import and use, but cabal > hadd

Re: [Haskell-cafe] Re: Completely confused by cabal

2009-03-22 Thread Andrea Vezzosi
I should clarify that cabal install --global won't see the packages installed in the user db, even if not run as root. But it at least will take into consideration the available packages' cache and the config file in ~/.cabal/ ___ Haskell-Cafe mailing lis

Re: [Haskell-cafe] Re: Completely confused by cabal

2009-03-22 Thread Andrea Vezzosi
On Sun, Mar 22, 2009 at 12:51 PM, Colin Paul Adams wrote: >> "Achim" == Achim Schneider writes: > >    Achim> Colin Paul Adams wrote: >    >> So why doesn't it find packages then, when they are installed? >    >> >    Achim> I've got no idea, what exactly are you trying to do, and >    Achim

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-06 Thread Andrea Vezzosi
2009/3/6 Daryoush Mehrtash : > Two questions: > > a)   This  chat server implementation doesn't actually close the connection > as a real one would need to do.  If you use "forever"  is there a way to end > the loop so as to end the connection? Yes, throw an exception and catch it from outside the

Re: [Haskell-cafe] jhc speed

2009-02-25 Thread Andrea Vezzosi
2009/2/22 Luke Palmer : > On Sun, Feb 22, 2009 at 8:15 AM, John Meacham wrote: >> >> On Sun, Feb 22, 2009 at 03:36:34PM +0100, Peter Verswyvelen wrote: >> > Would it be possible to separate the frontend (Haskell to Core) and >> > backend >> > (Core to machine code) from the Haskell compilers (requ

Re: [Haskell-cafe] Trying to install Cabal

2009-02-20 Thread Andrea Vezzosi
the solution here is to compile Setup.hs with ghc first, i.e. "ghc --make Setup.hs" and then use the produced Setup.exe, this is also recommended un linux since runghc will have to load and interpret many modules if not. However if you've already built cabal-install against 1.6.0.1 you can simply

Re: [Haskell-cafe] Re: Bug in Cabal?

2009-02-17 Thread Andrea Vezzosi
On Tue, Feb 17, 2009 at 11:50 PM, Achim Schneider wrote: > Martin Huschenbett wrote: > >> $ cabal install ghci-haskeline >> Resolving dependencies... >> cabal.exe: dependencies conflict: ghc-6.10.1 requires process >> ==1.0.1.1 however >> process-1.0.1.1 was excluded because ghc-6.10.1 requires p

[Haskell-cafe] Re: haddock-2.3.0 literate comments discarded from .lhs input

2009-02-08 Thread Andrea Vezzosi
d when using Haddock 2, but if it is, it would solve this >> problem. > > Yes, against my better judgement the code in Cabal for haddock-2.x does > not run cpp or unliting like it does for haddock-0.x. Instead it assumes > that haddock-2.x will do all the cpp and unliting itself. Obvi

Re: [Haskell-cafe] [ANN] Working with HLint from Emacs

2009-01-14 Thread Andrea Vezzosi
Does it also let you apply a suggestion automatically? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Staged evaluation, names?

2009-01-08 Thread Andrea Vezzosi
On Thu, Jan 8, 2009 at 5:25 AM, wren ng thornton wrote: > > The question for y'all is what should I call it? I've been calling the > template-function qaf (for Compiled Applicative Form ;) and the type class > with that function would be the only thing in the package, but I'm not sure > where Q

Re: [Haskell-cafe] Threads with high CPU usage

2008-12-21 Thread Andrea Vezzosi
Tried running the program with +RTS -Nn where n = 2 or more? that should use more OS threads On Sun, Dec 21, 2008 at 10:43 PM, Günther Schmidt wrote: > Hi, > > in an application of mine I start a long-running operation in a thread via > forkIO so that the UI process doesn't get blocked. > It jus

Re: [Haskell-cafe] Ambiguous type variable woes

2008-11-24 Thread Andrea Vezzosi
If you want to defer the choice of 's' you've to make it appear in the type signature of test1, so you've to introduce an artificial parameter even if we're interested only in its type. e.g.: data Proxy (s :: * -> * -> *) -- useful because we can't have an argument of type 's' directly, since it's

Re: [Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-23 Thread Andrea Vezzosi
On Mon, Nov 24, 2008 at 7:40 AM, Andrea Vezzosi <[EMAIL PROTECTED]> wrote: > It's more natural to consider the cross product of no sets to be [[]] so > your crossr becomes: > > crossr [] = [[]] > crossr (x:xs) = concat (map (\h ->map (\t -> h:t) (crossr tail)) h

Re: [Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-23 Thread Andrea Vezzosi
It's more natural to consider the cross product of no sets to be [[]] so your crossr becomes: crossr [] = [[]] crossr (x:xs) = concat (map (\h ->map (\t -> h:t) (crossr tail)) hd) which we can rewrite with list comprehensions for conciseness: crossr [] = [[]] crossr (x:xs) = [ a:as | a <- x, a

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Andrea Vezzosi
I'd rather say that STM is intended to be used just for building up transactions, not to model your whole process/thread, simply because in the latter case your process couldn't have any observable intermediate state, or put in another way, between any two transactions the information can only go i

Re: [Haskell-cafe] synchronous channels in STM

2008-10-08 Thread Andrea Vezzosi
2008/10/9 Claus Reinke <[EMAIL PROTECTED]> > I was wondering if it was possible to implement synchronous channels >> within STM. In particular, I'd like to have CSP-like send and recv >> primitives >> on a channel that each block until the other side arrives to complete >> the transaction. >> > >

Re: [Haskell-cafe] ambiguous types although 'asTypeOf'

2007-12-25 Thread Andrea Vezzosi
As i understand it, the monomorphism restriction applies to "constrained type variables", but c :: forall a. a, so it remains polymorphic and each of its uses can be instantiated to a different type. 2007/12/25, Henning Thielemann <[EMAIL PROTECTED]>: > > > I thought I understand monomorphism rest

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-24 Thread Andrea Vezzosi
As a side note i'd like to point out that introspectData has a problem with constructors containing Strings because show (x::String) /= x: data Foo = Foo { bar :: String } deriving (Typeable,Data) introspectData (Foo "quux") --> [("bar","\"quux\"")] Those extras \" don't look very nice in the x

Re: [Haskell-cafe] writer monad help

2007-05-20 Thread Andrea Vezzosi
if by "figure out" you meant to "do what tell does without using it", you should have written: foo = Writer ((),"hello") that would have had the right type, using return you are doing something different. in the Writer monad return :: Monoid w => a -> Writer w a so return ((),"hello") :: Monoid w