The issue is more than just efficiency. It's vital that these improving
values get evaluated as little as possible. In my use for functional
reactivity, they represent the times of future event occurrences.
Your (<=)-via-min idea might work in some cases, though useful pointer
equality can be pr
Christian Maeder wrote:
> Conal Elliott wrote:
>> The type argument I ran into trouble with represents a value as a list
>> of increasing lower bounds, ending in the exact value. min produces
>> lower bounds from lower bounds and so is immediately productive before
>> even knowing which argument i
Conal Elliott wrote:
> The type argument I ran into trouble with represents a value as a list
> of increasing lower bounds, ending in the exact value. min produces
> lower bounds from lower bounds and so is immediately productive before
> even knowing which argument is the lesser one.
Is this on
Oh -- partial & partial. Thanks. I was pretty puzzled there.
The type argument I ran into trouble with represents a value as a list of
increasing lower bounds, ending in the exact value. min produces lower
bounds from lower bounds and so is immediately productive before even
knowing which argum
Conal Elliott wrote:
> AddBounds makes total orders from total orders. It just adds new least
> and greatest elements.
>
> The problem with the derived instance is that it doesn't exploit the
> potential laziness of min on 'a'. Because of their types, min it can
> produce partial info from parti
AddBounds makes total orders from total orders. It just adds new least and
greatest elements.
The problem with the derived instance is that it doesn't exploit the
potential laziness of min on 'a'. Because of their types, min it can
produce partial info from partial info and (<=) and compares can
Conal Elliott wrote:
> I have an algebraic data type (not newtype) that derives Ord:
>
> data AddBounds a = MinBound | NoBound a | MaxBound
> deriving (Eq, Ord, Read, Show)
The class Ord is not suited for partial orders. If you write your own
Ord instances anyway, I'd suggest to intro
Thanks for the pointers. I'd found 10.1 but hadn't noticed 10.5.
So I suggest that you use an explicit Ord instance and define min/max the
> way you want.
>
Yep. That's my solution:
instance Ord a => Ord (AddBounds a) where
MinBound <= _ = True
NoBound _ <= MinBound =
On Wed, 2008-03-19 at 14:11 -0700, Conal Elliott wrote:
> I have an algebraic data type (not newtype) that derives Ord:
>
> data AddBounds a = MinBound | NoBound a | MaxBound
> deriving (Eq, Ord, Read, Show)
>
> I was hoping to get a min method defined in terms of the min method of
>
I have an algebraic data type (not newtype) that derives Ord:
data AddBounds a = MinBound | NoBound a | MaxBound
deriving (Eq, Ord, Read, Show)
I was hoping to get a min method defined in terms of the min method of the
type argument (a). Instead, I think GHC is producing something in
10 matches
Mail list logo