> > min2 :: [a] -> a
> > min2 ((l:ls) :: [a] <= Sorted) = l
> > min2 l = min l
>
> What's the semantics of that supposed to be?
> If the list is not known to be definitely sorted,
> will it check sortedness at runtime?

No.

> If not, then the semantics could be nondeterministic,
> in general, so you've broken referential transparency.

If this is true, then what I'm doing is horrible. But I don't see how this
leads to nondeterminism or broken referential transparency. min2 returns the
same value for the same list, but it's simply more efficient if we happen to
know some more information about the list.



Reply via email to