haskell-ricochet icon indicating copy to clipboard operation
haskell-ricochet copied to clipboard

Add the first draft of the proposal

Open froozen opened this issue 9 years ago • 9 comments

This PR will serve as the thread for the discussion of the contents of this proposal.

froozen avatar Dec 16 '15 01:12 froozen

The name is really bad. Should we change it to API proposal or something along those lines?

froozen avatar Dec 16 '15 01:12 froozen

I’d like to add that the protobuf utils will be in the second level as well, since our rationale for not putting the protobuf things in the second level was that library users might want to heavily change the protobuf specifications, but the utils would stay the same.

I think both util functions in the second level should actually be in the fourth one, since our custom Chan type kind of belongs in there. selectChannel would be bettor off as a prism, ie:

selectingChannel :: Word16 -> Prism' Packet Packet

Additionally, you didn’t apply all the arguments to Chan – It would be Chan Packet Packet instead of Chan Packet. And I’d switch the arguments of transform in order to be parallel to fmap.

photm5 avatar Dec 16 '15 14:12 photm5

I’d like to add that the [protobuf utils][1] will be in the second level as well, … I think both util functions in the second level should actually be in the fourth one, since our custom Chan type kind of belongs in there.

I don't think all code in the library has to be separated into the different levels. For me, it's just a way to create some sort of order in our implementation of the specs. Anything falling outside that, say utility functions and types, just exists without being bound to a certain level.

All the other suggestions

Agreed! I'll change those things right now.

froozen avatar Dec 16 '15 20:12 froozen

What's @lukasepple's opinion on this so far?

froozen avatar Dec 16 '15 22:12 froozen

Maybe the code on channels should be replaced by a link to the implementation #52?

sternenseemann avatar Dec 19 '15 09:12 sternenseemann

The more parts of the proposal I implemented on lowest-two-levels, the more the level seperation seems weird... What is meant to be in the fourth level? I don’t see anything new described in there compared to level two.

photm5 avatar Dec 24 '15 11:12 photm5

Shouldn't we just merge this?

sternenseemann avatar Dec 25 '15 14:12 sternenseemann

Level two implements the parsing of raw ByteStrings into the Packet type. This is something that probably won't change between protocol versions in the future. Level four will implement the conversion of those Packets into more specific types, like ChatMessage. As this is very dependant on protocol specification versions, it should reside in a higher level of the API.

froozen avatar Dec 25 '15 21:12 froozen

Parsing protobuf messages is in level three though, so what’s new in level four?

photm5 avatar Dec 25 '15 22:12 photm5