Status of nubOrd (Proposal #2629)
Bertram Felgenhauer
bertram.felgenhauer at googlemail.com
Thu Oct 9 11:08:22 EDT 2008
Wolfgang Jeltsch wrote:
> Am Donnerstag, 9. Oktober 2008 10:41 schrieb Bart Massey:
> > > nubBool = take 2 . nub
Hmm, I wrote that.
> nub [False,True,undefined] => _|_
Surely you mean False : True : _|_
> but
>
> nubBool [False,True,undefined] => [False,True]
>
> right? Is this really intended?
Yes. It's a feature. I'm perfectly happy with
nub :: [Bool] -> [Bool] ⊑ nubBool,
which means that pure functions using 'nubBool' will never fail when
using 'nub' instead works, because pure functions are monotonous. Most
of the time, relaxing the strictness of functions is not a problem.
> Take care. Bool has three values (False, True and _|_).
> This is no Agda. ;-)
Yes, I know. But for some reason people rarely try to actually evaluate
a _|_ value, even in Haskell. ;-)
Bertram
More information about the Libraries
mailing list