To my example with    havle(xs : List T) ...
Ralf Hemmecke writes

> Apart from your wish to learn about local functions, you can write your
> function in any of the ways below.
> [..]
> 
>    split2(l: L): Product(L, L) ==
>        r: L := []
>        c: L := l
>        while not empty? c and not empty?(c:=rest c) repeat
>            r := cons(first l, r)
>            l := rest l
>            c := rest c
>        [reverse! r, l]

Thank you. I knew of the optimization of this kind.
It is difficult for a Haskeller to believe in the necessity of such  
loops. When I try this, it takes much more time of me to develop a code
of this kind.

By the way, Haskellers like to denote like this: `r' and `rs',  by this, 
it is easier to read in the source where it is a list and where is its 
element. 

Regards,

------
Sergei
[email protected]

   
       

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to