Permalink
Browse files

Ugly fix to provide FromReqURI instance for [String].

  • Loading branch information...
1 parent 70887e8 commit 6189acfbf75531a85bdb0261678b2a82392bf509 @jgm committed Feb 7, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 Network/Gitit/Types.hs
View
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE TypeSynonymInstances, ScopedTypeVariables, FlexibleInstances #-}
{-
Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu>,
Anton van Straaten <anton@appsolutions.com>
@@ -289,6 +289,14 @@ data Params = Params { pUsername :: String
, pResetCode :: String
} deriving Show
+instance FromReqURI [String] where
+ fromReqURI s = case fromReqURI s of
+ Just (s' :: String) ->
+ case reads s' of
+ ((xs,""):_) -> xs
+ _ -> Nothing
+ Nothing -> Nothing
+
instance FromData Params where
fromData = do
let look' = liftM fromEntities . look

0 comments on commit 6189acf

Please sign in to comment.