Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ocaml object system can also achieve this in a quite lightweight way

    type foo = < foo:int >
    type bar = < bar:int >
    type k = < foo; bar >
    type u = < k; baz:int >
    let f (x: <u; ..>) (\* the type annotation is not needed \*) = x#m


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: