Permalink
Browse files

Merge pull request #11 from mjorlitzky/doctests

Doctests
  • Loading branch information...
2 parents 5f5c324 + 8be25fc commit caa33facf8631b23e5fded0af1daeb4d36971d91 @kazu-yamamoto committed Sep 12, 2013
Showing with 409 additions and 184 deletions.
  1. +11 −0 Doctests.hs
  2. +22 −20 Network/DNS.hs
  3. +257 −36 Network/DNS/Lookup.hs
  4. +88 −39 Network/DNS/Resolver.hs
  5. +31 −1 dns.cabal
  6. +0 −88 test2/LookupSpec.hs
View
@@ -0,0 +1,11 @@
+module Main
+where
+
+import Test.DocTest
+import System.FilePath.Find ((==?), always, extension, find)
+
+find_sources :: IO [FilePath]
+find_sources = find always (extension ==? ".hs") "Network"
+
+main :: IO ()
+main = find_sources >>= doctest
View
@@ -1,35 +1,37 @@
-{-|
- Thread-safe DNS library written in Haskell.
-
- This code is written in Haskell, not using FFI.
-
- Sample code for DNS lookup:
-
-@
- import qualified Network.DNS as DNS (lookup)
- import Network.DNS hiding (lookup)
- main :: IO ()
- main = do
- rs <- makeResolvSeed defaultResolvConf
- withResolver rs $ \\resolver -> do
- DNS.lookup resolver \"www.example.com\" A >>= print
-@
--}
-
+-- | The Network.DNS module re-exports all other exposed modules for
+-- convenience.
+--
+-- Applications will most likely use the high-level interface, while
+-- library/daemon authors may need to use the lower-level one.
+--
module Network.DNS (
-- * High level
module Network.DNS.Lookup
+ -- | The "Network.DNS.Lookup" module contains simple functions to
+ -- perform various DNS lookups. If you simply want to resolve a
+ -- hostname ('lookupA'), or find a domain's MX record
+ -- ('lookupMX'), this is the easiest way to do it.
+
, module Network.DNS.Resolver
+ -- | The "Network.DNS.Resolver" module is slightly more low-level
+ -- than "Network.DNS.Lookup". If you need to do something unusual,
+ -- you may need to use the 'lookup', 'lookupAuth', or 'lookupRaw'
+ -- functions.
+
, module Network.DNS.Types
+ -- | All of the types that the other modules use.
+
-- * Low level
, module Network.DNS.Decode
+ -- | Decoding a response.
+
, module Network.DNS.Encode
+ -- | Encoding a query.
+
) where
import Network.DNS.Lookup
import Network.DNS.Resolver
import Network.DNS.Types
import Network.DNS.Decode
import Network.DNS.Encode
-
-
Oops, something went wrong.

0 comments on commit caa33fa

Please sign in to comment.