git.iko.soy/typeable/http-api-data
on master help sign in
No null checking (yesodweb/yesod#421)
commit658f725d7caaa662453a921ccce47380382de80b authorMichael Snoyman <michael@snoyman.com> dateFri 21 Sep 2012, 14:24 (14 years ago) parentc01064d
2 files changed+4−4
Web/PathPieces.hs+3−3 path-pieces.cabal+1−1
Web/PathPieces.hs+3−3
@@ -20,15 +20,15 @@ class PathPiece s where
2020 toPathPiece :: s -> S.Text
2121
2222instance PathPiece String where
23− fromPathPiece s = if S.null s then Nothing else Just (S.unpack s)
23+ fromPathPiece = Just . S.unpack
2424 toPathPiece = S.pack
2525
2626instance PathPiece S.Text where
27− fromPathPiece s = if S.null s then Nothing else Just s
27+ fromPathPiece = Just
2828 toPathPiece = id
2929
3030instance PathPiece L.Text where
31− fromPathPiece s = if S.null s then Nothing else Just (L.fromChunks [s])
31+ fromPathPiece = Just . L.fromChunks . return
3232 toPathPiece = S.concat . L.toChunks
3333
3434instance PathPiece Integer where
path-pieces.cabal+1−1
@@ -1,5 +1,5 @@
11name: path-pieces
2−version: 0.1.1
2+version: 0.1.2
33license: BSD3
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>