[Haskell-cafe] Non-blocking for reactive programs (was: Objects in Haskell)

2004-11-29 Thread Graham Klyne
At 00:39 29/11/04 +0100, Benjamin Franksen wrote: One problem remains: to preserve reactivity, the programmer must make sure that methods don't execute IO actions that may block indefinitely. Unfortunately there is no way in Haskell to enforce this, because (indefinitely) blocking IO actions have

[Haskell-cafe] Help!

2004-11-29 Thread balarcon
Hi, I'm a computerĀ“s student and have some problems with a work I have to do. My teacher has an application written in Haskell(with GUI) and he wants I work on Visual Studio.net to make a GUI in C# and its buttons have to call his Haskell'application . I'm very disoriented and

[Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

2004-11-29 Thread George Russell
(indexing with TypeRep) This is yet another incidence where Robert Will's ByMaps would be very useful In fact GHC at least *already* generates a unique integer for each TypeRep. A good idea, since it means comparisons can be done in unit time. Thus indexing can be done trivially using this

[Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

2004-11-29 Thread Benjamin Franksen
On Monday 29 November 2004 11:35, George Russell wrote: (indexing with TypeRep) This is yet another incidence where Robert Will's ByMaps would be very useful In fact GHC at least *already* generates a unique integer for each TypeRep. A good idea, since it means comparisons can be done

[Haskell-cafe] Re: Global Variables and IO initializers

2004-11-29 Thread George Russell
Benjamin wrote (snipped): Typeable would be completely safe if the only way to declare instances would be to derive them, but this is only practical if it can be done from anywhere outside the data type definition. Unfortunately this would also outlaw some legitimate uses of Typeable. In

Re: [Haskell-cafe] Help!

2004-11-29 Thread Keith Wansbrough
Hi, I'm a computerĀ“s student and have some problems with a work I have to do. My teacher has an application written in Haskell(with GUI) and he wants I work on Visual Studio.net to make a GUI in C# and its buttons have to call his Haskell'application . I'm very disoriented and

Re: [Haskell-cafe] emtpy fundep LHS

2004-11-29 Thread Robert Dockins
Keean Schupke wrote: Martin Sulzmann wrote: Well, if there's only instance which is not exported, then you can use functional dependencies. Assume class C a instance ... = C t Internally, use class C a | - a instance ... = C t The cases I was looking at had more than one instance, but thats

Re: [Haskell-cafe] emtpy fundep LHS

2004-11-29 Thread Keean Schupke
Robert Dockins wrote: Indeed, it seems to me that one could bootstrap arbitrary closed classes from a class with the (- a) fundep and multiparameter type classes. (code follows). Then, I should be able to prove some properties of the MyNum class (and type-level programs using it) without

[Haskell-cafe] not possible with monad transformers ?

2004-11-29 Thread Pavel Zolnikov
Hi, I have been playing with Maybe and Output monad transformers and realized that I cannot make the following work nicely: foo a b = do output before r - (liftM2(+)) a b when r == Nothing $ output error return r As soon as computation produces Nothing, I am loosing

[Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Keean Schupke
Benjamin Franksen wrote: I still have problems. They are probably due to a wrong definition of the operator (#). Note that (#) is nowhere defined inside the HList sources, so I assumed an inverse application aoperator. This is my program now: No, # is the record selection operator from the

[Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Benjamin Franksen
On Monday 29 November 2004 21:47, Keean Schupke wrote: Benjamin Franksen wrote: I still have problems. They are probably due to a wrong definition of the operator (#). Note that (#) is nowhere defined inside the HList sources, so I assumed an inverse application operator. This is my program

Re: [Haskell-cafe] Haskore Wiki (really Haskore T-shirt)

2004-11-29 Thread Fritz Ruehr
Henning and others who are interested in Haskore might want to check out the Haskore-themed T-shirt available from CafePress: http://www.cafepress.com/haskore.13482964 Note that the 8 laws of polymorphic temporal media appear on the rear side of the shirt: just click on the View Larger

Re: [Haskell-cafe] Re: [Haskell] Re: Global Variables and IOinitializers

2004-11-29 Thread John Meacham
On Mon, Nov 29, 2004 at 03:09:53PM -, Simon Peyton-Jones wrote: | In fact GHC at least *already* generates a unique integer for each | TypeRep. A good idea, since it means comparisons can be done in unit | time. Thus indexing can be done trivially using this integer as a | hash

Re: [Haskell-cafe] not possible with monad transformers ?

2004-11-29 Thread Mike Gunter
This: foo a b = do output before let r = liftM2 (+) a b when (r == Nothing) $ output error return r -- ??? lift r seems to address your complains, but I don't understand what you want well enough to know if this is that. mike Pavel Zolnikov [EMAIL

Re: [Haskell-cafe] Re: OO in Haskell

2004-11-29 Thread Keean Schupke
Benjamin Franksen wrote: Of course, stupid me. Ok, I changed that. Still won't compile. I post only the first of four type errors (they are all about 40 lines long; note that the inferred type below is almost longer than the complete test program). You'd probably need this as well: {-#

Re: [Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

2004-11-29 Thread John Meacham
On Mon, Nov 29, 2004 at 11:57:31AM +0100, Benjamin Franksen wrote: Can anyone think of a situation where adding a derived instance to an abstract data type breaks one of its invariants? Yes, I was thinking of this the other day, newtype LessThan5 = LessThen5 Int new x | x 5 = LessThen5 x