purescript-waterslide-rs
purescript-waterslide-rs copied to clipboard
Take &str instead of String in purs_module!()
It would be more ergonomic:
purs_module!("Data.Dogs"; Dachsund, ChowChow, Mutt<Void, Void>)
PursModule would have an added lifetime <'a> and member name would be &'a str.
This should not be a problem, especially since I think for most use-cases a string literal is going to be used there. I have no objection to this making it into the release (next time I have time to work on this project).
It could also be done by calling .to_string() in the macro before constructing the PursModule. Then PursModule wouldn't need to track that lifetime.