package fmlib

  1. Overview
  2. Docs
Functional monadic library

Install

Dune Dependency

Authors

Maintainers

Sources

0.1.0.tar.gz
sha256=0558665285e4d7691e5a80c90ab05a7acb86c09f03ceef6589f150f6d3574573
md5=fb61f4d6e7233cf8d1d71758e6110c1e

doc/src/fmlib.fmlib_parse/position.ml.html

Source file position.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
type t =
    {line: int; column: int}

type range = t * t

let line (p: t): int =
    p.line

let column (p:t): int =
    p.column

let start: t =
    {line = 0; column = 0}

let next_column (p: t): t =
    {p with column = p.column + 1}

let next_line (p: t): t =
    {line = p.line + 1; column = 0;}

let next (c: char) (p: t): t =
    if c = '\n' then
        next_line p
    else
        next_column p
OCaml

Innovation. Community. Security.