Skip to content

Commit

Permalink
Adding 'Network' prefix back to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBurton committed Feb 19, 2012
1 parent 470e90f commit 36e9fa5
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 24 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -34,21 +34,23 @@ but at the same time tries to use a sensible implementation that
can easily work with other programming languages and systems.

{-# LANGUAGE OverloadedStrings #-}
import NetSpec.ByteString
import Network.NetSpec.ByteString

-- or --

{-# LANGUAGE OverloadedStrings #-}
import NetSpec.Text
import Network.NetSpec.Text

-- or --

{-# LANGUAGE TemplateHaskell #-}
import NetSpec.Json
import Network.NetSpec.Json

You select whether you are a server or a client based on
which kind of spec you run.

import Network.NetSpec

main = runSpec ServerSpec { ... }

-- or --
Expand Down
4 changes: 2 additions & 2 deletions examples/BlackjackClient.hs
@@ -1,7 +1,7 @@
import BlackjackData

import NetSpec
import NetSpec.Json
import Network.NetSpec
import Network.NetSpec.Json

import Control.Monad (void)
import Data.List (intercalate)
Expand Down
2 changes: 1 addition & 1 deletion examples/BlackjackData.hs
Expand Up @@ -2,7 +2,7 @@

module BlackjackData where

import NetSpec.Json
import Network.NetSpec.Json


data Suit = Heart
Expand Down
4 changes: 2 additions & 2 deletions examples/BlackjackServer.hs
@@ -1,7 +1,7 @@
import BlackjackData

import NetSpec
import NetSpec.Json
import Network.NetSpec
import Network.NetSpec.Json
import Control.Monad

-- cabal install random-shuffle
Expand Down
4 changes: 2 additions & 2 deletions examples/Chat.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}

import NetSpec
import NetSpec.Text
import Network.NetSpec
import Network.NetSpec.Text

-- Notice the restrictions NetSpec places on how you can communicate.
-- Working within NetSpec isn't well-suited for all situations;
Expand Down
4 changes: 2 additions & 2 deletions examples/Echo.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}

import NetSpec
import NetSpec.Text
import Network.NetSpec
import Network.NetSpec.Text

main :: IO ()
main = runSpec ServerSpec
Expand Down
4 changes: 2 additions & 2 deletions examples/Relay.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}

import NetSpec
import NetSpec.Text
import Network.NetSpec
import Network.NetSpec.Text

main :: IO ()
main = runSpec ServerSpec {
Expand Down
5 changes: 3 additions & 2 deletions examples/Telnet.hs
@@ -1,7 +1,8 @@
-- no need for OverloadedStrings

import NetSpec
import NetSpec.Text
import Network.NetSpec
import Network.NetSpec.Text

import System.Environment (getArgs)
import Data.Text as T
import Data.Text.IO as TIO
Expand Down
9 changes: 6 additions & 3 deletions netspec.cabal
@@ -1,5 +1,5 @@
name: netspec
version: 0.1.0.0
version: 0.2.0.0
synopsis: Simplify static Networking tasks

homepage: http://github.com/DanBurton/netspec
Expand All @@ -24,7 +24,10 @@ cabal-version: >=1.8

library
exposed-modules:
NetSpec, NetSpec.Json, NetSpec.Text, NetSpec.ByteString
Network.NetSpec,
Network.NetSpec.Json,
Network.NetSpec.Text,
Network.NetSpec.ByteString
build-depends:
base >= 4 && < 4.6,
aeson == 0.6.*,
Expand All @@ -44,4 +47,4 @@ source-repository head
source-repository this
type: git
location: git://github.com/DanBurton/netspec.git
tag: netspec-0.1.0.0
tag: netspec-0.2.0.0
2 changes: 1 addition & 1 deletion src/NetSpec.hs → src/Network/NetSpec.hs
@@ -1,5 +1,5 @@
-- | Simplify static Networking tasks.
module NetSpec (
module Network.NetSpec (
-- * Types and Constructors
NetSpec (..)
, SpecState (..)
Expand Down
Expand Up @@ -4,7 +4,7 @@
-- For this module, a message is prefixed by a
-- 64-bit little-endian signed integer, indicating the length in bytes
-- of the remaining message.
module NetSpec.ByteString (
module Network.NetSpec.ByteString (
-- * Receiving
receive
-- * Sending
Expand Down
4 changes: 2 additions & 2 deletions src/NetSpec/Json.hs → src/Network/NetSpec/Json.hs
Expand Up @@ -4,7 +4,7 @@
-- For this module, a message is prefixed by a
-- 64-bit little-endian signed integer, indicating the length in bytes
-- of the remaining message, which is encoded in JSON format.
module NetSpec.Json (
module Network.NetSpec.Json (
-- * Receiving
receive
-- * Sending
Expand All @@ -28,7 +28,7 @@ import Data.Aeson.TH (deriveJSON)
import Data.Foldable as F (Foldable, mapM_)
import Language.Haskell.TH (Name, Q, Dec)

import qualified NetSpec.ByteString as B (send, receive)
import qualified Network.NetSpec.ByteString as B (send, receive)

-- | Derives 'A.ToJSON' and 'A.FromJSON' instances
-- for your data types. These are necessary in order to
Expand Down
2 changes: 1 addition & 1 deletion src/NetSpec/Text.hs → src/Network/NetSpec/Text.hs
Expand Up @@ -3,7 +3,7 @@
-- | Use 'X.Text' to send and receive messages.
-- For this module, a message is a single line;
-- the newline character acts as the end-of-message flag.
module NetSpec.Text (
module Network.NetSpec.Text (
-- * Receiving
receive
-- * Sending
Expand Down

0 comments on commit 36e9fa5

Please sign in to comment.