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
Split into servant-multipart-api, servant-multipart-client, servant-multipart #51
Conversation
servant-multipart
I might need a little help deciphering what happened in the CI. |
Basically Travis should be considered dead. I'll migrate to github actions, hopefully tomorrow. |
What is the current state? Is there anything i can/should do to increase chances of progress? |
Hi, sorry for the delay! I've updated CI in master and in your branch. Looks like compatibility with ghc <8.4 is broken due to missing I'll take a more thorough look in the next couple of days. |
Should be fixed now. |
@maksbotan did you use some kind of tool to determine unused deps or did you determine that by hand? |
I used this feature of GHC 8.10: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using-warnings.html#ghc-flag--Wunused-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things, otherwise looks good. Thanks for your work!
instance ToMultipart tag (MultipartData tag) where | ||
toMultipart = id | ||
|
||
class MultipartBackend tag where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this class, along with resourcet
dependency, belongs in servant-multipart
package, not the -api
one. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought the same, but then i am clueless about this:
- class
MultipartBackend
defines typeMultipartResult
- type
MultipartResult
is needed by typeFileData
- type
FileData
is needed by typeMultipartData
- type
MultipartData
is needed by classesFromMultipart
andToMultipart
- and
ToMultipart
seems like a client thing
if the last bullet point is correct then it seems like moving this all into the servant-multipart
package is not the right thing, or is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, in the current state of the PR one can't actually use client without server, since client needs MultipartResult tag
instance to construct the input.
I propose we make MultipartResult
a top-level open type family instead of associated type and define Mem and Tmp instances in this module. Then, move this class to server. Now the client user no longer needs to import server package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good, but this touches the edge of my haskell knowledge. I'd love to do that, but then i need instructions in a little bit more explicit steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean you leave in this module only this:
type family MultipartResult (tag :: *) :: *
type instance MultipartResult Mem = ...
type instance MultipartResult Tmp = ...
The rest goes to the respective server and client packages.
If you have no luck with this, I'll try to do it myself tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is helpful, i will try it. won't have time for that today though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i tried my luck. This is pretty straightforward up to the point where loadFile
is used from the servant-multipart-client
library but defined in the backend class which i moved to servant-multipart
. While trying to move the loadFile
function out of the backend class to the client, i somehow got lost in the whole idea around the type proxy mixed with the new type family.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done it, please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
@maksbotan what is missing here? from my perspective it looks like (due to your help, thank you) we are down to "remove the |
Hi @tfc! Actually, we are down to "I need to find time to merge this" :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I think it's all OK now. I will check my project with this branch, just in case, to see if it's backwards-compatible.
If it's OK, I will merge this soon.
Thanks for your contribution!
Great, thank you for this great open source co-op experience! |
Oh so this is why A tiny bit of documentation would have saved me 3 hours just now :( |
That is
typechecked just fine and gave me a
for reasons that I can understand now. |
This is about #48
cc @maksbotan