StackOverflow in continuation monad
问题 Using the following continuation monad: type ContinuationMonad() = member this.Bind (m, f) = fun c -> m (fun a -> f a c) member this.Return x = fun k -> k x let cont = ContinuationMonad() I fail to see why the following gives me a stack overflow: let map f xs = let rec map xs = cont { match xs with | [] -> return [] | x :: xs -> let! xs = map xs return f x :: xs } map xs id;; let q = [1..100000] |> map ((+) 1) While the following doesn't: let map f xs = let rec map xs = cont { match xs with |