RE: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Prasanth Somasundar
> I like this Cool > I toyed at one point with the idea of having the code generator automatically > chop off as many layers of nesting as it could without causing collisions, > though that's a bit more complicated to implement. I thought about this myself, but the biggest issue I have with it

RE: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Ian Denhardt
Quoting Prasanth Somasundar (2019-06-01 23:12:20) > What about just dumping everything into the same module, but without > the prefixed namespace for every value/type/type constructor. The > reason that we're prefixing everything with underscores is to avoid > name collisions, but we can simply er

RE: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Prasanth Somasundar
Ok, so I spent almost exactly one hour on modules per struct and have concluded that this is impossible. I did have one other idea that I thought I might float by you guys: What about just dumping everything into the same module, but without the prefixed namespace for every value/type/type cons

RE: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Prasanth Somasundar
Yea, I'm not going to put a ton of time into that particular problem. Maybe just a few hours. --Prasanth -Original Message- From: capnproto@googlegroups.com On Behalf Of Ian Denhardt Sent: Saturday, June 1, 2019 10:02 AM To: 'Kenton Varda' via Cap'n Proto ; David Renshaw ; Kenton Var

Re: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Ian Denhardt
Quoting Prasanth Somasundar (2019-06-01 04:21:18) >Except for module names. Like I said, I'll try to fix this as best I >can and see if it makes sense to pursue. My current plan is to >topologically sort the graph, break any cycles with extra generics, and >then hide the generics i

Re: [capnproto] Reading/modifying/writing config structs

2019-06-01 Thread 'Kenton Varda' via Cap'n Proto
Hi Ádám, You can initialize a Builder from a Reader, like: fooBulider.setBar(someBarReader); Or for the top-level MessageReader/MessageBuilder: messageBuilder.setRoot(messageReader.getRoot()); This does require a copy, but for your use case, that copy is probably not a big deal. Config

Re: [capnproto] Cap'n Proto for Elm

2019-06-01 Thread Prasanth Somasundar
Because you're giving an alias to the *type*, not the variant tag. Haskell has a PatternSynonyms extension that I've not used heavily, but Elm doesn't give you anything to work with here. Except for module names. Like I said, I'll try to fix this as best I can and see if it makes sense to pursue.