Skip to content

Generalise builder methods so they accept "AnyUrl" as a parameter - #12

Open
clintonmead wants to merge 3 commits into
TheInnerLight:mainfrom
clintonmead:main
Open

Generalise builder methods so they accept "AnyUrl" as a parameter#12
clintonmead wants to merge 3 commits into
TheInnerLight:mainfrom
clintonmead:main

Conversation

@clintonmead

@clintonmead clintonmead commented Jun 3, 2026

Copy link
Copy Markdown

Using </> to build an AnyUrl was annoying because unlike many of the functions in Dormouse.Client which are generalised over IsUrl, </> and ? where not.

Doing so has required adding an additional method to the IsUrl class called mapIsUrl, so this according to the PVP spec requires a major version bump, hence the move to 0.4.0.0, although I do doubt any users are actually defining their own IsUrl instances.

I've also added a generalised printing method isUrlAsBS which works on instances of the IsUrl class also, and a simple utility function to split out the scheme and components into a tuple.

p.s. This seems like a really well designed library. I hopped around a few URL libraries before finding this one, I found modern-uri whilst extensive was also too general without type constraints (resulting in various runtime checks at call sites) whereas with req like you said the ports being a separate type instead of part of the URL is weird and it didn't really have a inbuilt "print" method that included the port, and also the data type was quite opaque. Finally I stumbled into this and it for the moment (after a day of usage) fits the bill perfectly, so thanks for taking the time to write this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants