RE: [Haskell-cafe] Hoogle? [Stacking monads]

2008-10-07 Thread Mitchell, Neil
> Actually, I was thinking more along the lines of > Data.Traversable.sequence, which has > > sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) > > > Are you expecting c1 (:: * -> * -> *) to unify with [] (:: * -> *)? > > That seems kind incorrect at the very last. Additionally, > t

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Krasimir Angelov
I use darcs on Windows every day and it works well. The only problem is that it is not very usable if you access your repository via SSH and the authentication is via password. On Mon, Oct 6, 2008 at 9:11 PM, Dominic Steinitz <[EMAIL PROTECTED]> wrote: > Not really a Haskell question but I'm not

Re: [Haskell-cafe] Inferred type is less polymorphic than expected, depends on order

2008-10-07 Thread Ryan Ingram
On Mon, Oct 6, 2008 at 10:27 PM, Jason Dagit <[EMAIL PROTECTED]> wrote: > Why is useful to replace forall with /\? To make it look more like a capital lambda, just like \ is notation for lambda. It's a lambda abstraction over a type instead of a value; that's how polymorphism works in GHC's core

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Dougal Stanton
On Mon, Oct 6, 2008 at 9:48 PM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > Andrew Coppin wrote: >> >> I have some longwinded code that works, but I'm still thinking about how >> to do this more elegantly. It looks like what I really need is something >> like >> >> type M = StateT State (ResultSetT

Re: [Haskell-cafe] Type classes question

2008-10-07 Thread Ryan Ingram
On Tue, Oct 7, 2008 at 1:13 PM, Roly Perera <[EMAIL PROTECTED]> wrote: > Hi, > > I'm reasonably well versed in Haskell but fairly new to defining type classes. > In particular I don't really understand how to arrange for all instances of X > to also be instances of Y. > > It's quite possibly that m

[Haskell-cafe] Re: New System.Process

2008-10-07 Thread Simon Marlow
john lask wrote: Something that has irked me in the past about System.Process is the inability to obtain an OS system handle from the haskell Process handle. Such a facility would greatly enhance the interoperabity of c and haskell libraries. Provision is made (although not standardised) to o

Re: [Haskell-cafe] I'll do USB in Haskell - tips?

2008-10-07 Thread Marc Weber
> Thanks, > Maurício Hi Maurício, that's good news :-) However I personally would be scared by the amount of work and testing which is needed. I guess I would prefer wiriting some bindings to a nexisting library.. But if you manage to write it I might become a user in the future.. Marc __

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Thomas Schilling
GHC uses http://darcs.haskell.org/bin/darcs-to-git which is a fork of http://github.com/purcell/darcs-to-git It's not very fast, but it works well enough. I tried tailor only briefly but it failed on its own test suite and I didn't bother to investigate any further. 2008/10/6 Dominic Steinitz <[

Re[2]: [Haskell-cafe] newbie questions (read, etc., with Data.ByteString.Lazy.Char8)

2008-10-07 Thread Bulat Ziganshin
Hello wman, Tuesday, October 7, 2008, 8:44:48 AM, you wrote: > btw, why is the example #2 > (http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=ghc&id=2) > (which kicks collective asses of all other participants) not > considered in the shootout ? Too much optimizations ? it's

[Haskell-cafe] Re: [darcs-users] announcing darcs 2.1.0pre3

2008-10-07 Thread Iain Lane
On Thu, Oct 2, 2008 at 1:07 PM, Eric Kow <[EMAIL PROTECTED]> wrote: > Hi everybody, > > The third pre-release of darcs 2.1 is now available at > http://darcs.net/darcs-2.1.0pre3.tar.gz > [...] > -- > Eric Kow > PGP Key ID: 08AC04F9 > >

[Haskell-cafe] Re: Inferred type is less polymorphic than expected, depends on order

