This is a compromise that gets us most of the way towards what we have with the heterogeneous list in Haskell, but without any complex abstractions.
6 lines
143 B
Rust
6 lines
143 B
Rust
pub struct Puzzle<Input, const N: usize> {
|
|
pub number: u32,
|
|
pub parser: fn(&str) -> Input,
|
|
pub parts: [fn(&Input) -> String; N],
|
|
}
|