@@ -83,9 +83,12 @@ instance PathMultiPiece [L.Text] where
8383 toPathMultiPiece = map $ S.concat . L.toChunks
8484
8585instance (PathPiece a) => PathPiece (Maybe a) where
86− fromPathPiece s = case s of
87− "Nothing" -> Just Nothing
88− _ -> Just $ fromPathPiece s
86+ fromPathPiece s = if isPrefixOf "Just " s
87+ then Just $ fromPathPiece $ fromJust $ stripPrefix "Just " s
88+ else
89+ if s == "Nothing"
90+ then Just Nothing
91+ else Nothing
8992 toPathPiece m = case m of
9093 Just s -> toPathPiece s
9194 _ -> "Nothing"