Used stylish-haskell on all source files

This commit is contained in:
"Vincent Ambo ext:(%22) 2013-04-28 14:30:00 +02:00
parent 8f1b6b5c4e
commit 9719b5a62d
5 changed files with 125 additions and 105 deletions

View file

@ -1,23 +1,28 @@
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, DeriveDataTypeable, TemplateHaskell, QuasiQuotes, RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
module Blog where module Blog where
import Control.Monad (when, unless) import BlogDB
import Control.Monad (unless, when)
import Data.Data (Data, Typeable) import Data.Data (Data, Typeable)
import Data.List (intersperse) import Data.List (intersperse)
import Data.Maybe (fromJust) import Data.Maybe (fromJust)
import Data.Monoid (mempty) import Data.Monoid (mempty)
import Data.Text (Text, append, pack, empty) import Data.Text (Text, append, empty, pack)
import Data.Text.Lazy (fromStrict) import Data.Text.Lazy (fromStrict)
import Data.Time import Data.Time
import Locales
import Network.Captcha.ReCaptcha import Network.Captcha.ReCaptcha
import System.Locale (defaultTimeLocale) import System.Locale (defaultTimeLocale)
import Text.Blaze.Html (preEscapedToHtml) import Text.Blaze.Html (preEscapedToHtml)
import Text.Hamlet import Text.Hamlet
import Text.Lucius import Text.Lucius
import Text.Markdown import Text.Markdown
import Locales
import BlogDB
import qualified Data.Text as T import qualified Data.Text as T

View file

@ -1,5 +1,10 @@
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, RecordWildCards, {-# LANGUAGE DeriveDataTypeable #-}
TemplateHaskell, TypeFamilies, OverloadedStrings, ScopedTypeVariables, BangPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module BlogDB where module BlogDB where
@ -11,18 +16,19 @@ import Data.Acid.Local
import Data.ByteString (ByteString) import Data.ByteString (ByteString)
import Data.Char (toLower) import Data.Char (toLower)
import Data.Data (Data, Typeable) import Data.Data (Data, Typeable)
import Data.IxSet (Indexable(..), IxSet(..), (@=), Proxy(..), getOne, ixFun, ixSet) import Data.IxSet (Indexable (..), IxSet (..), Proxy (..),
getOne, ixFun, ixSet, (@=))
import Data.List (insert) import Data.List (insert)
import Data.SafeCopy (SafeCopy, base, deriveSafeCopy) import Data.SafeCopy (SafeCopy, base, deriveSafeCopy)
import Data.Text (Text, pack) import Data.Text (Text, pack)
import Data.Text.Lazy (toStrict) import Data.Text.Lazy (toStrict)
import Data.Time import Data.Time
import Happstack.Server (FromReqURI(..)) import Happstack.Server (FromReqURI (..))
import System.Environment (getEnv) import System.Environment (getEnv)
import qualified Crypto.Hash.SHA512 as SHA (hash) import qualified Crypto.Hash.SHA512 as SHA (hash)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Base64 as B64 (encode) import qualified Data.ByteString.Base64 as B64 (encode)
import qualified Data.ByteString.Char8 as B
import qualified Data.IxSet as IxSet import qualified Data.IxSet as IxSet
import qualified Data.Text as Text import qualified Data.Text as Text

View file

@ -1,4 +1,6 @@
{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Locales where module Locales where

View file

@ -1,15 +1,21 @@
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, GeneralizedNewtypeDeriving, {-# LANGUAGE DeriveDataTypeable #-}
DeriveDataTypeable, FlexibleContexts, MultiParamTypeClasses, TemplateHaskell, {-# LANGUAGE FlexibleContexts #-}
TypeFamilies, RecordWildCards, BangPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where module Main where
import Control.Applicative ((<$>), (<*>), optional, pure) import Control.Applicative (optional, pure, (<$>), (<*>))
import Control.Exception (bracket) import Control.Exception (bracket)
import Control.Monad (msum, mzero, when, unless) import Control.Monad (msum, mzero, unless, when)
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Control.Monad.State (get, put)
import Control.Monad.Reader (ask) import Control.Monad.Reader (ask)
import Control.Monad.State (get, put)
import qualified Crypto.Hash.SHA512 as SHA import qualified Crypto.Hash.SHA512 as SHA
import Data.Acid import Data.Acid
import Data.Acid.Advanced import Data.Acid.Advanced
@ -19,10 +25,10 @@ import Data.ByteString.Char8 (ByteString, pack, unpack)
import Data.Data (Data, Typeable) import Data.Data (Data, Typeable)
import Data.Maybe (fromJust) import Data.Maybe (fromJust)
import Data.Monoid (mempty) import Data.Monoid (mempty)
import Data.SafeCopy (base, deriveSafeCopy)
import Data.Text (Text) import Data.Text (Text)
import qualified Data.Text as T import qualified Data.Text as T
import Data.Time import Data.Time
import Data.SafeCopy (base, deriveSafeCopy)
import Happstack.Server hiding (Session) import Happstack.Server hiding (Session)
import Happstack.Server.Compression import Happstack.Server.Compression
import Network.Captcha.ReCaptcha import Network.Captcha.ReCaptcha
@ -30,7 +36,8 @@ import Options
import System.Locale (defaultTimeLocale) import System.Locale (defaultTimeLocale)
import Blog import Blog
import BlogDB hiding (addComment, updateEntry, deleteComment) import BlogDB hiding (addComment, deleteComment,
updateEntry)
import Locales import Locales
import RSS import RSS

View file

@ -5,12 +5,12 @@ module RSS (renderFeed) where
import qualified Data.Text as T import qualified Data.Text as T
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Data.Time (getCurrentTime, UTCTime) import Data.Time (UTCTime, getCurrentTime)
import Network.URI import Network.URI
import Text.RSS import Text.RSS
import Locales
import BlogDB hiding (Title) import BlogDB hiding (Title)
import Locales
createChannel :: BlogLang -> UTCTime -> [ChannelElem] createChannel :: BlogLang -> UTCTime -> [ChannelElem]
createChannel l now = [ Language $ show l createChannel l now = [ Language $ show l