サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ブックレビュー
ocaml.org
OCaml Programming Guidelines This is a set of reasonable guidelines for writing OCaml programs that reflect the consensus among veteran OCaml programmers. OCaml source code can be formatted automatically with OCamlFormat, so you don't have to worry about formatting it by hand. You can speed up code review by just focusing on the important parts. Nevertheless, some best practices are not automated,
NotesIn C the header files describe the functions, etc., but only by convention. In OCaml, the *.mli file is the exported signature of the module, and the compiler strictly enforces it. In most cases for a module called Foo you will find two files: foo.ml and foo.mli. foo.ml is the implementation and foo.mli is the interface or signature. Notice also that the first letter of the file is turned to
Objects Objects and Classes OCaml is an object-oriented, imperative, functional programming language. It mixes all these paradigms and lets you use the most appropriate (or most familiar) programming paradigm for the task at hand. In this chapter, we're going to look at object-oriented programming in OCaml, but we'll also talk about why you might or might not want to write object-oriented programs
Profiling Speed Why is OCaml fast? Indeed, step back and ask is OCaml fast? How can we make programs faster? In this chapter we'll look at what actually happens when you compile your OCaml programs down to machine code. This will help in understanding why OCaml is not just a great language for programming, but is also a very fast language indeed. And it'll help you to help the compiler write bette
GNU make でのコンパイル OCamlMakefile と組み合わせて GNU make を使う OCamlMakefile は、 複雑なOCamlプロジェクトのコンパイル作業をとても楽にする生成的な Makefile だ。 標準のライブラリのみを使う基本的なOCamlプログラムやライブラリについては、 単にカレントディレクトリにOCamlMakefileをコピーし、 以下の Makefile を作成する: RESULT = myprogram SOURCES = \ mymodule1.mli mymodule1.ml \ myparser.mli myparser.mly mylexer.mll mymodule2.ml \ mymainprogram.ml OCAMLMAKEFILE = OCamlMakefile include $(OCAMLMAKEFILE) これは5つの
You can explore the OCaml documentation, Platform Tools, guides, exercises, and books to enhance your knowledge.
Modules Basic Usage File-Based Modules In OCaml, every piece of code is wrapped into a module. Optionally, a module itself can be a submodule of another module, pretty much like directories in a file system - but we don't do this very often. When you write a program, let's say using two files amodule.ml and bmodule.ml, each of these files automatically defines a module named Amodule and a module n
☰The OCaml languageThe OCaml languageLanguage extensions Chapter 12 Language extensions This chapter describes language extensions and convenience features that are implemented in OCaml, but not described in chapter 11.
Functional Programming What Is Functional Programming? We've got quite far into the tutorial, yet we haven't really considered functional programming. All the features given so far (rich data types, pattern matching, type inference, nested functions) could exist in a "super C" language. These are cool features that make your code concise, easy to read, and have fewer bugs; however, they actually h
If Statements and Recursions As in other OCaml.org documentation, the code examples will either be something you can test or an example of code. Code snippets that begin with the CLI prompt #, end with ;;, and have a clear output can be tested in the OCaml toplevel (ocaml or utop) or pasted into the OCaml playground. If the code doesn't start with # and end in ;;, it's an example of how to write t
Compiling OCaml Projects This tutorial explains how to compile your OCaml programs into executable form. It addresses, in turn: The compilation commands ocamlc and ocamlopt provided with OCaml. It is useful to learn these commands to understand OCaml's compilation model. The ocamlfind front-end to the compiler, which saves you from worrying about where libraries have been installed on your particu
Data Types and Matching In this tutorial, we learn how to build our own types in OCaml and to write functions that process this new data. Please note throughout this tutorial the code is written in the ocaml toplevel. Whereas # denoted a comment and $ the command prompt in the Up & Running document, when in the ocaml or utop toplevel, the command prompt appears as a #, as shown in the following ex
sectionYPositions = computeSectionYPositions($el), 10)" x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)" class="pr-5" > Exercise Categories Lists Tail of a List Last Two Elements of a List N'th Element of a List Length of a List Reverse a List Palindrome Flatten a List Eliminate Duplicates Pack Consecutive Duplicates Run-Length Encoding Modified Run-Length Encoding
These companies and organizations rely on OCaml every day — along with thousands of other developers. Case Studies Read how OCaml users are solving real-world problems and how OCaml was a key to their success.
# let square x = x * x val square : int -> int = < fun > # square 3 - : int = 9 # let rec fac x = if x <= 1 then 1 else x * fac (x - 1) val fac : int -> int = < fun > # fac 5 - : int = 120 # square 120 - : int = 14400
fprintf outchan format arg1 ... argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan. The format string is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing of arguments.
Index of modules Index of module types Index of types Index of exceptions Index of values Index of keywords Xavier Leroy, Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon
If you want to contribute a blog post, or add your RSS feed, check out the Contributing Guide on GitHub.
(search values, type signatures, and descriptions - case sensitive)ⓘ You may search bare values, like map, or indicate the module, like List.map, or type signatures, like int -> float.To combine several keywords, just separate them by a space. Quotes can be used to prevent from splitting words at spaces. For instance, int array will search for int and/or array, while "int array" will only list fun
Functor building an implementation of the weak hash set structure.
このページを最初にブックマークしてみませんか?
『Welcome to a World of OCaml』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く