Skip to content

Next version #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
176af66
Make Sceheme requred for non-relative URIs
garyb Jan 26, 2018
4356849
WIP
garyb Jan 29, 2018
15b8078
WIP
garyb Jan 29, 2018
df02b9e
WIP
garyb Jan 29, 2018
b843e7f
Split "nonstandard" types out
garyb Jan 29, 2018
8b316de
Record for parser/printer components
garyb Jan 29, 2018
aeae895
Free hosts from being an array
garyb Jan 29, 2018
c3decaf
Use functions for component parsing
garyb Jan 30, 2018
f528b7a
Remove some junk from Common, avoid regex parsers (mostly)
garyb Jan 30, 2018
372b3af
Style consistency for imports
garyb Jan 30, 2018
8fbf064
Delete old test for now-deleted `match1`
garyb Jan 30, 2018
14273b0
Add host/port parameters, introduce some encoded-value types
garyb Feb 1, 2018
97534e6
Introduce encoded-value type for Query
garyb Feb 1, 2018
9730451
Split up tests, update path representation
garyb Feb 3, 2018
e5e7b11
More tests, fix some re-exports
garyb Feb 5, 2018
c917296
Update to use preferred test/parse libraries
garyb Feb 5, 2018
2fed7b5
Some progress on valid handling of `,` & multi-host support
garyb Feb 6, 2018
0386d26
Fix warning
garyb Feb 6, 2018
3da1466
Fully parameterise host/port parsing
garyb Feb 6, 2018
49d3168
Safe construction for a few more values
garyb Feb 6, 2018
9a15157
Restore `QueryPairs` extra structure
garyb Feb 6, 2018
d5a5f33
Introduce `MultiHostPortPair`
garyb Feb 6, 2018
25aa142
Merge remote-tracking branch 'slamdata/master' into next
garyb Feb 6, 2018
281a512
Add extra for `user:password` handling in `UserInfo`
garyb Feb 7, 2018
33468dd
use NonEmptyString for RegName and PathSegmentNZ
safareli Feb 27, 2018
2c177fd
use crashWith for Scheme
safareli Feb 27, 2018
17c1408
add Semigroup and Monoid for Path
safareli Feb 27, 2018
3fba380
use NonEmptyString for unsafeFromString
safareli Feb 27, 2018
dcafee8
use NonEmptyString for PathSegmentNZNC
safareli Feb 27, 2018
36c51c0
update unsafe usages
safareli Feb 27, 2018
802dd78
Add crashes for illegal unsafe port/ipv4 address constructions
garyb Feb 28, 2018
4614557
Fix illegal port in tests
garyb Feb 28, 2018
619ed07
Move namespace to just URI
garyb Feb 28, 2018
308c2ee
Add details about the new setup to the README
garyb Mar 1, 2018
c6b8cec
Add doc comments for Scheme / use NES internally
garyb Mar 1, 2018
e26df37
Use NES for UserInfo internally, decouple parser composition
garyb Mar 1, 2018
c4323cc
Decouple parser composition from component parsers
garyb Mar 1, 2018
678bbbe
Clean up NES usage in UserInfo
garyb Mar 1, 2018
4d993d7
Use NonEmptyString for RegName
garyb Mar 1, 2018
56975f1
Simplify tests slightly with `nes` helper
garyb Mar 1, 2018
b11ee9a
Add fragment doc comments
garyb Mar 1, 2018
9cbc350
Add query doc comments
garyb Mar 1, 2018
df188b5
Tweak wording and add examples in UserInfo
garyb Mar 1, 2018
35d0658
Add doc comments for RegName, and print function
garyb Mar 1, 2018
b4843b0
Doc comments for IPv4Address
garyb Mar 1, 2018
a6dfbc2
Add more `Gen`s, doc comments, tests
garyb Mar 1, 2018
2d2f264
Avoid redefining some token parsers & rename some
garyb Mar 2, 2018
0015d5a
Last few doc comments for common
garyb Mar 2, 2018
daae752
Authority doc comments, remove unused synonym
garyb Mar 2, 2018
23df58e
Wording consistency tweak
garyb Mar 2, 2018
78119e5
Doc comments for HostPortPair
garyb Mar 2, 2018
98e99ad
Port doc comments
garyb Mar 2, 2018
64478e6
Tweak examples of authority option types usage
garyb Mar 2, 2018
5d81aa9
HierarchicalPart doc comments
garyb Mar 2, 2018
6316dd0
Newtype instance for UserPassInfo
safareli Mar 2, 2018
f868610
Path doc comments (and added TODO for NEA note)
garyb Mar 2, 2018
8dbdf12
Make `Path` match path-abempty from the spec
garyb Mar 2, 2018
ae42bc5
Doc comments for path varieties
garyb Mar 2, 2018
2d3a801
Adjust some segment stuff for consistency
garyb Mar 2, 2018
131b869
The -> a
garyb Mar 2, 2018
18365fd
Path segment doc comments
garyb Mar 2, 2018
d3cc178
Remove `';'` from `keyPartChar`
safareli Mar 16, 2018
4fb7a71
use in QueryPairs tests
safareli Mar 16, 2018
58a08b7
Add common URI schemes
garyb Mar 19, 2018
5dd71e8
Scheme `fromString` should fail if input is not fully consumed
garyb Mar 19, 2018
8047c1b
Make `pctEncoded` return a `NonEmptyString`
garyb Mar 19, 2018
7e612b3
More doc comment changes
garyb Mar 19, 2018
ed35231
Export char parsers used for printEncoded, etc
garyb Mar 20, 2018
a0ee260
Fix accidental loss of `try` in `URIRef` parser
garyb Mar 20, 2018
4aec4c5
Doc comments for the extras
garyb Mar 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Record for parser/printer components
  • Loading branch information
