File: polytypes.ml

package info (click to toggle)
ocamlformat 0.28.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,436 kB
  • sloc: ml: 63,321; pascal: 4,769; lisp: 229; sh: 217; makefile: 121
file content (49 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (2)
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
48
49
let t1 : 'a 'b. 'a t -> b t = ()

let t2 :
    'a 'b.
       'a t________________________________
    -> 'b t_______________________________________ =
  ()

let t3 :
    'long 'sequence 'of_ 'universally 'quantified 'type_ 'variables 'that
    'must 'wrap.
       'a t_________________________________________________
    -> 'b t______________________________________________________________
    -> 'c t______________________________________________________________ =
  ()

let t4 :
    'long 'sequence 'of_ 'universally 'quantified 'type_ 'variables 'that
    'must 'wrap.
    'a t_________________________________________________
    * 'b t______________________________________________________________
    * 'c t______________________________________________________________ =
  ()

let foo : type a. a =
  (* aaaaaa *)
  failwith "foo"

class c =
  let id : 'a. 'a -> 'a = fun x -> x in
  object end

let _ =
  let id : 'a. 'a -> 'a = fun x -> x in
  ()

let equal_list :
    'a. ('a, 't) gexpr marked list -> ('a, 't) gexpr marked list -> bool =
 fun es1 es2 ->
  try List.for_all2 equal es1 es2 with Invalid_argument _ -> false

let rec equal_list :
    'a. ('a, 't) gexpr marked list -> ('a, 't) gexpr marked list -> bool =
 fun es1 es2 ->
  try List.for_all2 equal es1 es2 with Invalid_argument _ -> false

and equal : 'a. ('a, 't) gexpr marked -> ('a, 't) gexpr marked -> bool =
 fun (type a) (e1 : (a, 't) gexpr marked) (e2 : (a, 't) gexpr marked) ->
  match (Marked.unmark e1, Marked.unmark e2) with x -> x