Skip to content

Commit

Permalink
cabalize
Browse files Browse the repository at this point in the history
  • Loading branch information
informatikr committed Feb 28, 2011
1 parent 148ec99 commit fd56cbf
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
redis
dist
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright (c)2011, Falko Peters

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Falko Peters nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 2 additions & 0 deletions Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ main = withSocketsDo $ do
(Message c "logout") -> unsubscribe "myChan"
_ -> return ()

sendRequest ["PING"]

print pong1

hClose h
2 changes: 2 additions & 0 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
39 changes: 39 additions & 0 deletions redis-client.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: redis-client
version: 0.1
synopsis: A client for the Redis datastore.
Description: TODO cabal description
license: BSD3
license-file: LICENSE
author: Falko Peters
maintainer: [email protected]
copyright: Copyright (c) 2009-2010 Falko Peters
category: Database

build-type: Simple


-- Extra files to be distributed with the package, such as examples or
-- a README.
-- Extra-source-files:

-- Constraint on the version of Cabal needed to build this package.
Cabal-Version: >=1.2


Library
Hs-Source-Dirs: src
Exposed-modules: Database.Redis
Build-depends: base >= 4,
network >= 2,
bytestring >= 0.9,
mtl >= 2,
attoparsec >= 0.8
Other-modules: Database.Redis.Internal,
Database.Redis.PubSub,
Database.Redis.Reply,
Database.Redis.Request


source-repository head
type: git
location: https://github.com/informatikr/redis-client
7 changes: 7 additions & 0 deletions src/Database/Redis.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Database.Redis (
module Database.Redis.Internal,
module Database.Redis.PubSub
) where

import Database.Redis.Internal
import Database.Redis.PubSub
6 changes: 3 additions & 3 deletions Internal.hs → src/Database/Redis/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Internal (
module Database.Redis.Internal (
module Network,
Connection(..),
connectTo,
Expand All @@ -19,8 +19,8 @@ import Network (HostName(..), PortID(..), withSocketsDo)
import qualified Network (connectTo)
import System.IO (Handle, hClose, hFlush)

import Reply
import Request
import Database.Redis.Reply
import Database.Redis.Request


type Connection = Handle
Expand Down
6 changes: 3 additions & 3 deletions PubSub.hs → src/Database/Redis/PubSub.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module PubSub (
module Database.Redis.PubSub (
PubSub,
Message(Message, PMessage),
pubSub,
Expand All @@ -13,8 +13,8 @@ import Control.Monad.Writer
import qualified Data.ByteString.Char8 as B
import Data.Maybe

import Reply
import Internal
import Database.Redis.Reply
import Database.Redis.Internal


newtype PubSub a = PubSub (WriterT PuSubActions IO a)
Expand Down
2 changes: 1 addition & 1 deletion Reply.hs → src/Database/Redis/Reply.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
module Reply (Reply(..), parseReply) where
module Database.Redis.Reply (Reply(..), parseReply) where

import Prelude hiding (error, take)
import Control.Applicative
Expand Down
2 changes: 1 addition & 1 deletion Request.hs → src/Database/Redis/Request.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
module Request where
module Database.Redis.Request where

import qualified Data.ByteString.Char8 as S

Expand Down

0 comments on commit fd56cbf

Please sign in to comment.