Commit 62e3ca6b authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-24 19:55:27 by cvscast] Samples again

Original author: cvscast
Date: 2003-05-24 19:55:27+00:00
parent 28bde346
......@@ -98,12 +98,12 @@ runtime/value.cmx: types/atoms.cmx types/builtin.cmx types/chars.cmx \
types/types.cmx runtime/value.cmi
driver/cduce.cmo: parser/ast.cmo types/builtin.cmo runtime/eval.cmi \
types/ident.cmo parser/location.cmi parser/parser.cmi types/patterns.cmi \
misc/state.cmi typing/typed.cmo typing/typer.cmi types/types.cmi \
runtime/value.cmi parser/wlexer.cmo driver/cduce.cmi
types/sample.cmi misc/state.cmi typing/typed.cmo typing/typer.cmi \
types/types.cmi runtime/value.cmi parser/wlexer.cmo driver/cduce.cmi
driver/cduce.cmx: parser/ast.cmx types/builtin.cmx runtime/eval.cmx \
types/ident.cmx parser/location.cmx parser/parser.cmx types/patterns.cmx \
misc/state.cmx typing/typed.cmx typing/typer.cmx types/types.cmx \
runtime/value.cmx parser/wlexer.cmx driver/cduce.cmi
types/sample.cmx misc/state.cmx typing/typed.cmx typing/typer.cmx \
types/types.cmx runtime/value.cmx parser/wlexer.cmx driver/cduce.cmi
driver/run.cmo: driver/cduce.cmi types/ident.cmo parser/location.cmi \
types/sequence.cmi misc/state.cmi runtime/value.cmi parser/wlexer.cmo
driver/run.cmx: driver/cduce.cmx types/ident.cmx parser/location.cmx \
......
......@@ -26,7 +26,10 @@ let rec get memo t =
try try_seq typ [ Types.Int.any; Types.Atom.any; Types.Char.any ] with Not_found ->
try try_seq pair (Types.Product.get t) with Not_found ->
try try_seq xml (Types.Product.get ~kind:`XML t) with Not_found ->
try try_seq record (Types.Record.get t) with Not_found ->
try
let r = Types.Record.get t in
let r = List.sort (fun (_,_,n1) (_,_,n2) -> -(compare n1 n2)) r in
try_seq record r with Not_found ->
try Types.Arrow.sample t with Not_found ->
raise Not_found
......
......@@ -7,7 +7,7 @@ val get : Types.descr -> t
using products, XML elements and records, without recursion nor
boolean combination.
The simpler type is not a subtype because of arrows...
The simpler type is not a subtype because of arrows and records.
Interpretation of this subtype, to extract sample values:
- basic type: pick a value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment