31 results found for ocaml >>=
State monad in OCaml State monad in OCaml I was trying to implement the state monad in OCaml (as an exercise). My implementation looks like this:
http://stackoverflow.com/questions/5843773/state-monad-in-ocaml
CPS in curried languages CPS in curried languages How does CPS in curried languages like lambda calculus or Ocaml even make sense? Technically, all
http://stackoverflow.com/questions/4511472/cps-in-curried-languages
otherwise = fib (n-1) + fib (n-2) main = getArgs >>= print . fib . read . head Result: > ghc -O3 -fllvm -optlo-O3 Main.hs -o fib > time ./fib 40 165580141
http://stackoverflow.com/question...-to-c-in-fibonacci-micro-benchmark
use GHCi. I know all about compiling to get things fast. Parsing costs should be completely irrelevant: if ML and OCaml can start 300x faster than GHCi,
http://stackoverflow.com/question...interpreter-suitable-for-scripting
putStrLn . maximum . filter palindrome $ tails xs >>= zipWith (*) xs where xs = [100..999] Well i got my problem solved 15m after posting my question, but
http://stackoverflow.com/question...er-functional-programming-language
OCaml and found that they were ~5× slower than the parser generators on offer at the time. I recently revisited this subject and benchmarked Haskell's
http://stackoverflow.com/question...rser-combinators-be-made-efficient
mapM (\(x, e') -> eval env' e' >>= \v -> return (x, v)) bs return $ nub (env'' ++ env) This is my test function I want to evaluate: test3 :: Expr test3 =
http://stackoverflow.com/question...lly-recursive-evaluator-in-haskell
while writing in another? The assumption that a functional language will be implemented using an imperative one is suspect. OCaml is written in OCaml, and
http://stackoverflow.com/question...l-programming-for-basic-algorithms
let rec f g x = ignore(g x) ; fun y -> f g y but ocamlc -rectypes does. OCaml's -rectypes option amounts more or less to disabling the occur-check in
http://stackoverflow.com/question...9547/function-which-returns-itself
Here is a summary of what I got (shortest first, grouped by similar score). Python, Ruby, JavaScript, Perl, Lua, PHP, Mozart/OZ OCaml, Erlang, Racket,
http://stackoverflow.com/question...hy-dont-they-have-a-better-rank-in