packages feed

ZFS 0.0.1 → 0.0.2

raw patch · 3 files changed

+39/−25 lines, 3 filesdep ~basenew-uploader

Dependency ranges changed: base

Files

ZFS.cabal view
@@ -1,8 +1,11 @@ name:                ZFS-version:             0.0.1+version:             0.0.2  license:             PublicDomain author:              Amr Sabry, R. Kent Dybvig, Simon L. Peyton Jones, Oleg Kiselyov+maintainer:          Julian K. Arni <jkarni@gmail.com>+homepage:            https://github.com/jkarni/ZipperFS+bug-reports:         https://github.com/jkarni/ZipperFS/issues  stability:           Experimental category:            Monads@@ -14,17 +17,28 @@                      There are no unsafe operations, no GHC (let alone) Unix threads,                      no concurrency problems. Our threads can't even do IO and can't                      mutate any global state - and the type system sees to it.+                     .+                     To run, type @main' fs1@ on ghci after loading ZFS.hs.+                     Then from some other terminal, type 'telnet localhost 1503'.  data-files:          zfs.pdf, README-Cabal-Version:       >= 1.2+Cabal-Version:       >= 1.8 Tested-With:         GHC==6.8.2 build-type:          Simple -Library-        build-depends:       base>3, mtl, unix, network, containers, CC-delcont <= 0.2+source-repository head+    type: git+    location: git://github.com/jkarni/ZipperFS.git +Library+        build-depends:       base > 3 && < 5+                           , mtl+                           , unix+                           , network+                           , containers+                           , CC-delcont <= 0.2         hs-source-dirs:      src         exposed-modules:     ZFS, ZipperM -        ghc-options:         -Wall+        ghc-options:         -Wall -threaded         ghc-prof-options:    -prof -auto-all
src/ZFS.hs view
@@ -1,4 +1,7 @@-{-# OPTIONS -fglasgow-exts #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE ScopedTypeVariables #-}  {- Zipper-based File/Operating system@@ -17,16 +20,16 @@  import ZipperM -import Control.Exception (bracket)+import Control.Exception (try, bracket) import Control.Monad.Trans (liftIO, MonadIO())-import Data.List as List-import Data.Map  as Map+import qualified Data.List as List+import qualified Data.Map  as Map import Foreign                          -- needed for select hacks: import Foreign.C                        -- Unix select is not available in import Foreign.Ptr                      -- GHC import Network.Socket import System.IO-import System.IO.Error as IO+import qualified System.IO.Error as IO import System.Posix (closeFd) import System.Posix.Types(Fd(..)) @@ -89,8 +92,6 @@                      , osPrompt  :: Prompt r (OSReq r IO)                      } -main = main' fs1- main' :: Term -> IO a main' fs = bracket (serverSocket newClientPort) sClose $   \s ->@@ -168,9 +169,9 @@       syslog ["reading from",show s]       syslog ["osloop: queue size: ", show $ length $ jobQueue world]       dat <- liftIO $ (-             do r <-  IO.try (recv s (1024 * 8))+             do r <- try (recv s (1024 * 8))                 case r of-                       Left err  -> if isEOFError err then return ""+                       Left err  -> if IO.isEOFError err then return ""                                     else ioError err                        Right msg -> return msg)       k (return dat) >>= interpret'req world ctx@@ -367,13 +368,16 @@                                         (Monad m, Monad m1) =>                                         FSZipper r m -> t -> t1 -> t2 -> m1 (FSCmdResp r1 m2) cmd'help z _ _ _ = return $ FSCS $ "Commands: " ++-                     (concat $ intersperse ", " $ List.map fst cmds)+                     (concat $ List.intersperse ", " $ List.map fst cmds)   where-  cmds = fsCommands-  -- The following statement does nothing at run-time. It is here-  -- just to tell the typechecker that the monad `m' in fsCommands and-  -- that in 'z' are the same-  _ = snd (head cmds) z++   cmds :: [(String, FSZipper r2 m+                    -> Prompt r2 (OSReq r2 m)+                    -> String+                    -> String+                    -> String+                    -> CCT r2 m (OSReq r2 m))]+   cmds = fsCommands  cmd'ls :: forall t                                              r
src/ZipperM.hs view
@@ -1,8 +1,4 @@-{-# OPTIONS -fglasgow-exts #-}---- Zipper over the Map with path accumulation--- $Id: ZipperM.hs,v 1.4 2005/09/22 03:06:38 oleg Exp $-+{-# LANGUAGE ScopedTypeVariables #-} module ZipperM (Term(..)                , FileName                , FileCont