Skip to content

Commit fd2a029

Browse files
committed
readme update
1 parent bb0c07e commit fd2a029

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,22 @@ This pulls in Borsh serialization automatically — no extra dependencies needed
9393
| `#[hsrs::function]` | Method exported over FFI | Type-safe Haskell wrapper |
9494
| `#[hsrs::module]` | Groups a data type with its methods | Generates all FFI glue for the type |
9595
96-
`Result<T, E>` becomes `Either E T` and `Option<T>` becomes `Maybe T`, both serialized transparently.
96+
`Result<T, E>` becomes `Either E T`, `Option<T>` becomes `Maybe T`, `Vec<T>` becomes `[T]`, and `String` becomes `Text` — all serialized transparently via Borsh.
97+
98+
## Supported types
99+
100+
| Rust | Haskell | Transfer |
101+
|---|---|---|
102+
| `i8`, `i16`, `i32`, `i64` | `Int8`, `Int16`, `Int32`, `Int64` | Direct (C FFI) |
103+
| `u8`, `u16`, `u32`, `u64` | `Word8`, `Word16`, `Word32`, `Word64` | Direct (C FFI) |
104+
| `bool` | `CBool` | Direct (C FFI) |
105+
| `usize` / `isize` | `Word64` / `Int64` | Direct (C FFI) |
106+
| `#[hsrs::enumeration]` enum | `Word8` newtype + patterns | Direct (C FFI) |
107+
| `#[hsrs::value_type]` struct | `data` record | Borsh |
108+
| `String` | `Text` | Borsh |
109+
| `Vec<T>` | `[T]` | Borsh |
110+
| `Option<T>` | `Maybe T` | Borsh |
111+
| `Result<T, E>` | `Either E T` | Borsh |
97112
98113
## Platform notes
99114

0 commit comments

Comments
 (0)