git.iko.soy/typeable/http-api-data
on master help sign in
Add instance for ()
597f2fcAndrew Martin
Web/PathPieces.hs+4
@@ -24,6 +24,10 @@ class PathPiece s where
24 fromPathPiece :: S.Text -> Maybe s
24 fromPathPiece :: S.Text -> Maybe s
25 toPathPiece :: s -> S.Text
25 toPathPiece :: s -> S.Text
26
26
27+instance PathPiece () where
28+ fromPathPiece t = if t == "_" then Just () else Nothing
29+ toPathPiece () = "_"
30+
27instance PathPiece String where
31instance PathPiece String where
28 fromPathPiece = Just . S.unpack
32 fromPathPiece = Just . S.unpack
29 toPathPiece = S.pack
33 toPathPiece = S.pack