I think it happens because of the layout based syntax; I'll take a look closer.
Thanks.
Hi!
I tried to rearrange the "quick sort" algorithm in such a way:
qsort [] = []
// Using let-in form:
qsort (x::xs) = let lessThan = section (<)
notLessThan = section (>=)
section pred = qsort [y \\ y<-xs | y `pred` x]
in lessThan ++ [x] ++ notLessThan
//Using where form:
/*qsort (x::xs) = lessThan ++ [x] ++ notLessThan where
lessThan = section (<)
notLessThan = section (>=)
section pred = qsort [y \\ y<-xs | y `pred` x]*/
qsort [2,1,6,1,6,8]
I see the message: "A conflicting definition of 'qsort'" If I toggle comments turning on the second variant, it works. Why does it happen?
Alexey
--
---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
elalang+u...@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.