implemented Helpers.incParamBy
This commit is contained in:
@@ -29,6 +29,7 @@ module Helpers (
|
||||
editHost,
|
||||
dropParam,
|
||||
editParam,
|
||||
incParamBy,
|
||||
incStrBy
|
||||
) where
|
||||
|
||||
@@ -119,6 +120,17 @@ editParam pName f url = do
|
||||
) $ params url
|
||||
Just url { params = params' }
|
||||
|
||||
-- | Increment a parameter of a 'Url' by a given amount (if possible)
|
||||
incParamBy
|
||||
:: Integer
|
||||
-- ^ the amount to increment by
|
||||
-> String
|
||||
-- ^ the parameter
|
||||
-> Url
|
||||
-- ^ the 'Url' to edit
|
||||
-> Maybe Url
|
||||
incParamBy n p = editParam p $ incStrBy n
|
||||
|
||||
-- | Increment a 'String' representation of an 'Integer' by a given
|
||||
-- amount (if possible)
|
||||
incStrBy
|
||||
|
||||
Reference in New Issue
Block a user