packages feed

eternal 0.1.0 → 0.1.1

raw patch · 10 files changed

+34/−190 lines, 10 filesdep −bytestringdep −conduitdep −conduit-extra

Dependencies removed: bytestring, conduit, conduit-extra, directory, filepath, http-conduit, http-types, network, process, regex-compat

Files

LICENSE view
@@ -1,30 +1,30 @@-Copyright 2014 Heather Cynede--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions-are met:--1. Redistributions of source code must retain the above copyright-   notice, this list of conditions and the following disclaimer.--2. 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.--3. Neither the name of the author nor the names of his contributors-   may be used to endorse or promote products derived from this software-   without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.+Copyright 2014 Heather Cynede
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. 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.
+
+3. Neither the name of the author nor the names of his contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
eternal.cabal view
@@ -1,11 +1,11 @@ name:       eternal
 category:   Control
-version:    0.1.0
+version:       0.1.1
 author:        Heather Cynede
 maintainer:    Heather Cynede <Cynede@Gentoo.org>
-license: BSD3
-license-file: LICENSE
-synopsis: everything breaking the Fairbairn threshold
+license:       BSD3
+license-file:  LICENSE
+synopsis:      everything breaking the Fairbairn threshold
 description:
   Everything breaking the Fairbairn threshold
   but in the same time usable in other projects
@@ -20,34 +20,15 @@     Control.Eternal
     
     Control.Eternal.Syntax
-    Control.Eternal.String
-    Control.Eternal.System
-    Control.Eternal.Algorithms
     Control.Eternal.Reactive
     
     Control.Eternal.Syntax.Operators
     Control.Eternal.Syntax.Unicode
     Control.Eternal.Syntax.Lift
     Control.Eternal.Syntax.Logic
-    
-    Control.Eternal.System.FileSystem
-    Control.Eternal.System.Exec
-    Control.Eternal.System.HTTP
-    
-    Control.Eternal.Algorithms.NaturalSort
 
   Build-Depends:  
     base >= 4.3 && < 5
-    , directory
-    , filepath
-    , regex-compat
-    , process
-    , network
-    , http-types
-    , conduit
-    , conduit-extra
-    , http-conduit
     , transformers
     , utf8-string
-    , bytestring
     , base-unicode-symbols
src/Control/Eternal.hs view
@@ -1,13 +1,7 @@ module Control.Eternal
   ( module Control.Eternal.Syntax
-  , module Control.Eternal.String
-  , module Control.Eternal.System
-  , module Control.Eternal.Algorithms
   , module Control.Eternal.Reactive
   ) where
 
 import Control.Eternal.Syntax
-import Control.Eternal.String
-import Control.Eternal.System
-import Control.Eternal.Algorithms
 import Control.Eternal.Reactive
− src/Control/Eternal/Algorithms.hs
@@ -1,5 +0,0 @@-module Control.Eternal.Algorithms
-  ( module Control.Eternal.Algorithms.NaturalSort
-  ) where
-
-import Control.Eternal.Algorithms.NaturalSort
− src/Control/Eternal/Algorithms/NaturalSort.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}
-module Control.Eternal.Algorithms.NaturalSort
-  ( nSort
-  ) where
-
-import Data.List
-import Data.Char
-
-import Control.Eternal.Syntax
-
-nSort   ::  [String] → [String]
-nSort s =   if all allFloat s then    
-                let { readFloat = read :: String → Float } 
-                in  (map show ∘ sortBy compare ∘ map readFloat) s
-            else sortBy natComp s
-    where allFloat = all (\x → isDigit x ∨ '.' ≡ 'x')
-
-natComp ::  String → String → Ordering
-natComp [] []                       = EQ
-natComp [] _                        = LT
-natComp _ []                        = GT
-natComp xxs@(x:xs) yys@(y:ys)
-    | noDigit x ∧ noDigit y ∧ x ≡ y = natComp xs ys
-    | noDigit x ∨ noDigit y         = compare x y
-    | nx == ny                      = natComp rx ry
-    | otherwise                     = compare nx ny
-    where   (nx,rx)     = getNumber xxs
-            (ny,ry)     = getNumber yys
-            noDigit     = not ∘ isDigit
-            getNumber s = let { digits = takeWhile isDigit s }
-                          in (read digits :: Integer, drop (length digits) s)
− src/Control/Eternal/String.hs
@@ -1,16 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}
-module Control.Eternal.String
-  ( trim
-  ) where
-
-import Data.Char (isSpace)
-
-trim :: String → String
-trim xs = dropSpaceTail "" $ dropWhile isSpace xs
-
-dropSpaceTail :: String → String → String
-dropSpaceTail maybeStuff "" = ""
-dropSpaceTail maybeStuff (x:xs)
-        | isSpace x       = dropSpaceTail (x:maybeStuff) xs
-        | null maybeStuff = x : dropSpaceTail "" xs
-        | otherwise       = reverse maybeStuff ++ x : dropSpaceTail "" xs
− src/Control/Eternal/System.hs
@@ -1,9 +0,0 @@-module Control.Eternal.System
-  ( module Control.Eternal.System.FileSystem
-  , module Control.Eternal.System.Exec
-  , module Control.Eternal.System.HTTP
-  ) where
-
-import Control.Eternal.System.FileSystem
-import Control.Eternal.System.Exec
-import Control.Eternal.System.HTTP
− src/Control/Eternal/System/Exec.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}
-module Control.Eternal.System.Exec
-  ( exec
-  , exc
-  ) where
-
-import System.Directory (setCurrentDirectory)
-import System.Process (waitForProcess)
-import System.Cmd (system)
-
-import Control.Eternal.Syntax
-
-exec :: String → IO()
-exec args = system args ≫ return ()
-
-exc :: String → String → IO()
-exc path args = setCurrentDirectory path ≫ exec args
− src/Control/Eternal/System/FileSystem.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}
-module Control.Eternal.System.FileSystem
-  ( copyDir
-  ) where
-
-import System.Directory(createDirectory, getDirectoryContents, doesDirectoryExist, copyFile)
-import Control.Monad(forM_)
-
-import System.FilePath((</>))
-
-import Control.Eternal.Syntax
-
-copyDir :: FilePath → FilePath → IO ()
-copyDir src dst = do
-    createDirectory dst
-    content ← getDirectoryContents src
-    let xs = filter (∉ [".", ".."]) content
-    forM_ xs $ \name → let srcPath = src </> name
-                           dstPath = dst </> name
-        in doesDirectoryExist srcPath >>= \dirExist →
-            if dirExist then copyDir srcPath dstPath
-                        else copyFile srcPath dstPath
− src/Control/Eternal/System/HTTP.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}
-module Control.Eternal.System.HTTP
-  ( getHTTP
-  , download
-  ) where
-
-import Network.Socket (withSocketsDo)
-import Network.HTTP.Conduit
-
-import Data.Conduit.Binary (sinkFile)
-import Network.HTTP.Types
-
-import qualified Data.Conduit as C
-import qualified Data.ByteString.Lazy as L
-import qualified Codec.Binary.UTF8.String as S
-
-import Control.Monad.IO.Class (liftIO)
-
-getHTTP :: [Char] → IO String
-getHTTP url = withSocketsDo
-    $ simpleHttp url
-        >>= \bs → return $ S.decode $ L.unpack bs
-
-download :: String → String → IO()
-download url filename = withSocketsDo $ do
-    irequest ← liftIO $ parseUrl url
-    withManager $ \manager → do
-        let request = irequest
-             { method = methodGet }
-        response ← http request manager
-        responseBody response C.$$+- sinkFile filename