並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 43件

新着順 人気順

OCamlの検索結果1 - 40 件 / 43件

  • OCaml でゲームボーイエミュレータを書いた話 - Qiita

    はじめに ブラウザ上で動くゲームボーイエミュレータを OCaml で書きました。以下のページで試せます。 デモページ いくつかの homebrew ROM も一緒になっているのでいろいろ遊んでみてください。おすすめは「Bouncing ball」と「Tobu Tobu Girl」です。最近のスマホならだいたい安定して 60 FPS 出るはずなので、スマホでも遊べます。 レポジトリはこちらです。 スクリーンショット なぜ OCaml でゲームボーイエミュレータ?新しいプログラミング言語を学ぶ過程で以下のように思ったことはないでしょうか? 簡単なプログラムなら書けるが、中規模以上のコード1をどうやって書けばよいのか分からない 発展的な言語機能2も勉強しなんとなく理解した気になったが、実践のなかでどのように活用すればいいのかが分からない OCaml を本格的に勉強し始めてた数ヶ月前の筆者はまさに

      OCaml でゲームボーイエミュレータを書いた話 - Qiita
    • 40歳から始める関数型言語、OCaml - すぎゃーんメモ

      動機 Why OCaml 学習方法 Real World OCaml Github Copilot と ChatGPT オンラインジャッジ (競プロ) Advent of Code その次? 所感 関数型という概念 OCamlの書き味 Rust, Python の経験 AIとの親和性 まとめ 某Nさんがここ最近Haskellとか勉強してて楽しそうで真似してみたくなって、自分も今さらながら何か関数型言語はじめてみるか〜と周りに相談したところOCamlをオススメされたので 今年に入ってからひたすらOCaml書く練習してる。AtCoder Boot camp for BeginnersのEasy 100をようやく終わらせたところ。 pic.twitter.com/POBWhvHHCn— すぎゃーん💯 (@sugyan) April 9, 2023 大西さんが動画の中で感極まっていたけど、宮川さ

        40歳から始める関数型言語、OCaml - すぎゃーんメモ
      • 抽象度の高い関数型言語プログラミングのスキルを身につけるための書籍が発売/「OCaml」を通じて関数型プログラミングを学べる『関数型言語で学ぶプログラミングの基本』【Book Watch/ニュース】

          抽象度の高い関数型言語プログラミングのスキルを身につけるための書籍が発売/「OCaml」を通じて関数型プログラミングを学べる『関数型言語で学ぶプログラミングの基本』【Book Watch/ニュース】
        • 自作OCamlコンパイラでセルフホストした - molecular coordinates

          概要 ここ最近作っていたOCaml*1コンパイラmlml*2でセルフホストを達成しました。ヤッター github.com mlmlには以下に代表されるような、OCamlの基本的な機能が実装されています。 再帰関数 ヴァリアント、レコード パターンマッチ カリー化 モジュール また、多少の標準ライブラリも実装されています。 mlmlの特徴 ほぼフルスクラッチ 今回LLVMやパーサジェネレータに頼らないコンパイラづくりを体験するのが目的の一部だったので、結果的にフルスクラッチらしきこと*3になりました。OCamlの標準ライブラリ以外の外部ライブラリを使用しておらず、字句解析器・構文解析器は手書きです。 OCamlで書かれている セルフホストしたのでそれはそうなんですが、OCamlで書かれています。 また、言語処理系を書く場合ランタイムライブラリはC言語で用意してリンクする場合が多いと思いますが

            自作OCamlコンパイラでセルフホストした - molecular coordinates
          • OCaml Programming: Correct + Efficient + Beautiful — OCaml Programming: Correct + Efficient + Beautiful

            Preface About This Book Installing OCaml Introduction 1. Better Programming Through OCaml 1.1. The Past of OCaml 1.2. The Present of OCaml 1.3. Look to Your Future 1.4. A Brief History of CS 3110 1.5. Summary 2. The Basics of OCaml 2.1. The OCaml Toplevel 2.2. Compiling OCaml Programs 2.3. Expressions 2.4. Functions 2.5. Documentation 2.6. Printing 2.7. Debugging 2.8. Summary 2.9. Exercises OCaml

            • OCaml 製 ActivityPub サーバ Waq の紹介 - HackMD

              今年に入ってからずっと、OCaml で ActivityPub サーバを書いています。名前は Waq(ワク)で、例によって GitHub で大公開しています。SNS に必要な最低限の機能は揃っていて、README に従うと Docker Compose でデモが動かせるので、よければ試してみてください。

                OCaml 製 ActivityPub サーバ Waq の紹介 - HackMD
              • Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml - Tristan Hume

                During my final term at UWaterloo I took the CS444 compilers class with a project to write a compiler from a substantial subset of Java to x86, in teams of up to three people with a language of the group’s choice. This was a rare opportunity to compare implementations of large programs that all did the same thing, written by friends I knew were highly competent, and have a fairly pure opportunity

                • Release OCaml 5.0.0 · ocaml/ocaml

                  OCaml 5.0.0 introduces a completely new runtime environment with support for shared memory parallelism and effect handlers. As a language, OCaml 5 is fully compatible with OCaml 4 down to the performance characteristics of your programs. In other words, any code that works with OCaml 4 should work the same with OCaml 5. The currently known exceptions to this rule are: the removal of many long-depr

                    Release OCaml 5.0.0 · ocaml/ocaml
                  • 関数型言語初心者にこそおすすめしたい"OCaml"の特徴

                    2019年7月29日、Opt Technologiesが主催するイベント「Fun Fun Functional (2) 関数型言語Lightning Talks!!」が開催されました。関数型プログラミングについて楽しく学び、知見を共有することを目的に開催されている本勉強会。今回は6名のエンジニアが、関数型プログラミング言語にまつわるユニークな発表を行いました。プレゼンテーション「関数型初心者にこそおすすめしたい言語 "OCaml" 」に登壇したのは、cedretaber氏。講演資料はこちら 関数型初心者にこそおすすめしたい言語 "OCaml" cedretaber氏(以下、cedretaber):「関数型初心者にこそおすすめしたい言語 "OCaml"」ということで、またOCamlの話だということになってしまうんですが。 自己紹介、cedretaberと申します。 「ドワンゴから来ました」っ

                      関数型言語初心者にこそおすすめしたい"OCaml"の特徴
                    • GitHub - OCamlPro/owi: OCaml WebAssembly Interpreter

                      Owi is a toolchain to work with WebAssembly. It is written in OCaml. It provides a binary with many subcommands: owi c: a bug finding tool for C code that performs symbolic execution by compiling to Wasm and using our symbolic Wasm interpreter; owi fmt: a formatter for Wasm; owi opt: an optimizer for Wasm; owi run: a concrete Wasm interpreter; owi script: an interpreter for Wasm scripts; owi sym:

                        GitHub - OCamlPro/owi: OCaml WebAssembly Interpreter
                      • 世界のプログラミング言語(27) デキるやつが使ってる『OCaml』は実用的な関数型言語

                        OCamlは関数型言語の一つで、実用性の高さで人気があります。オブジェクト指向や強い静的型付けなどの特徴を持ち、実行速度がC言語並みに速いことも特徴の一つです。筆者の中ではデキるプログラマーが好んで使っているイメージがあります。Microsoftが開発した.NET対応言語のF#をはじめ、多くの言語にも大きな影響を与えました。今回は、OCamlについて紹介します。 OCamlのWebサイト OCamlについて OCamlは、もともとプログラミング言語ML言語の方言の一つです。もともと、「Objective Caml」という名前でしたが、OCamlに改名されました。つまり、OCamlのOはオブジェクト指向のOなのです。1996年にフランスのINRIA(フランス国立研究所)で開発されました。 残念ながら原稿執筆時点では、TIOBE Indexなどの人気プログラミング言語ベスト50にはランクインし

                          世界のプログラミング言語(27) デキるやつが使ってる『OCaml』は実用的な関数型言語
                        • OCamlの型検査は決定不能

                          1990年代から(少なくとも一部の人に)知られていることですが、OCamlの型検査は決定不能です。この文書では、ML系モジュールシステムにおけるシグネチャマッチングの仕組みを説明した後、OCamlの型検査器がどのように無限ループに陥るかを確認します。 シグネチャマッチングML系言語において、シグネチャは、モジュールのインターフェイスを表すために用いられます。あるモジュールが何らかのシグネチャに適合していることを保証するためにsignature ascriptionという機構があります。 Standard MLでは、M : SやM :> Sという風に書くと、モジュールMがシグネチャSに適合していることを保証できます。M : Sはtransparent signature ascriptionと呼ばれ、M :> Sはopaque signature ascriptionと呼ばれます。 シグネチ

                          • OCamlとCoqでブロックチェーンプログラミング

                            2019年7月29日、Opt Technologiesが主催するイベント「Fun Fun Functional (2) 関数型言語Lightning Talks!!」が開催されました。関数型プログラミングについて楽しく学び、知見を共有することを目的に開催されている本勉強会。今回は6名のエンジニアが、関数型プログラミング言語にまつわるユニークな発表を行いました。プレゼンテーション「OCamlとCoqでブロックチェーンプログラミング 」に登壇したのは、yoshihiro503氏。 OCamlとCoqでブロックチェーンプログラミング yoshihiro503氏(以下、yoshihiro503):みなさんこんにちは。こういう鶏のアイコンのyoshihiro503です。今日「OCamlは良いぞ!」という話をします。株式会社ドワンゴのDMC開発部に所属しています。 簡単に自己紹介を

                              OCamlとCoqでブロックチェーンプログラミング
                            • OCamlコンパイラのバックエンドを提供するMalfunctionが面白そう - Arantium Maestum

                              OCamlのDiscuss掲示板を眺めていたらこんなプロジェクトについての言及があった: github.com Malfunction is a high-performance, low-level untyped program representation, designed as a target for compilers of functional programming languages. OCamlコンパイラの中間表現であるLambda言語(とほぼ同等のもの)を受け取り、OCamlバイトコードかnativeコードへのコンパイルをしてくれるようだ。 (追記:バイトコードにコンパイルできるというのは間違い。実際にはOCamlコンパイラとは別なLambda言語インタプリタがある) Lambda IRはOCamlコンパイラにフラグを渡すと出力してくれる。以前少し調べていくつか記事

                                OCamlコンパイラのバックエンドを提供するMalfunctionが面白そう - Arantium Maestum
                              • Writing a Game Boy Emulator in OCaml

                                IntroductionFor the past few months, I have been working on a project called CAMLBOY, a Game Boy emulator written in OCaml that runs in the browser. You can try it out on the following demo page: Demo Page I included several homebrew ROMs in the demo, so please try them out (I recommend Bouncing ball and Rocket Man Demo). You can also play with it in your mobile browser as it runs at 60 FPS on rec

                                  Writing a Game Boy Emulator in OCaml
                                • Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCaml

                                  Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCamlby Isabella Leandersson, Thomas Leonard, and Anil Madhavapeddy on Mar 20th, 2024 The OCaml 5 update brought much-anticipated support for programming on multiple cores. It also introduced support for concurrency via effect handlers – one of the first mainstream languages to do so. This significant update has had profound performa

                                    Eio 1.0 Release: Introducing a new Effects-Based I/O Library for OCaml
                                  • Leaving OCaml

                                    Part of a 3 part series. Followups on F#, Rust I built the first demo of Dark in Python, in about two weeks. A few months later when I started productizing it, I rebuilt it in OCaml. Back in 2017, when I was considering the language and platform to use for Dark, OCaml was extremely compelling: it's a high-level language with static types, so easy to make large scale changes as we figure out what t

                                      Leaving OCaml
                                    • 知らない言語を使ってみたい - ReasonML編 (OCaml な AltJS) - Qiita

                                      これだけで導入は完了。Windows でも問題なし。素晴らしい。 エディタ支援 Editor Plugins - Reason VS Code が推奨されているので、素直にそれを使う。 これまでは、以下のプラグインを利用していたが、 https://marketplace.visualstudio.com/items?itemName=freebroccolo.reasonml 今後は公式に作られている以下プラグインの方が良いだろう。 https://marketplace.visualstudio.com/items?itemName=jaredly.reason-vscode サンプル体験 コードの書き心地をするだけなら、Playground が用意されているが、実際の開発をイメージするためにローカルで始める。 プロジェクト作成 $ bsb -init sample_1206 -the

                                        知らない言語を使ってみたい - ReasonML編 (OCaml な AltJS) - Qiita
                                      • Haskell vs OCaml

                                        haskell Published on December 6, 2019, last updated December 11, 2019 This is a comparison between the two languages by someone who has written code professionally in both. That said, I’m much more familiar with Haskell than with OCaml, so if you think there is a mistake in the text, let me know. Background and users Haskell is a niche, rarely used language. The situation is changing, but make no

                                        • First thoughts on Rust vs OCaml

                                          I'm about two weeks into Rust now, so this feels like a good time to write a critique, before I get Stockholm Syndrome'd. My main motivation in learning Rust is that I have to maintain some of Dark's Rust code. There was a recent outage related to that code, and I had to learn on the fly, so better to actually know what I'm looking at. I've also been dreaming of rewriting Dark in Rust for quite so

                                            First thoughts on Rust vs OCaml
                                          • OCamlの開発環境2019末

                                            この記事は株式会社オープンストリームアドベントカレンダーの3日目の記事です。 年の瀬ということで、いい感じに部屋が冷えてきてちょうどよいです。さて、 あまりネタがない 今回はOCamlの開発環境について書こうかと思います。 以前にも書いたんですが、ちょっとした更新とか、結構大きな更新とかがあったので、まとめということで。 Package Manager opam (OCaml Package Manager)でどうぞ。現状、過去から受け継がれているとかで無い限り、これを使わない理由は皆無になりました。 version 2.0からは、ローカルのパッケージを簡単に追加できるようになっているので、このパッケージが更新されない・・・とかにも対応することが出来たりします。 Windowsへのクロスコンパイルなどの用途でも利用できるものなので、まー大人しく使っておきましょう。なお、Windows用のバ

                                            • Real World OCaml

                                              PrologueWhy OCaml?A Brief HistoryThe Base Standard LibraryThe OCaml PlatformAbout This BookWhat to ExpectInstallation InstructionsCode ExamplesContributorsPart 1: Language Concepts1. A Guided TourBase and CoreOCaml as a CalculatorFunctions and Type InferenceType InferenceInferring Generic TypesType Errors Versus ExceptionsTuples, Lists, Options, and Pattern MatchingTuplesOperators in Base and the

                                              • OCamlで48 Hour Schemeをやってみる その5 (第九、十章) - Arantium Maestum

                                                Write Yourself a Scheme in 48 Hoursの最後の二章をやっていく。入出力と標準ライブラリ作成。 第九章:入出力 stdin, stdoutやファイルに対する入出力を実装する。 github.com 例によって「Haskellだとモナドが出現していろいろ型を頑張らないといけないけどOCamlだから・・・」という案件。 HaskellではIOモナド型のために新しいIOFunc式を用意したりしているが、OCamlだと普通に今まで通りPrimitiveFuncに放り込んでいける。 type expt = (* 省略 *) | PortIn of in_channel | PortOut of out_channel と入出力用のchannelをラップしたPortIn/PortOut式は用意する。あとはIoモジュールでそれを使う関数を定義し、primitives.mlで

                                                  OCamlで48 Hour Schemeをやってみる その5 (第九、十章) - Arantium Maestum
                                                • OCaml 5.0.0 is out!

                                                  We have the pleasure of celebrating the birthdays of Jane Austen and Arthur C. Clarke by announcing the release of OCaml version 5.0.0. The highlight of this new major version of OCaml is the long-awaited runtime support for shared memory parallelism and effect handlers. This multicore support is the culmination of more than 8 years of effort, and required a full rewrite of the OCaml runtime envir

                                                  • Sketch.sh - Interactive ReasonML/OCaml sketchbook

                                                    Sketching ReasonML/OCaml code with inline evaluation results

                                                    • プログラミング in OCaml 〜関数型プログラミングの基礎からGUI構築まで

                                                      プログラミング in OCaml 〜関数型プログラミングの基礎からGUI構築まで〜 (GIHYO Digital Publishing, amazon, 楽天Kobo, yahoo, cbook24.com) PDF/EPUB 版を販売しているGIHYO Digital Publishing のページ おしらせ EPUB版が GIHYO Digital Publishing, Amazon, 楽天Koboで販売開始です.GIHYO Digital Publishing だと pdf とのセット販売(価格は同じ)です. (2014.12.10) 長い間,出版社在庫切れとなっていましたが,この度,細かい修正を施した pdf 版の販売を GIHYO Digital Publishing にて開始しました.価格は 1,400 円と冊子体の半額です! (2012.08.29) 第16章のプログラム

                                                      • OCamlでできるだけ型注釈を書かずに済ませる - Qiita

                                                        これはAdvent Calendarとか関係なくなんとなく書かれた記事です。 ML系言語で型注釈が必要なケース - Qiita にある通り、OCamlには型注釈なしではコンパイルが通らないケースがいくつかある。 そのような場合でも、別の書き方をすることで型注釈なしで済ませる/より少ない型注釈で済ませる方法を紹介する。 GADTs type 'a t = | Int : int -> int t | Bool : bool -> bool t let f : type a. a t -> int -> bool = fun t y -> match t with | Int x -> y >= 2 | Bool x -> x このケースでは、型注釈を付けないと、 Int x の時点で f の型が int t -> int -> bool に確定してしまい、 Bool x : bool t ≠

                                                          OCamlでできるだけ型注釈を書かずに済ませる - Qiita
                                                        • OCamlでMonadic Parserを作ってみる(前編) - Arantium Maestum

                                                          OCaml 4.08でmonadic/applicative letの構文が入ったことだし、これを使ってみよう、ということでHaskellのParsecのようなMonadic Parser Combinatorが作れるか試してみた。 具体的にはGraham HuttonのProgramming in Haskellの13章にあたる「Monadic parsing」の章をOCamlで追ってみたい。 Parser型 Huttonの例ではParserは newtype Parser a = P (String -> [(a, String)]) となっている。文字列を受け取り、パースが失敗したら空リスト、成功したらパースした結果と残りの文字列のタプルが唯一の要素のリストを返す。 OCamlに訳すにあたって三つ変えてみる: コンストラクタを使わない。Haskellではtypeclassのインスタン

                                                            OCamlでMonadic Parserを作ってみる(前編) - Arantium Maestum
                                                          • Two Years of OCaml

                                                            The other day I saw this post on OCaml discussed in Hacker News and Lobsters. Almost two years ago I rewrote the Austral compiler from Standard ML to OCaml, so I thought I’d share my thoughts on OCaml after using it in writing a complex software project, explaining what is good and what is bad and how it compares mainly to Haskell. If this seems overwhelmingly negative, it’s because the things OCa

                                                              Two Years of OCaml
                                                            • Learn Lambda Calculus in 10 minutes with OCaml

                                                              I'm going to teach you the basics of Lambda Calculus really quickly. Lambda Calculus is deep. But I'm covering only the fundamentals here. What is Lambda Calculus? Lambda Calculus (LC) is a model to describe computations. LC describes the syntax and semantics. Syntax A lambda expression (also known as lambda term) can be one of the following three things: Variable Application Abstraction Variable

                                                                Learn Lambda Calculus in 10 minutes with OCaml
                                                              • OCaml 入門その4 モジュール・ファンクタ - Qiita

                                                                プログラムの部品だが、OCaml では ストラクチャと呼ぶ。 OCamlのライブラリは全てモジュール(ストラクチャ)として提供される。 ファイル名がモジュール名 example.ml というファイル名 → Example というモジュール。 標準モジュール OCaml組み込みのモジュール郡 (* リスト *) # List.length [1; 2; 3];; - : int = 3 # let q = Queue.create ();; val q : '_a Queue.t = <abstr> (* キュー *) # Queue.add "first" q;; - : unit = () # Queue.take q;; - : string = "first" # Queue.take q;; Exception: Queue.Empty. (* 配列 *) # Array.make

                                                                  OCaml 入門その4 モジュール・ファンクタ - Qiita
                                                                • GitHub - Ekdohibs/camlboot: Experiment on how to bootstrap the OCaml compiler

                                                                  camlboot is an experiment on the boostraping of the OCaml compiler. It is composed of: An interpreter of OCaml, in the directory interpreter/, which is able to interpret the OCaml compiler. This interpreter is written in a subset of OCaml called miniml, for which a compiler is available as part of the experiment. A compiler for miniml, in the directory miniml/compiler/. This compiler compiles mini

                                                                    GitHub - Ekdohibs/camlboot: Experiment on how to bootstrap the OCaml compiler
                                                                  • ocamllexのlexerとmenhirのparserの間に任意のOCamlコードによる変換を挿入する - Arantium Maestum

                                                                    OCamlでパーサを書く場合 lexerをocamllexで書く そのlexerを受け取るparserをmenhirで書く というのが最近の鉄板のようだ。 let lexbuf = Lexing.from_channel stdin in let exp = Parser.f Lexer.f lexbuf in print (eval exp) というような流れ。 ocamllexもmenhirも構文が普通のOCamlではなく、いったん独自構文で書かれた.mll/.mlyファイルを両ツールでOCamlの.mlに変換してから普通のOCamlモジュールとして使う。 なので長らくぱっと見どうやってocamllex製のlexerが返すトークンに対して任意の変換を行ってからmenhir製のparserに渡せばいいのか、イメージが湧かなかった。 しかし実際にやってみたら拍子抜けするほど簡単。 パースし

                                                                      ocamllexのlexerとmenhirのparserの間に任意のOCamlコードによる変換を挿入する - Arantium Maestum
                                                                    • GitHub - yawaramin/dream-html: Render HTML, SVG, MathML, htmx markup from your OCaml Dream backend server

                                                                      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                                        GitHub - yawaramin/dream-html: Render HTML, SVG, MathML, htmx markup from your OCaml Dream backend server
                                                                      • How to print anything in OCaml

                                                                        ONE of the big benefits of OCaml is its powerful REPL (also called the toplevel), the interactive command-line utility where you can load modules, type in and execute code, and see its results. The modern REPL, utop, has powerful auto-completion and integration with the build system dune, which enables productive workflows like loading an entire project's libraries in the REPL and interactively ex

                                                                          How to print anything in OCaml
                                                                        • Improving the dead code elimination algorithm in js_of_ocaml - Micah Cantor

                                                                          I'm looking for a full-time software engineering position starting in January 2024. If you or your team is hiring, please reach out! Introduction This summer I worked as a software engineer intern at Tarides from their Paris office. My project centered on improving the dead code elimination algorithm in the OCaml to JavaScript compiler, js_of_ocaml. In this post, I'll give some background on why t

                                                                            Improving the dead code elimination algorithm in js_of_ocaml - Micah Cantor
                                                                          • Oxidizing OCaml: Locality

                                                                            OCaml with Jane Street extensions is available from our public opam repo. Only a slice of the features described in this series are currently implemented. Rust, OCaml, and Resource Management Coming from OCaml, the Rust programming language has many appealing features. Rust’s system for tracking lifetime and ownership allows users to safely express patterns that are awkward in OCaml, such as: Stac

                                                                              Oxidizing OCaml: Locality
                                                                            • Docker上にOCaml+Coqの環境を構築して動かしてみるまで - Qiita

                                                                              はじめに CoqをDocker上にインストールしたのでその手順をまとめます。 CoqのコードはOCamlに変換できるので、変換したコードをOCamlから呼び出してみます。 Dockerのインストールは済んでいる前提で進めていきます。 OPAMのインストール OCaml、CoqをインストールするためにまずOPAMをインストールします。 OPAMはOCamlのパッケージマネージャです。 OPAMをインストールするとOCamlは自動的に入りますが古いバージョンなので新しいバージョンを別にインストールします。 Alpine Linuxのコンテナを起動します。

                                                                                Docker上にOCaml+Coqの環境を構築して動かしてみるまで - Qiita
                                                                              • OCaml4.08のmonadic/applicative let/andについて - Arantium Maestum

                                                                                OCaml4.08でシンタックスシュガーとしてlet*、let+、and+などの構文が新たに導入された。 詳細については jobjo.github.io がわかりやすかった。 直接モナドやApplicativeをサポートする構文というよりは、 let (let*) x f = g x f などと好きに定義すれば let* x = a in h x が脱糖されて g a (fun x -> h x) になる、ということのようだ。モナドだったらlet (let*) x f = bind x f、Applicativeだったらlet (let+) x f = map f xにすればうまくいく。 let (let+) x f = map f x let (let*) x f = bind x f let+ x = a in g x (* desugars to map (fun x -> g x)

                                                                                  OCaml4.08のmonadic/applicative let/andについて - Arantium Maestum
                                                                                • R5RSのformal semanticsをOCamlで書いた

                                                                                  R5RSのformal semanticsをOCamlで書いた 背景 bitのバックナンバーを読んでいたら見つけた 「プログラム検証入門」という記事(1980年9月〜12月号掲載)が非常に面白かった。 その記事に参考文献として載っていた 「数理情報学入門―スコット・プログラム理論」という本を買ってみたら、 これまたすごく面白かった。 この本で使っている記号が、R5RSのformal semanticsで使っている記号と 大体同じであることを思い出し、R5RSのformal semanticsを読み直してみたら、 以前よりしっかり理解できて、これまた非常に楽しかった。 楽しかったのだが、 call-with-valuesの定義 がおかしいことに気づいた。 cwv: E* -> K -> C [call-with-values] cwv = twoarg(λε1ε2κ.applicate ε1