НА: Embedded Ela documentation - update is needed

9 views
Skip to first unread message

Василий Воронков

unread,
Nov 14, 2013, 1:19:21 AM11/14/13
to ela...@googlegroups.com
I think it happens because of the layout based syntax; I'll take a look closer.

Thanks.

От: Tikhonov Alexey
Отправлено: ‎14.‎11.‎2013 9:37
Кому: ela...@googlegroups.com
Тема: Re: Embedded Ela documentation - update is needed

 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.
Reply all
Reply to author
Forward
0 new messages