
5 Jun
2007
5 Jun
'07
6:37 a.m.
Hi, Im curious about how the Haskell compilers nowadays take care of a simple function definition like append append [] l = l append (h:t) l = h: (append t l) Do they take a rewriting way like append [1,2] [3,4] ==> 1: (append [2] [3,4]) ==> 1: (2 : (append [] [3,4]) ) ==> 1 : (2: [3,4]) ==> [1,2,3,4] Or do they converte the append definintion to some lambda-calculus flavour language append = Y (\f -> \l1 l2 -> case l1 of [] -> l2 (h:t) -> h: (f t l2)) And then apply this converted definition to the arguments? Best Miguel