]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/ng_refiner/nRstatus.ml
Simplest typing for status records.
[helm.git] / helm / software / components / ng_refiner / nRstatus.ml
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 (* $Id: nCicRefiner.ml 9802 2009-05-25 15:39:26Z tassi $ *)
13
14 class type g_status =
15  object
16   inherit NCicCoercion.g_status
17   inherit NCicLibrary.g_status
18  end
19
20 class status =
21  object (self)
22   inherit NCicCoercion.status
23   inherit NCicLibrary.status
24   method set_rstatus
25    : 'status. #g_status as 'status -> 'self
26    = fun o -> (self#set_coercion_status o)#set_library_status o
27  end
28
29 type sstatus = status
30
31 module Serializer =
32  struct
33   include NCicLibrary.Serializer(struct type status = sstatus end)
34
35   let require ~baseuri status = 
36    let rstatus = require ~baseuri (status : #status :> status) in
37    let status = status#set_coerc_db (rstatus#coerc_db) in
38    let status = status#set_uhint_db (rstatus#uhint_db) in
39    let status = status#set_timestamp (rstatus#timestamp) in
40     status 
41  end
42
43 class type g_dumpable_status =
44  object
45   inherit g_status
46   method dump: Serializer.obj list
47  end
48
49 class dumpable_status =
50  object
51   inherit status
52   val dump = ([] : Serializer.obj list)
53   method dump = dump
54   method set_dump v = {< dump = v >}
55   method set_dumpable_status
56    : 'status. #g_dumpable_status as 'status -> 'self
57    = fun o -> {< dump = o#dump >}#set_rstatus o
58  end