http-types icon indicating copy to clipboard operation
http-types copied to clipboard

Add support of URI Fragment

Open swamp-agr opened this issue 5 years ago • 0 comments

Hi @aristidb,

Problem statement

I found that URI fragment is missing in the package.

Screenshot 2020-07-16 at 23 15 48

I am talking about secondary part of URI (after hash sign, #). Despite it does not used in HTTP REST API, it is quite useful in HTTP (e.g. as HTML anchor). I would like to have it as a part of http-types just not to introduce it separately in several other packages dependent on this package (e.g. yesod-core).

Motivation

Consider GitHub, e.g. following URL: https://github.com/aristidb/http-types/blob/master/Network/HTTP/Types/URI.hs#L340-L347

While the content of the page with and without anchor remains the same, the page markup is different.

Imagine the situation where I want to introduce server-side rendering for HTML page with similar (highlighting) functionality based on fragment.

Would you like to accept PR with this missing part?

Thanks, Andrey

swamp-agr avatar Jul 19 '20 18:07 swamp-agr