garyb committed Jan 29, 2018
commit 8b316dedaf09f31d7efbb6ae1dd9604f7f1e9544
66 changes: 39 additions & 27 deletions src/Data/URI/AbsoluteURI.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Data.URI.AbsoluteURI
( AbsoluteURI(..)
, AbsoluteURIParseOptions
, parser
, AbsoluteURIPrintOptions
, print
, _scheme
, _hierPart
Expand All @@ -27,58 +29,68 @@ import Text.Parsing.StringParser.Combinators (optionMaybe)
import Text.Parsing.StringParser.String (eof)

-- | An absolute AbsoluteURI.
data AbsoluteURI userInfo path query = AbsoluteURI Scheme (HierarchicalPart userInfo path) (Maybe query)
data AbsoluteURI userInfo hierPath query = AbsoluteURI Scheme (HierarchicalPart userInfo hierPath) (Maybe query)

derive instance eqAbsoluteURI ∷ (Eq userInfo, Eq path, Eq query) ⇒ Eq (AbsoluteURI userInfo path query)
derive instance ordAbsoluteURI ∷ (Ord userInfo, Ord path, Ord query) ⇒ Ord (AbsoluteURI userInfo path query)
derive instance genericAbsoluteURI ∷ Generic (AbsoluteURI userInfo path query) _
instance showAbsoluteURI ∷ (Show userInfo, Show path, Show query) ⇒ Show (AbsoluteURI userInfo path query) where show = genericShow
derive instance eqAbsoluteURI ∷ (Eq userInfo, Eq hierPath, Eq query) ⇒ Eq (AbsoluteURI userInfo hierPath query)
derive instance ordAbsoluteURI ∷ (Ord userInfo, Ord hierPath, Ord query) ⇒ Ord (AbsoluteURI userInfo hierPath query)
derive instance genericAbsoluteURI ∷ Generic (AbsoluteURI userInfo hierPath query) _
instance showAbsoluteURI ∷ (Show userInfo, Show hierPath, Show query) ⇒ Show (AbsoluteURI userInfo hierPath query) where show = genericShow

type AbsoluteURIParseOptions userInfo hierPath query r =
( parseUserInfo ∷ Parser userInfo
, parseHierPath ∷ Parser hierPath
, parseQuery ∷ Parser query
| r
)

parser
∷ ∀ userInfo path query
. Parser userInfo
→ Parser path
→ Parser query
→ Parser (AbsoluteURI userInfo path query)
parser parseUserInfo parsePath parseQuery = AbsoluteURI
∷ ∀ userInfo hierPath query r
. Record (AbsoluteURIParseOptions userInfo hierPath query r)
→ Parser (AbsoluteURI userInfo hierPath query)
parser opts = AbsoluteURI
<$> Scheme.parser
<*> HPart.parser parseUserInfo parsePath
<*> optionMaybe (Query.parser parseQuery)
<*> HPart.parser opts
<*> optionMaybe (Query.parser opts.parseQuery)
<* eof

type AbsoluteURIPrintOptions userInfo hierPath query r =
( printUserInfo ∷ userInfo → String
, printHierPath ∷ hierPath → String
, printQuery ∷ query → String
| r
)

print
∷ ∀ userInfo path query
. (userInfo → String)
→ (path → String)
→ (query → String)
→ AbsoluteURI userInfo path query
∷ ∀ userInfo hierPath query r
. Record (AbsoluteURIPrintOptions userInfo hierPath query r)
→ AbsoluteURI userInfo hierPath query
→ String
print printUserInfo printPath printQuery (AbsoluteURI s h q) =
print opts (AbsoluteURI s h q) =
S.joinWith "" $ catMaybes
[ Just (Scheme.print s)
, Just (HPart.print printUserInfo printPath h)
, Query.print printQuery <$> q
, Just (HPart.print opts h)
, Query.print opts.printQuery <$> q
]

_scheme
∷ ∀ userInfo path query
. Lens' (AbsoluteURI userInfo path query) Scheme
∷ ∀ userInfo hierPath query
. Lens' (AbsoluteURI userInfo hierPath query) Scheme
_scheme =
lens
(\(AbsoluteURI s _ _) → s)
(\(AbsoluteURI _ h q) s → AbsoluteURI s h q)

_hierPart
∷ ∀ userInfo path query
. Lens' (AbsoluteURI userInfo path query) (HierarchicalPart userInfo path)
∷ ∀ userInfo hierPath query
. Lens' (AbsoluteURI userInfo hierPath query) (HierarchicalPart userInfo hierPath)
_hierPart =
lens
(\(AbsoluteURI _ h _) → h)
(\(AbsoluteURI s _ q) h → AbsoluteURI s h q)

_query
∷ ∀ userInfo path query
. Lens' (AbsoluteURI userInfo path query) (Maybe query)
∷ ∀ userInfo hierPath query
. Lens' (AbsoluteURI userInfo hierPath query) (Maybe query)
_query =
lens
(\(AbsoluteURI _ _ q) → q)
Expand Down
23 changes: 15 additions & 8 deletions src/Data/URI/Authority.purs
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,27 @@ derive instance ordAuthority ∷ Ord userInfo ⇒ Ord (Authority userInfo)
derive instance genericAuthority ∷ Generic (Authority userInfo) _
instance showAuthority ∷ Show userInfo ⇒ Show (Authority userInfo) where show = genericShow

parser ∷ ∀ userInfo. Parser userInfo → Parser (Authority userInfo)
parser parseUserInfo = do
parser
∷ ∀ userInfo r
. { parseUserInfo ∷ Parser userInfo | r }
→ Parser (Authority userInfo)
parser opts = do
_ ← string "//"
ui ← optionMaybe $ try (UserInfo.parser parseUserInfo <* string "@")
ui ← optionMaybe $ try (UserInfo.parser opts.parseUserInfo <* string "@")
hosts ← flip sepBy (string ",") $
Tuple <$> Host.parser <*> optionMaybe (string ":" *> Port.parser)
pure $ Authority ui (fromFoldable hosts)

print ∷ ∀ userInfo. (userInfo → String) → Authority userInfo → String
print printUserInfo (Authority ui hs) =
"//" <> printUserInfo' ui <> S.joinWith "," (printHostAndPort <$> hs)
print
∷ ∀ userInfo r
. { printUserInfo ∷ userInfo → String | r }
→ Authority userInfo
→ String
print opts (Authority ui hs) =
"//" <> printUserInfo ui <> S.joinWith "," (printHostAndPort <$> hs)
where
printUserInfo' =
maybe "" (\u → printUserInfo u <> "@")
printUserInfo =
maybe "" (\u → opts.printUserInfo u <> "@")
printHostAndPort (Tuple h p) =
Host.print h <> maybe "" (\n → ":" <> Port.print n) p

Expand Down
46 changes: 29 additions & 17 deletions src/Data/URI/HierarchicalPart.purs
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,55 @@ import Data.URI.Path as Path
import Text.Parsing.StringParser (Parser)

-- | The "hierarchical part" of a generic or absolute URI.
data HierarchicalPart userInfo path = HierarchicalPart (Maybe (Authority userInfo)) (Maybe path)
data HierarchicalPart userInfo hierPath = HierarchicalPart (Maybe (Authority userInfo)) (Maybe hierPath)

derive instance eqHierarchicalPart ∷ (Eq userInfo, Eq path) ⇒ Eq (HierarchicalPart userInfo path)
derive instance ordHierarchicalPart ∷ (Ord userInfo, Ord path) ⇒ Ord (HierarchicalPart userInfo path)
derive instance genericHierarchicalPart ∷ Generic (HierarchicalPart userInfo path) _
instance showHierarchicalPart ∷ (Show userInfo, Show path) ⇒ Show (HierarchicalPart userInfo path) where show = genericShow
derive instance eqHierarchicalPart ∷ (Eq userInfo, Eq hierPath) ⇒ Eq (HierarchicalPart userInfo hierPath)
derive instance ordHierarchicalPart ∷ (Ord userInfo, Ord hierPath) ⇒ Ord (HierarchicalPart userInfo hierPath)
derive instance genericHierarchicalPart ∷ Generic (HierarchicalPart userInfo hierPath) _
instance showHierarchicalPart ∷ (Show userInfo, Show hierPath) ⇒ Show (HierarchicalPart userInfo hierPath) where show = genericShow

parser ∷ ∀ userInfo path. Parser userInfo → Parser path → Parser (HierarchicalPart userInfo path)
parser parseUserInfo parsePath = withAuth <|> withoutAuth
parser
∷ ∀ userInfo hierPath r
. { parseUserInfo ∷ Parser userInfo
, parseHierPath ∷ Parser hierPath
| r
}
→ Parser (HierarchicalPart userInfo hierPath)
parser opts = withAuth <|> withoutAuth
where
withAuth =
HierarchicalPart <<< Just
<$> Authority.parser parseUserInfo
<*> Path.parsePathAbEmpty parsePath
<$> Authority.parser opts
<*> Path.parsePathAbEmpty opts.parseHierPath

withoutAuth = HierarchicalPart Nothing <$> noAuthPath

noAuthPath
= (Just <$> Path.parsePathAbsolute parsePath)
<|> (Just <$> Path.parsePathRootless parsePath)
= (Just <$> Path.parsePathAbsolute opts.parseHierPath)
<|> (Just <$> Path.parsePathRootless opts.parseHierPath)
<|> pure Nothing

print ∷ ∀ userInfo path. (userInfo → String) → (path → String) → HierarchicalPart userInfo path → String
print printUserInfo printPath (HierarchicalPart a p) =
print
∷ ∀ userInfo hierPath r
. { printUserInfo ∷ userInfo → String
, printHierPath ∷ hierPath → String
| r
}
→ HierarchicalPart userInfo hierPath → String
print opts (HierarchicalPart a p) =
S.joinWith "" $
catMaybes
[ Authority.print printUserInfo <$> a
, printPath <$> p
[ Authority.print opts <$> a
, opts.printHierPath <$> p
]

_authority ∷ ∀ userInfo path. Lens' (HierarchicalPart userInfo path) (Maybe (Authority userInfo))
_authority ∷ ∀ userInfo hierPath. Lens' (HierarchicalPart userInfo hierPath) (Maybe (Authority userInfo))
_authority =
lens
(\(HierarchicalPart a _) → a)
(\(HierarchicalPart _ p) a → HierarchicalPart a p)

_path ∷ ∀ userInfo path. Lens' (HierarchicalPart userInfo path) (Maybe path)
_path ∷ ∀ userInfo hierPath. Lens' (HierarchicalPart userInfo hierPath) (Maybe hierPath)
_path =
lens
(\(HierarchicalPart _ p) → p)
Expand Down
46 changes: 29 additions & 17 deletions src/Data/URI/RelativePart.purs
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,56 @@ import Data.URI.Path as Path
import Text.Parsing.StringParser (Parser)

-- | The "relative part" of a relative reference.
data RelativePart userInfo path = RelativePart (Maybe (Authority userInfo)) (Maybe path)
data RelativePart userInfo relPath = RelativePart (Maybe (Authority userInfo)) (Maybe relPath)

derive instance eqRelativePart ∷ (Eq userInfo, Eq path) ⇒ Eq (RelativePart userInfo path)
derive instance ordRelativePart ∷ (Ord userInfo, Ord path) ⇒ Ord (RelativePart userInfo path)
derive instance genericRelativePart ∷ Generic (RelativePart userInfo path) _
instance showRelativePart ∷ (Show userInfo, Show path) ⇒ Show (RelativePart userInfo path) where show = genericShow
derive instance eqRelativePart ∷ (Eq userInfo, Eq relPath) ⇒ Eq (RelativePart userInfo relPath)
derive instance ordRelativePart ∷ (Ord userInfo, Ord relPath) ⇒ Ord (RelativePart userInfo relPath)
derive instance genericRelativePart ∷ Generic (RelativePart userInfo relPath) _
instance showRelativePart ∷ (Show userInfo, Show relPath) ⇒ Show (RelativePart userInfo relPath) where show = genericShow

parser ∷ ∀ userInfo path. Parser userInfo → Parser path → Parser (RelativePart userInfo path)
parser parseUserInfo parsePath = withAuth <|> withoutAuth
parser
∷ ∀ userInfo relPath r
. { parseUserInfo ∷ Parser userInfo
, parseRelPath ∷ Parser relPath
| r
}
→ Parser (RelativePart userInfo relPath)
parser opts = withAuth <|> withoutAuth
where

withAuth =
RelativePart
<$> Just <$> Authority.parser parseUserInfo
<*> Path.parsePathAbEmpty parsePath
<$> Just <$> Authority.parser opts
<*> Path.parsePathAbEmpty opts.parseRelPath

withoutAuth = RelativePart Nothing <$> noAuthPath

noAuthPath
= (Just <$> Path.parsePathAbsolute parsePath)
<|> (Just <$> Path.parsePathNoScheme parsePath)
= (Just <$> Path.parsePathAbsolute opts.parseRelPath)
<|> (Just <$> Path.parsePathNoScheme opts.parseRelPath)
<|> pure Nothing

print ∷ ∀ userInfo path. (userInfo → String) → (path → String) → RelativePart userInfo path → String
print printUserInfo printPath (RelativePart a p) =
print
∷ ∀ userInfo relPath r
. { printUserInfo ∷ userInfo → String
, printRelPath ∷ relPath → String
| r
}
→ RelativePart userInfo relPath → String
print opts (RelativePart a p) =
S.joinWith "" $
catMaybes
[ Authority.print printUserInfo <$> a
, printPath <$> p
[ Authority.print opts <$> a
, opts.printRelPath <$> p
]

_authority ∷ ∀ userInfo path. Lens' (RelativePart userInfo path) (Maybe (Authority userInfo))
_authority ∷ ∀ userInfo relPath. Lens' (RelativePart userInfo relPath) (Maybe (Authority userInfo))
_authority =
lens
(\(RelativePart a _) → a)
(\(RelativePart _ p) a → RelativePart a p)

_path ∷ ∀ userInfo path. Lens' (RelativePart userInfo path) (Maybe path)
_path ∷ ∀ userInfo relPath. Lens' (RelativePart userInfo relPath) (Maybe relPath)
_path =
lens
(\(RelativePart _ p) → p)
Expand Down
69 changes: 35 additions & 34 deletions src/Data/URI/RelativeRef.purs
Original file line number Diff line number Diff line change
Expand Up @@ -25,64 +25,65 @@ import Text.Parsing.StringParser.Combinators (optionMaybe)
import Text.Parsing.StringParser.String (eof)

-- | A relative reference for a URI.
data RelativeRef userInfo path query fragment = RelativeRef (RelativePart userInfo path) (Maybe query) (Maybe fragment)
data RelativeRef userInfo relPath query fragment = RelativeRef (RelativePart userInfo relPath) (Maybe query) (Maybe fragment)

derive instance eqRelativeRef ∷ (Eq userInfo, Eq path, Eq query, Eq fragment) ⇒ Eq (RelativeRef userInfo path query fragment)
derive instance ordRelativeRef ∷ (Ord userInfo, Ord path, Ord query, Ord fragment) ⇒ Ord (RelativeRef userInfo path query fragment)
derive instance genericRelativeRef ∷ Generic (RelativeRef userInfo path query fragment) _
instance showRelativeRef ∷ (Show userInfo, Show path, Show query, Show fragment) ⇒ Show (RelativeRef userInfo path query fragment) where show = genericShow
--
-- parse ∷ String → Either ParseError RelativeRef
-- parse = runParser parser
derive instance eqRelativeRef ∷ (Eq userInfo, Eq relPath, Eq query, Eq fragment) ⇒ Eq (RelativeRef userInfo relPath query fragment)
derive instance ordRelativeRef ∷ (Ord userInfo, Ord relPath, Ord query, Ord fragment) ⇒ Ord (RelativeRef userInfo relPath query fragment)
derive instance genericRelativeRef ∷ Generic (RelativeRef userInfo relPath query fragment) _
instance showRelativeRef ∷ (Show userInfo, Show relPath, Show query, Show fragment) ⇒ Show (RelativeRef userInfo relPath query fragment) where show = genericShow

parser
∷ ∀ userInfo path query fragment
. Parser userInfo
→ Parser path
→ Parser query
→ Parser fragment
→ Parser (RelativeRef userInfo path query fragment)
parser parseUserInfo parsePath parseQuery parseFragment =
∷ ∀ userInfo relPath query fragment r
. { parseUserInfo ∷ Parser userInfo
, parseRelPath ∷ Parser relPath
, parseQuery ∷ Parser query
, parseFragment ∷ Parser fragment
| r
}
→ Parser (RelativeRef userInfo relPath query fragment)
parser opts =
RelativeRef
<$> RPart.parser parseUserInfo parsePath
<*> optionMaybe (Query.parser parseQuery)
<*> optionMaybe (Fragment.parser parseFragment)
<$> RPart.parser opts
<*> optionMaybe (Query.parser opts.parseQuery)
<*> optionMaybe (Fragment.parser opts.parseFragment)
<* eof

print
∷ ∀ userInfo path query fragment
. (userInfo → String)
→ (path → String)
→ (query → String)
→ (fragment → String)
→ RelativeRef userInfo path query fragment
∷ ∀ userInfo relPath query fragment r
. { printUserInfo ∷ userInfo → String
, printRelPath ∷ relPath → String
, printQuery ∷ query → String
, printFragment ∷ fragment → String
| r
}
→ RelativeRef userInfo relPath query fragment
→ String
print printUserInfo printPath printQuery printFragment (RelativeRef h q f) =
print opts (RelativeRef h q f) =
S.joinWith "" $ catMaybes
[ Just (RPart.print printUserInfo printPath h)
, Query.print printQuery <$> q
, Fragment.print printFragment <$> f
[ Just (RPart.print opts h)
, Query.print opts.printQuery <$> q
, Fragment.print opts.printFragment <$> f
]

_relPart
∷ ∀ userInfo path query fragment
. Lens' (RelativeRef userInfo path query fragment) (RelativePart userInfo path)
∷ ∀ userInfo relPath query fragment
. Lens' (RelativeRef userInfo relPath query fragment) (RelativePart userInfo relPath)
_relPart =
lens
(\(RelativeRef r _ _) → r)
(\(RelativeRef _ q f) r → RelativeRef r q f)

_query
∷ ∀ userInfo path query fragment
. Lens' (RelativeRef userInfo path query fragment) (Maybe query)
∷ ∀ userInfo relPath query fragment
. Lens' (RelativeRef userInfo relPath query fragment) (Maybe query)
_query =
lens
(\(RelativeRef _ q _) → q)
(\(RelativeRef r _ f) q → RelativeRef r q f)

_fragment
∷ ∀ userInfo path query fragment
. Lens' (RelativeRef userInfo path query fragment) (Maybe fragment)
∷ ∀ userInfo relPath query fragment
. Lens' (RelativeRef userInfo relPath query fragment) (Maybe fragment)
_fragment =
lens
(\(RelativeRef _ _ f) → f)
Expand Down
Loading