From ba87ca171f0a058f501655ffa6f6e845f2f800a6 Mon Sep 17 00:00:00 2001 From: pho Date: Wed, 3 Oct 2007 23:42:19 +0900 Subject: [PATCH] Doc fix darcs-hash:20071003144219-62b54-a8806574b4e19ed0c6f02a9e35f981344ec64612.gz --- Network/HTTP/Lucu/Abortion.hs | 17 +++++++++-------- Network/HTTP/Lucu/Config.hs | 6 +++--- Network/HTTP/Lucu/ETag.hs | 6 +++--- Network/HTTP/Lucu/Httpd.hs | 7 ++++--- Network/HTTP/Lucu/MIMEType/Guess.hs | 6 +++--- Network/HTTP/Lucu/Parser.hs | 22 ++++++++++++---------- 6 files changed, 34 insertions(+), 30 deletions(-) diff --git a/Network/HTTP/Lucu/Abortion.hs b/Network/HTTP/Lucu/Abortion.hs index fd4903d..ef70477 100644 --- a/Network/HTTP/Lucu/Abortion.hs +++ b/Network/HTTP/Lucu/Abortion.hs @@ -1,7 +1,7 @@ -- #prune --- | Aborting the computation of 'Network.HTTP.Lucu.Resource.Resource' --- in any IO monads or arrows. +-- |Aborting the computation of 'Network.HTTP.Lucu.Resource.Resource' +-- in any 'Prelude.IO' monads or arrows. module Network.HTTP.Lucu.Abortion ( Abortion(..) , abort @@ -37,12 +37,13 @@ data Abortion = Abortion { , aboMessage :: !(Maybe String) } deriving (Show, Typeable) --- | Computation of @'abort' status headers msg@ aborts the +-- |Computation of @'abort' status headers msg@ aborts the -- 'Network.HTTP.Lucu.Resource.Resource' monad with given status, -- additional response headers, and optional message string. -- --- What this really does is to just throw a special DynException. The --- exception will be caught by the system. +-- What this really does is to just throw a special +-- 'Control.Exception.DynException'. The exception will be caught by +-- the Lucu. -- -- 1. If the 'Network.HTTP.Lucu.Resource.Resource' is in the /Deciding -- Header/ or any precedent states, it is possible to use the @@ -69,15 +70,15 @@ abort status headers msg liftIO $ throwIO exc {-# SPECIALIZE abort :: StatusCode -> [ (String, String) ] -> Maybe String -> Resource a #-} --- | Computation of @'abortSTM' status headers msg@ just computes --- 'abort' in a STM monad. +-- |Computation of @'abortSTM' status headers msg@ just computes +-- 'abort' in a 'Control.Monad.STM.STM' monad. abortSTM :: StatusCode -> [ (String, String) ] -> Maybe String -> STM a abortSTM status headers msg = status `seq` headers `seq` msg `seq` unsafeIOToSTM $! abort status headers msg -- | Computation of @'abortA' -< (status, (headers, msg))@ just --- computes 'abort' in an ArrowIO. +-- computes 'abort' in an 'Control.Arrow.ArrowIO.ArrowIO'. abortA :: ArrowIO a => a (StatusCode, ([ (String, String) ], Maybe String)) c abortA = arrIO3 abort diff --git a/Network/HTTP/Lucu/Config.hs b/Network/HTTP/Lucu/Config.hs index b605d81..3d256ed 100644 --- a/Network/HTTP/Lucu/Config.hs +++ b/Network/HTTP/Lucu/Config.hs @@ -46,9 +46,9 @@ data Config = Config { -- guessed only by file name. -- -- Guessing by file magic is indeed a wonderful idea but that is - -- not implemented (yet). But hey, don't you think it's better a - -- file system got a MIME Type as a part of inode? Or it might be - -- a good idea to use GnomeVFS + -- not implemented (yet). But, don't you think it's better a file + -- system got a MIME Type as a part of inode? Or it might be a + -- good idea to use GnomeVFS -- () -- instead of vanilla FS. , cnfExtToMIMEType :: !ExtMap diff --git a/Network/HTTP/Lucu/ETag.hs b/Network/HTTP/Lucu/ETag.hs index c75394f..20fa047 100644 --- a/Network/HTTP/Lucu/ETag.hs +++ b/Network/HTTP/Lucu/ETag.hs @@ -33,13 +33,13 @@ instance Show ETag where ++ quoteStr token --- |This is equivalent to @'ETag' False@. If you want to generate --- an ETag from a file, try using +-- |This is equivalent to @'ETag' 'Prelude.False'@. If you want to +-- generate an ETag from a file, try using -- 'Network.HTTP.Lucu.StaticFile.generateETagFromFile'. strongETag :: String -> ETag strongETag = ETag False --- |This is equivalent to @'ETag' True@. +-- |This is equivalent to @'ETag' 'Prelude.True'@. weakETag :: String -> ETag weakETag = ETag True diff --git a/Network/HTTP/Lucu/Httpd.hs b/Network/HTTP/Lucu/Httpd.hs index 2b81de1..cbbb517 100644 --- a/Network/HTTP/Lucu/Httpd.hs +++ b/Network/HTTP/Lucu/Httpd.hs @@ -15,14 +15,15 @@ import Network.HTTP.Lucu.ResponseWriter import System.IO import System.Posix.Signals --- | This is the entry point of Lucu httpd. It listens to a socket and +-- |This is the entry point of Lucu httpd. It listens to a socket and -- waits for clients. Computation of 'runHttpd' never stops by itself -- so the only way to stop it is to raise an exception in the thread -- computing it. -- -- Note that 'runHttpd' automatically makes SIGPIPE be ignored by --- computing @installHandler sigPIPE Ignore Nothing@. This can hardly --- cause a problem but it may do. +-- computing @'System.Posix.Signals.installHandler' +-- 'System.Posix.Signals.sigPIPE' 'System.Posix.Signals.Ignore' +-- 'Prelude.Nothing'@. This can hardly cause a problem but it may do. -- -- Example: -- diff --git a/Network/HTTP/Lucu/MIMEType/Guess.hs b/Network/HTTP/Lucu/MIMEType/Guess.hs index 6f46326..dfcceb9 100644 --- a/Network/HTTP/Lucu/MIMEType/Guess.hs +++ b/Network/HTTP/Lucu/MIMEType/Guess.hs @@ -1,5 +1,5 @@ --- |MIME Type guesser which guesses by a file extension. This is a --- poor man's way of guessing MIME Types. It is simple and fast. +-- |MIME Type guessing by a file extension. This is a poor man's way +-- of guessing MIME Types. It is simple and fast. -- -- In general you don't have to use this module directly. module Network.HTTP.Lucu.MIMEType.Guess @@ -23,7 +23,7 @@ import Network.HTTP.Lucu.Parser.Http import Network.HTTP.Lucu.Utils import System.IO --- |Map from extension to MIME Type. +-- |'Data.Map.Map' from extension to MIME Type. type ExtMap = Map String MIMEType -- |Guess the MIME Type of file. diff --git a/Network/HTTP/Lucu/Parser.hs b/Network/HTTP/Lucu/Parser.hs index cc12cd7..f2e4be3 100644 --- a/Network/HTTP/Lucu/Parser.hs +++ b/Network/HTTP/Lucu/Parser.hs @@ -1,7 +1,8 @@ --- |Yet another parser combinator. This is mostly a subset of Parsec --- but there are some differences: +-- |Yet another parser combinator. This is mostly a subset of +-- "Text.ParserCombinators.Parsec" but there are some differences: -- --- * This parser works on ByteString instead of String. +-- * This parser works on 'Data.ByteString.Base.LazyByteString' +-- instead of 'Prelude.String'. -- -- * Backtracking is the only possible behavior so there is no \"try\" -- action. @@ -50,11 +51,11 @@ module Network.HTTP.Lucu.Parser where import Control.Monad.State.Strict +import Data.ByteString.Base (LazyByteString) +import Data.ByteString.Lazy () import qualified Data.ByteString.Lazy.Char8 as B -import Data.ByteString.Lazy.Char8 (ByteString) - --- |@Parser a@ is obviously a parser which parses and returns @a@. +-- |@'Parser' a@ is obviously a parser which parses and returns @a@. newtype Parser a = Parser { runParser :: State ParserState (ParserResult a) } @@ -62,7 +63,7 @@ newtype Parser a = Parser { data ParserState = PST { - pstInput :: ByteString + pstInput :: LazyByteString , pstIsEOFFatal :: !Bool } deriving (Eq, Show) @@ -87,13 +88,14 @@ instance Monad Parser where return x = x `seq` Parser $! return $! Success x fail _ = Parser $! return $! IllegalInput --- |@'failP'@ is just a synonym for @'Prelude.fail Prelude.undefined'@. +-- |@'failP'@ is just a synonym for @'Prelude.fail' +-- 'Prelude.undefined'@. failP :: Parser a failP = fail undefined -- |@'parse' p bstr@ parses @bstr@ with @p@ and returns @(result, -- remaining)@. -parse :: Parser a -> ByteString -> (ParserResult a, ByteString) +parse :: Parser a -> LazyByteString -> (ParserResult a, LazyByteString) parse p input -- input は lazy である必要有り。 = p `seq` let (result, state') = runState (runParser p) (PST input True) @@ -101,7 +103,7 @@ parse p input -- input は lazy である必要有り。 result `seq` (result, pstInput state') -- pstInput state' も lazy である必要有り。 -- |@'parseStr' p str@ packs @str@ and parses it. -parseStr :: Parser a -> String -> (ParserResult a, ByteString) +parseStr :: Parser a -> String -> (ParserResult a, LazyByteString) parseStr p input = p `seq` -- input は lazy である必要有り。 parse p $! B.pack input -- 2.40.0