-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract type support? #6
Comments
By the way, the module StringMap = Map.Make(String); This is my attempt at getting a general purpose dictionary. I suppose I could also model it as: type KeywordList('a) = list(("string", 'a)) but I'd rather not since I'll get |
abstract types are definitely supported, but I imagine the error message could be better. Here's an example |
Thanks for sharing this. So is the advice to add "TypeHelpers" to my |
yup! And for the abstract type that you want to support, add manual serialization & deserialization functions. (the example there is for Belt's String Set and String Map) |
Excellent! Thanks, @jaredly! And thanks for such a great library. As I get more comfortable in this ecosystem, I'd love to contribute. |
I had some difficulty understanding the following error message: "Abstract type found, but no 'helpers' module specified for this engine" I received this error because I had an Abstract Type in the object that I wanted to serialize and deserialize but I didn't provide any implementations for Milk to serialize or deserialize it. I'm adding a section on "Abstract Types" to the Readme.md to document what I learned from the issue and to hopefully help others and my future self. See this thread for more information: jaredly#6
First of all - thank you for making this and open sourcing it. I'm loving it so far. I'm new to Reason and OCaml so forgive me if the way I phrase this question is vague.
I added a new field to my record that I'm encoding of type
StringMap.t(list(string))
. When I runmilk
, I get this error:This error goes away when I remove the
StringMap.t(..)
. I'm inferring from the error that the "abstract type" is theStringMap.t
and that I need to provide my ownserialize
anddeserialize
functions. I think this makes sense. Can you point me to a place in the documentation where I can learn more about doing this? If there isn't any, I'd be happy to write some if you give me a hand.Thanks!
The text was updated successfully, but these errors were encountered: