Michael Bock
Michael Bock
Generally I thought of this, instead of the union types: ``` class CanDrawOn a data P5 data Graphics instance canDrawOnGraphics :: CanDrawOn Graphics instance canDrawOnP5 :: CanDrawOn P5 -- So...
see https://blog.ndk.io/purescript-ffi.html (section "How do I wrap a class hierarchy?")
@wclr Sorry for the late reply! Thanks for reporting, this totally makes sense. I'll have a closer look into your PR!
@garyb we can close this issue since it's tackled in the already merged #69 PR
@wclr True, you're right!
Alright, I'll implement it. To be in sync with the other sum codecs this will be adding a `nullarySumWith` codec that accepts encoding options.
From a practical point of view this feature is used with functions like `toSnakeCase`, `toLower`, `prefixWith...`. What do you mean by a more type safe mapping feature, @wclr ?
How about this API: ```purescript sum' { "Foo": { label: "foolery", codec: ... } , "Bar": { label: "bar", codec: ... } , "Baz": { label: "bazinga", codec: ... }...
@wclr Got your point. Maybe the API you suggests makes more sense. Yes, a function `String -> String` I would prefer, too instead of just `String`. Regarding the "unsafe coerce",...
@wclr I looked into your PR! It was very helpful to get a better understanding of the problem. Thanks for the effort! I ended up to go a slightly different...