summaryrefslogtreecommitdiffhomepage
path: root/ocaml.html.markdown
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-09-12 19:42:50 +0700
committerDaniil Baturin <daniil@baturin.org>2014-09-12 19:42:50 +0700
commit3995be4f4bf518e2c3436632ec100c14bb47bda1 (patch)
tree60d309c9d7b3d84368b3fa427df00c63123cc43d /ocaml.html.markdown
parent962d58d013fa245c6b61863d2d14420c4c563743 (diff)
Break some long lines in OCaml tutorial to avoid horizontal scrolling.
Diffstat (limited to 'ocaml.html.markdown')
-rw-r--r--ocaml.html.markdown11
1 files changed, 6 insertions, 5 deletions
diff --git a/ocaml.html.markdown b/ocaml.html.markdown
index 1732f7be..41bc4ff2 100644
--- a/ocaml.html.markdown
+++ b/ocaml.html.markdown
@@ -81,7 +81,8 @@ let foo = 1 ;;
let foo' = foo * 2 ;;
(* Since OCaml compiler infers types automatically, you normally don't need to
- specify argument types explicitly. However, you can do it if you want or need to. *)
+ specify argument types explicitly. However, you can do it if
+ you want or need to. *)
let inc_int (x: int) = x + 1 ;;
(* You need to mark recursive function definitions as such with "rec" keyword. *)
@@ -285,8 +286,8 @@ let l = Cons (1, EmptyList) ;;
languages, but offers a lot more expressive power.
Even though it may look complicated, it really boils down to matching
- an argument against an exact value, a predicate, or a type constructor. The type system
- is what makes it so powerful. *)
+ an argument against an exact value, a predicate, or a type constructor.
+ The type system is what makes it so powerful. *)
(** Matching exact values. **)
@@ -328,8 +329,8 @@ say (Cat "Fluffy") ;; (* "Fluffy says meow". *)
(* Recursive types can be traversed with pattern matching easily.
Let's see how we can traverse a datastructure of the built-in list type.
- Even though the built-in cons ("::") looks like an infix operator, it's actually
- a type constructor and can be matched like any other. *)
+ Even though the built-in cons ("::") looks like an infix operator,
+ it's actually a type constructor and can be matched like any other. *)
let rec sum_list l =
match l with
| [] -> 0