Hi,
I'm using the structural subtyping aspects of Ocaml's object system to emulate
width
subtyping. I've come across a problem which does not type-check, though
intuitively
it seems correct. I reckon that the compiler may need some help in the form of
type
annotations and/or coercions,
Hi, the following seems to do the trick (?) :
Le 28 mars 10 à 18:38, Dario Teixeira a écrit :
let rec step1 ?story () = match story with
| Some s - step2 s#title
| None - step2 title1
and step2 title =
let story =
object
Dario Teixeira a écrit :
A simple nonsensical example that illustrates the problem is listed below; the
type-checking error occurs in function step1, where the optional parameter
story
is used as an object of type title:string; .. . In function step3,
this
parameter story is actually
Hi,
On Sun, 28 Mar 2010 19:32:37 +0200, Stéphane Glondu wrote:
type steps = {
step1 : 'a. ?story:(title : string; .. as 'a) - unit - bool;
step2 : string - bool;
step3 : 'a. story:(title : string; count : int; .. as 'a) - bool
}
let rec steps = { [...]
IMHO, recursive modules
On Sun, Mar 28, 2010 at 2:24 PM, Stefan Ratschan
stefan.ratsc...@cs.cas.cz wrote:
The printing of Big_int is possible and AFAIK Big_int is an abstract
data type.
let print_big_int (value_big_int:Big_int.big_int) =
Format.printf %s (Big_int.string_of_big_int value_big_int);;
I see,
Hi,
I'm using the structural subtyping aspects of Ocaml's object system to
emulate width
subtyping. I've come across a problem which does not type-check, though
intuitively
it seems correct. I reckon that the compiler may need some help in the form
of type
annotations and/or
CALL FOR PAPERS
APLAS 2010
Eighth Asian Symposium on Programming Languages and Systems
Shanghai, China
November 28-December 1, 2010