Export renderSubURI to aid debugging

This commit is contained in:
Pere Lev 2024-03-14 22:25:08 +02:00
parent ac2ef9d1b3
commit 9096e371ce
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D

View file

@ -1,6 +1,6 @@
{- This file is part of Vervis. {- This file is part of Vervis.
- -
- Written 2019, 2022 by fr33domlover <fr33domlover@riseup.net>. - Written 2019, 2022, 2024 by fr33domlover <fr33domlover@riseup.net>.
- -
- Copying is an act of love. Please copy, reuse and share. - Copying is an act of love. Please copy, reuse and share.
- -
@ -263,9 +263,6 @@ instance PersistField LocalSubURI where
. T.stripPrefix dummyPrefix . T.stripPrefix dummyPrefix
. renderSubURI . renderSubURI
. SubURI dummyAuthority . SubURI dummyAuthority
where
renderSubURI :: UriMode t => SubURI t -> Text
renderSubURI = renderFullURI . fromFullSubURI . fromSubURI
fromPersistValue fromPersistValue
= bimap T.pack subUriLocal . parseSubURI' . (dummyPrefix <>) = bimap T.pack subUriLocal . parseSubURI' . (dummyPrefix <>)
<=< fromPersistValue <=< fromPersistValue
@ -506,6 +503,9 @@ toSubURI (FullSubURI s a l) = flip SubURI l <$> checkAuthority s a
fromSubURI :: UriMode t => SubURI t -> FullSubURI fromSubURI :: UriMode t => SubURI t -> FullSubURI
fromSubURI (SubURI a l) = FullSubURI (authorityScheme a) (toFull a) l fromSubURI (SubURI a l) = FullSubURI (authorityScheme a) (toFull a) l
renderSubURI :: UriMode t => SubURI t -> Text
renderSubURI = renderFullURI . fromFullSubURI . fromSubURI
uriFromSubURI :: UriMode t => SubURI t -> URI uriFromSubURI :: UriMode t => SubURI t -> URI
uriFromSubURI = fromFullURI . fromFullSubURI . fromSubURI uriFromSubURI = fromFullURI . fromFullSubURI . fromSubURI