Hi, I currently playing around a bit with different languages in the PF realm. I've noticed that foldl
gives somewhat different results in Racket than in other language, notable Haskell and OCaml.
#lang racket
(define (tfoldl f z xs)
(if (null? xs)
z
(tfoldl f (f z (car xs)) (cdr xs))))
(foldl - 3 '(1 2)) ; 4
(tfoldl - 3 '(1 2)) ; 0
foldl
Haskell and OCaml also evaluates to 0. I'm trying to understand why the results of these identically named functions differ.