2008-10-07 Thread apfelmus
Jason Dagit wrote: > Ryan Ingram wrote: >> Jason Dagit wrote: >>> \begin{code} >>> badOrder :: (Sealed (p x)) -> (forall b. (Sealed (q b))) -> (Sealed (q >>> x)) >>> badOrder sx sy = case sy of >>> Sealed y -> case sx of >>> Sealed x -> Sealed (f x y) >

[Haskell-cafe] Type classes question

2008-10-07 Thread Roly Perera
Hi, I'm reasonably well versed in Haskell but fairly new to defining type classes. In particular I don't really understand how to arrange for all instances of X to also be instances of Y. It's quite possibly that my question is ill-posed, so I'll make it as concrete as possible: in the foll

Re[2]: [Haskell-cafe] newbie questions (read, etc., with Data.ByteString.Lazy.Char8)

2008-10-07 Thread Bulat Ziganshin
Hello Brandon, Tuesday, October 7, 2008, 7:59:06 AM, you wrote: > is there a reason why -O2 shouldn't be made the default (and > allowing to turn off optimizations by -O0 perhaps) ? it compiles ~2x slower and firces more recompilation (because it does inter-module inlining). so it's not perfect

Re: [Haskell-cafe] Type classes question

2008-10-07 Thread Bulat Ziganshin
Hello Roly, Tuesday, October 7, 2008, 4:13:25 PM, you wrote: > I'm reasonably well versed in Haskell but fairly new to defining type classes. http://haskell.org/haskellwiki/OOP_vs_type_classes may be useful -- Best regards, Bulatmailto:[EMAIL PROTECTED] __

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Miguel Mitrofanov
On 7 Oct 2008, at 12:11, Krasimir Angelov wrote: I use darcs on Windows every day and it works well. The only problem is that it is not very usable if you access your repository via SSH and the authentication is via password. Why not? It worked fine for me. ___

RE: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Mitchell, Neil
> > I use darcs on Windows every day and it works well. The > only problem > > is that it is not very usable if you access your repository via SSH > > and the authentication is via password. > > Why not? It worked fine for me. It's never worked for me, I always get a frozen darcs trying to r

Re: [Haskell-cafe] Inferred type is less polymorphic than expected, depends on order

2008-10-07 Thread Jason Dagit
On Tue, Oct 7, 2008 at 1:13 AM, Ryan Ingram <[EMAIL PROTECTED]> wrote: > > You may think it doesn't matter, because you could instantiate it to > anything after the fact, but it's possible that the result of the case > statement depends on the choice of instantiation for sy; consider if > sy had a

Re: [Haskell-cafe] Re: Inferred type is less polymorphic than expected, depends on order

2008-10-07 Thread Jason Dagit
On Tue, Oct 7, 2008 at 8:02 AM, apfelmus <[EMAIL PROTECTED]> wrote: > Jason Dagit wrote: > > Ryan Ingram wrote: > >> Jason Dagit wrote: > >>> \begin{code} > >>> badOrder :: (Sealed (p x)) -> (forall b. (Sealed (q b))) -> (Sealed (q > >>> x)) > >>> badOrder sx sy = case sy of > >>>

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Miguel Mitrofanov
Yes, I've used SSH key. Didn't think it would be different with a password. On 7 Oct 2008, at 20:19, Mitchell, Neil wrote: I use darcs on Windows every day and it works well. The only problem is that it is not very usable if you access your repository via SSH and the authentication is vi

Re: [Haskell-cafe] After upgrade bytestring to 0.9.1.3, my program cannot run.

2008-10-07 Thread Duncan Coutts
On Mon, 2008-10-06 at 20:21 -0700, Don Stewart wrote: > magicloud.magiclouds: > > Just a simple text process program. When I runhaskell it. I got: > > > > GHCi runtime linker: fatal error: I found a duplicate definition for symbol > > fps_minimum > > whilst processing object file > > ~/.cabal/

Re: [Haskell-cafe] Re: Random question

