File: default.txt

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (47 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* This is a
   multiline
   comment */

type point = {
  x: float,
  y: float,
};

let some_string = "this is a string";

let rec length = lst =>
  switch (lst) {
  | [] => 0
  | [head, ...tail] => 1 + length(tail)
  };

type result('a, 'b) =
  | Ok('a)
  | Error('b);

let promisify = (res: result('a, 'b)) : Js.Promise.t('a) =>
  switch (res) {
  | Ok(a) => Js.Promise.resolve(a)
  | Error(b) => Js.Promise.reject(b)
  };

exception Test;

module MakeFFI = (T: {type t;}) => {
  [@bs.module] external ffi : string => T.t = "";
};

type expression =
  | Const(float)
  | Var(string)
  | Sum(expression, expression) /* e1 + e2 */
  | Diff(expression, expression) /* e1 - e2 */
  | Prod(expression, expression) /* e1 * e2 */
  | Quot(expression, expression); /* e1 / e2 */

class point = {
  as _;
  val mutable x = 0;
  pub get_x = x;
  pri move = d => x = x + d;
};