git.iko.soy/typeable/http-api-data
on master help sign in
Add instance for ()
commit597f2fcbf57d1914854eb25f23748a6ba8127ad2 authorAndrew Martin <amartin@layer3com.com> dateWed 26 Aug 2015, 13:41 (11 years ago) parent19b5a76
1 file changed+4
Web/PathPieces.hs+4
Web/PathPieces.hs+4
@@ -24,6 +24,10 @@ class PathPiece s where
2424 fromPathPiece :: S.Text -> Maybe s
2525 toPathPiece :: s -> S.Text
2626
27+instance PathPiece () where
28+ fromPathPiece t = if t == "_" then Just () else Nothing
29+ toPathPiece () = "_"
30+
2731instance PathPiece String where
2832 fromPathPiece = Just . S.unpack
2933 toPathPiece = S.pack