Re: [Haskell-cafe] Variants of a recursive data structure

2006-08-03 Thread Christophe Poucet
ce it would be nice to reuse it here. > > Thanks for the GADT suggestion. I assume you are referring to Bringert's > ICFP'06 paper? I will take a look. > > Klaus > > -Original Message- > From: Christophe Poucet [mailto:[EMAIL PROTECTED] > Sent: T

Re: [Haskell-cafe] Variants of a recursive data structure

2006-08-03 Thread Christophe Poucet
> Exp > > that does *not* need to know about the full structure of expressions. > > So, what options do I have to address this problem in Haskell? > > Klaus > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > ht

Re: [Haskell-cafe] seq - RTFM?

2006-07-21 Thread Christophe Poucet
> Prelude> putStr "Ahoj\n" `seq` 3+3 > Ahoj > 6 > > ??? > > Does it have something common with monads or is it a behavior of seq? > > Thanks, > > Dusan > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@h

[Haskell-cafe] Darcs-synchronisation tool

2006-07-05 Thread Christophe Poucet
Hello,I typically back up my darcs repositories on different computers.   However I do always use the same structure for the different "forests" of darcs repositories.  Lately my laptop charger has died which has led me to constantly use a usbstick to move these repositories.  Therefore I have star

[Haskell-cafe] Re: Cyclic Type-synonyms

2006-07-05 Thread Christophe Poucet
ike a real limitation On 7/5/06, Christophe Poucet <[EMAIL PROTECTED]> wrote: Hello, I use the Indirect Composite pattern a lot, and this means that typically, especially with recursive types (such as an AST), you end up with a lot of data-constructors.  I understand that it is not possible t

[Haskell-cafe] Cyclic Type-synonyms

2006-07-05 Thread Christophe Poucet
Hello, I use the Indirect Composite pattern a lot, and this means that typically, especially with recursive types (such as an AST), you end up with a lot of data-constructors.  I understand that it is not possible to have pure cyclic types (because haskell requires iso-recursive and not equi-recur

Re: [Haskell-cafe] Scoped data declarations

2006-06-26 Thread Christophe Poucet
Hello,Well one specific example where this would be useful is for lambdabot and similar systems.  Additionally this could be useful for experimenting in any interpreter such as hugs or ghci.Regards On 6/26/06, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: On 6/23/06, Christophe Poucet &

[Haskell-cafe] Scoped data declarations

2006-06-23 Thread Christophe Poucet
Dear,Yesterday, while discussing with Cale and SamB on I suddenly came up with the crazy idea of scoped data declarations.  After some brief discussion to check the validity, I finally came to the conclusion that they should be feasible. In addition, I don't think that they would require a high amo

Re: [Haskell-cafe] Type class hell

2006-06-08 Thread Christophe Poucet
I'm not certain but I think this will still fail for exactly the piece that you ignored, which is the crux of the problem.On 6/8/06, Greg Buchholz < [EMAIL PROTECTED]> wrote: Christophe Poucet wrote:> The idea however is that MonoType is going to be used in a recursive>

Re: [Haskell-cafe] Type class hell

2006-06-07 Thread Christophe Poucet
some. Greg Buchholz wrote: Christophe Poucet wrote: What I would like to do is combine HasVars and Type (mostly because in my framework the two concepts shouldn't be divided from a design perspective) into one type class to clean it up a bit. However I fail to see how I would implement toT

[Haskell-cafe] Type class hell

2006-06-07 Thread Christophe Poucet
freeVars (TyConst _ xs) = nub . concatMap freeVars $ xs occurs x (TyVar y) = x == y occurs x (TyConst _ xs) = or . map (occurs x) $ xs Cheers, Christophe(vincenz) -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) imec (dot) be Website: http://notvincenz.com/

Fwd: [Haskell-cafe] Undecideable instances for one instance?

2006-06-07 Thread Christophe Poucet
Hello Bulat,You are indeed correct. However I fail to see how there is any undecideability.  If instead one specified it as follows, it would be fine:class Locatable a b | a -> b, b -> a where    value :: a -> b    wrap :: b -> ainstance Locatatable (Located a) a where   value (L a) = a   wrap a   

[Haskell-cafe] Undecideable instances for one instance?

2006-06-07 Thread Christophe Poucet
In the instance declaration for `Locatable a' Christophe(vincenz) -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) imec (dot) be Website: http://notvincenz.com/ IMEC vzw – Register of Legal Entities Leuven VAT BE 0425.260.668 – Kapeldreef 75, B

[Haskell-cafe] Re: Bug in Data.Graph

2006-06-03 Thread Christophe Poucet
I just realized that I was looking at dependencies the wrong way (which is where I'm using this). So please ignore, the implementation is correct, I just made a mental typo :/ Christophe Poucet wrote: Dear, I think I have discovered a bug in Data.Graph. If one looks at the document

[Haskell-cafe] Bug in Data.Graph

2006-06-03 Thread Christophe Poucet
pecification we have the graph (with arrows pointing down) 1 / \ | 3 |/ 2 | 4 Therefore one would expect [4,2,3,1]. Is this a bug in the documentation or the implementation? With regards, Christophe -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) i

[Haskell-cafe] Filtering on data constructors with TH

2006-05-31 Thread Christophe Poucet
do let l = [A 1 "s", B 2, C] let l2 = [Foo 1, Bar "a", Foo 2, Bar "b"] print l print $ filter isA l print l2 print $ filter isFoo l2 Cheers Christophe ([EMAIL PROTECTED]) -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Pou

[Haskell-cafe] (no subject)

2006-05-29 Thread Christophe Poucet
- -- FooBar.hs:31:12: -- Couldn't match the rigid variable `b' against `f b1' -- `b' is bound by the instance declaration at FooBar.hs:30:0 -- Expected type: b -- Inferred type: f b1 -- In the application `fmap (foo) c' -- In the definition of `foo': foo c = fmap (foo) c

[Haskell-cafe] TypeCasting in Haskell

2006-05-24 Thread Christophe Poucet
ve: ([EMAIL PROTECTED] {unBar = bar}) -> TF $ b --- what is the fix? Basically do a noop on b --- [EMAIL PROTECTED] {unBar = bar} -> --- TF $ b{unBar = bar} Cheers, Christophe -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) imec (dot) be W

Re: [Haskell-cafe] GHC wish

2006-05-23 Thread Christophe Poucet
correct way of displaying an AST. I can personally think of a few ways an AST could be pretty printed. Chris. On 24 May 2006, at 00:05, Christophe Poucet wrote: Dear all, I recently stumbled upon something that I think should be added to the GHC wishlist. Not knowing where to put it, I

[Haskell-cafe] GHC wish

2006-05-23 Thread Christophe Poucet
ASTs it could make it much easier to look at the output. With regards, Christophe -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) imec (dot) be Website: http://notvincenz.com/ IMEC vzw – Register of Legal Entities Leuven VAT BE 0425.26

