Re: [Haskell-cafe] Deconstructing types

2009-09-09 Thread José Pedro Magalhães
Hello Louis, On Tue, Sep 8, 2009 at 19:06, Louis Wasserman wasserman.lo...@gmail.comwrote: Sean, The answer is, I'm working on a recently semi-released package called TrieMap. Is that similar to what is done in [1]? A draft paper [2] also refers that implementation. Cheers, Pedro [1]

[Haskell-cafe] Re: Snow Leopard breaks GHC

2009-09-09 Thread Christian Maeder
If compiling template haskell of Pandoc still does not work, please make a ticket as Simon wrote in: http://hackage.haskell.org/trac/ghc/ticket/2965#comment:24 Cheers Christian Christian Maeder wrote: Maybe runhaskell is used for template haskell? HTH Christian Brian Sniffen wrote: No,

Re: [Haskell-cafe] How to understand the 'forall' ?

2009-09-09 Thread Daniil Elovkov
Ryan Ingram wrote: On Tue, Sep 8, 2009 at 12:44 PM, Daniil Elovkovdaniil.elov...@googlemail.com wrote: Existential is a perfect word, because it really is data S = exists a. Show a = S [a]. If you were going to make exists a keyword, I think you would write it like this: data S = ConsS

[Haskell-cafe] ANNOUNCE: graphviz-2999.5.0.0

2009-09-09 Thread Ivan Lazar Miljenovic
I am pleased to announce version 2999.5.0.0 [1] of the graphviz [2] package for Haskell. This is what I like to think of as the Hey, this is almost getting to be a decent library! version :p [1] http://hackage.haskell.org/packages/archive/graphviz/2999.5.0.0/graphviz-2999.5.0.0.tar.gz [2]

Re: [Haskell-cafe] ANN: fclabels-0.4.0 - First class accessor labels.

2009-09-09 Thread Sebastiaan Visser
On Sep 8, 2009, at 11:54 PM, Henning Thielemann wrote: On Fri, 4 Sep 2009, Sebastiaan Visser wrote: Hello all, There are more package around that serve the same purpose (like the Lenses package which was uploaded a few days ago), but I'm convinced the simplicity and elegance of fclabels

[Haskell-cafe] Strange type error (tfp package + GADTs)

2009-09-09 Thread Emil Axelsson
Hi Café, Can anyone explain why `add1` is rejected in the code below (which uses the tfp package): import Types.Data.Num data A n where A :: NaturalT n = Int - A n getA :: A n - Int getA (A n) = n add1 :: NaturalT (m:+:n) = A m - A n - A (m:+:n) add1 (A a) (A b) = A (a+b) add2 ::

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Duncan Coutts
On Tue, 2009-09-08 at 09:58 -0500, Jeff Wheeler wrote: On Tue, Sep 8, 2009 at 9:17 AM, Peter Verswyvelenbugf...@gmail.com wrote: Ouch, right, I forgot the default is global. It works fine with cabal install --user. And of course I could have edited the default config file, setting

[Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Anakim Border
Hi, I've put together a parser that works like this: - the full input is read into a strict ByteString; - such string is split into a number of lines; - each line is fed (independently) to a parser based on Parsec (version 3). Running the serial version of the parser (compiled with -O2

[Haskell-cafe] Resolving overloading loops for circular constraint graph

2009-09-09 Thread Stefan Holdermans
Manuel, Simon, I've spotted a hopefully small but for us quite annoying bug in GHC's type checker: it loops when overloading resolving involves a circular constraint graph containing type-family applications. The following program (also attached) demonstrates the problem: {-# LANGUAGE

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Don Stewart
akborder: The threaded version running on 2 cores is moderately faster than the serial one: $ ./Parser +RTS -s -N2 2,377,165,256 bytes allocated in the heap 36,320,944 bytes copied during GC 6,020,720 bytes maximum residency (6 sample(s)) 6,933,928 bytes maximum

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Bulat Ziganshin
Hello Anakim, Wednesday, September 9, 2009, 5:35:32 PM, you wrote: MUT time1.93s ( 1.99s elapsed) MUT time2.06s ( 1.19s elapsed) the speedup is very good. usually you don't get 2x faster execution because cores compete for the access to memory ps: are you sure that you

Re: [Haskell-cafe] Strange type error (tfp package + GADTs)

2009-09-09 Thread Emil Axelsson
I forgot to say that I'm using GHC 6.10.1. Also, the code requires {-# LANGUAGE FlexibleContexts, GADTs, TypeOperators #-} / Emil Emil Axelsson skrev: Hi Café, Can anyone explain why `add1` is rejected in the code below (which uses the tfp package): import Types.Data.Num data A n

Re: [Haskell-cafe] Deconstructing types

2009-09-09 Thread Louis Wasserman
The goal is similar, but I'm attempting to automatically infer the appropriate map type for any algebraic datatype -- and while I'm at it, the TrieMap package aims to include all the methods Data.Map offers. Louis Wasserman wasserman.lo...@gmail.com 2009/9/9 José Pedro Magalhães j...@cs.uu.nl

Re: [Haskell-cafe] Deconstructing types

2009-09-09 Thread Sean Leather
The goal is similar, but I'm attempting to automatically infer the appropriate map type for any algebraic datatype -- and while I'm at it, the TrieMap package aims to include all the methods Data.Map offers. Perhaps you want to read about the type-indexed tries in Generic Haskell:

Re: [Haskell-cafe] Deconstructing types

2009-09-09 Thread Louis Wasserman
This is about the same as the other paper I linked to, I think, but I'm interested in actually connecting the fully general trie construction to Template Haskell and other facilities to reduce the coder's overhead of using these tries in practice to a minimum. Louis Wasserman

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Anakim Border
Very interesting idea! I think the big thing would be to measure it with GHC HEAD so you can see how effectively the sparks are being converted into threads. Is there a package and test case somewhere we can try out? At this point the parser is just a proof of concept. For those brave

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Peter Verswyvelen
Yes, it's true that most people tended to be administrators on their own Windows desktops, but since Vista, this has changed. Now in Vista, some people still forced admin rights, to get rid of the many annoying dialog boxes that popped up for every tiny task that might be a security breach. But

[Haskell-cafe] ANNOUNCE: CCA-0.1

2009-09-09 Thread Paul L
I'm pleased to annouce that a library for Causal Commutative Arrows (CCA) has been uploaded to Hackage DB. It implements CCA normalization using Template Haskell and a modified arrow pre-processor (based on arrowp) to generate outout that Template Haskell can parse. It's highly experimental since

Re: [Haskell-cafe] ANNOUNCE: CCA-0.1

2009-09-09 Thread Peter Verswyvelen
Congratulations! On Wed, Sep 9, 2009 at 5:47 PM, Paul Lnine...@gmail.com wrote: I'm pleased to annouce that a library for Causal Commutative Arrows (CCA) has been uploaded to Hackage DB. It implements CCA normalization using Template Haskell and a modified arrow pre-processor (based on

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Edward Kmett
Hi Anakim, Nice to see someone else working in this space. I have also been working on a set of parallel parsing techniques, which can use small Parsec parsers for local context sensitivity. See the second set of slides in http://comonad.com/reader/2009/iteratees-parsec-and-monoid/ for an

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Don Stewart
ekmett: Hi Anakim,   Nice to see someone else working in this space.   I have also been working on a set of parallel parsing techniques, which can use small Parsec parsers for local context sensitivity.   See the second set of slides in http://comonad.com/reader/2009/

Re: [Haskell-cafe] ANNOUNCE: CCA-0.1

2009-09-09 Thread Max Bolingbroke
Great stuff Paul! It looks like you missed it out, so for others it might be helpful to know taht the link is: http://hackage.haskell.org/package/CCA I'm very happy you released this, as it was just today that I found out that I really needed a version of arrowp that could produce Template

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Edward Kmett
On Wed, Sep 9, 2009 at 12:16 PM, Don Stewart d...@galois.com wrote: ekmett: Hi Anakim, Nice to see someone else working in this space. I have also been working on a set of parallel parsing techniques, which can use small Parsec parsers for local context sensitivity. See the

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Don Stewart
ekmett: On Wed, Sep 9, 2009 at 12:16 PM, Don Stewart d...@galois.com wrote: ekmett: Hi Anakim,   Nice to see someone else working in this space.   I have also been working on a set of parallel parsing techniques, which can use small Parsec

Re: [Haskell-cafe] problems with HOC install from svn

2009-09-09 Thread John Velman
I'm guessing the problem was with cabal's use of dlopen (see my inclusion of error message below). From some googling, the OS-X dlopen was redone by apple at some time and from results I obtained, seems to require dylib libraries unless (some things I don't understand). It seems that some

Re: [Haskell-cafe] Resolving overloading loops for circular constraint graph

2009-09-09 Thread Martin Sulzmann
Your example must loop because as you show below the instance declaration leads to a cycle. By black-holing you probably mean co-induction. That is, if the statement to proven appears again, we assume it must hold. However, type classes are by default inductive, so there's no easy fix to offer to

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Duncan Coutts
On Wed, 2009-09-09 at 16:59 +0200, Peter Verswyvelen wrote: Yes, it's true that most people tended to be administrators on their own Windows desktops, but since Vista, this has changed. Now in Vista, some people still forced admin rights, to get rid of the many annoying dialog boxes that

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Sebastian Sylvan
On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Tue, 2009-09-08 at 09:58 -0500, Jeff Wheeler wrote: On Tue, Sep 8, 2009 at 9:17 AM, Peter Verswyvelenbugf...@gmail.com wrote: Ouch, right, I forgot the default is global. It works fine with cabal

Re: [Haskell-cafe] Resolving overloading loops for circular constraint graph

2009-09-09 Thread Stefan Holdermans
Dear Martin, Your example must loop because as you show below the instance declaration leads to a cycle. By black-holing you probably mean co-induction. That is, if the statement to proven appears again, we assume it must hold. However, type classes are by default inductive, so there's no

[Haskell-cafe] Re: Resolving overloading loops for circular constraint graph

2009-09-09 Thread Stefan Holdermans
Dear Martin, By black-holing you probably mean co-induction. That is, if the statement to proven appears again, we assume it must hold. However, type classes are by default inductive, so there's no easy fix to offer to your problem. A propos: are there fundamental objections to coinductive

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Anakim Border
Hi Edward, I read your slides a few weeks ago when they were posted on Reddit and found your approach very interesting. In fact it provided the inspiration for the parser I've written. I did not use the same strategy, however, because parsing makefiles poses its own challenges. The make syntax

[Haskell-cafe] Darcs 2.3 and NFS

2009-09-09 Thread Lewis-Sandy, Darrell
I am trying to set up darcs so that I can share patches between the many machines that I use for application development and testing. The machines have various operating systems (Windows XP, Windows 2000, Windows Vista, Ubuntu 9.04 32-bit, Ubuntu 64 bit, etc). I have a windows file share

Re: [Haskell-cafe] Darcs 2.3 and NFS

2009-09-09 Thread Ganesh Sittampalam
On Wed, 9 Sep 2009, Lewis-Sandy, Darrell wrote: Windows Vista, Ubuntu 9.04 32-bit, Ubuntu 64 bit, etc). I have a windows file share that is accessible to all the machines, and has been permanently mounted as a CIFS share on the Linux machines. I have built darcs 2.3 on the Ubuntu 9.04

Re: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Edward Kmett
Actually you can still do the same trick, you just need a smarter delimiter -- ironically the same one I use in Kata. ;) Look for non-backslashed newlines rather than newlines in general and start there. You need a little bit of book-keeping in case a backslash and newline straddle the chunk

[Haskell-cafe] adding state in GUIs (qtHaskell)

2009-09-09 Thread Michael P Mossey
I'm trying to learn qtHaskell. I realize few people on this list know anything about qtHaskell, but I have a question that probably relates to all GUIs as implemented in Haskell. I just need a hint that could help me figure out the next step, which I might be able to infer from the qtHaskell

Re: [Haskell-cafe] adding state in GUIs (qtHaskell)

2009-09-09 Thread Michael P Mossey
Been poking around. Maybe IORef has something to do with this? I found a qtHaskell example that seems to make use of IORef in order to accomplish something similar to what I want. Michael P Mossey wrote: I'm trying to learn qtHaskell. I realize few people on this list know anything about

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Jeff Wheeler
On Wed, Sep 9, 2009 at 2:19 PM, Sebastian Sylvansebastian.syl...@gmail.com wrote: I think it's morally right to run as user by default. Yes, the windows culture has some legacy that may, on occasion, make it slightly harder to use well behaved programs, but it's fairly minor these days. I

[Haskell-cafe] Fixed length list type?

2009-09-09 Thread Job Vranish
Does anyone know of a hackage package that has fixed length list type that is an instance of Applicative, Foldable and Traversable? (a list type that somehow encodes its length in the type) I've found lots of fixed length list types, but non that are members of the common typeclasses. I've

Re[2]: [Haskell-cafe] Parallel parsing multicore

2009-09-09 Thread Bulat Ziganshin
Hello Anakim, Wednesday, September 9, 2009, 11:58:58 PM, you wrote: foresee. I guess a possible solution would be to base parMap on different 'par' primitive; one that sparks a number of computations equal to the number of available OS threads and then blocks until at least one of them is

Re: [Haskell-cafe] adding state in GUIs (qtHaskell)

2009-09-09 Thread Bulat Ziganshin
Hello Michael, Thursday, September 10, 2009, 5:29:33 AM, you wrote: I'm totally stuck on this part, because Haskell doesn't have state. There must Haskell support states (yes, IORef is equal to C++ reference type - it's a constant pointer to some memory area that you may read/write), but it