*To*: Florian Haftmann <florian.haftmann at informatik.tu-muenchen.de>*Subject*: Re: [isabelle] No tail-recursive code equation for List.map*From*: Brian Huffman <huffman at in.tum.de>*Date*: Sun, 28 Apr 2013 09:23:49 -0700*Cc*: Isabelle Users ML <cl-isabelle-users at lists.cam.ac.uk>*In-reply-to*: <517BD08D.2010207@informatik.tu-muenchen.de>*References*: <CAGbqCMz-55E56FmnaRtdCGfaiuUUmn_8uMLS0-YDjgNh6cQQ6g@mail.gmail.com> <F42C9D80-06F3-499B-8F0E-5005A2362BC8@uibk.ac.at> <1366992954.2569.40.camel@lapbroy33> <82283125-D692-4644-876F-3EE66CBD3236@uibk.ac.at> <517BD08D.2010207@informatik.tu-muenchen.de>

On Sat, Apr 27, 2013 at 6:20 AM, Florian Haftmann <florian.haftmann at informatik.tu-muenchen.de> wrote: > Before making any step ahead, it would be good to collect some general > observations which shapes of code equations are particularly suitable > for certain target languages, e.g. > * avoid Currying in languages which have bias towards tupled function > arguments (Scala) > * avoid tail recursion in lazy languages (Haskell) > * eta-expand certain function defintions (???) > * … "Avoid tail recursion" is not good general advice for Haskell! Tail-recursive implementations are preferred for many Haskell functions, especially those that always consume the entire input before they can produce any output. For example, "sum :: [Int] -> Int" is best as tail-recursive. Functions like "map" and "[m..n]" are implemented without tail recursion so that they can produce output incrementally. A better rule of thumb for Haskell is that for functions that return lazy datatypes, equations with a lazy constructor surrounding any recursive calls are preferable. - Brian

**References**:**[isabelle] No tail-recursive code equation for List.map***From:*C. Diekmann

**Re: [isabelle] No tail-recursive code equation for List.map***From:*René Thiemann

**Re: [isabelle] No tail-recursive code equation for List.map***From:*Peter Lammich

**Re: [isabelle] No tail-recursive code equation for List.map***From:*René Thiemann

**Re: [isabelle] No tail-recursive code equation for List.map***From:*Florian Haftmann

- Previous by Date: Re: [isabelle] No tail-recursive code equation for List.map
- Next by Date: Re: [isabelle] Problems with code generation for the reals
- Previous by Thread: Re: [isabelle] No tail-recursive code equation for List.map
- Next by Thread: Re: [isabelle] No tail-recursive code equation for List.map
- Cl-isabelle-users April 2013 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list