inline-rust
inline-rust copied to clipboard
Support more types
I think we will want:
| Haskell | Rust argument | Status |
|---|---|---|
StorableArray Int a |
&mut [a'] |
see https://github.com/harpocrates/inline-rust/issues/12 |
Vector a |
Vec<a'> |
|
StablePtr a |
*const a' |
|
() |
() |
Done |
(a,b) |
(a',b') |
Done |
(a,b,c) |
(a',b',c') |
Done |
Storable data |
corresponding #[repr(C)] struct |
Done |
ByteString |
&[u8] |
see https://github.com/harpocrates/inline-rust/issues/12 |
Maybe a |
Option<a'> |
Done |
Either e a |
Result<a',e'> |
Done |
I'm still undecided on what to do around strings. I also feel like we could make good use of box somewhere here...
This will be really cool when it works. Will using tree/graph-like types be feasible? (I think that's ADTs?)
@22459 Yeah, I'd like to eventually have Haskell ADTs mapping to Rust enums. Right now, I only support passing things that have the same memory-representation, so I'd have to add support for some extra processing on both the Haskell and Rust side.
Really, I just need to find more time to work on this.
Right. Good luck!