diff --git a/src/Network/FedURI.hs b/src/Network/FedURI.hs index 8d7a5cd..ca8b178 100644 --- a/src/Network/FedURI.hs +++ b/src/Network/FedURI.hs @@ -1,6 +1,6 @@ {- This file is part of Vervis. - - - Written 2019, 2022 by fr33domlover . + - Written 2019, 2022, 2024 by fr33domlover . - - ♡ Copying is an act of love. Please copy, reuse and share. - @@ -263,9 +263,6 @@ instance PersistField LocalSubURI where . T.stripPrefix dummyPrefix . renderSubURI . SubURI dummyAuthority - where - renderSubURI :: UriMode t => SubURI t -> Text - renderSubURI = renderFullURI . fromFullSubURI . fromSubURI fromPersistValue = bimap T.pack subUriLocal . parseSubURI' . (dummyPrefix <>) <=< fromPersistValue @@ -506,6 +503,9 @@ toSubURI (FullSubURI s a l) = flip SubURI l <$> checkAuthority s a fromSubURI :: UriMode t => SubURI t -> FullSubURI 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 = fromFullURI . fromFullSubURI . fromSubURI