search for: llglobalvalu

Displaying 4 results from an estimated 4 matches for "llglobalvalu".

Did you mean: llglobalvalue
2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
...antage is that if we want to add another type we have to edit all the type definitions. This also means that we can't add another library that subclasses from something and still use these functions: type 'a t type llfunction = [ `Function ] type llglobalvariable = [ `GlobalVariable ] type llglobalvalue = [ llfunction | llglobalvariable ] type llconstant = [ `Constant ] type llvalue = [ llconstant | llglobalvalue ] val value_name : [< llvalue] t -> string val is_null : [< llconstant] t -> bool val is_declaration : [< llglobalvalue] t -> bool val is_global_constant : [< llg...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
...> sacrifices some type safety, as we're saying that the arguments are > a superset of the variants. We can control this by limiting who can > create 't's: > > type 'a t > > type llvalue = [ `Value ] > type llconstant = [ llvalue | `Constant ] > type llglobalvalue = [ llvalue | `GlobalValue ] > type llglobalvariable = [ llglobalvalue | `GlobalVariable ] > type llfunction = [ llglobalvalue | `Function ] > > val value_name : [> `Value] t -> string > val is_null : [> `Constant] t -> bool > val is_declaration : [> `GlobalValue]...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick, On 2008-03-15, at 04:03, Erick Tryzelaar wrote: > I was talking to Gordon on #llvm earlier, and he challenged me with > coming up with a way to improve the ocaml binding's type safety. I > think I got an easy solution with phantom types. This could be a good step. I'm not sure I can predict all of the implications; I'd suggest you work up a proof of concept.
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast