[Haskell-cafe] whine and solution about programmers not
respecting documentations
Daniel Fischer
daniel.is.fischer at web.de
Tue Jun 29 07:14:10 EDT 2010
On Tuesday 29 June 2010 12:50:34, Ketil Malde wrote:
> Daniel Fischer <daniel.is.fischer at web.de> writes:
> >> An important point of a powerful type system is to model your program
> >> so that only sensible code is legal.
> >
> > That would be an awesomely powerful type system :)
>
> Heh. But while we're waiting for it, we can try to use what we got to
> eliminate as much non-sensical code as possible.
+1
>
> ...which is a worry my implementation removed by letting the user decide
> through partial application.
>
Aye.
> > For a symmetric relation, you needn't care.
>
> But the docs (are interpreted to) say equivalence relation, so woe
> betide you if you give it a symmetric but non-transitive or
> non-reflexive function!
>
> deleteBy (\x y -> abs (x-y) == 2) 5 [1..5]
grin
>
> Anyway: I guess the point here is that if all 'deleteBy f x ys' does
> with arguments f and x is apply f to x and then use the result, we might
> as well feed it that result and eliminate a lot of uncertainity as well
> as some documentation all too few of us bother to read.
>
Full agreement!
More information about the Haskell-Cafe
mailing list