Ambiguous defaults

2003-01-02 Thread Ferenc Wagner
Hello, What's the way to express the following: a compound object is generally made up of two components with identical type. For this common case I'd like to provide some default methods, which take the object apart, operate on the parts and put the results back together. In other

Re: Sets

2003-01-02 Thread Eray Ozkural
I had asked a similar question on haskell lists about how to implement hypergraphs efficiently, which are combinatorics of finite sets (sets of sets). As a matter of fact, I obtained a nice and small finite set implementation that works for me, let me see if it is worth posting. If you are work

Re: comonads, io

2003-01-02 Thread Andrew J Bromage
G'day all. On Wed, Jan 01, 2003 at 01:15:09PM +0100, Nicolas.Oury wrote: > From this, I think the safety become intuitive. Maybe. Using the OI module from Richard Kieburtz' paper, I can write this: -- Bootstrap into the OI comonad main :: IO () main = return $! comain s

Re: Ambiguous defaults

2003-01-02 Thread Andrew J Bromage
G'day all. On Thu, Jan 02, 2003 at 05:49:41PM +0100, Ferenc Wagner wrote: > What's the way to express the following: a compound object > is generally made up of two components with identical type. This should work: \begin{code} module Test where class Component b where property :: b -> Int

Re: comonads, io

2003-01-02 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>, Andrew J Bromage <[EMAIL PROTECTED]> wrote: > comain :: OI a -> () > comain w > = coeval (w .>> show (a,b) =>> stdPutStrLn) > where > a = coeval (w .>> () =>> stdGetChar) > b = coeval (w .>> () =>> stdGetC

Re: comonads, io

2003-01-02 Thread Andrew J Bromage
G'day all. On Thu, Jan 02, 2003 at 08:08:20PM -0800, Ashley Yakeley wrote: > So is Kieburtz smoking crack, or are we writing OI-style programs > incorrectly? I mailed him the example and asked. (I phrased the question a bit differently, though.) > One possibility is that comonads are useful f