2008-10-07 Thread Iain Barnett
On 5 Oct 2008, at 7:06 pm, Henning Thielemann wrote: Instead of separate calls to 'take' and 'drop' you may prefer 'splitAt': requeue z xs = let (prefix,pivot:suffix) = splitAt (z-1) xs in prefix ++ suffix ++ [pivot] Thanks. Took me a while to get the function to shuffle properly

Re: [Haskell-cafe] Hoogle? [Stacking monads]

2008-10-07 Thread Andrew Coppin
Mitchell, Neil wrote: Well, as I said, replacing one term with another transforms one signature into the other. I guess you can't curry type constructors as easily as functions - or at least, Hoogle currently doesn't like it. Yes, currying of type constructors is much less common, and en

Re: [Haskell-cafe] Re: Random question

2008-10-07 Thread Brent Yorgey
On Tue, Oct 07, 2008 at 06:40:22PM +0100, Iain Barnett wrote: > On 5 Oct 2008, at 7:06 pm, Henning Thielemann wrote: >> >> Instead of separate calls to 'take' and 'drop' you may prefer 'splitAt': >> >> requeue z xs = >> let (prefix,pivot:suffix) = splitAt (z-1) xs >> in prefix ++ suffix +

[Haskell-cafe] Network.URI bug? (2.2.0.0)

2008-10-07 Thread Bárður Árantsson
Hi all, I'm having a bit of difficulty with Network.URI -- unless I misunderstand the documentation, the attached demo program is supposed to produce: http://localhost:9000 http://localhost:9000/d1 http://localhost:9000/d1/d2 but it produces http://localhost:9000 http://localhost

[Haskell-cafe] Re: Network.URI bug? (2.2.0.0)

2008-10-07 Thread Bárður Árantsson
Bárður Árantsson wrote: > Hi all, > [--snip--] *Smacks forehead* Apparently you absolutely need a trailing slash on the relative URIs. So base = fromJust $ parseURI "http://localhost:9000"; d1 = fromJust $ parseRelativeReference "d1/" d2 = fromJust $ parseRelativeReference "d2/" ...

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Andrew Coppin
The good news: I managed to turn ResultSet into a monad transformer. Yay, me! The bad news: It generates the entire result set before returning anything to the caller. In other words, it works perfectly for finite result sets, and locks up forever on infinite result sets. Since the entire *p

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Daniel Fischer
Am Dienstag, 7. Oktober 2008 20:27 schrieb Andrew Coppin: > The good news: I managed to turn ResultSet into a monad transformer. > Yay, me! > > The bad news: It generates the entire result set before returning > anything to the caller. > > In other words, it works perfectly for finite result sets,

[Haskell-cafe] Cabal: error on configure

2008-10-07 Thread David Barton
OK, I suspect this is a real newbie error, but please have mercy. I have downloaded and installed cabal (at least it responds to the --help command from the command line). Yet when I do, say (to give a real example): cabal configure parameterized_ data (having done he fetch) I get this erro

Re: [Haskell-cafe] Cabal: error on configure

