Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Web/Routes/PathInfo.hs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,10 @@ instance PathInfo Text where
toPathSegments = (:[])
fromPathSegments = anySegment

instance PathInfo [Text] where
toPathSegments = id
fromPathSegments = many anySegment

instance PathInfo String where
toPathSegments = (:[]) . pack
fromPathSegments = unpack <$> anySegment

instance PathInfo [String] where
toPathSegments = id . map pack
fromPathSegments = many (unpack <$> anySegment)

instance PathInfo Int where
toPathSegments i = [pack $ show i]
fromPathSegments = pToken (const "Int") checkInt
Expand All @@ -340,3 +332,7 @@ instance PathInfo Integer where
| Text.null r -> Just n
| otherwise -> Nothing


instance PathInfo a => PathInfo [a] where
toPathSegments = concat . fmap toPathSegments
fromPathSegments = many fromPathSegments