@@ -20,15 +20,15 @@ class PathPiece s where
20 toPathPiece :: s -> S.Text
20 toPathPiece :: s -> S.Text
22instance PathPiece String where
22instance PathPiece String where
23− fromPathPiece s = if S.null s then Nothing else Just (S.unpack s)
23+ fromPathPiece = Just . S.unpack
24 toPathPiece = S.pack
24 toPathPiece = S.pack
26instance PathPiece S.Text where
26instance PathPiece S.Text where
27− fromPathPiece s = if S.null s then Nothing else Just s
27+ fromPathPiece = Just
28 toPathPiece = id
28 toPathPiece = id
30instance PathPiece L.Text where
30instance PathPiece L.Text where
31− fromPathPiece s = if S.null s then Nothing else Just (L.fromChunks [s])
31+ fromPathPiece = Just . L.fromChunks . return
32 toPathPiece = S.concat . L.toChunks
32 toPathPiece = S.concat . L.toChunks
34instance PathPiece Integer where
34instance PathPiece Integer where