[Haskell-cafe] Dynamically stackable monads

2006-05-05 Thread Christophe Poucet
Hello,I was wondering if it's possible to stack a runtime-known amount ofmonads on top of each other. Let me illustrate. Assume I have a monadthat can consume data and expects as starting parameter an action of the underlying monad to use this data (call it produce at the lower levelmonad).Now one

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Christophe Poucet
ld it using parsec or happy? jake ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: [EMAIL PROTECTED] IMEC vzw – Register of

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Christophe Poucet
I would be very interested in this as well. I have looked myself but haven't found anything else. I wrote one myself in Haskell but for a subset of C++ (subset of C but with some extra things like methods). Christophe Poucet Ravi Nanavati wrote: It turns out we might find such a

Re: [Haskell-cafe] Advice needed on best way to simulate an STL vector

2006-04-19 Thread Christophe Poucet
Either way, Even an STL vector has O(N) insert because it needss to shift all the items past the current element where insertion is taking place. If your application is insert intensive the most ideal structure is a map. Concerning the suggestion regarding doubling the capacity, I don't bel

Re: [Haskell-cafe] GUI-Woes

2006-03-13 Thread Christophe Poucet
I have to concur with Duncan.I started using Gtk2Hs for a small project and literally within a couple hours I had a good understanding upon which to build a nice gui as well as the gui itself.  I haven't tried out wxhaskell, but trying gtk2hs and it's cairo bindings, I fell in love with the simplic