@@ -84,12 +84,11 @@ instance PathMultiPiece [L.Text] where
8484 toPathMultiPiece = map $ S.concat . L.toChunks
8585
8686instance (PathPiece a) => PathPiece (Maybe a) where
87− fromPathPiece s = if S.isPrefixOf "Just " s
88− then Just $ fromPathPiece $ fromJust $ S.stripPrefix "Just " s
89− else
90− if s == "Nothing"
91− then Just Nothing
92− else Nothing
87+ fromPathPiece s = case S.stripPrefix "Just " s of
88+ Just r -> Just $ fromPathPiece r
89+ _ -> case s of
90+ "Nothing" -> Just Nothing
91+ _ -> Nothing
9392 toPathPiece m = case m of
9493 Just s -> "Just " `S.append` toPathPiece s
9594 _ -> "Nothing"