Re: looking for data structure advice

2003-12-24 Thread Conor McBride
Hi Sorry to take so long: I've spent a week watching paint dry, so I can confirm that this is more interesting. Jon Cast wrote: > > Conor McBride <[EMAIL PROTECTED]> wrote: > > > > I've always been a little bothered by the MonadPlus class: zero and > > plus are associated (no pun intended) in

Re: looking for data structure advice

2003-12-17 Thread Graham Klyne
At 07:05 15/12/03 -0500, David Roundy wrote: My or_maybe is just defined as or_maybe (Just e) _ = Just e or_maybe Nothing f = f which is pretty simple... Indeed... I have been tending to do something similar inline... I'm finding there's a tension between having lots of auxilliary functions and

Re: looking for data structure advice

2003-12-15 Thread Jon Cast
Conor McBride <[EMAIL PROTECTED]> wrote: > I've always been a little bothered by the MonadPlus class: zero and > plus are associated (no pun intended) in my mind with monoidal > structure. Is there more to MonadPlus than a clumsy workaround for > the lack of quantified constraints? Yes. For ev

Re: looking for data structure advice

2003-12-15 Thread Conor McBride
Hi David Roundy wrote: > > On Mon, Dec 15, 2003 at 08:55:10AM +, Graham Klyne wrote: > > I apologize... my question was unclear. > > > > It was not the standard MonadPlus class and functions that I was asking > > about, but the specific instance for Maybe (i.e. or_maybe). As it happens, > >

Re: looking for data structure advice

2003-12-15 Thread Samuel Tardieu
> "David" == David Roundy <[EMAIL PROTECTED]> writes: David> My or_maybe is just defined as David> or_maybe (Just e) _ = Just e or_maybe Nothing f = f David> which is pretty simple, so you can run a series of calculations David> (assuming you want to keep the first that has a non-Nothing Dav

Re: looking for data structure advice

2003-12-15 Thread Samuel Tardieu
> "Graham" == Graham Klyne <[EMAIL PROTECTED]> writes: Graham> I apologize... my question was unclear. It was not the Graham> standard MonadPlus class and functions that I was asking Graham> about, but the specific instance for Maybe (i.e. or_maybe). Graham> As it happens, a couple of times i

Re: looking for data structure advice

2003-12-15 Thread David Roundy
On Mon, Dec 15, 2003 at 08:55:10AM +, Graham Klyne wrote: > I apologize... my question was unclear. > > It was not the standard MonadPlus class and functions that I was asking > about, but the specific instance for Maybe (i.e. or_maybe). As it happens, > a couple of times in the past couple

Re: looking for data structure advice

2003-12-15 Thread Graham Klyne
I apologize... my question was unclear. It was not the standard MonadPlus class and functions that I was asking about, but the specific instance for Maybe (i.e. or_maybe). As it happens, a couple of times in the past couple of weeks, I might have used such a function if it were available in th

Re: looking for data structure advice

2003-12-14 Thread Derek Elkins
On Fri, 12 Dec 2003 20:55:59 + Graham Klyne <[EMAIL PROTECTED]> wrote: > At 14:17 12/12/03 -0500, Derek Elkins wrote: > >This will also provide a migration path if you want a more featureful > >monad. (or_maybe is mplus, fail or mzero can be used for Nothing > >when you explicitly want to fai

Re: looking for data structure advice

2003-12-14 Thread David Roundy
On Fri, Dec 12, 2003 at 08:55:59PM +, Graham Klyne wrote: > At 14:17 12/12/03 -0500, Derek Elkins wrote: > >This will also provide a migration path if you want a more featureful > >monad. (or_maybe is mplus, fail or mzero can be used for Nothing when > >you explicitly want to fail). > > Is th

Re: looking for data structure advice

2003-12-14 Thread Tomasz Zielonka
On Fri, Dec 12, 2003 at 08:55:59PM +, Graham Klyne wrote: > At 14:17 12/12/03 -0500, Derek Elkins wrote: > >This will also provide a migration path if you want a more featureful > >monad. (or_maybe is mplus, fail or mzero can be used for Nothing when > >you explicitly want to fail). > > Is th

Re: looking for data structure advice

2003-12-14 Thread Graham Klyne
At 14:17 12/12/03 -0500, Derek Elkins wrote: This will also provide a migration path if you want a more featureful monad. (or_maybe is mplus, fail or mzero can be used for Nothing when you explicitly want to fail). Is this or_maybe (and friends) actually defined in any of the standard libraries?

Re: looking for data structure advice

2003-12-12 Thread Derek Elkins
On Fri, 12 Dec 2003 07:24:04 -0500 David Roundy <[EMAIL PROTECTED]> wrote: Other libraries are Daan's DData, http://www.cs.uu.nl/~daan/ddata.html, and Edison, http://cvs.sourceforge.net/viewcvs.py/hfl/hfl/edison/ (or the version in the old hslibs), however nothing jumps out at me as doing exactly

looking for data structure advice

2003-12-12 Thread David Roundy
Hello everyone, I am trying to restructure some of my code to eliminate some O(n^2) operations, and have realized that this will require a change in how my data is represented, but I don't see any standard data types (in Data) that will really suit my needs. Currently I have a sequence of patches