mrkkrp / modern-uri

Modern library for working with URIs
Other
68 stars 18 forks source link

Track trailing slash in path component and 'relativeTo' and 'nonStrictRelativeTo' #8

Closed mjepronk closed 6 years ago

mjepronk commented 6 years ago

This is a change that implements a method to keep track of trailing slashes in the path component and implements two new methods 'relativeTo' and 'nonStrictRelativeTo'. These two methods can be used to combine two URI's. This is my solution for issue #6. Let me know what you think!

mrkkrp commented 6 years ago

Why do you add semigroups dependency for all versions? All modules from semigroups are included in base since 4.9.0.0. So there is no reason to do that.

It looks like Travis is having some issues, I'll get to your PR and review it a bit later this week, I hope there is no hurry.

mjepronk commented 6 years ago

Hi Mark, Nope, no hurry! I'll revert the change from the Cabal config, I did it because this Travis build for GHC version 7.10.3 failed with:

tests/Text/URISpec.hs:8:8:
    Could not find module ‘Data.List.NonEmpty’
    It is a member of the hidden package ‘semigroups-0.18.3@BnVBg2IbzT8BYxio7S9rrp’.
    Perhaps you need to add ‘semigroups’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
mrkkrp commented 6 years ago

That means you need to add

  if !impl(ghc >= 8.0)
    build-depends:    semigroups       == 0.18.*

to the test component, not remove the conditional in the library component.

mjepronk commented 6 years ago

Doh, of course you're right.

mjepronk commented 6 years ago

Thank you for your review, it's very instructive (especially in regard to the partial functions, which are unfortunately not annotated in Haskell). I agree with your comments.

Please proceed in the way that takes you as little time as possible.

mrkkrp commented 6 years ago

Applied as 0214160bee93715007356ca649c96bfbfe273a6e.

Thanks!