2008-10-07 Thread Don Stewart
dlb: > OK, I suspect this is a real newbie error, but please have mercy. I have > downloaded and installed cabal (at least it responds to the --help command > from the command line). Yet when I do, say (to give a real example): > > cabal configure parameterized_ data > > (having done he fetch

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Andrew Coppin
Daniel Fischer wrote: Am Dienstag, 7. Oktober 2008 20:27 schrieb Andrew Coppin: Basically, the core code is something like raw_bind :: (Monad m) => [[x]] -> (x -> m (ResultSet y)) -> m (ResultSet y) raw_bind [] f = return empty raw_bind (xs:xss) f = do rsYs <- mapM f xs rsZ <-

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Daniel Fischer
Am Dienstag, 7. Oktober 2008 22:09 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Am Dienstag, 7. Oktober 2008 20:27 schrieb Andrew Coppin: > >> Basically, the core code is something like > >> > >> raw_bind :: (Monad m) => [[x]] -> (x -> m (ResultSet y)) -> m > >> (ResultSet y) > >> raw_bin

Re: [Haskell-cafe] newbie questions (read, etc., with Data.ByteString.Lazy.Char8)

2008-10-07 Thread George Pollard
On Mon, 2008-10-06 at 21:06 -0500, Mike Coleman wrote: > There's a readInt method, which I guess I could use, but it returns a > Maybe, and I don't see how I can easily strip that off. You can use Data.Maybe's 'mapMaybe' function "The mapMaybe function is a version of map which can throw out eleme

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread David Menendez
On Tue, Oct 7, 2008 at 5:07 PM, Daniel Fischer <[EMAIL PROTECTED]> wrote: > Am Dienstag, 7. Oktober 2008 22:09 schrieb Andrew Coppin: >> Daniel Fischer wrote: >> > Maybe it is as simple as >> > >> > raw_bind (xs:xss) f = do >> > rsYs <- mapM f xs >> > ~rsZ <- raw_bind xss f >> > retu

Re: [Haskell-cafe] Linux binary dist problems

2008-10-07 Thread Colin Fleming
Ok, I tried nix but I couldn't get it to work. Initially I had a problem since I was trying to get nix to install in my home directory and on the host (Dreamhost) that's actually a symlink, which nix doesn't allow. Then once I got it installed finally it didn't build - I can't remember the details

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread Daniel Fischer
Am Dienstag, 7. Oktober 2008 23:38 schrieb David Menendez: > On Tue, Oct 7, 2008 at 5:07 PM, Daniel Fischer <[EMAIL PROTECTED]> wrote: > > Am Dienstag, 7. Oktober 2008 22:09 schrieb Andrew Coppin: > >> Daniel Fischer wrote: > >> > Maybe it is as simple as > >> > > >> > raw_bind (xs:xss) f = do > >

Re: [Haskell-cafe] Monad transformers [Stacking monads]

2008-10-07 Thread David Menendez
On Mon, Oct 6, 2008 at 4:48 PM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > Andrew Coppin wrote: >> >> I have some longwinded code that works, but I'm still thinking about how >> to do this more elegantly. It looks like what I really need is something >> like >> >> type M = StateT State (ResultSetT

[Haskell-cafe] ANNOUNCE: Data.IVar 0.1

2008-10-07 Thread Luke Palmer
Several very elegant FRP approaches are emerging, most visibly FRP.Reactive, which rely on blocking on multiple variables at once, continuing when the *first* of them is available. . . inside an unsafePerformIO, so the beautiful STM "orElse" solution is not available. The current solution is to ra

Re: [Haskell-cafe] monadic parser with Happy and Alex

2008-10-07 Thread Timothy Goddard
On Sun, 05 Oct 2008 04:05:51 Manlio Perillo wrote: > Hi. > > I have completed a draft of a CSS lexer, using Alex. > http://hg.mperillo.ath.cx/haskell/webtools/file/tip/src/CSS/Lexer.x > > The lexer use the posn wrapper. > > Now I'm starting to write the parser with Happy, however for the final > pr

Re: [Haskell-cafe] ANNOUNCE: Data.IVar 0.1

2008-10-07 Thread Don Stewart
lrpalmer: >Several very elegant FRP approaches are emerging, most visibly >FRP.Reactive, which rely on blocking on multiple variables at once, >continuing when the *first* of them is available. . . inside an >unsafePerformIO, so the beautiful STM "orElse" solution is not available.

Re: [Haskell-cafe] ANNOUNCE: Data.IVar 0.1

2008-10-07 Thread Luke Palmer
On Wed, Oct 8, 2008 at 12:20 AM, Don Stewart <[EMAIL PROTECTED]> wrote: > lrpalmer: > >Several very elegant FRP approaches are emerging, most visibly > >FRP.Reactive, which rely on blocking on multiple variables at once, > >continuing when the *first* of them is available. . . inside a