Source

ocamlspot / tests / test13.ml

type (* type t => *) t (* <= type t *) = (* Foo => *) Foo (* <= Foo *) | (* Bar => *) Bar (* <= Bar *) of int 

let _ = Foo (* ? Foo *)
let _ = Bar (* ? Bar *) 1

type u = A of v (* ? type v *)
and (* type v => *) v (* <= type v *) = (* B => *) B (* <= B *) of u | (* C => *) C  (* <= C *)

let _ = A C (* ? C *)
let _ = B (* ? B *) (A C)

type (* type x => *) x (* <= type x *) = { (* x.y => *) y (* <= x.y *) : int } 

let (* x => *) x (* <= x *) = { y = 1 } (* ? type x *)

let _ = function Foo (* ? Foo *) -> 1 | Bar (* ? Bar *) n -> n

let _ = 
  match { y = 1 } (* ? type x *) with
  | { y (* ? x.y *) = (* n => *) n (* <= n *) } (* ? type x *) -> n (* ? n *)

let _ = x(* ? x *).y (* ? x.y *) 

let _ = fun ((* fun x => *) x (* <= fun x *) : t (* ? type t *)) -> x (* ? fun x *) 

let _ = (1 : int)

type 'a (* type tt => *) tt (* <= type tt *) = Null | Cons of 'a * 'a tt (* ? type tt *) 


type 'a uu = Foo of 'a vv (* ? type vv *)
and 'a (* type vv => *) vv (* <= type vv *) = Bar of 'a uu 

module M = struct
  type (* type typ => *) typ (* <= type typ *) = (* M.F => *) F (* <= M.F *)
  let (* value typ => *) typ (* <= value typ *) = 1
end

type mt = M.typ (* ? type typ *)

let _ = (M.F (* ? M.F *) : M.typ (* ? type typ *))
let _ = M.typ (* ? value typ *)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.