@@ -20,15 +20,15 @@ class PathPiece s where
2020 toPathPiece :: s -> S.Text
2121
2222instance PathPiece String where
23− fromPathPiece s = if S.null s then Nothing else Just (S.unpack s)
23+ fromPathPiece = Just . S.unpack
2424 toPathPiece = S.pack
2525
2626instance PathPiece S.Text where
27− fromPathPiece s = if S.null s then Nothing else Just s
27+ fromPathPiece = Just
2828 toPathPiece = id
2929
3030instance PathPiece L.Text where
31− fromPathPiece s = if S.null s then Nothing else Just (L.fromChunks [s])
31+ fromPathPiece = Just . L.fromChunks . return
3232 toPathPiece = S.concat . L.toChunks
3333
3434instance PathPiece Integer where