@@ -82,6 +82,14 @@ instance PathMultiPiece [L.Text] where
8282 fromPathMultiPiece = Just . map (L.fromChunks . return)
8383 toPathMultiPiece = map $ S.concat . L.toChunks
8484
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
91+ _ -> "Nothing"
92+
8593{-# DEPRECATED toSinglePiece "Use toPathPiece instead of toSinglePiece" #-}
8694toSinglePiece :: PathPiece p => p -> S.Text
8795toSinglePiece = toPathPiece