@@ -82,6 +82,14 @@ instance PathMultiPiece [L.Text] where
82 fromPathMultiPiece = Just . map (L.fromChunks . return)
82 fromPathMultiPiece = Just . map (L.fromChunks . return)
83 toPathMultiPiece = map $ S.concat . L.toChunks
83 toPathMultiPiece = map $ S.concat . L.toChunks
85+instance (PathPiece a) => PathPiece (Maybe a) where
86+ fromPathPiece s = case s of
87+ "Nothing" -> Just Nothing
88+ _ -> Just $ fromPathPiece s
89+ toPathPiece m = case m of
90+ Just s -> toPathPiece s
85{-# DEPRECATED toSinglePiece "Use toPathPiece instead of toSinglePiece" #-}
93{-# DEPRECATED toSinglePiece "Use toPathPiece instead of toSinglePiece" #-}
86toSinglePiece :: PathPiece p => p -> S.Text
94toSinglePiece :: PathPiece p => p -> S.Text
87toSinglePiece = toPathPiece
95toSinglePiece = toPathPiece