about summary refs log tree commit diff
path: root/src/BlogDB.hs
diff options
context:
space:
mode:
authorVincent Ambo <vincent@kivra.com>2015-11-21T02·18+0100
committerVincent Ambo <vincent@kivra.com>2015-11-21T02·18+0100
commit77c376e283e5dd2bde32ab1f20555c28c4adad89 (patch)
treee58288525e64ff4d76e373b288d9c05a73d59aea /src/BlogDB.hs
parentc2fe73b02715f05cae8721d0e8474e6baa683adf (diff)
[all] Fix all warnings
Diffstat (limited to 'src/BlogDB.hs')
-rw-r--r--src/BlogDB.hs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/BlogDB.hs b/src/BlogDB.hs
index 316c2fdc08..52e4e80c39 100644
--- a/src/BlogDB.hs
+++ b/src/BlogDB.hs
@@ -7,11 +7,9 @@ import Data.Acid.Advanced
 import Data.Acid.Remote
 import Data.ByteString      (ByteString)
 import Data.Data            (Data, Typeable)
-import Data.IxSet           (Indexable (..), IxSet (..), Proxy (..), getOne, ixFun, ixSet, (@=))
-import Data.List            (insert)
-import Data.SafeCopy        (SafeCopy, base, deriveSafeCopy)
+import Data.IxSet           (Indexable (..), IxSet, Proxy (..), getOne, ixFun, ixSet, (@=))
+import Data.SafeCopy        (base, deriveSafeCopy)
 import Data.Text            (Text, pack)
-import Data.Text.Lazy       (toStrict)
 import Data.Time
 import Network              (PortID (..))
 import System.Environment   (getEnv)
@@ -20,7 +18,6 @@ import qualified Crypto.Hash.SHA512     as SHA (hash)
 import qualified Data.ByteString.Base64 as B64 (encode)
 import qualified Data.ByteString.Char8  as B
 import qualified Data.IxSet             as IxSet
-import qualified Data.Text              as Text
 
 newtype EntryId = EntryId { unEntryId :: Integer }
     deriving (Eq, Ord, Data, Enum, Typeable)
@@ -138,12 +135,12 @@ updateEntry e =
 
 getEntry :: EntryId -> Query Blog (Maybe Entry)
 getEntry eId =
-    do b@Blog{..} <- ask
+    do Blog{..} <- ask
        return $ getOne $ blogEntries @= eId
 
 latestEntries :: BlogLang -> Query Blog [Entry]
 latestEntries lang =
-    do b@Blog{..} <- ask
+    do Blog{..} <- ask
        return $ IxSet.toDescList (Proxy :: Proxy EDate) $ blogEntries @= lang
 
 addSession :: Session -> Update Blog Session
@@ -154,7 +151,7 @@ addSession nSession =
 
 getSession :: SessionID -> Query Blog (Maybe Session)
 getSession sId =
-  do b@Blog{..} <- ask
+  do Blog{..} <- ask
      return $ getOne $ blogSessions @= sId
 
 clearSessions :: Update Blog [Session]
@@ -172,12 +169,12 @@ addUser un pw =
 
 getUser :: Username -> Query Blog (Maybe User)
 getUser uN =
-  do b@Blog{..} <- ask
+  do Blog{..} <- ask
      return $ getOne $ blogUsers @= uN
 
 checkUser :: Username -> String -> Query Blog Bool
 checkUser uN pw =
-  do b@Blog{..} <- ask
+  do Blog{..} <- ask
      let user = getOne $ blogUsers @= uN
      case user of
        Nothing  -> return False