On Fri, 22 Jun 2007, Rohan Drape wrote:

> Henning Thielemann <[EMAIL PROTECTED]> writes:
> > > > -- Either variant allowing for both.
> > > > data Which a b = One a | Other b | Both (a,b) deriving (Eq, Show)
> >
> > Probably not. Is (Maybe a, Maybe b) also appropriate?
>
> Not really, precisely because:
>
> > This also contains the case (Nothing, Nothing).
>
> which is cannot occur in this particular
> context...
>
> > What application do you think of?
>
> Merging sequences of temporal values?

Is it possible to merge more than two sequences? In this case a non-empty
list type may be a solution. You need different types? Do you have
different types of events?

In Haskore I have factored out two modules for handling sequences of
events, incl. a merge function:
 http://darcs.haskell.org/haskore/src/Haskore/Basic/TimeOrderedList.lhs
 http://darcs.haskell.org/haskore/src/Haskore/Basic/TimeOrderedListPad.lhs

Sometimes I thought it would be a good idea to put them in a separate
package.
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to