packages feed

MissingH 1.1.0.2 → 1.1.0.3

raw patch · 38 files changed

+2837/−11 lines, 38 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Data.Hash.MD5.Zord64_HARD: data Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Bits Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Bounded Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Enum Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Eq Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Integral Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Num Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Ord Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Read Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Real Zord64
- Data.Hash.MD5.Zord64_HARD: instance [overlap ok] Show Zord64
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFS a) => HVFS (HVFSChroot a)
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFS a) => HVFS (HVFSReadOnly a)
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFS a) => Show (HVFSChroot a)
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFS a) => Show (HVFSReadOnly a)
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFSOpenable a) => HVFSOpenable (HVFSChroot a)
- System.IO.HVFS.Combinators: instance [overlap ok] (HVFSOpenable a) => HVFSOpenable (HVFSReadOnly a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFS a => HVFS (HVFSChroot a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFS a => HVFS (HVFSReadOnly a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFS a => Show (HVFSChroot a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFS a => Show (HVFSReadOnly a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFSOpenable a => HVFSOpenable (HVFSChroot a)
+ System.IO.HVFS.Combinators: instance [overlap ok] HVFSOpenable a => HVFSOpenable (HVFSReadOnly a)
- Data.Bits.Utils: fromBytes :: (Bits a) => [a] -> a
+ Data.Bits.Utils: fromBytes :: Bits a => [a] -> a
- Data.Either.Utils: eitherToMonadError :: (MonadError e m) => Either e a -> m a
+ Data.Either.Utils: eitherToMonadError :: MonadError e m => Either e a -> m a
- Data.Either.Utils: forceEither :: (Show e) => Either e a -> a
+ Data.Either.Utils: forceEither :: Show e => Either e a -> a
- Data.Either.Utils: forceEitherMsg :: (Show e) => String -> Either e a -> a
+ Data.Either.Utils: forceEitherMsg :: Show e => String -> Either e a -> a
- Data.Either.Utils: maybeToEither :: (MonadError e m) => e -> Maybe a -> m a
+ Data.Either.Utils: maybeToEither :: MonadError e m => e -> Maybe a -> m a
- Data.Hash.MD5: finished :: (MD5 a) => a -> Bool
+ Data.Hash.MD5: finished :: MD5 a => a -> Bool
- Data.Hash.MD5: get_next :: (MD5 a) => a -> ([Word32], Int, a)
+ Data.Hash.MD5: get_next :: MD5 a => a -> ([Word32], Int, a)
- Data.Hash.MD5: len_pad :: (MD5 a) => Zord64 -> a -> a
+ Data.Hash.MD5: len_pad :: MD5 a => Zord64 -> a -> a
- Data.Hash.MD5: md5 :: (MD5 a) => a -> ABCD
+ Data.Hash.MD5: md5 :: MD5 a => a -> ABCD
- Data.Hash.MD5: md5i :: (MD5 a) => a -> Integer
+ Data.Hash.MD5: md5i :: MD5 a => a -> Integer
- Data.Hash.MD5: md5s :: (MD5 a) => a -> String
+ Data.Hash.MD5: md5s :: MD5 a => a -> String
- Data.List.Utils: addToAL :: (Eq key) => [(key, elt)] -> key -> elt -> [(key, elt)]
+ Data.List.Utils: addToAL :: Eq key => [(key, elt)] -> key -> elt -> [(key, elt)]
- Data.List.Utils: alwaysElemRIndex :: (Eq a) => a -> [a] -> Int
+ Data.List.Utils: alwaysElemRIndex :: Eq a => a -> [a] -> Int
- Data.List.Utils: contains :: (Eq a) => [a] -> [a] -> Bool
+ Data.List.Utils: contains :: Eq a => [a] -> [a] -> Bool
- Data.List.Utils: countElem :: (Eq a) => a -> [a] -> Int
+ Data.List.Utils: countElem :: Eq a => a -> [a] -> Int
- Data.List.Utils: delFromAL :: (Eq key) => [(key, a)] -> key -> [(key, a)]
+ Data.List.Utils: delFromAL :: Eq key => [(key, a)] -> key -> [(key, a)]
- Data.List.Utils: elemRIndex :: (Eq a) => a -> [a] -> Maybe Int
+ Data.List.Utils: elemRIndex :: Eq a => a -> [a] -> Maybe Int
- Data.List.Utils: endswith :: (Eq a) => [a] -> [a] -> Bool
+ Data.List.Utils: endswith :: Eq a => [a] -> [a] -> Bool
- Data.List.Utils: genericJoin :: (Show a) => String -> [a] -> String
+ Data.List.Utils: genericJoin :: Show a => String -> [a] -> String
- Data.List.Utils: hasAny :: (Eq a) => [a] -> [a] -> Bool
+ Data.List.Utils: hasAny :: Eq a => [a] -> [a] -> Bool
- Data.List.Utils: hasKeyAL :: (Eq a) => a -> [(a, b)] -> Bool
+ Data.List.Utils: hasKeyAL :: Eq a => a -> [(a, b)] -> Bool
- Data.List.Utils: merge :: (Ord a) => [a] -> [a] -> [a]
+ Data.List.Utils: merge :: Ord a => [a] -> [a] -> [a]
- Data.List.Utils: replace :: (Eq a) => [a] -> [a] -> [a] -> [a]
+ Data.List.Utils: replace :: Eq a => [a] -> [a] -> [a] -> [a]
- Data.List.Utils: split :: (Eq a) => [a] -> [a] -> [[a]]
+ Data.List.Utils: split :: Eq a => [a] -> [a] -> [[a]]
- Data.List.Utils: startswith :: (Eq a) => [a] -> [a] -> Bool
+ Data.List.Utils: startswith :: Eq a => [a] -> [a] -> Bool
- Data.List.Utils: subIndex :: (Eq a) => [a] -> [a] -> Maybe Int
+ Data.List.Utils: subIndex :: Eq a => [a] -> [a] -> Maybe Int
- Data.List.Utils: uniq :: (Eq a) => [a] -> [a]
+ Data.List.Utils: uniq :: Eq a => [a] -> [a]
- Data.Progress.Tracker: withStatus :: (ProgressStatuses a b) => a -> (ProgressStatus -> b) -> b
+ Data.Progress.Tracker: withStatus :: ProgressStatuses a b => a -> (ProgressStatus -> b) -> b
- Data.String.Utils: endswith :: (Eq a) => [a] -> [a] -> Bool
+ Data.String.Utils: endswith :: Eq a => [a] -> [a] -> Bool
- Data.String.Utils: replace :: (Eq a) => [a] -> [a] -> [a] -> [a]
+ Data.String.Utils: replace :: Eq a => [a] -> [a] -> [a] -> [a]
- Data.String.Utils: split :: (Eq a) => [a] -> [a] -> [[a]]
+ Data.String.Utils: split :: Eq a => [a] -> [a] -> [[a]]
- Data.String.Utils: startswith :: (Eq a) => [a] -> [a] -> Bool
+ Data.String.Utils: startswith :: Eq a => [a] -> [a] -> Bool
- Network.Email.Mailbox: addFlags :: (MailboxWriter a b) => a -> [b] -> Flags -> IO ()
+ Network.Email.Mailbox: addFlags :: MailboxWriter a b => a -> [b] -> Flags -> IO ()
- Network.Email.Mailbox: appendMessages :: (MailboxWriter a b) => a -> [(Flags, Message)] -> IO [b]
+ Network.Email.Mailbox: appendMessages :: MailboxWriter a b => a -> [(Flags, Message)] -> IO [b]
- Network.Email.Mailbox: class (MailboxReader a b) => MailboxWriter a b
+ Network.Email.Mailbox: class MailboxReader a b => MailboxWriter a b
- Network.Email.Mailbox: deleteMessages :: (MailboxWriter a b) => a -> [b] -> IO ()
+ Network.Email.Mailbox: deleteMessages :: MailboxWriter a b => a -> [b] -> IO ()
- Network.Email.Mailbox: getAll :: (MailboxReader a b) => a -> IO [(b, Flags, Message)]
+ Network.Email.Mailbox: getAll :: MailboxReader a b => a -> IO [(b, Flags, Message)]
- Network.Email.Mailbox: getMessages :: (MailboxReader a b) => a -> [b] -> IO [(b, Flags, Message)]
+ Network.Email.Mailbox: getMessages :: MailboxReader a b => a -> [b] -> IO [(b, Flags, Message)]
- Network.Email.Mailbox: listIDs :: (MailboxReader a b) => a -> IO [b]
+ Network.Email.Mailbox: listIDs :: MailboxReader a b => a -> IO [b]
- Network.Email.Mailbox: listMessageFlags :: (MailboxReader a b) => a -> IO [(b, Flags)]
+ Network.Email.Mailbox: listMessageFlags :: MailboxReader a b => a -> IO [(b, Flags)]
- Network.Email.Mailbox: removeFlags :: (MailboxWriter a b) => a -> [b] -> Flags -> IO ()
+ Network.Email.Mailbox: removeFlags :: MailboxWriter a b => a -> [b] -> Flags -> IO ()
- Network.Email.Mailbox: setFlags :: (MailboxWriter a b) => a -> [b] -> Flags -> IO ()
+ Network.Email.Mailbox: setFlags :: MailboxWriter a b => a -> [b] -> Flags -> IO ()
- System.IO.Binary: fromBuf :: (BinaryConvertible a) => Int -> (Ptr CChar -> IO Int) -> IO [a]
+ System.IO.Binary: fromBuf :: BinaryConvertible a => Int -> (Ptr CChar -> IO Int) -> IO [a]
- System.IO.Binary: fullGetBlocks :: (BinaryConvertible b) => Int -> IO [[b]]
+ System.IO.Binary: fullGetBlocks :: BinaryConvertible b => Int -> IO [[b]]
- System.IO.Binary: fullGetBufStr :: (BinaryConvertible b) => Int -> IO [b]
+ System.IO.Binary: fullGetBufStr :: BinaryConvertible b => Int -> IO [b]
- System.IO.Binary: getBlocks :: (BinaryConvertible b) => Int -> IO [[b]]
+ System.IO.Binary: getBlocks :: BinaryConvertible b => Int -> IO [[b]]
- System.IO.Binary: getBufStr :: (BinaryConvertible b) => Int -> IO [b]
+ System.IO.Binary: getBufStr :: BinaryConvertible b => Int -> IO [b]
- System.IO.Binary: putBufStr :: (BinaryConvertible b) => [b] -> IO ()
+ System.IO.Binary: putBufStr :: BinaryConvertible b => [b] -> IO ()
- System.IO.Binary: toBuf :: (BinaryConvertible a) => [a] -> (Ptr CChar -> IO c) -> IO c
+ System.IO.Binary: toBuf :: BinaryConvertible a => [a] -> (Ptr CChar -> IO c) -> IO c
- System.IO.HVFS: class (Show a) => HVFS a
+ System.IO.HVFS: class Show a => HVFS a
- System.IO.HVFS: class (HVFS a) => HVFSOpenable a
+ System.IO.HVFS: class HVFS a => HVFSOpenable a
- System.IO.HVFS: class (Show a) => HVFSStat a
+ System.IO.HVFS: class Show a => HVFSStat a
- System.IO.HVFS: vAccessTime :: (HVFSStat a) => a -> EpochTime
+ System.IO.HVFS: vAccessTime :: HVFSStat a => a -> EpochTime
- System.IO.HVFS: vCreateDirectory :: (HVFS a) => a -> FilePath -> IO ()
+ System.IO.HVFS: vCreateDirectory :: HVFS a => a -> FilePath -> IO ()
- System.IO.HVFS: vCreateLink :: (HVFS a) => a -> FilePath -> FilePath -> IO ()
+ System.IO.HVFS: vCreateLink :: HVFS a => a -> FilePath -> FilePath -> IO ()
- System.IO.HVFS: vCreateSymbolicLink :: (HVFS a) => a -> FilePath -> FilePath -> IO ()
+ System.IO.HVFS: vCreateSymbolicLink :: HVFS a => a -> FilePath -> FilePath -> IO ()
- System.IO.HVFS: vDeviceID :: (HVFSStat a) => a -> DeviceID
+ System.IO.HVFS: vDeviceID :: HVFSStat a => a -> DeviceID
- System.IO.HVFS: vDoesDirectoryExist :: (HVFS a) => a -> FilePath -> IO Bool
+ System.IO.HVFS: vDoesDirectoryExist :: HVFS a => a -> FilePath -> IO Bool
- System.IO.HVFS: vDoesExist :: (HVFS a) => a -> FilePath -> IO Bool
+ System.IO.HVFS: vDoesExist :: HVFS a => a -> FilePath -> IO Bool
- System.IO.HVFS: vDoesFileExist :: (HVFS a) => a -> FilePath -> IO Bool
+ System.IO.HVFS: vDoesFileExist :: HVFS a => a -> FilePath -> IO Bool
- System.IO.HVFS: vFileGroup :: (HVFSStat a) => a -> GroupID
+ System.IO.HVFS: vFileGroup :: HVFSStat a => a -> GroupID
- System.IO.HVFS: vFileID :: (HVFSStat a) => a -> FileID
+ System.IO.HVFS: vFileID :: HVFSStat a => a -> FileID
- System.IO.HVFS: vFileMode :: (HVFSStat a) => a -> FileMode
+ System.IO.HVFS: vFileMode :: HVFSStat a => a -> FileMode
- System.IO.HVFS: vFileOwner :: (HVFSStat a) => a -> UserID
+ System.IO.HVFS: vFileOwner :: HVFSStat a => a -> UserID
- System.IO.HVFS: vFileSize :: (HVFSStat a) => a -> FileOffset
+ System.IO.HVFS: vFileSize :: HVFSStat a => a -> FileOffset
- System.IO.HVFS: vGetCurrentDirectory :: (HVFS a) => a -> IO FilePath
+ System.IO.HVFS: vGetCurrentDirectory :: HVFS a => a -> IO FilePath
- System.IO.HVFS: vGetDirectoryContents :: (HVFS a) => a -> FilePath -> IO [FilePath]
+ System.IO.HVFS: vGetDirectoryContents :: HVFS a => a -> FilePath -> IO [FilePath]
- System.IO.HVFS: vGetFileStatus :: (HVFS a) => a -> FilePath -> IO HVFSStatEncap
+ System.IO.HVFS: vGetFileStatus :: HVFS a => a -> FilePath -> IO HVFSStatEncap
- System.IO.HVFS: vGetModificationTime :: (HVFS a) => a -> FilePath -> IO ClockTime
+ System.IO.HVFS: vGetModificationTime :: HVFS a => a -> FilePath -> IO ClockTime
- System.IO.HVFS: vGetSymbolicLinkStatus :: (HVFS a) => a -> FilePath -> IO HVFSStatEncap
+ System.IO.HVFS: vGetSymbolicLinkStatus :: HVFS a => a -> FilePath -> IO HVFSStatEncap
- System.IO.HVFS: vIsBlockDevice :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsBlockDevice :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsCharacterDevice :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsCharacterDevice :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsDirectory :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsDirectory :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsNamedPipe :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsNamedPipe :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsRegularFile :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsRegularFile :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsSocket :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsSocket :: HVFSStat a => a -> Bool
- System.IO.HVFS: vIsSymbolicLink :: (HVFSStat a) => a -> Bool
+ System.IO.HVFS: vIsSymbolicLink :: HVFSStat a => a -> Bool
- System.IO.HVFS: vLinkCount :: (HVFSStat a) => a -> LinkCount
+ System.IO.HVFS: vLinkCount :: HVFSStat a => a -> LinkCount
- System.IO.HVFS: vModificationTime :: (HVFSStat a) => a -> EpochTime
+ System.IO.HVFS: vModificationTime :: HVFSStat a => a -> EpochTime
- System.IO.HVFS: vOpen :: (HVFSOpenable a) => a -> FilePath -> IOMode -> IO HVFSOpenEncap
+ System.IO.HVFS: vOpen :: HVFSOpenable a => a -> FilePath -> IOMode -> IO HVFSOpenEncap
- System.IO.HVFS: vOpenBinaryFile :: (HVFSOpenable a) => a -> FilePath -> IOMode -> IO HVFSOpenEncap
+ System.IO.HVFS: vOpenBinaryFile :: HVFSOpenable a => a -> FilePath -> IOMode -> IO HVFSOpenEncap
- System.IO.HVFS: vRaiseError :: (HVFS a) => a -> IOErrorType -> String -> Maybe FilePath -> IO c
+ System.IO.HVFS: vRaiseError :: HVFS a => a -> IOErrorType -> String -> Maybe FilePath -> IO c
- System.IO.HVFS: vReadFile :: (HVFSOpenable a) => a -> FilePath -> IO String
+ System.IO.HVFS: vReadFile :: HVFSOpenable a => a -> FilePath -> IO String
- System.IO.HVFS: vReadSymbolicLink :: (HVFS a) => a -> FilePath -> IO FilePath
+ System.IO.HVFS: vReadSymbolicLink :: HVFS a => a -> FilePath -> IO FilePath
- System.IO.HVFS: vRemoveDirectory :: (HVFS a) => a -> FilePath -> IO ()
+ System.IO.HVFS: vRemoveDirectory :: HVFS a => a -> FilePath -> IO ()
- System.IO.HVFS: vRemoveFile :: (HVFS a) => a -> FilePath -> IO ()
+ System.IO.HVFS: vRemoveFile :: HVFS a => a -> FilePath -> IO ()
- System.IO.HVFS: vRenameDirectory :: (HVFS a) => a -> FilePath -> FilePath -> IO ()
+ System.IO.HVFS: vRenameDirectory :: HVFS a => a -> FilePath -> FilePath -> IO ()
- System.IO.HVFS: vRenameFile :: (HVFS a) => a -> FilePath -> FilePath -> IO ()
+ System.IO.HVFS: vRenameFile :: HVFS a => a -> FilePath -> FilePath -> IO ()
- System.IO.HVFS: vSetCurrentDirectory :: (HVFS a) => a -> FilePath -> IO ()
+ System.IO.HVFS: vSetCurrentDirectory :: HVFS a => a -> FilePath -> IO ()
- System.IO.HVFS: vSpecialDeviceID :: (HVFSStat a) => a -> DeviceID
+ System.IO.HVFS: vSpecialDeviceID :: HVFSStat a => a -> DeviceID
- System.IO.HVFS: vStatusChangeTime :: (HVFSStat a) => a -> EpochTime
+ System.IO.HVFS: vStatusChangeTime :: HVFSStat a => a -> EpochTime
- System.IO.HVFS: vWriteFile :: (HVFSOpenable a) => a -> FilePath -> String -> IO ()
+ System.IO.HVFS: vWriteFile :: HVFSOpenable a => a -> FilePath -> String -> IO ()
- System.IO.HVFS: withOpen :: HVFSOpenEncap -> (forall a. (HVIO a) => a -> b) -> b
+ System.IO.HVFS: withOpen :: HVFSOpenEncap -> (forall a. HVIO a => a -> b) -> b
- System.IO.HVFS: withStat :: HVFSStatEncap -> (forall a. (HVFSStat a) => a -> b) -> b
+ System.IO.HVFS: withStat :: HVFSStatEncap -> (forall a. HVFSStat a => a -> b) -> b
- System.IO.HVFS.Combinators: data (HVFS a) => HVFSChroot a
+ System.IO.HVFS.Combinators: data HVFS a => HVFSChroot a
- System.IO.HVFS.Combinators: data (HVFS a) => HVFSReadOnly a
+ System.IO.HVFS.Combinators: data HVFS a => HVFSReadOnly a
- System.IO.HVFS.Combinators: newHVFSChroot :: (HVFS a) => a -> FilePath -> IO (HVFSChroot a)
+ System.IO.HVFS.Combinators: newHVFSChroot :: HVFS a => a -> FilePath -> IO (HVFSChroot a)
- System.IO.HVFS.InstanceHelpers: getFullPath :: (HVFS a) => a -> String -> IO String
+ System.IO.HVFS.InstanceHelpers: getFullPath :: HVFS a => a -> String -> IO String
- System.IO.HVFS.InstanceHelpers: getFullSlice :: (HVFS a) => a -> String -> IO [String]
+ System.IO.HVFS.InstanceHelpers: getFullSlice :: HVFS a => a -> String -> IO [String]
- System.IO.HVFS.Utils: lsl :: (HVFS a) => a -> FilePath -> IO String
+ System.IO.HVFS.Utils: lsl :: HVFS a => a -> FilePath -> IO String
- System.IO.HVFS.Utils: recurseDir :: (HVFS a) => a -> FilePath -> IO [FilePath]
+ System.IO.HVFS.Utils: recurseDir :: HVFS a => a -> FilePath -> IO [FilePath]
- System.IO.HVFS.Utils: recurseDirStat :: (HVFS a) => a -> FilePath -> IO [(FilePath, HVFSStatEncap)]
+ System.IO.HVFS.Utils: recurseDirStat :: HVFS a => a -> FilePath -> IO [(FilePath, HVFSStatEncap)]
- System.IO.HVFS.Utils: recursiveRemove :: (HVFS a) => a -> FilePath -> IO ()
+ System.IO.HVFS.Utils: recursiveRemove :: HVFS a => a -> FilePath -> IO ()
- System.IO.HVIO: class (Show a) => HVIO a
+ System.IO.HVIO: class Show a => HVIO a
- System.IO.HVIO: vClose :: (HVIO a) => a -> IO ()
+ System.IO.HVIO: vClose :: HVIO a => a -> IO ()
- System.IO.HVIO: vFlush :: (HVIO a) => a -> IO ()
+ System.IO.HVIO: vFlush :: HVIO a => a -> IO ()
- System.IO.HVIO: vGetBuf :: (HVIO a) => a -> Ptr b -> Int -> IO Int
+ System.IO.HVIO: vGetBuf :: HVIO a => a -> Ptr b -> Int -> IO Int
- System.IO.HVIO: vGetBuffering :: (HVIO a) => a -> IO BufferMode
+ System.IO.HVIO: vGetBuffering :: HVIO a => a -> IO BufferMode
- System.IO.HVIO: vGetChar :: (HVIO a) => a -> IO Char
+ System.IO.HVIO: vGetChar :: HVIO a => a -> IO Char
- System.IO.HVIO: vGetContents :: (HVIO a) => a -> IO String
+ System.IO.HVIO: vGetContents :: HVIO a => a -> IO String
- System.IO.HVIO: vGetFP :: (HVIO a) => a -> IO (Maybe FilePath)
+ System.IO.HVIO: vGetFP :: HVIO a => a -> IO (Maybe FilePath)
- System.IO.HVIO: vGetLine :: (HVIO a) => a -> IO String
+ System.IO.HVIO: vGetLine :: HVIO a => a -> IO String
- System.IO.HVIO: vIsClosed :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsClosed :: HVIO a => a -> IO Bool
- System.IO.HVIO: vIsEOF :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsEOF :: HVIO a => a -> IO Bool
- System.IO.HVIO: vIsOpen :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsOpen :: HVIO a => a -> IO Bool
- System.IO.HVIO: vIsReadable :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsReadable :: HVIO a => a -> IO Bool
- System.IO.HVIO: vIsSeekable :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsSeekable :: HVIO a => a -> IO Bool
- System.IO.HVIO: vIsWritable :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vIsWritable :: HVIO a => a -> IO Bool
- System.IO.HVIO: vMkIOError :: (HVIO a) => a -> IOErrorType -> String -> Maybe FilePath -> IOError
+ System.IO.HVIO: vMkIOError :: HVIO a => a -> IOErrorType -> String -> Maybe FilePath -> IOError
- System.IO.HVIO: vPutBuf :: (HVIO a) => a -> Ptr b -> Int -> IO ()
+ System.IO.HVIO: vPutBuf :: HVIO a => a -> Ptr b -> Int -> IO ()
- System.IO.HVIO: vPutChar :: (HVIO a) => a -> Char -> IO ()
+ System.IO.HVIO: vPutChar :: HVIO a => a -> Char -> IO ()
- System.IO.HVIO: vPutStr :: (HVIO a) => a -> String -> IO ()
+ System.IO.HVIO: vPutStr :: HVIO a => a -> String -> IO ()
- System.IO.HVIO: vPutStrLn :: (HVIO a) => a -> String -> IO ()
+ System.IO.HVIO: vPutStrLn :: HVIO a => a -> String -> IO ()
- System.IO.HVIO: vReady :: (HVIO a) => a -> IO Bool
+ System.IO.HVIO: vReady :: HVIO a => a -> IO Bool
- System.IO.HVIO: vRewind :: (HVIO a) => a -> IO ()
+ System.IO.HVIO: vRewind :: HVIO a => a -> IO ()
- System.IO.HVIO: vSeek :: (HVIO a) => a -> SeekMode -> Integer -> IO ()
+ System.IO.HVIO: vSeek :: HVIO a => a -> SeekMode -> Integer -> IO ()
- System.IO.HVIO: vSetBuffering :: (HVIO a) => a -> BufferMode -> IO ()
+ System.IO.HVIO: vSetBuffering :: HVIO a => a -> BufferMode -> IO ()
- System.IO.HVIO: vShow :: (HVIO a) => a -> IO String
+ System.IO.HVIO: vShow :: HVIO a => a -> IO String
- System.IO.HVIO: vTell :: (HVIO a) => a -> IO Integer
+ System.IO.HVIO: vTell :: HVIO a => a -> IO Integer
- System.IO.HVIO: vTestEOF :: (HVIO a) => a -> IO ()
+ System.IO.HVIO: vTestEOF :: HVIO a => a -> IO ()
- System.IO.HVIO: vTestOpen :: (HVIO a) => a -> IO ()
+ System.IO.HVIO: vTestOpen :: HVIO a => a -> IO ()
- System.IO.HVIO: vThrow :: (HVIO a) => a -> IOErrorType -> IO b
+ System.IO.HVIO: vThrow :: HVIO a => a -> IOErrorType -> IO b
- System.IO.Utils: hGetLines :: (HVIO a) => a -> IO [String]
+ System.IO.Utils: hGetLines :: HVIO a => a -> IO [String]
- System.IO.Utils: hPutStrLns :: (HVIO a) => a -> [String] -> IO ()
+ System.IO.Utils: hPutStrLns :: HVIO a => a -> [String] -> IO ()
- System.Path: recurseDir :: (HVFS a) => a -> FilePath -> IO [FilePath]
+ System.Path: recurseDir :: HVFS a => a -> FilePath -> IO [FilePath]
- System.Path: recurseDirStat :: (HVFS a) => a -> FilePath -> IO [(FilePath, HVFSStatEncap)]
+ System.Path: recurseDirStat :: HVFS a => a -> FilePath -> IO [(FilePath, HVFSStatEncap)]
- System.Path: recursiveRemove :: (HVFS a) => a -> FilePath -> IO ()
+ System.Path: recursiveRemove :: HVFS a => a -> FilePath -> IO ()
- System.Path.Glob: vGlob :: (HVFS a) => a -> FilePath -> IO [FilePath]
+ System.Path.Glob: vGlob :: HVFS a => a -> FilePath -> IO [FilePath]
- System.Time.Utils: clockTimeToEpoch :: (Num a) => ClockTime -> a
+ System.Time.Utils: clockTimeToEpoch :: Num a => ClockTime -> a
- System.Time.Utils: epochToClockTime :: (Real a) => a -> ClockTime
+ System.Time.Utils: epochToClockTime :: Real a => a -> ClockTime
- Text.ParserCombinators.Parsec.Utils: allg :: (Show a) => GeneralizedTokenParser a st [a]
+ Text.ParserCombinators.Parsec.Utils: allg :: Show a => GeneralizedTokenParser a st [a]
- Text.ParserCombinators.Parsec.Utils: satisfyg :: (Show a) => (a -> Bool) -> GeneralizedTokenParser a st a
+ Text.ParserCombinators.Parsec.Utils: satisfyg :: Show a => (a -> Bool) -> GeneralizedTokenParser a st a
- Text.ParserCombinators.Parsec.Utils: tokeng :: (Show a) => (a -> Maybe b) -> GeneralizedTokenParser a st b
+ Text.ParserCombinators.Parsec.Utils: tokeng :: Show a => (a -> Maybe b) -> GeneralizedTokenParser a st b

Files

+ 3rd-party-licenses/BSD view
@@ -0,0 +1,29 @@+Copyright (c) The Regents of the University of California.+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 University nor the names of its contributors+   may be used to endorse or promote products derived from this software+   without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.++# arch-tag: 3-clause BSD license text+
+ 3rd-party-licenses/LGPL-2.1 view
@@ -0,0 +1,511 @@++                  GNU LESSER GENERAL PUBLIC LICENSE+                       Version 2.1, February 1999++ Copyright (C) 1991, 1999 Free Software Foundation, Inc.+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++[This is the first released version of the Lesser GPL.  It also counts+ as the successor of the GNU Library Public License, version 2, hence+ the version number 2.1.]++                            Preamble++  The licenses for most software are designed to take away your+freedom to share and change it.  By contrast, the GNU General Public+Licenses are intended to guarantee your freedom to share and change+free software--to make sure the software is free for all its users.++  This license, the Lesser General Public License, applies to some+specially designated software packages--typically libraries--of the+Free Software Foundation and other authors who decide to use it.  You+can use it too, but we suggest you first think carefully about whether+this license or the ordinary General Public License is the better+strategy to use in any particular case, based on the explanations+below.++  When we speak of free software, we are referring to freedom of use,+not price.  Our General Public Licenses are designed to make sure that+you have the freedom to distribute copies of free software (and charge+for this service if you wish); that you receive source code or can get+it if you want it; that you can change the software and use pieces of+it in new free programs; and that you are informed that you can do+these things.++  To protect your rights, we need to make restrictions that forbid+distributors to deny you these rights or to ask you to surrender these+rights.  These restrictions translate to certain responsibilities for+you if you distribute copies of the library or if you modify it.++  For example, if you distribute copies of the library, whether gratis+or for a fee, you must give the recipients all the rights that we gave+you.  You must make sure that they, too, receive or can get the source+code.  If you link other code with the library, you must provide+complete object files to the recipients, so that they can relink them+with the library after making changes to the library and recompiling+it.  And you must show them these terms so they know their rights.++  We protect your rights with a two-step method: (1) we copyright the+library, and (2) we offer you this license, which gives you legal+permission to copy, distribute and/or modify the library.++  To protect each distributor, we want to make it very clear that+there is no warranty for the free library.  Also, if the library is+modified by someone else and passed on, the recipients should know+that what they have is not the original version, so that the original+author's reputation will not be affected by problems that might be+introduced by others.++  Finally, software patents pose a constant threat to the existence of+any free program.  We wish to make sure that a company cannot+effectively restrict the users of a free program by obtaining a+restrictive license from a patent holder.  Therefore, we insist that+any patent license obtained for a version of the library must be+consistent with the full freedom of use specified in this license.++  Most GNU software, including some libraries, is covered by the+ordinary GNU General Public License.  This license, the GNU Lesser+General Public License, applies to certain designated libraries, and+is quite different from the ordinary General Public License.  We use+this license for certain libraries in order to permit linking those+libraries into non-free programs.++  When a program is linked with a library, whether statically or using+a shared library, the combination of the two is legally speaking a+combined work, a derivative of the original library.  The ordinary+General Public License therefore permits such linking only if the+entire combination fits its criteria of freedom.  The Lesser General+Public License permits more lax criteria for linking other code with+the library.++  We call this license the "Lesser" General Public License because it+does Less to protect the user's freedom than the ordinary General+Public License.  It also provides other free software developers Less+of an advantage over competing non-free programs.  These disadvantages+are the reason we use the ordinary General Public License for many+libraries.  However, the Lesser license provides advantages in certain+special circumstances.++  For example, on rare occasions, there may be a special need to+encourage the widest possible use of a certain library, so that it+becomes a de-facto standard.  To achieve this, non-free programs must+be allowed to use the library.  A more frequent case is that a free+library does the same job as widely used non-free libraries.  In this+case, there is little to gain by limiting the free library to free+software only, so we use the Lesser General Public License.++  In other cases, permission to use a particular library in non-free+programs enables a greater number of people to use a large body of+free software.  For example, permission to use the GNU C Library in+non-free programs enables many more people to use the whole GNU+operating system, as well as its variant, the GNU/Linux operating+system.++  Although the Lesser General Public License is Less protective of the+users' freedom, it does ensure that the user of a program that is+linked with the Library has the freedom and the wherewithal to run+that program using a modified version of the Library.++  The precise terms and conditions for copying, distribution and+modification follow.  Pay close attention to the difference between a+"work based on the library" and a "work that uses the library".  The+former contains code derived from the library, whereas the latter must+be combined with the library in order to run.++                  GNU LESSER GENERAL PUBLIC LICENSE+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION++  0. This License Agreement applies to any software library or other+program which contains a notice placed by the copyright holder or+other authorized party saying it may be distributed under the terms of+this Lesser General Public License (also called "this License").+Each licensee is addressed as "you".++  A "library" means a collection of software functions and/or data+prepared so as to be conveniently linked with application programs+(which use some of those functions and data) to form executables.++  The "Library", below, refers to any such software library or work+which has been distributed under these terms.  A "work based on the+Library" means either the Library or any derivative work under+copyright law: that is to say, a work containing the Library or a+portion of it, either verbatim or with modifications and/or translated+straightforwardly into another language.  (Hereinafter, translation is+included without limitation in the term "modification".)++  "Source code" for a work means the preferred form of the work for+making modifications to it.  For a library, complete source code means+all the source code for all modules it contains, plus any associated+interface definition files, plus the scripts used to control+compilation and installation of the library.++  Activities other than copying, distribution and modification are not+covered by this License; they are outside its scope.  The act of+running a program using the Library is not restricted, and output from+such a program is covered only if its contents constitute a work based+on the Library (independent of the use of the Library in a tool for+writing it).  Whether that is true depends on what the Library does+and what the program that uses the Library does.++  1. You may copy and distribute verbatim copies of the Library's+complete source code as you receive it, in any medium, provided that+you conspicuously and appropriately publish on each copy an+appropriate copyright notice and disclaimer of warranty; keep intact+all the notices that refer to this License and to the absence of any+warranty; and distribute a copy of this License along with the+Library.++  You may charge a fee for the physical act of transferring a copy,+and you may at your option offer warranty protection in exchange for a+fee.++  2. You may modify your copy or copies of the Library or any portion+of it, thus forming a work based on the Library, and copy and+distribute such modifications or work under the terms of Section 1+above, provided that you also meet all of these conditions:++    a) The modified work must itself be a software library.++    b) You must cause the files modified to carry prominent notices+    stating that you changed the files and the date of any change.++    c) You must cause the whole of the work to be licensed at no+    charge to all third parties under the terms of this License.++    d) If a facility in the modified Library refers to a function or a+    table of data to be supplied by an application program that uses+    the facility, other than as an argument passed when the facility+    is invoked, then you must make a good faith effort to ensure that,+    in the event an application does not supply such function or+    table, the facility still operates, and performs whatever part of+    its purpose remains meaningful.++    (For example, a function in a library to compute square roots has+    a purpose that is entirely well-defined independent of the+    application.  Therefore, Subsection 2d requires that any+    application-supplied function or table used by this function must+    be optional: if the application does not supply it, the square+    root function must still compute square roots.)++These requirements apply to the modified work as a whole.  If+identifiable sections of that work are not derived from the Library,+and can be reasonably considered independent and separate works in+themselves, then this License, and its terms, do not apply to those+sections when you distribute them as separate works.  But when you+distribute the same sections as part of a whole which is a work based+on the Library, the distribution of the whole must be on the terms of+this License, whose permissions for other licensees extend to the+entire whole, and thus to each and every part regardless of who wrote+it.++Thus, it is not the intent of this section to claim rights or contest+your rights to work written entirely by you; rather, the intent is to+exercise the right to control the distribution of derivative or+collective works based on the Library.++In addition, mere aggregation of another work not based on the Library+with the Library (or with a work based on the Library) on a volume of+a storage or distribution medium does not bring the other work under+the scope of this License.++  3. You may opt to apply the terms of the ordinary GNU General Public+License instead of this License to a given copy of the Library.  To do+this, you must alter all the notices that refer to this License, so+that they refer to the ordinary GNU General Public License, version 2,+instead of to this License.  (If a newer version than version 2 of the+ordinary GNU General Public License has appeared, then you can specify+that version instead if you wish.)  Do not make any other change in+these notices.++  Once this change is made in a given copy, it is irreversible for+that copy, so the ordinary GNU General Public License applies to all+subsequent copies and derivative works made from that copy.++  This option is useful when you wish to copy part of the code of+the Library into a program that is not a library.++  4. You may copy and distribute the Library (or a portion or+derivative of it, under Section 2) in object code or executable form+under the terms of Sections 1 and 2 above provided that you accompany+it with the complete corresponding machine-readable source code, which+must be distributed under the terms of Sections 1 and 2 above on a+medium customarily used for software interchange.++  If distribution of object code is made by offering access to copy+from a designated place, then offering equivalent access to copy the+source code from the same place satisfies the requirement to+distribute the source code, even though third parties are not+compelled to copy the source along with the object code.++  5. A program that contains no derivative of any portion of the+Library, but is designed to work with the Library by being compiled or+linked with it, is called a "work that uses the Library".  Such a+work, in isolation, is not a derivative work of the Library, and+therefore falls outside the scope of this License.++  However, linking a "work that uses the Library" with the Library+creates an executable that is a derivative of the Library (because it+contains portions of the Library), rather than a "work that uses the+library".  The executable is therefore covered by this License.+Section 6 states terms for distribution of such executables.++  When a "work that uses the Library" uses material from a header file+that is part of the Library, the object code for the work may be a+derivative work of the Library even though the source code is not.+Whether this is true is especially significant if the work can be+linked without the Library, or if the work is itself a library.  The+threshold for this to be true is not precisely defined by law.++  If such an object file uses only numerical parameters, data+structure layouts and accessors, and small macros and small inline+functions (ten lines or less in length), then the use of the object+file is unrestricted, regardless of whether it is legally a derivative+work.  (Executables containing this object code plus portions of the+Library will still fall under Section 6.)++  Otherwise, if the work is a derivative of the Library, you may+distribute the object code for the work under the terms of Section 6.+Any executables containing that work also fall under Section 6,+whether or not they are linked directly with the Library itself.++  6. As an exception to the Sections above, you may also combine or+link a "work that uses the Library" with the Library to produce a+work containing portions of the Library, and distribute that work+under terms of your choice, provided that the terms permit+modification of the work for the customer's own use and reverse+engineering for debugging such modifications.++  You must give prominent notice with each copy of the work that the+Library is used in it and that the Library and its use are covered by+this License.  You must supply a copy of this License.  If the work+during execution displays copyright notices, you must include the+copyright notice for the Library among them, as well as a reference+directing the user to the copy of this License.  Also, you must do one+of these things:++    a) Accompany the work with the complete corresponding+    machine-readable source code for the Library including whatever+    changes were used in the work (which must be distributed under+    Sections 1 and 2 above); and, if the work is an executable linked+    with the Library, with the complete machine-readable "work that+    uses the Library", as object code and/or source code, so that the+    user can modify the Library and then relink to produce a modified+    executable containing the modified Library.  (It is understood+    that the user who changes the contents of definitions files in the+    Library will not necessarily be able to recompile the application+    to use the modified definitions.)++    b) Use a suitable shared library mechanism for linking with the+    Library.  A suitable mechanism is one that (1) uses at run time a+    copy of the library already present on the user's computer system,+    rather than copying library functions into the executable, and (2)+    will operate properly with a modified version of the library, if+    the user installs one, as long as the modified version is+    interface-compatible with the version that the work was made with.++    c) Accompany the work with a written offer, valid for at least+    three years, to give the same user the materials specified in+    Subsection 6a, above, for a charge no more than the cost of+    performing this distribution.++    d) If distribution of the work is made by offering access to copy+    from a designated place, offer equivalent access to copy the above+    specified materials from the same place.++    e) Verify that the user has already received a copy of these+    materials or that you have already sent this user a copy.++  For an executable, the required form of the "work that uses the+Library" must include any data and utility programs needed for+reproducing the executable from it.  However, as a special exception,+the materials to be distributed need not include anything that is+normally distributed (in either source or binary form) with the major+components (compiler, kernel, and so on) of the operating system on+which the executable runs, unless that component itself accompanies+the executable.++  It may happen that this requirement contradicts the license+restrictions of other proprietary libraries that do not normally+accompany the operating system.  Such a contradiction means you cannot+use both them and the Library together in an executable that you+distribute.++  7. You may place library facilities that are a work based on the+Library side-by-side in a single library together with other library+facilities not covered by this License, and distribute such a combined+library, provided that the separate distribution of the work based on+the Library and of the other library facilities is otherwise+permitted, and provided that you do these two things:++    a) Accompany the combined library with a copy of the same work+    based on the Library, uncombined with any other library+    facilities.  This must be distributed under the terms of the+    Sections above.++    b) Give prominent notice with the combined library of the fact+    that part of it is a work based on the Library, and explaining+    where to find the accompanying uncombined form of the same work.++  8. You may not copy, modify, sublicense, link with, or distribute+the Library except as expressly provided under this License.  Any+attempt otherwise to copy, modify, sublicense, link with, or+distribute the Library is void, and will automatically terminate your+rights under this License.  However, parties who have received copies,+or rights, from you under this License will not have their licenses+terminated so long as such parties remain in full compliance.++  9. You are not required to accept this License, since you have not+signed it.  However, nothing else grants you permission to modify or+distribute the Library or its derivative works.  These actions are+prohibited by law if you do not accept this License.  Therefore, by+modifying or distributing the Library (or any work based on the+Library), you indicate your acceptance of this License to do so, and+all its terms and conditions for copying, distributing or modifying+the Library or works based on it.++  10. Each time you redistribute the Library (or any work based on the+Library), the recipient automatically receives a license from the+original licensor to copy, distribute, link with or modify the Library+subject to these terms and conditions.  You may not impose any further+restrictions on the recipients' exercise of the rights granted herein.+You are not responsible for enforcing compliance by third parties with+this License.++  11. If, as a consequence of a court judgment or allegation of patent+infringement or for any other reason (not limited to patent issues),+conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License.  If you cannot+distribute so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you+may not distribute the Library at all.  For example, if a patent+license would not permit royalty-free redistribution of the Library by+all those who receive copies directly or indirectly through you, then+the only way you could satisfy both it and this License would be to+refrain entirely from distribution of the Library.++If any portion of this section is held invalid or unenforceable under+any particular circumstance, the balance of the section is intended to+apply, and the section as a whole is intended to apply in other+circumstances.++It is not the purpose of this section to induce you to infringe any+patents or other property right claims or to contest validity of any+such claims; this section has the sole purpose of protecting the+integrity of the free software distribution system which is+implemented by public license practices.  Many people have made+generous contributions to the wide range of software distributed+through that system in reliance on consistent application of that+system; it is up to the author/donor to decide if he or she is willing+to distribute software through any other system and a licensee cannot+impose that choice.++This section is intended to make thoroughly clear what is believed to+be a consequence of the rest of this License.++  12. If the distribution and/or use of the Library is restricted in+certain countries either by patents or by copyrighted interfaces, the+original copyright holder who places the Library under this License+may add an explicit geographical distribution limitation excluding those+countries, so that distribution is permitted only in or among+countries not thus excluded.  In such case, this License incorporates+the limitation as if written in the body of this License.++  13. The Free Software Foundation may publish revised and/or new+versions of the Lesser General Public License from time to time.+Such new versions will be similar in spirit to the present version,+but may differ in detail to address new problems or concerns.++Each version is given a distinguishing version number.  If the Library+specifies a version number of this License which applies to it and+"any later version", you have the option of following the terms and+conditions either of that version or of any later version published by+the Free Software Foundation.  If the Library does not specify a+license version number, you may choose any version ever published by+the Free Software Foundation.++  14. If you wish to incorporate parts of the Library into other free+programs whose distribution conditions are incompatible with these,+write to the author to ask for permission.  For software which is+copyrighted by the Free Software Foundation, write to the Free+Software Foundation; we sometimes make exceptions for this.  Our+decision will be guided by the two goals of preserving the free status+of all derivatives of our free software and of promoting the sharing+and reuse of software generally.++                            NO WARRANTY++  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH+DAMAGES.++                     END OF TERMS AND CONDITIONS++           How to Apply These Terms to Your New Libraries++  If you develop a new library, and you want it to be of the greatest+possible use to the public, we recommend making it free software that+everyone can redistribute and change.  You can do so by permitting+redistribution under these terms (or, alternatively, under the terms+of the ordinary General Public License).++  To apply these terms, attach the following notices to the library.+It is safest to attach them to the start of each source file to most+effectively convey the exclusion of warranty; and each file should+have at least the "copyright" line and a pointer to where the full+notice is found.+++    <one line to give the library's name and a brief idea of what it does.>+    Copyright (C) <year>  <name of author>++    This library is free software; you can redistribute it and/or+    modify it under the terms of the GNU Lesser General Public+    License as published by the Free Software Foundation; either+    version 2.1 of the License, or (at your option) any later version.++    This library is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU+    Lesser General Public License for more details.++    You should have received a copy of the GNU Lesser General Public+    License along with this library; if not, write to the Free Software+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA++Also add information on how to contact you by electronic and paper mail.++You should also get your employer (if you work as a programmer) or+your school, if any, to sign a "copyright disclaimer" for the library,+if necessary.  Here is a sample; alter the names:++  Yoyodyne, Inc., hereby disclaims all copyright interest in the+  library `Frob' (a library for tweaking knobs) written by James+  Random Hacker.++  <signature of Ty Coon>, 1 April 1990+  Ty Coon, President of Vice++That's all there is to it!++# arch-tag: LGPL 2.1 license text+
+ Makefile view
@@ -0,0 +1,47 @@+# Copyright (C) 2004 - 2009 John Goerzen <jgoerzen@complete.org>+#+#    This library is free software; you can redistribute it and/or+#    modify it under the terms of the GNU Lesser General Public+#    License as published by the Free Software Foundation; either+#    version 2.1 of the License, or (at your option) any later version.+#+#    This library is distributed in the hope that it will be useful,+#    but WITHOUT ANY WARRANTY; without even the implied warranty of+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU+#    Lesser General Public License for more details.+#+#    You should have received a copy of the GNU Lesser General Public+#    License along with this library; if not, write to the Free Software+#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA+all: setup+	@echo "Please use Cabal to build this package; not make."+	./setup configure+	./setup build++setup: Setup.hs+	ghc --make -o setup Setup.hs++install: setup+	./setup install++clean:+	./Setup.hs clean++.PHONY: test+test: test-ghc test-hugs+	@echo ""+	@echo "All tests pass."++test-hugs: setup+	@echo " ****** Running hugs tests"+	./setup configure -f buildtests --hugs+	./setup build+	runhugs -98 +o -P$(PWD)/dist/scratch:$(PWD)/dist/scratch/programs/runtests: \+		dist/scratch/programs/runtests/Main.hs++test-ghc: setup+	@echo " ****** Building GHC tests"+	./setup configure -f buildtests+	./setup build+	@echo " ****** Running GHC tests"+	./dist/build/runtests/runtests
MissingH.cabal view
@@ -1,17 +1,34 @@ Name: MissingH-Version: 1.1.0.2+Version: 1.1.0.3 License: GPL Maintainer: John Goerzen <jgoerzen@complete.org> Author: John Goerzen-Copyright: Copyright (c) 2004-2009 John Goerzen+Copyright: Copyright (c) 2004-2010 John Goerzen license-file: COPYRIGHT extra-source-files: COPYING,+                    announcements/0.10.0.txt,+                    announcements/0.8.0.txt,+                    announcements/0.9.0.txt,                     testsrc/gzfiles/empty.gz,                     testsrc/gzfiles/t1.gz,                     testsrc/gzfiles/t1bad.gz,                     testsrc/gzfiles/t2.gz,                     testsrc/gzfiles/zeros.gz,-                    testsrc/mime.types.test+                    testsrc/mime.types.test,+                    3rd-party-licenses/BSD,+                    3rd-party-licenses/LGPL-2.1,+                    Makefile,+                    TODO,+                    examples/simplegrep.hs,+                    examples/test2.hs,+                    examples/test3.hs,+                    pending/Gopher.hs,+                    pending/Maildir.disabled,+                    pending/Tar.newhs,+                    pending/Tar/HeaderParser.newhs,+                    tolgpl,+                    winbuild.bat,+                    wintest.bat homepage: http://software.complete.org/missingh Category: Unclassified synopsis: Large utility library@@ -24,6 +41,9 @@  Flag splitBase   description: Choose the new smaller, split-up base package.+Flag buildtests+  description: Build the executable to run unit tests+  default: False  Library  Hs-Source-Dirs: src@@ -66,14 +86,14 @@  Extensions: ExistentialQuantification, OverlappingInstances,    UndecidableInstances, CPP, Rank2Types,    MultiParamTypeClasses, FlexibleInstances, FlexibleContexts,-   PatternSignatures+   ScopedTypeVariables   Build-Depends: network, parsec, base,                haskell98, mtl, HUnit, regex-compat,                filepath,                hslogger  If flag(splitBase)-   Build-Depends: base >= 4, base <= 5, directory, random, process, old-time,+   Build-Depends: base >= 4, base < 5, directory, random, process, old-time,                              containers, old-locale, array  Else    Build-Depends: base < 3@@ -81,9 +101,31 @@    Build-Depends: unix  Executable runtests-  Buildable: False+  if flag(buildtests)+    Buildable: True+    Build-Depends: testpack, QuickCheck >= 1.0 && <2.0, HUnit+  else+    Buildable: False   Main-Is: runtests.hs   HS-Source-Dirs: testsrc, .-  Build-Depends: testpack, QuickCheck >= 1.0 && <2.0, HUnit+  Other-Modules: Bitstest,+    CRC32GZIPtest,+    CRC32POSIXtest,+    Eithertest,+    GZiptest,+    Globtest,+    HVFStest,+    HVIOtest,+    IOtest,+    Listtest,+    MIMETypestest,+    Maptest,+    Pathtest,+    ProgressTrackertest,+    Str.CSVtest,+    Strtest,+    Tests,+    Timetest,+    WildMatchtest   Extensions: ExistentialQuantification, OverlappingInstances,-    UndecidableInstances, CPP, PatternSignatures+    UndecidableInstances, CPP, ScopedTypeVariables
+ TODO view
@@ -0,0 +1,33 @@+Document MissingH/Quantity and see if it has tests yet++Test forceEitherMsg++Cmd: pOpenBoth -- read and write, use forkIO for one of them++tests for new Parsec stuff++HVFStest:+  test all sorts of exceptions+  test .. et al++FTP server:+  timeouts+  Proper error checking lots of places, esp. runDataChan++CSVtest:+  Test CSV generation++Add Quantity and ProgressTracker to README++--------------------------------------------------+From: Jeremy Shaw +The patch to MissingH.HUnit includes a modified version of the 'tests' function+from Test.QuickCheck. That module has the license:++-- Module      :  Test.QuickCheck+-- Copyright   :  (c) Koen Claessen, John Hughes 2001+-- License     :  BSD-style (see the file libraries/base/LICENSE)++If this is problematic, let me know, and I can rewrite it.++j.
+ announcements/0.10.0.txt view
@@ -0,0 +1,81 @@+MissingH 0.10.0++New feature summary:++ * Compatibility with Hugs 2005xx and GHC 6.4.+   Compatibility with GHC 6.2 has been retained.  Compatibility with+   Hugs 2003xx is mostly retained but not completely possible.++ * Tighter integration with Cabal.++ * Better installation instructions.++ * New parser for debian/control files and similar Debian commands+   (does not require Debian to build/run)++ * New parser for CSV files++ * New utility for Maybe type++ * New binary I/O utilities (readBinaryFile, writeBinaryFile)++ * Powerful new list mainpulation functions: wholeMap, fixedWidth++ * New function: epochToClockTime++-------------------------+What is MissingH?+-------------------------++It's a collection of Haskell-related utilities.  It is an extension of my+earlier work developing MissingLib for OCaml.  You can download+MissingH from http://quux.org/devel/missingh.  There is a mirror, with+a few days' lag, at http://ftp.debian.org/debian/pool/main/m/missingh.++-------------------------+Major Features+-------------------------++ * Powerful Logging Framework for Haskell+   This framework provides a system of hierarchical loggers and+   modular handlers permitting fine-grained logging with a great deal+   of control and yet a simple and fast interface.  It's based on+   log4j for Java and logging for Python.++   Also included is a native-Haskell Syslog client.++ * Versatile modules to simplify everyday tasks:+   + FTP client library+   + E-mail client library+   + MIME types library to determine MIME types from files or URLs+   + Configuration file parser/generator++ * IO utilities make it easier to work with line-based text files+   and binary files++ * IO object virtualization so you can use one set of code to work+   on files of many different types++ * Filesystem virtualization so you can access variuos items with the+   same ease as your system's filesystem++ * Network utilities to streamline connections++ * List utilities including association list tools,+   list splitting, truncation, and delimiter joining++ * String utilities including removal of leading or trailing+   whitespace, joining, splitting, and truncation++ * Other utilities for threads, parers, filenames, etc.++ * Printf utilities for formatting strings++ * GZip decompression++ * Hundreds of unit tests to verify proper functionality++ * DBM module abstraction+++# arch-tag: 0.10.0 announcement
+ announcements/0.8.0.txt view
@@ -0,0 +1,63 @@+MissingH 0.8.0 -- the "Festive Lambda" release++New feature summary:++ * Virtualized I/O system+   Use familiar functions to work on not just Handles but all sorts of+   other types, including in-memory buffers. (HVIO module)++ * Virtualized filesystem+   Extends the virtual I/O concept to the filesystem, supporting+   entire virtual filesystems, and operations such as renames,+   stat(), etc. on them.  (HVFS module)++ * Network server infrastructure+   Makes it easy to write a network server in Haskell.  Functional+   interface permits easy adding of things such as multithreading,+   logging, etc.  Functions to do these things are provided.+   Patterned loosely after Python's SocketServer system.+   (SocketServer module)++ * Full, pure-Haskell FTP server+   Provides a full FTP server over a real or virtual (HVFS)+   filesystem.  It's a SocketServer server, so you get multithreading+   for free.  Supports passive eand port modes.++   See below for an example:+ + * Many path/file manipulation functions imported from+   Volker's HsShellScript.++ * Existing MissingH.IO functions updated to be HVIO compatible.++MissingH 0.8.0 is available from:++  gopher://gopher.quux.org/1/devel/missingh++or++  http://gopher.quux.org:70/devel/missingh++------------------------------------------------------------++Here is an example of a fully self-contained FTP server that serves+up the local filesystem in read-only mode:++import MissingH.Network.FTP.Server+import MissingH.Network.SocketServer+import MissingH.Logging.Logger+import MissingH.IO.HVFS+import MissingH.IO.HVFS.Combinators++main = do+       updateGlobalLogger "" (setLevel DEBUG)+       updateGlobalLogger "MissingH.Network.FTP.Server" (setLevel DEBUG)+       let opts = (simpleTCPOptions 12345) {reuse = True}+       serveTCPforever opts $+            threadedHandler $ +            loggingHandler "" INFO $+            handleHandler $+            anonFtpHandler (HVFSReadOnly SystemFS)+++# arch-tag: 0.8.0 announcement
+ announcements/0.9.0.txt view
@@ -0,0 +1,86 @@+MissingH 0.9.0++New feature summary:++ * Perl-like regular expression operators (MissingH.Regex.Pesco)+   +   This module builds atop the standard POSIX Text.Regex module,+   extending it to be far more convenient with easier maching,+   grouping, and substitution operations.  (Integrated from Pesco)++ * strToAL, strFomAL (MissingH.List)++   Converts any [(String, String)] and many other association lists+   to a simple string representation that can be stored on-disk+   or sent across the network.  Also, re-generates the original list+   upon parsing the string representation.  Used internally by+   MissingH.AnyDBM.StringDBM.++ * Persistent or non-persistent DBM storage class++   MissingH.AnyDBM is an abstraction for various mapping systems.+   MissingH itself provides an implementation using a non-persistent+   HashTable or FiniteMap, as well as a persistent StringDBM.+   Bindings to dbm, gdbm, dbhash, etc. are in the works and will+   be simple members of this typeclass.++ * Major cleaning up of the build system.++Description of MissingH from README:++-------------------------+What is MissingH?+-------------------------++It's a collection of Haskell-related utilities.  It is an extension of my+earlier work developing MissingLib for OCaml.  You can download+MissingH from http://quux.org/devel/missingh.  There is a mirror, with+a few days' lag, at http://ftp.debian.org/debian/pool/main/m/missingh.++-------------------------+Major Features+-------------------------++ * Powerful Logging Framework for Haskell+   This framework provides a system of hierarchical loggers and+   modular handlers permitting fine-grained logging with a great deal+   of control and yet a simple and fast interface.  It's based on+   log4j for Java and logging for Python.++   Also included is a native-Haskell Syslog client.++ * Versatile modules to simplify everyday tasks:+   + FTP client library+   + E-mail client library+   + MIME types library to determine MIME types from files or URLs+   + Configuration file parser/generator++ * IO utilities make it easier to work with line-based text files+   and binary files++ * IO object virtualization so you can use one set of code to work+   on files of many different types++ * Filesystem virtualization so you can access variuos items with the+   same ease as your system's filesystem++ * Network utilities to streamline connections++ * List utilities including association list tools,+   list splitting, truncation, and delimiter joining++ * String utilities including removal of leading or trailing+   whitespace, joining, splitting, and truncation++ * Other utilities for threads, parers, filenames, etc.++ * Printf utilities for formatting strings++ * GZip decompression++ * Hundreds of unit tests to verify proper functionality++ * DBM module abstraction+++# arch-tag: 0.9.0 announcement
+ examples/simplegrep.hs view
@@ -0,0 +1,6 @@+import MissingH.List+main = do+   c <- getContents+   putStr (unlines(filter (\line -> contains "Haskell" line)+                          (lines c)))+
+ examples/test2.hs view
@@ -0,0 +1,26 @@+-- example code 2 for socketserver+import MissingH.Network.SocketServer+import MissingH.IO+import MissingH.Logging.Logger+import Data.Char+import System.IO+import MissingH.Str++lineInteraction :: [String] -> [String]+lineInteraction inp =+   let realInteract :: [String] -> [String]+       realInteract [] = []+       realInteract ("QUIT":_) = ["Goodbye!"]+       realInteract ("easeregg":_) = ["Yow!"]+       realInteract (x:xs) = map toUpper x : realInteract xs+       in+       ("Welcome to the uppercase server.  I'll echo everything back to\n" +++         "you in uppercase.  When done, just type \"QUIT\" to exit.\n") :+         realInteract (map rstrip inp)++realhandler h = do hLineInteract h h lineInteraction+                   hClose h+handler = threadedHandler $ loggingHandler "main" INFO $ handleHandler $+            realhandler+main = do updateGlobalLogger "main" (setLevel DEBUG)+          serveTCPforever ((simpleInetOptions 12345) {reuse = True}) handler
+ examples/test3.hs view
@@ -0,0 +1,35 @@+-- example code 3 for socketserver+import MissingH.Network.SocketServer+import MissingH.IO+import MissingH.Logging.Logger+import Data.Char+import System.IO+import MissingH.Str+import System.Time++realhandler h = +    let loop = do e <- hIsEOF h+                  if e then return ()+                     else do c <- hGetLine h+                             case (rstrip c) of +                                 "QUIT" -> hPutStr h "Goodbye!\n"+                                 "COMMANDS" -> do hPutStrLn h "You can type TIME for the current time"+                                                  loop+                                 "TIME" -> do ct <- getClockTime+                                              calt <- toCalendarTime ct+                                              hPutStrLn h $ calendarTimeToString calt+                                              loop+                                 x -> do hPutStrLn h (map toUpper x)+                                         loop+        in do hPutStrLn h "Welcome to the uppercase server.  I'll echo"+              hPutStrLn h "everything back to you in uppercase.  When done,"+              hPutStrLn h "just type \"QUIT\" to exit."+              hPutStrLn h "You can also type \"COMMANDS\" for some fun stuff."+              hPutStrLn h ""+              loop+              hClose h++handler = threadedHandler $ loggingHandler "main" INFO $ handleHandler $+            realhandler+main = do updateGlobalLogger "main" (setLevel DEBUG)+          serveTCPforever ((simpleInetOptions 12345) {reuse = True}) handler
+ pending/Gopher.hs view
@@ -0,0 +1,86 @@+{- arch-tag: Gopher support+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module     : MissingH.Network.Gopher+   Copyright  : Copyright (C) 2004 John Goerzen+   License    : GNU GPL, version 2 or above++   Maintainer : John Goerzen, +   Maintainer : jgoerzen@complete.org+   Stability  : experimental+   Portability: systems with networking++This module provides types and generic support for Gopher clients or serves.++Related standards: RFC1436 <http://www.faqs.org/rfcs/rfc1436.html>,+Gopher+ spec <gopher://gopher.quux.org/1/Archives/mirrors/boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher%2B/Gopher%2B.txt>++Written by John Goerzen, jgoerzen\@complete.org+-}++module MissingH.Network.Gopher (-- * Types+                                GopherEntry(..)+                               )+    where++import MissingH.Printf+import MissingH.Str+import Data.FiniteMap++{- | Type representing an entry in a Gopher directory.++May add more Gopher+ stuff in here down the road.++You can show a 'GopherEntry'.  This will produce a one-line string suitable+for use on a Gopher server.++You can 'read' to a 'GopherEntry'.  This will parse a string as a one-line+piece of text suitable for use generating a 'GopherEntry'.++Neither show nor read will consider the 'ea' member. -}+data GopherEntry = GopherEntry +    {+     selector :: String,                -- ^ Path to file on server+     gophertype :: Char,                -- ^ Gopher0 type character+     name :: String,                    -- ^ Gopher menu name+     host :: String,                    -- ^ Content host name+     port :: Integer,                   -- ^ Remote port+     gopherpsupport :: Bool,            -- ^ Whether Gopher+ is supported+     ea :: FiniteMap String String      -- ^ Gopher+ extended attributes+    }++instance Show GopherEntry where+    show x = let basic = vsprintf "%c%s\t%s\t%s\t%d"+                             (gophertype x) (name x) (selector x) (host x)+                                            (port x)+                 in if gopherpsupport x then+                    basic ++ "\t+"+                    else basic++instance Read GopherEntry where+    read s = let parts = split "\t" s+                 in+                 GopherEntry {selector = parts !! 2,+                              gophertype = head (parts !! 0),+                              name = parts !! 1,+                              host = parts !! 3,+                              port = read (parts !! 4),+                              gopherpsupport = length parts > 5 && (parts !! 5 == "+"),+                              ea = emptyFM+                             }
+ pending/Maildir.disabled view
@@ -0,0 +1,76 @@+{-+Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module     : MissingH.Email.Mailbox.Maildir+   Copyright  : Copyright (C) 2005 John Goerzen+   License    : GNU GPL, version 2 or above++   Maintainer : John Goerzen <jgoerzen@complete.org> +   Stability  : provisional+   Portability: portable++Support for Maildir-style mailboxes.++Information about the Maildir format can be found at:++ * <http://www.qmail.org/qmail-manual-html/man5/maildir.html>++ * <http://cr.yp.to/proto/maildir.html>++Written by John Goerzen, jgoerzen\@complete.org+-}++module MissingH.Email.Mailbox.Maildir(Maildir(..), readMaildir)+where++import MissingH.Email.Mailbox+import System.Posix.IO(OpenMode(..))+import System.Directory+import MissingH.Path+import MissingH.Maybe+import Control.Monad+import Text.Regex++data Maildir = Maildir +    {loc :: FilePath}+instance Show Maildir+    where show x = loc x+    +{-+splitFN :: String -> (String, Flags)+                   +splitFN fn = +    +    where (base, fstr) = +     case span (/= ':') of+              (h, []) = (h, [])+              (h, f) = (h, tail f)++-}+{- | Open a Maildir mailbox. -}+-- For reading only, for now.++openMaildir :: FilePath -> IO Maildir+openMaildir fp =+    do cwd <- getCurrentDirectory+       let abspath = forceMaybeMsg "abspath readMaildir" $ absNormPath cwd fp+       c <- getDirectoryContents fp+       unless ("cur" `elem` c && "new" `elem` c && "tmp" `elem` c)+              $ error (fp ++ " is not a valid Maildir.")+       return (Maildir fp)
+ pending/Tar.newhs view
@@ -0,0 +1,61 @@+{-+Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module     : MissingH.FileArchive.Tar+   Copyright  : Copyright (C) 2005 John Goerzen+   License    : GNU GPL, version 2 or above++   Maintainer : John Goerzen <jgoerzen@complete.org>+   Stability  : provisional+   Portability: portable++Tar file format handler++Copyright (c) 2005 John Goerzen, jgoerzen\@complete.org++-}+module MissingH.FileArchive.Tar (++                                 )+where++import MissingH.Checksum.CRC32.GZip+import MissingH.List+import Data.List+import Data.Bits+import Control.Monad.Error+import Control.Monad.State+import Data.Char+import Data.Word+import MissingH.Bits+import System.IO+import Numeric++type Section = (Header, [Word8])++data GZipError = CRCError               -- ^ CRC-32 check failed+               | NotGZIPFile            -- ^ Couldn't find a GZip header+               | UnknownMethod          -- ^ Compressed with something other than method 8 (deflate)+               | UnknownError String    -- ^ Other problem arose+               deriving (Eq, Show)++instance Error GZipError where+    noMsg = UnknownError ""+    strMsg = UnknownError+
+ pending/Tar/HeaderParser.newhs view
@@ -0,0 +1,98 @@+{-+Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module     : MissingH.FileArchive.Tar.HeaderParser+   Copyright  : Copyright (C) 2005 John Goerzen+   License    : GNU GPL, version 2 or above++   Maintainer : John Goerzen <jgoerzen@complete.org>+   Stability  : provisional+   Portability: portable++Parser for tar-format headers.++Copyright (c) 2005 John Goerzen, jgoerzen\@complete.org++-}+module MissingH.FileArchive.Tar.HeaderParser+    (++     )++where++import Text.ParserCombinators.Parsec+import Data.Word+import Numeric++{- | The data structure representing the Tar header.  This occurs+at the beginning of each 'Section'. -}+data Header = +    UStar {+           name :: String,+           mode :: Int,+           uid :: Int,+           gid :: Int,+           size :: Integer,+           mtime :: Integer,+           chksum :: Word32,+           typeflag :: Char,+           linkname :: String,+           magic :: String,+           version :: String,+           uname :: String,+           gname :: String,+           devmajor :: Integer,+           devminor :: Integer,+           prefix :: String}+    deriving (Eq, Show)++parseUStarHeader :: CharParser st Header+parseUStarHeader =+    do name <- (grab 100 >>= rchopstr)+       mode <- (grab 8 >>= rreadoct)+       uid <- (grab 8 >>= rreadoct)+       gid <- (grab 8 >>= rreadoct)+       size <- (grab 8 >>= rreadoct)+       mtime <- (grab 12 >>= rreadoct)+       chksum <- (grab 8 >>= rreadoct)+       typeflag <- anyChar+       linkname <- (grab 100 >>= rchopstr)+       string "ustar\0"         -- Magic+       string "00"              -- Version+       uname <- (grab 32 >>= rchopstr)+       gname <- (grab 32 >>= rchopstr)+       devmajor <- (grab 8 >>= rreadoct)+       devminor <- (grab 8 >>= rreadoct)+       prefix <- (grab 155 >>= rchopstr)++       return $ UStar  {name = name, mode = mode, uid = uid, gid = gid,+                        size = size, mtime = mtime, chksum = chksum,+                        typeflag = typeflag, linkname = linkname,+                        magic = "", version = "",+                        uname = uname, gname = gname, devmajor = devmajor,+                        devminor = devminor, prefix = prefix}+    where grab n = count n anyChar+          chopstr = takeWhile (\c -> c /= '\0')+          rchopstr = return . chopstr+          chopsstr = takeWhile (\c -> c /= ' ') . chopstr+          readoct :: (Num a) => String -> a+          readoct = fst . head . readOct . chopsstr+          rreadoct :: (Num a, Monad m) => String -> m a+          rreadoct = return . readoct
src/System/Cmd/Utils.hs view
@@ -166,7 +166,7 @@ {- | Read data from a pipe.  Returns a Handle and a 'PipeHandle'.  When done, you must hClose the handle, and then use either 'forceSuccess' or-getProcessStatus on the 'PipeHandle'.  Zomeibes will result otherwise.+getProcessStatus on the 'PipeHandle'.  Zombies will result otherwise.  This function logs as pipeFrom. @@ -215,7 +215,7 @@ to.  When done, you must hClose the handle, and then use either 'forceSuccess' or-getProcessStatus on the 'PipeHandle'.  Zomeibes will result otherwise.+getProcessStatus on the 'PipeHandle'.  Zombies will result otherwise.  This function logs as pipeTo. @@ -265,7 +265,7 @@ a 3-tuple of ('PipeHandle', Data From Pipe, Data To Pipe).  When done, you must hClose both handles, and then use either 'forceSuccess' or-getProcessStatus on the 'PipeHandle'.  Zomeibes will result otherwise.+getProcessStatus on the 'PipeHandle'.  Zombies will result otherwise.  Hint: you will usually need to ForkIO a thread to handle one of the Handles; otherwise, deadlock can result.
+ testsrc/Bitstest.hs view
@@ -0,0 +1,52 @@+{- arch-tag: Bits tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Bitstest(tests) where+import Test.HUnit+import Data.Bits.Utils+import Data.Word++test_fromBytes =+    let f :: [Word32] -> Word32 -> Test+        f inp exp = TestCase $ exp @=? fromBytes inp in+        [+         f [] 0+        ,f [0] 0+        ,f [1] 1+        ,f [0xff, 0] 0xff00+        ,f [0x0, 0xff] 0xff+        ,f [0x12, 0x34, 0x56, 0x78] 0x12345678+        ,f [0xff, 0xff, 0xff, 0xff] 0xffffffff+        ,f [0xff, 0, 0, 0] 0xff000000+        ]++test_getBytes =+    let f :: Word32 -> [Word32] -> Test+        f inp exp = TestCase $ exp @=? getBytes inp in+        [+         f 0 [0, 0, 0, 0]+        ,f 0x1200 [0, 0, 0x12, 0]+        ,f 0x0012 [0, 0, 0, 0x12]+        ,f 0xffffffff [0xff, 0xff, 0xff, 0xff]+        ,f 0x12345678 [0x12, 0x34, 0x56, 0x78]+        ,f 0xf0000000 [0xf0, 0, 0, 0]+        ]++tests = TestList [TestLabel "getBytes" (TestList test_getBytes),+                  TestLabel "fromBytes" (TestList test_fromBytes)+                 ]
+ testsrc/CRC32GZIPtest.hs view
@@ -0,0 +1,37 @@+{- arch-tag: Tests for Gzip CRC-32 module+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module CRC32GZIPtest(tests) where+import Test.HUnit+import Data.Hash.CRC32.GZip++test_crcgzip =+    let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp (calc_crc32 inp) in+        [f "Simple" "Test 1" 0x9927f819+        ,f "Empty" "" 0x0+         --f "Empty" "" 4294967295,+         --f "1" "1" 433426081,+         --f "some numbers" "153141341309874102987412" 2083856642,+         --f "Some text" "This is a test of the crc32 thing\n" 2449124888++        ]++tests = TestList [TestLabel "crcgzip" (TestList test_crcgzip)++                 ]+
+ testsrc/CRC32POSIXtest.hs view
@@ -0,0 +1,36 @@+{- arch-tag: Tests for CRC-32 module+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module CRC32POSIXtest(tests) where+import Test.HUnit+import Data.Hash.CRC32.Posix++test_crc32 =+    let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp (crc32 inp) in+        [+         f "Empty" "" 4294967295,+         f "1" "1" 433426081,+         f "some numbers" "153141341309874102987412" 2083856642,+         f "Some text" "This is a test of the crc32 thing\n" 2449124888++        ]++tests = TestList [TestLabel "crc32" (TestList test_crc32)++                 ]+
+ testsrc/Eithertest.hs view
@@ -0,0 +1,51 @@+{- arch-tag: Data.Either.Utils tests+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Eithertest(tests) where+import Test.HUnit+import Data.Either.Utils+import Test.HUnit.Tools+import Control.Exception++instance Eq ErrorCall where+    (ErrorCall x) == (ErrorCall y) = x == y++test_maybeToEither =+    let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp inp in+        [+         f "Nothing" (maybeToEither "error" (Nothing::Maybe String))+           (Left "error"),+         f "Nothing diff types" (maybeToEither "error" (Nothing::Maybe Int))+           (Left "error"),+         f "Just" (maybeToEither "error" (Just "good")) (Right "good"),+         f "Diff types" (maybeToEither "error" (Just (5::Int))) +           (Right (5::Int))+        ]++test_forceEither =+    let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp inp in+    [+     f "Right" (forceEither ((Right "foo")::Either Int String)) "foo",+     TestLabel "Left" $ TestCase $ assertRaises "" (ErrorCall "\"wrong\"")+           ("" @=? forceEither (Left "wrong"))+    ]++tests = TestList [TestLabel "test_maybeToEither" (TestList test_maybeToEither),+                  TestLabel "test_forceEither" (TestList test_forceEither)+                 ]+
+ testsrc/GZiptest.hs view
@@ -0,0 +1,99 @@+{- arch-tag: Tests for GZip module+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module GZiptest(tests) where+import Test.HUnit+import System.FileArchive.GZip+import System.FilePath+import Data.Compression.Inflate+import System.IO.Binary+import System.IO+import Data.Either.Utils+import Data.List++mf fn exp conf = TestLabel fn $ TestCase $+                     do c <- readBinaryFile $+                          joinPath ["testsrc", "gzfiles", fn]+                        assertEqual "" exp (conf c)++{-+import System.FileArchive.GZip+import System.IO+import Data.Either.Utils++main = do+       c <- hGetContents stdin+       let x = snd . forceEither . read_header $ c+       putStr x++test_bunches =+    let f fn exp conv = mf fn exp (conv . snd . forceEither . read_header)+        f2 c = let fn = "t/z" ++ (show c) ++ ".gz" in+                   f fn c (length . inflate_string)+        in+        map f2 [0..1000]+-}+test_inflate = +    let f fn exp conv = mf fn exp (conv . snd . forceEither . read_header) in+        [+         f "t1.gz" "Test 1" inflate_string+        ,f "t1.gz" 6 (length . inflate_string)+        ,f "t1.gz" ("Test 1",+                    "\x19\xf8\x27\x99\x06\x00\x00\x00") inflate_string_remainder+        ,f "empty.gz" "" inflate_string+        --,f "zeros.gz" 10485760 (length . inflate_string)+        -- BAD BAD ,f "zeros.gz" (replicate (10 * 1048576) '\0') inflate_string+        -- This line tests Igloo's code:+        --,f "zeros.gz" True (\x -> (replicate 10485760 '\0') == inflate_string x)+        ]++test_header =+    let f fn exp = mf fn exp (fst . forceEither . read_header)+        in+        [+         f "t1.gz" Header {method = 8, flags = 0, extra = Nothing,+                            filename = Nothing, comment = Nothing,+                          mtime = 1102111446, xfl = 2, os = 3}+        ,f "empty.gz" Header {method = 8, flags = 8, extra = Nothing,+                              filename = Just "empty", +                              comment = Nothing,+                             mtime = 1102127257, xfl = 0, os = 3}+        ]++test_gunzip =+    let f fn exp = mf fn exp decompress+        in+        [+         f "t1.gz" ("Test 1", Nothing)+        ,f "t1bad.gz" ("Test 1", Just CRCError)+        ,f "t2.gz" ("Test 1Test 2", Nothing)+        -- The following tests my code+         {-+        ,mf "zeros.gz" True (\x -> case decompress x of+                             (y, _) -> y == replicate 10485760 '\0'+                            )+         -}+        ]++tests = TestList [TestLabel "inflate" (TestList test_inflate),+                  TestLabel "header" (TestList test_header),+--                  TestLabel "bunches" (TestList test_bunches),+                  TestLabel "gunzip" (TestList test_gunzip)++                 ]+
+ testsrc/Globtest.hs view
@@ -0,0 +1,113 @@+{- +Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}+++module Globtest(tests) where+import Test.HUnit+import System.Path.Glob+import System.Path+import Test.HUnit.Tools+import System.IO.HVFS+import System.Directory(createDirectory)+#if !(defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS) || defined(__MINGW32__))+import System.Posix.Directory hiding (createDirectory)+import System.Posix.Files+#endif+import Control.Exception+import Data.List++bp = "testtmp"+touch x = writeFile x ""++globtest thetest = +    bracket_ (setupfs)+             (recursiveRemove SystemFS bp)+             thetest+    where setupfs =+              do mapM_ (\x -> createDirectory x)+                       [bp, bp ++ "/a", bp ++ "/aab", bp ++ "/aaa",+                        bp ++ "/ZZZ", bp ++ "/a/bcd",+                        bp ++ "/a/bcd/efg"]+                 mapM_ touch [bp ++ "/a/D", bp ++ "/aab/F", bp ++ "/aaa/zzzF",+                              bp ++ "/a/bcd/EF", bp ++ "/a/bcd/efg/ha",+                             bp ++ "/a/foo", bp ++ "/a/afoo",+                             bp ++ "/a/a-foo", bp ++ "/a/a.foo"]+#if !(defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS) || defined(__MINGW32__))+                 createSymbolicLink (preppath "broken") (preppath "sym1")+                 createSymbolicLink (preppath "broken") (preppath "sym2")+#endif+                 +eq msg exp res =+    assertEqual msg (sort exp) (sort res)+mf msg func = TestLabel msg $ TestCase $ globtest func+f func = TestCase $ globtest func+preppath x = bp ++ "/" ++ x++test_literal =+    map f+            [glob (preppath "a") >>= eq "" [preppath "a"]+            ,glob (preppath "a/D") >>= eq "" [preppath "a/D"]+            ,glob (preppath "aab") >>= eq "" [preppath "aab"]+            ,glob (preppath "nonexistant") >>= eq "empty" []+            ]++test_one_dir =+    map f+        [glob (preppath "a*") >>= eq "a*" (map preppath ["a", "aab", "aaa"]),+         glob (preppath "*a") >>= eq "*a" (map preppath ["a", "aaa"]),+         glob (preppath "aa?") >>= eq "aa?" (map preppath ["aaa", "aab"]),+         glob (preppath "aa[ab]") >>= eq "aa[ab]" (map preppath ["aaa", "aab"]),+         glob (preppath "*q") >>= eq "*q" []+        ]++test_nested_dir =+    map f+        [glob (preppath "a/bcd/E*") >>= eq "a/bcd/E*" [preppath "a/bcd/EF"],+         glob (preppath "a/bcd/*g") >>= eq "a/bcd/*g" [preppath "a/bcd/efg"],+         glob (preppath "a/*.foo") >>= eq "a/*.foo" [preppath "a/a.foo"]+        ]++test_dirnames = +    map f+        [glob (preppath "*/D") >>= eq "*/D" [preppath "a/D"],+         glob (preppath "*/*a") >>= eq "*/*a" [],+         glob (preppath "a/*/*/*a") >>= eq "a/*/*/*a" [preppath "a/bcd/efg/ha"],+         glob (preppath "?a?/*F") >>= eq "?a?/*F" (map preppath ["aaa/zzzF", "aab/F"])+        ]++test_brokensymlinks =+#if !(defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS) || defined(__MINGW32__))+    map f+        [glob (preppath "sym*") >>= eq "sym*" (map preppath ["sym1", "sym2"]),+         glob (preppath "sym1") >>= eq "sym1" [preppath "sym1"],+         glob (preppath "sym2") >>= eq "sym2" [preppath "sym2"]+        ]+#else+    []+#endif+         ++tests = TestList [TestLabel "test_literal" (TestList test_literal),+                  TestLabel "test_one_dir" (TestList test_one_dir),+                  TestLabel "test_nested_dir" (TestList test_nested_dir),+                  TestLabel "test_dirnames" (TestList test_dirnames),+                  TestLabel "test_brokensymlinks" (TestList test_brokensymlinks)]++++
+ testsrc/HVFStest.hs view
@@ -0,0 +1,126 @@+{- arch-tag: HVFS tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module HVFStest(tests) where+import Test.HUnit+import System.IO.HVIO+import System.IO.HVFS+import System.IO.HVFS.InstanceHelpers+import System.IO.HVFS.Combinators+import Test.HUnit.Tools+import System.IO+import System.IO.Error+import Control.Exception++ioeq :: (Show a, Eq a) => a -> IO a -> Assertion+ioeq exp inp = do x <- inp+                  exp @=? x++testTree = [("test.txt", MemoryFile "line1\nline2\n"),+            ("file2.txt", MemoryFile "line3\nline4\n"),+            ("emptydir", MemoryDirectory []),+            ("dir1", MemoryDirectory+             [("file3.txt", MemoryFile "line5\n"),+              ("test.txt", MemoryFile "subdir test"),+              ("dir2", MemoryDirectory [])+             ]+            )+           ]++test_nice_slice =+    let f exp fp = TestLabel fp $ TestCase $ exp @=? nice_slice fp+        in [+            f [] "/"+           ,f ["foo", "bar"] "/foo/bar"+           --,f [] "."+           ]++test_content = +    let f exp fp = TestLabel fp $ TestCase $+                     do x <- newMemoryVFS testTree+                        h <- vOpen x fp ReadMode+                        case h of+                           HVFSOpenEncap h2 -> exp `ioeq` vGetContents h2+        in+        [+         f "line1\nline2\n" "test.txt",+         f "line1\nline2\n" "/test.txt",+         f "line5\n" "dir1/file3.txt",+         f "subdir test" "/dir1/test.txt"+        ]++test_chroot =+    let f msg testfunc = TestLabel msg $ TestCase $ +                         do x <- newMemoryVFS testTree+                            vSetCurrentDirectory x "/emptydir"+                            y <- newHVFSChroot x "/dir1"+                            testfunc y+        in+        [+         f "root" (\x -> ["file3.txt", "test.txt", "dir2"]+                   `ioeq` vGetDirectoryContents x "/")+        ,f "cwd" (\x -> "/" `ioeq` vGetCurrentDirectory x)+        ,f "dir2" (\x -> [] `ioeq` vGetDirectoryContents x "/dir2")+        ,f "dot" (\x -> ["file3.txt", "test.txt", "dir2"]+                  `ioeq` vGetDirectoryContents x ".")+        ,f "cwd tests" $+          (\x -> do a <- vGetDirectoryContents x "/"+                    ["file3.txt", "test.txt", "dir2"] @=? a+                    vSetCurrentDirectory x "/dir2"+                    cwd <- vGetCurrentDirectory x+                    "/dir2" @=? cwd+                    y <- vGetDirectoryContents x "."+                    [] @=? y+                    vSetCurrentDirectory x ".."+                    "/" `ioeq` vGetCurrentDirectory x+                    --vSetCurrentDirectory x ".."+                    --"/" `ioeq` vGetCurrentDirectory x+          )+        --,f "test.txt" (\x -> "subdir test" `ioeq` +        --               (vOpen x "/test.txt" ReadMode >>= vGetContents))+        ]+++test_structure =+    let f msg testfunc = TestLabel msg $ TestCase $ do x <- newMemoryVFS testTree+                                                       testfunc x+        in+        [+         f "root" (\x -> ["test.txt", "file2.txt", "emptydir", "dir1"]+                         `ioeq` vGetDirectoryContents x "/")+        ,f "dot" (\x -> ["test.txt", "file2.txt", "emptydir", "dir1"]+                  `ioeq` vGetDirectoryContents x ".")+        ,f "dot2" (\x -> ["file3.txt", "test.txt", "dir2"]+                   `ioeq` do vSetCurrentDirectory x "./dir1"+                             vGetDirectoryContents x ".")+        ,f "emptydir" (\x -> [] `ioeq` vGetDirectoryContents x "/emptydir")+        ,f "dir1" (\x -> ["file3.txt", "test.txt", "dir2"] `ioeq`+                   vGetDirectoryContents x "/dir1")+        ,f "dir1/dir2" (\x -> [] `ioeq` vGetDirectoryContents x "/dir1/dir2")+        ,f "relative tests" (\x -> +            do vSetCurrentDirectory x "dir1"+               [] `ioeq` vGetDirectoryContents x "dir2"+                            )+        ]+                            ++tests = TestList [TestLabel "nice_slice" (TestList test_nice_slice)+                 ,TestLabel "structure" (TestList test_structure)+                 ,TestLabel "content" (TestList test_content)+                 ,TestLabel "chroot" (TestList test_chroot)+                 ]
+ testsrc/HVIOtest.hs view
@@ -0,0 +1,95 @@+{- arch-tag: HVIO tests main file+Copyright (C) 2004-2009 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module HVIOtest(tests) where+import Test.HUnit+import System.IO.HVIO+import Test.HUnit.Tools+import System.IO+import System.IO.Error+import Control.Exception++ioeq :: (Show a, Eq a) => a -> IO a -> Assertion+ioeq exp inp = do x <- inp+                  exp @=? x++test_MemoryBuffer =+    let f inp testfunc = TestLabel inp $ TestCase $ do x <- newMemoryBuffer inp mbDefaultCloseFunc+                                                       testfunc x+        in+        [+         f "" (\x -> do True `ioeq` vIsOpen x+                        assertRaises "eof error" (mkIOError eofErrorType "" Nothing Nothing) (vGetChar x)+                        vPutStrLn x "Line1"+                        vPutStrLn x "Line2"+                        vRewind x+                        "Line1" `ioeq` vGetLine x+                        "Line2" `ioeq` vGetLine x+                        12 `ioeq` vTell x+                        vSeek x AbsoluteSeek 1+                        "ine1" `ioeq` vGetLine x+                        vSeek x RelativeSeek (-3)+                        "e1" `ioeq` vGetLine x+                        vSeek x SeekFromEnd (-3)+                        "e2" `ioeq` vGetLine x+                        vSeek x AbsoluteSeek 1+                        vPutStr x "IN"+                        vRewind x+                        "LINe1" `ioeq` vGetLine x+                        "Line2" `ioeq` vGetLine x                        +                        vSeek x SeekFromEnd 0+                        vPutChar x 'c'+                        assertRaises "eof error" (mkIOError eofErrorType "" Nothing Nothing) (vGetLine x)+                        vRewind x+                        "LINe1\nLine2\nc" `ioeq` vGetContents x+              )+        ]++test_StreamReader =+    let f inp testfunc = TestLabel inp $ TestCase $ do x <- newStreamReader inp+                                                       testfunc x+        in +        [+         f "" (\x -> do True `ioeq` vIsEOF x+                        True `ioeq` vIsOpen x+                        assertRaises "eof error" (mkIOError eofErrorType "" Nothing Nothing) (vGetChar x)+                        vClose x+                        False `ioeq` vIsOpen x+                        +              )+        ,f "abcd" (\x -> do False `ioeq` vIsEOF x+                            True `ioeq` vIsOpen x+                            'a' `ioeq` vGetChar x+                            "bcd" `ioeq` vGetContents x+                            vClose x+               )+        ,f "line1\nline2\n\n\nline5\nlastline"+           (\x -> do False `ioeq` vIsEOF x+                     "line1" `ioeq` vGetLine x+                     "line2" `ioeq` vGetLine x+                     "" `ioeq` vGetLine x+                     "" `ioeq` vGetLine x+                     "line5" `ioeq` vGetLine x+                     "lastline" `ioeq` vGetLine x+                     assertRaises "eof error" (mkIOError eofErrorType "" Nothing Nothing) (vGetLine x)+           )+        ]++tests = TestList [TestLabel "streamReader" (TestList test_StreamReader),+                  TestLabel "MemoryBuffer" (TestList test_MemoryBuffer)+                 ]
+ testsrc/IOtest.hs view
@@ -0,0 +1,28 @@+{- arch-tag: IO tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module IOtest() where+import Test.HUnit+import System.IO+import Test.HUnit.Tools++++++
+ testsrc/Listtest.hs view
@@ -0,0 +1,256 @@+{- arch-tag: List tests main file+Copyright (C) 2004-2005 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Listtest(tests) where+import Test.HUnit+import Data.List.Utils+import Data.List+import Test.HUnit+import Test.QuickCheck as QC+import Test.HUnit.Tools++test_delFromAL = +    let f :: [(String, Int)] -> [(String, Int)] -> Test+        f inp exp = TestCase $ exp @=? (delFromAL inp "testkey") in+        [+                 f [] []+                 ,f [("one", 1)] [("one", 1)]+                 ,f [("1", 1), ("2", 2), ("testkey", 3)] [("1", 1), ("2", 2)]+                 ,f [("testkey", 1)] []+                 ,f [("testkey", 1), ("testkey", 2)] []+                 ,f [("testkey", 1), ("2", 2), ("3", 3)] [("2", 2), ("3", 3)]+                 ,f [("testkey", 1), ("2", 2), ("testkey", 3), ("4", 4)]+                    [("2", 2), ("4", 4)]+        ]++test_addToAL =+    let f :: [(String, Int)] -> [(String, Int)] -> Test+        f inp exp = TestCase $ exp @=? (addToAL inp "testkey" 101) in+        [+         f [] [("testkey", 101)]+        ,f [("testkey", 5)] [("testkey", 101)]+        ,f [("testkey", 5), ("testkey", 6)] [("testkey", 101)]+        ]++test_split =+    let f delim inp exp = TestCase $ exp @=? split delim inp in+        [+         f "," "foo,bar,,baz," ["foo", "bar", "", "baz", ""]+        ,f "ba" ",foo,bar,,baz," [",foo,","r,,","z,"]+        ,f "," "" []+        ,f "," "," ["", ""]+        ]++test_join =+    let f :: (Eq a, Show a) => [a] -> [[a]] -> [a] -> Test+        f delim inp exp = TestCase $ exp @=? join delim inp in+        [+         f "|" ["foo", "bar", "baz"] "foo|bar|baz"+        ,f "|" [] ""+        ,f "|" ["foo"] "foo"+         -- f 5 [[1, 2], [3, 4]] [1, 2, 5, 3, 4]+        ]++test_replace =+    let f old new inp exp = TestCase $ exp @=? replace old new inp in+        [+         f "" "" "" ""+        ,f "foo" "bar" "" ""+        ,f "foo" "bar" "foo" "bar"+        ,f "foo" "bar" "footestfoothisisabarfoo" "bartestbarthisisabarbar"+        ,f "," ", " "1,2,3,4" "1, 2, 3, 4"+        ,f "," "." "1,2,3,4" "1.2.3.4"+        ]++test_genericJoin =+    let f delim inp exp = TestCase $ exp @=? genericJoin delim inp in+        [+         f ", " [1, 2, 3, 4] "1, 2, 3, 4"+        ,f ", " ([] :: [Int]) ""+        ,f "|" ["foo", "bar", "baz"] "\"foo\"|\"bar\"|\"baz\""+        ,f ", " [5] "5"+        ]++test_flipAL =+    let f inp exp = TestCase $ exp @=? flipAL inp in+        [+         f ([]::[(Int,Int)]) ([]::[(Int,[Int])])+        ,f [("a", "b")] [("b", ["a"])]+        ,f [("a", "b"),+            ("c", "b"),+            ("d", "e"),+            ("b", "b")] [("b", ["b", "c", "a"]),+                         ("e", ["d"])]+        ]++test_uniq =+    let f inp exp = TestCase $ exp @=? uniq inp in+    [f ([]::[Int]) [],+     f "asdf" "asdf",+     f "aabbcc" "abc",+     f "abcabc" "abc",+     f "aaaaaa" "a",+     f "aaaaaab" "ab",+     f "111111111111111" "1",+     f "baaaaaaaaa" "ba",+     f "baaaaaaaaab" "ba",+     f "aaacccdbbbefff" "acdbef",+     f "foo" "fo",+     f "15553344409" "153409",+     f "Mississippi" "Misp"]++test_trunc =+    let f len inp exp = TestCase $ exp @=? take len inp in+        [+         f 2 "Hello" "He"+        ,f 1 "Hello" "H"+        ,f 0 "Hello" ""+        ,f 2 "H" "H"+        ,f 2 "" ""+        ,f 2 [1, 2, 3, 4, 5] [1, 2]+        ,f 10 "Hello" "Hello"+        ,f 0 "" ""+        ]              ++test_contains =+    let f msg sub testlist exp = TestCase $ assertEqual msg exp (contains sub testlist) in+        [+         f "t1" "Haskell" "I really like Haskell." True+        ,f "t2" "" "Foo" True+        ,f "t3" "" "" True+        ,f "t4" "Hello" "" False+        ,f "t5" "Haskell" "Haskell" True+        ,f "t6" "Haskell" "1Haskell" True+        ,f "t7" "Haskell" "Haskell1" True+        ,f "t8" "Haskell" "Ocaml" False+        ,f "t9" "Haskell" "OCamlasfasfasdfasfd" False+        ,f "t10" "a" "Hello" False+        ,f "t11" "e" "Hello" True+        ]++test_elemRIndex =+    let f item inp exp = TestCase $ exp @=? elemRIndex item inp in+        [+         f "foo" [] Nothing+        ,f "foo" ["bar", "baz"] Nothing+        ,f "foo" ["foo"] (Just 0)+        ,f "foo" ["foo", "bar"] (Just 0)+        ,f "foo" ["bar", "foo"] (Just 1)+        ,f "foo" ["foo", "bar", "foo", "bar", "foo"] (Just 4)+        ,f 'f' ['f', 'b', 'f', 'f', 'b'] (Just 3)+        ,f 'f' ['b', 'b', 'f'] (Just 2)+        ]++test_alwaysElemRIndex =+    let f item inp exp = TestCase $ exp @=? alwaysElemRIndex item inp in+        [+         f "foo" [] (-1)+        ,f 'f' ['b', 'q'] (-1)+        ,f 'f' ['f', 'b', 'f', 'f', 'b'] 3+        ]++test_subIndex = +    let f item inp exp = TestCase $ exp @=? subIndex item inp in +        [f "foo" "asdfoobar" (Just 3)+        ,f "foo" [] (Nothing)+        ,f "" [] (Just 0)+        ,f "" "asdf" (Just 0)+        ,f "test" "asdftestbartest" (Just 4)+        ,f [(1::Int), 2] [0, 5, 3, 2, 1, 2, 4] (Just 4)+        ]++test_fixedWidth =+    let f inplen inplist exp = TestLabel ((show inplen) ++ ", " +++                                          (show inplist)) $ TestCase $+                               wholeMap (fixedWidth inplen) inplist @=? exp in+        [+         f [] ([]::[Int]) ([]::[[Int]])+        ,f [1] [5] [[5]]+        ,f [1] [3, 4, 5, 6] [[3], [4, 5, 6]]+        ,f [1] ([]::[Int]) ([]::[[Int]])+        ,f [2] [3] [[3]]+        ,f [2] [3, 4, 5, 6] [[3, 4], [5, 6]]+        ,f [2] [3, 4, 5] [[3, 4], [5]]+        ,f [1, 2, 3] "1234567890"  ["1","23","456","7890"]+        ,f (repeat 2) "123456789" ["12","34","56","78","9"]+        ,f [] "123456789" ["123456789"]+        ,f [5, 3, 6, 1] "Hello, This is a test." +               ["Hello",", T","his is"," ","a test."]+        ]++test_strToAL =+    let f inp exp = TestLabel (show inp) $ TestCase $ do let r = strFromAL inp+                                                         exp @=? r+                                                         inp @=? strToAL r+        in+        [+         f ([]::[(String, String)]) ""+        ,f [("foo", "bar")] "\"foo\",\"bar\"\n"+        ,f [("foo", "bar"), ("baz", "quux")] "\"foo\",\"bar\"\n\"baz\",\"quux\"\n"+        ,f [(1::Int, 2::Int), (3, 4)] "1,2\n3,4\n"+        ,f [(1::Int, "one"), (2, "two")] "1,\"one\"\n2,\"two\"\n"+        ,f [("one", 1::Double), ("n\nl", 2::Double)]+           "\"one\",1.0\n\"n\\nl\",2.0\n"+        ]++test_spanList =+    let f func inp exp = TestLabel (show inp) $ TestCase $ exp @=? spanList func inp+        in+          [f (contains "foo") "Testfoobar" ("Testf", "oobar"),+           f (\_ -> True) "Testasdf" ("Testasdf", ""),+           f (\_ -> False) "Testasdf" ("", "Testasdf"),+           f (contains "foo") "" ("", ""),+           f (contains "foo") "foo" ("f", "oo")]+++test_merge =+    qctest "prop_merge" prop_merge++prop_merge xs ys =+    merge (sort xs) (sort ys) == sort (xs ++ ys)+          where types = xs :: [Int]++test_mergeBy =+    qctest "test_mergeBy" prop_mergeBy++prop_mergeBy xs ys =+    mergeBy cmp (sortBy cmp xs) (sortBy cmp ys) == sortBy cmp (xs ++ ys)+          where types = xs :: [Int]+                cmp = compare++tests = TestList [test_merge,+                  test_mergeBy,+                  TestLabel "delFromAL" (TestList test_delFromAL),+                  TestLabel "uniq" (TestList test_uniq),+                  TestLabel "addToAL" (TestList test_addToAL),+                  TestLabel "split" (TestList test_split),+                  TestLabel "join" (TestList test_join),+                  TestLabel "genericJoin" (TestList test_genericJoin),+                  TestLabel "trunc" (TestList test_trunc),+                  TestLabel "flipAL" (TestList test_flipAL),+                  TestLabel "elemRIndex" (TestList test_elemRIndex),+                  TestLabel "alwaysElemRIndex" (TestList test_alwaysElemRIndex),+                  TestLabel "replace" (TestList test_replace),+                  TestLabel "contains" (TestList test_contains),+                  TestLabel "strFromAL & strToAL" (TestList test_strToAL),+                  TestLabel "fixedWidth" (TestList test_fixedWidth),+                  TestLabel "subIndex" (TestList test_subIndex),+                  TestLabel "spanList" (TestList test_spanList)]+++
+ testsrc/MIMETypestest.hs view
@@ -0,0 +1,75 @@+{- arch-tag: MIMETypes tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module MIMETypestest(tests) where+import Test.HUnit+import Data.List+import Data.MIME.Types++test_readMIMETypes =+    let omtd = readMIMETypes defaultmtd True "testsrc/mime.types.test"+        f = \strict inp exp -> TestCase $ do +                                          mtd <- omtd+                                          exp @=? guessType mtd strict inp+        fe = \strict inp exp -> TestCase $ do mtd <- omtd+                                              (sort exp) @=? sort (guessAllExtensions mtd strict inp)+        in [+            f True "foo.bar.baz" (Nothing, Nothing)+           ,f True "" (Nothing, Nothing)+           ,f True "foo.ez" (Just "application/andrew-inset", Nothing)+           ,fe True "application/andrew-inset" [".ez"]+           ,f True "foo.dv" (Just "video/x-dv", Nothing)+           ,fe True "video/x-dv" [".dif", ".dv"]+           ,f True "test.h++" (Just "text/x-c++hdr", Nothing)+           ,fe True "text/x-c++hdr" [".h++", ".hpp", ".hxx", ".hh"]+           ,f True "foo.tgz" (Just "application/x-tar", Just "gzip")+           ]+++test_guessAllExtensions =+    let f strict inp exp = TestCase $ (sort exp) @=? sort (guessAllExtensions defaultmtd strict inp) in+        [+         f True "" []+        ,f True "foo" []+        ,f True "application/octet-stream" [".obj", ".so", ".bin", ".a", ".dll", ".exe", ".o"]+        ,f True "text/plain" [".pl", ".ksh", ".bat", ".c", ".h", ".txt"]+        ,f True "application/rtf" []+        ,f False "application/rtf" [".rtf"]+        ]++test_guessType =+    let f strict inp exp = TestCase $ exp @=? guessType defaultmtd strict inp in +         [+            f True "" (Nothing, Nothing)+           ,f True "foo" (Nothing, Nothing)+           ,f True "foo.txt" (Just "text/plain", Nothing)+           ,f True "foo.txt.gz" (Just "text/plain", Just "gzip")+           ,f True "foo.txt.blah" (Nothing, Nothing)+           ,f True "foo.tar" (Just "application/x-tar", Nothing)+           ,f True "foo.tar.gz" (Just "application/x-tar", Just "gzip")+           ,f True "foo.tgz" (Just "application/x-tar", Just "gzip")+           ,f True "http://foo/test.dir/blah.rtf" (Nothing, Nothing)+           ,f False "http://foo/test.dir/blah.rtf" (Just "application/rtf", Nothing)+           ,f True "foo.pict" (Nothing, Nothing)+           ,f False "foo.pict" (Just "image/pict", Nothing)+           ]++tests = TestList [TestLabel "guessType" (TestList test_guessType),+                  TestLabel "guessAllExtensions" (TestList test_guessAllExtensions),+                  TestLabel "readMIMETypes" (TestList test_readMIMETypes)+                 ]
+ testsrc/Maptest.hs view
@@ -0,0 +1,47 @@+{-+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Maptest(tests) where+import Test.HUnit+import Data.Map.Utils+import Data.Map as M++test_flipM =+    let f inp exp = TestCase $ (M.fromList exp) @=? flipM (M.fromList inp) in+        [+         f ([]::[(Int,Int)]) ([]::[(Int,[Int])])+        ,f [("a", "b")] [("b", ["a"])]+        ,f [("a", "b"),+            ("c", "b"),+            ("d", "e"),+            ("b", "b")] [("b", ["c", "b", "a"]),+                         ("e", ["d"])]+        ]++test_flippedLookupM =+    let f item inp exp = TestCase $ exp @=? flippedLookupM item (M.fromList inp) in+        [+         f 'a' ([]::[(Char, Char)]) []+        ,f 'a' [("Test1", 'a'), ("Test2", 'b')] ["Test1"]+        ,f 'a' [("Test1", 'b'), ("Test2", 'b')] []+        ,f 'a' [("Test1", 'a'), ("Test2", 'a')] ["Test2", "Test1"]+        ]++tests = TestList [TestLabel "flipM" (TestList test_flipM),+                  TestLabel "flippedLookupM" (TestList test_flippedLookupM)+                 ]
+ testsrc/Pathtest.hs view
@@ -0,0 +1,77 @@+{- arch-tag: Path tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Pathtest(tests) where+import Test.HUnit+import System.Path++test_absNormPath =+    let f base p exp = TestLabel (show (base, p)) $ TestCase $ exp @=? absNormPath base p+        f2 = f "/usr/1/2" in+        [ +         f "/" "" (Just "/")+        ,f "/usr/test" "" (Just "/usr/test")+        ,f "/usr/test" ".." (Just "/usr")+        ,f "/usr/1/2" "/foo/bar" (Just "/foo/bar")+        ,f2 "jack/./.." (Just "/usr/1/2")+        ,f2 "jack///../foo" (Just "/usr/1/2/foo")+        ,f2 "../bar" (Just "/usr/1/bar")+        ,f2 "../" (Just "/usr/1")+        ,f2 "../.." (Just "/usr")+        ,f2 "../../" (Just "/usr")+        ,f2 "../../.." (Just "/")+        ,f2 "../../../" (Just "/")+        ,f2 "../../../.." Nothing+        ]++test_secureAbsNormPath =+    let f base p exp = TestLabel (show (base, p)) $ TestCase $ exp @=? secureAbsNormPath base p+        f2 = f "/usr/1/2" in+        [ +         f "/" "" (Just "/")+        ,f "/usr/test" "" (Just "/usr/test")+        ,f "/usr/test" ".." Nothing+        ,f "/usr/1/2" "/foo/bar" Nothing+        ,f "/usr/1/2" "/usr/1/2" (Just "/usr/1/2")+        ,f "/usr/1/2" "/usr/1/2/foo/bar" (Just "/usr/1/2/foo/bar")+        ,f2 "jack/./.." (Just "/usr/1/2")+        ,f2 "jack///../foo" (Just "/usr/1/2/foo")+        ,f2 "../bar" Nothing+        ,f2 "../" Nothing+        ,f2 "../.." Nothing+        ,f2 "../../" Nothing+        ,f2 "../../.." Nothing+        ,f2 "../../../" Nothing+        ,f2 "../../../.." Nothing+        ]++test_splitExt =+    let f inp exp = TestCase $ exp @=? splitExt inp in+        [+         f "" ("", "")+        ,f "/usr/local" ("/usr/local", "")+        ,f "../foo.txt" ("../foo", ".txt")+        ,f "../bar.txt.gz" ("../bar.txt", ".gz")+        ,f "foo.txt/bar" ("foo.txt/bar", "")+        ,f "foo.txt/bar.bz" ("foo.txt/bar", ".bz")+        ]++tests = TestList [TestLabel "splitExt" (TestList test_splitExt)+                 ,TestLabel "absNormPath" (TestList test_absNormPath)+                 ,TestLabel "secureAbsNormPath" (TestList test_secureAbsNormPath)+                 ]
+ testsrc/ProgressTrackertest.hs view
@@ -0,0 +1,144 @@+{- +Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module ProgressTrackertest(tests) where+import Data.Progress.Tracker+import Test.HUnit+import Control.Concurrent.MVar++setup =+    do timem <- newMVar 0+       let timesource = readMVar timem+       po <- newProgress' (ProgressStatus 0 100 0 "" timesource) []+       return (po, timem)++settime timem newval = swapMVar timem newval >> return ()++test_incrP = +    do (po, timem) <- setup+       incrP po 5+       withStatus po $ \s ->+                  do assertEqual "completedUnits" 5 (completedUnits s)+                     assertEqual "totalUnits" 100 (totalUnits s)+       incrP po 95+       withStatus po $ \s ->+                  do assertEqual "completedUnits" 100 (completedUnits s)+                     assertEqual "totalUnits" 100 (totalUnits s)+       incrP po 5+       withStatus po $ \s ->+                  do assertEqual "completedUnits" 105 (completedUnits s)+                     assertEqual "totalUnits" 105 (totalUnits s)+       incrP' po 5+       withStatus po $ \s ->+                  do assertEqual "completedUnits" 110 (completedUnits s)+                     assertEqual "totalUnits" 105 (totalUnits s)+       incrTotal po 10+       withStatus po $ \s ->+                  do 110 @=? completedUnits s+                     115 @=? totalUnits s++test_setP =+    do (po, timem) <- setup+       setP po 5+       withStatus po $ \s ->+           do 5 @=? completedUnits s+              100 @=? totalUnits s+       setP po 100+       withStatus po $ \s ->+           do 100 @=? completedUnits s+              100 @=? totalUnits s+       setP po 105+       withStatus po $ \s ->+           do 105 @=? completedUnits s+              105 @=? totalUnits s+       setP' po 110+       withStatus po $ \s ->+           do 110 @=? completedUnits s+              105 @=? totalUnits s+       setTotal po 115+       withStatus po $ \s ->+           do 110 @=? completedUnits s+              115 @=? totalUnits s++test_speed =+    do (po, timem) <- setup+       getSpeed po >>= assertEqual "initial speed" 0+       getETR po >>= assertEqual "initial ETR" 0+       getETA po >>= assertEqual "initial ETA" 0++       incrP po 10+       getSpeed po >>= assertEqual "speed after incr" 0+       getETR po >>= assertEqual "ETR after incr" 0+       getETA po >>= assertEqual "ETA after incr" 0++       settime timem 5+       getSpeed po >>= assertEqual "first speed" 2.0+       getETR po >>= assertEqual "first ETR" 45+       getETA po >>= assertEqual "first ETA" 50++       incrP po 90+       getSpeed po >>= assertEqual "speed 2" 20.0+       getETR po >>= assertEqual "etr 2" 0+       getETA po >>= assertEqual "eta 2" 5++       settime timem 400+       setP po 90+       getSpeed po >>= assertEqual "speed 3" 0.225+       getETR po >>= assertEqual "etr 2" 44+       getETA po >>= assertEqual "eta 2" 444++test_callback =       +    do (po, _) <- setup+       mcounter <- newMVar (0::Int)+       mcounter1 <- newMVar (0::Int)+       mcounter2 <- newMVar (0::Int)+       (po2, _) <- setup+       (po3, _) <- setup+       +       addCallback po (minc mcounter)+       addParent po po2+       incrP po 5+       readMVar mcounter >>= assertEqual "cb1" 1+       withStatus po (\x -> 5 @=? completedUnits x)+       withStatus po2 (\x -> do 5 @=? completedUnits x+                                200 @=? totalUnits x)+       +       addCallback po2 (minc mcounter2)+       incrP po 100+       readMVar mcounter2 >>= (\x -> assertBool "cb2" (0 /= x))+       withStatus po2 (\x -> do 105 @=? completedUnits x+                                205 @=? totalUnits x)+       +       incrP' po 5+       withStatus po2 (\x -> do 110 @=? completedUnits x+                                205 @=? totalUnits x)++       finishP po+       withStatus po2 (\x -> do 110 @=? completedUnits x+                                210 @=? totalUnits x)+       +       +    where minc mv _ _ = modifyMVar_ mv (\x -> return $ x + 1)++tests = TestList [TestLabel "incrP" (TestCase test_incrP),+                  TestLabel "setP" (TestCase test_setP),+                  TestLabel "speed" (TestCase test_speed),+                  TestLabel "test_callback" (TestCase test_callback)]+++
+ testsrc/Str/CSVtest.hs view
@@ -0,0 +1,42 @@+{- arch-tag: CSV tests main file+Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Str.CSVtest(tests) where+import Test.HUnit+import Data.CSV+import Text.ParserCombinators.Parsec++test_csv =+    let f inp exp = TestLabel inp $ TestCase $ +                    exp @=? case parse csvFile "" inp of+                                  Right x -> Right x+                                  Left y -> Left (show y)+        in [+        f "" (Right []),+        f "\n" (Right [[""]]),+        f "1,2,3\n" (Right [["1", "2", "3"]]),+        f "This is a,Test,Really\n" (Right [["This is a", "Test", "Really"]]),+        f "l1\nl2\n" (Right [["l1"], ["l2"]]),+        f "NQ,\"Quoted\"\n" (Right [["NQ", "Quoted"]]),+        f "1Q,\"\"\"\"\n" (Right [["1Q", "\""]]),+        f ",\"\"\n" (Right [["", ""]]),+        f "\"Embedded\"\"Quote\"\n" (Right [["Embedded\"Quote"]])+        ]++tests = TestList [TestLabel "csv" (TestList test_csv)]+
+ testsrc/Strtest.hs view
@@ -0,0 +1,85 @@+{- arch-tag: Str tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Strtest(tests) where+import Test.HUnit+import Data.String.Utils+import Test.HUnit.Tools+import Text.Regex+import Data.Char++test_lstrip =+    mapassertEqual "lstrip" lstrip+                       [("", ""),+                        ("a", "a"),+                        (" a ", "a "),+                        ("  abas", "abas"),+                        ("\n\t fdsa", "fdsa"),+                        ("abc def", "abc def")]++test_rstrip =+    mapassertEqual "rstrip" rstrip+                   [("", ""),+                    ("a", "a"),+                    (" a ", " a"),+                    ("abas  ", "abas"),+                    ("fdsa \n\t", "fdsa"),+                    ("abc def", "abc def")]++test_strip =+    mapassertEqual "strip" strip+                   [("", ""),+                    ("a", "a"),+                    (" a ", "a"),+                    ("abas  ", "abas"),+                    ("  abas", "abas"),+                    ("asdf\n\t ", "asdf"),+                    ("\nbas", "bas"),+                    ("abc def", "abc def")]++test_splitWs =+    let f exp inp = TestCase $ exp @=? splitWs inp+        in [+            f [] "    ",+            f [] "",+            f ["asdf"] " asdf\n",+            f ["one", "two", "three"] "  one\ntwo \tthree \n"+           ]+++test_escapeRe =+    map (\i -> TestLabel (show $ chr i) $ TestCase $ assertEqual [chr i] (Just []) +                (matchRegex (mkRegex $ escapeRe $ [chr i]) [chr i]))+             [1..255]+    +++    [TestCase $ assertEqual "big string" +                     (Just ([], teststr, [], []))+                     (matchRegexAll (mkRegex $ escapeRe teststr) teststr)+    ]+    where teststr = map chr [1..255]++tests = TestList [TestLabel "lstrip" (TestList test_lstrip),+                  TestLabel "rstrip" $ TestList test_rstrip,+                  TestLabel "strip" $ TestList test_strip,+                  TestLabel "splitWs" $ TestList test_splitWs,+                  TestLabel "escapeRe" $ TestList test_escapeRe+                  ]++++
+ testsrc/Tests.hs view
@@ -0,0 +1,61 @@+{- arch-tag: Tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Tests(tests) where+import Test.HUnit+import qualified MIMETypestest+import qualified Listtest+import qualified Maptest+import qualified Pathtest+import qualified Strtest+import qualified IOtest+import qualified Bitstest+import qualified Eithertest+import qualified CRC32POSIXtest+import qualified CRC32GZIPtest+import qualified GZiptest+import qualified HVIOtest+import qualified HVFStest+import qualified Timetest+import qualified Str.CSVtest+import qualified WildMatchtest+import qualified Globtest+import qualified ProgressTrackertest++test1 = TestCase ("x" @=? "x")++tests = TestList [TestLabel "test1" test1,+                 TestLabel "List" Listtest.tests,+                 TestLabel "Str" Strtest.tests,+                 TestLabel "CSV" Str.CSVtest.tests,+                 TestLabel "Time" Timetest.tests,+                 TestLabel "Map" Maptest.tests,+                 TestLabel "ProgressTracker" ProgressTrackertest.tests,+                 TestLabel "Path" Pathtest.tests,+                 TestLabel "WildMatch" WildMatchtest.tests,+                 TestLabel "HVIO" HVIOtest.tests,+                 TestLabel "HVFS" HVFStest.tests,+                 TestLabel "Glob" Globtest.tests,+                 TestLabel "MIMETypes" MIMETypestest.tests,+                 TestLabel "Bitstest" Bitstest.tests,+                 TestLabel "Eithertest" Eithertest.tests,+                 TestLabel "CRC32POSIXtest" CRC32POSIXtest.tests,+                 TestLabel "CRC32GZIPtest" CRC32GZIPtest.tests,+                 TestLabel "GZiptest" GZiptest.tests]++
+ testsrc/Timetest.hs view
@@ -0,0 +1,54 @@+{- arch-tag: Time tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++module Timetest(tests) where+import Test.HUnit+import System.Time.Utils+import System.Time++base =CalendarTime {ctYear = 2005, ctMonth = January, ctDay = 21,+                          ctHour = 1, ctMin = 1, ctSec = 20,+                          ctPicosec = 0, ctWDay = Sunday, ctYDay = 0,+                          ctTZName = "", ctTZ = 0, ctIsDST = False}+test_ctu2e =+    let f base exp = TestLabel (show base) $ TestCase $ exp @=? timegm base in+        [+         f (base {ctYear = 2005, ctMonth = January, ctDay = 21,+                          ctHour = 1, ctMin = 1, ctSec = 20})+           1106269280+           +         ,f (base {ctYear = 2004, ctMonth = July, ctDay = 1,+                           ctHour = 17, ctMin = 0, ctSec = 0})+           1088701200++        ]++test_ct2e =+    let f base exp = TestLabel (show base) $ TestCase $ +                       do r <- timelocal base+                          exp @=? r in+        [+         f (base {ctYear = 2005, ctMonth = January, ctDay = 20,+                          ctHour = 19, ctMin = 1, ctSec = 20})+           1106269280+        ,f (base {ctYear = 2004, ctMonth = July, ctDay = 1,+                           ctHour = 12, ctMin = 0, ctSec = 0})+           1088701200+        ]++tests = TestList [TestLabel "ctu2e" (TestList test_ctu2e)]
+ testsrc/WildMatchtest.hs view
@@ -0,0 +1,52 @@+{- +Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}+++module WildMatchtest(tests) where+import Test.HUnit+import System.Path.WildMatch+import Test.HUnit.Tools++test_wildCheckCase =+    let f patt name = TestCase $ assertBool (patt ++ "," ++ name ++ " was false")+                      (wildCheckCase patt name)+        f0 patt name = TestCase $ assertBool (patt ++ "," ++ name ++ " was true")+                       (not $ wildCheckCase patt name)+    in+    [f "asdf" "asdf",+     f "?*?" "abc",+     f "???*" "asd",+     f "*???" "asd",+     f "???" "asd",+     f "*" "asd",+     f "ab[cd]" "abc",+     f "ab[!de]" "abc",+     f0 "ab[de]" "abc",+     f0 "??" "a",+     f0 "a" "b",+     f "[\\]" "\\",+     f "[!\\]" "a",+     f0 "[!\\]" "\\",+     f0 "*.deb" "thedebianthing",+     f0 "a/*.foo" "testtmp/a/D"]+     +tests = TestList [TestLabel "wildCheckCase" (TestList test_wildCheckCase)]++++
+ tolgpl view
@@ -0,0 +1,7 @@+#!/bin/bash+ssed -i -e 's/GNU General/GNU Lesser General/g' \+        -e 's/ GPL/ LGPL/g' \+        -e 's/version 2 /version 2.1 /g' \+        -e 's/59 Temple Place, Suite 330, Boston, MA  02111-1307/51 Franklin St, Fifth Floor, Boston, MA  02110-1301/g' \+        $1+
+ winbuild.bat view
@@ -0,0 +1,4 @@+ghc -package Cabal Setup.hs -o setup.exe
+setup configure
+setup build
+
+ wintest.bat view
@@ -0,0 +1,5 @@+cd testsrc
+ghc --make -package hslogger -package FilePath -package mtl -package HUnit -fallow-overlapping-instances -fallow-undecidable-instances -fglasgow-exts -cpp -o runtests.exe -i..\dist\build:..\src runtests.hs
+cd ..
+testsrc\runtests
+