Skip to content

Commit

Permalink
Merge pull request #173 from adamflott/fix/add-wordn-parsable-instances
Browse files Browse the repository at this point in the history
Add Parsable instances for the Data.Word family
  • Loading branch information
Ryan Scott committed Jun 22, 2015
2 parents c41fa12 + 8e8f3e9 commit 0d615d5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Web/Scotty/Action.hs
Expand Up @@ -49,6 +49,7 @@ import Data.Monoid (mconcat)
import qualified Data.Text as ST
import qualified Data.Text.Lazy as T
import Data.Text.Lazy.Encoding (encodeUtf8)
import Data.Word

import Network.HTTP.Types
import Network.Wai
Expand Down Expand Up @@ -217,6 +218,12 @@ instance Parsable Float where parseParam = readEither
instance Parsable Int where parseParam = readEither
instance Parsable Integer where parseParam = readEither

instance Parsable Word where parseParam = readEither
instance Parsable Word8 where parseParam = readEither
instance Parsable Word16 where parseParam = readEither
instance Parsable Word32 where parseParam = readEither
instance Parsable Word64 where parseParam = readEither

-- | Useful for creating 'Parsable' instances for things that already implement 'Read'. Ex:
--
-- > instance Parsable Int where parseParam = readEither
Expand Down

0 comments on commit 0d615d5

Please sign in to comment.