Skip to content

Commit

Permalink
Revert "Imported Upstream version 1.1.0.1"
Browse files Browse the repository at this point in the history
This reverts commit 7c52827.
  • Loading branch information
jgoerzen committed Feb 16, 2010
1 parent 907f5e3 commit 71c337c
Show file tree
Hide file tree
Showing 37 changed files with 2,760 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 3rd-party-licenses/BSD
Original file line number Diff line number Diff line change
@@ -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

511 changes: 511 additions & 0 deletions 3rd-party-licenses/LGPL-2.1

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
=========================================
INSTALLATION INSTRUCTIONS
For Linux, Unix, BSD, and POSIX platforms
=========================================

Please see the file INSTALL-win.txt for Windows platform instructions.

PREREQUISITES
-------------

You must satisfy one or more of these major categories:

1. GHC 6.6 or above (including cpphs)
(for GHC 6.4.0 or 6.4.1, use MissingH 0.14.3 or below)

2. Hugs 2005xx or above, plus cpphs

If you don't already have cpphs, get it from
http://www.cs.york.ac.uk/fp/cpphs/.

If you need Cabal, get it from http://www.haskell.org/cabal.

Debian users can install the packages cpphs and ghc6

3. GHC extralibs collection, or the individual
libraries mentioned in MissingH.cabal

You can conveniently download them all in one package; see

http://software.complete.org/missingh/wiki/RelatedSoftware#RequisiteLibraries


INSTALLATION
------------

The first step is to generate your setup file. To do that, run:

make setup

Now, for GHC:

./setup configure
./setup build
./setup install

Or, for Hugs:

./setup configure --hugs
./setup build
./setup install

Optionally, to run the unit tests, you'll need to install HUnit. Then:

make test-ghc6

or:

make test-hugs

(More to come in this file)
33 changes: 33 additions & 0 deletions INSTALL-win.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
=========================
INSTALLATION INSTRUCTIONS
For Microsoft platforms
=========================

For Unix, Linux, BSD, and other POSIX platforms (including Cygwin),
see the INSTALL file instead of this one.

PREREQUISITES
-------------

You need GHC 6.6 or above plus the packages listed at
http://software.complete.org/missingh/wiki/RelatedSoftware#RequisiteLibraries

INSTALLATION
------------

Before doing anything, open up a command prompt and cd into the
top-level missingh directory.

Now, run the script to build the program:

winbuild

To install, run:

setup install

To compile and run the unit tests, run:

wintest

(More to come in this file)
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# arch-tag: Main Makefile
# 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

PROJECT := MissingH
GHCPARMS := -fallow-overlapping-instances -fallow-undecidable-instances -fglasgow-exts -cpp

.PHONY: all hugsbuild
all: setup # GHC build
./setup configure
./setup build

hugsbuild: setup
./setup configure --hugs
./setup build

setup: Setup.hs $(PROJECT).cabal
ghc -package Cabal Setup.hs -o setup

doctmp/%.hs: %.lhs doctmp
mkdir -p `dirname $@`
$(UNLIT) $< $@

doctmp:
mkdir doctmp

.PHONY: doc
doc: $(LHSCONVSOURCES) setup
-rm -rf html
./setup configure
./setup haddock
# haddock $(HADDOCKARGS) --package=$(PROJECT) \
# --dump-interface=html/$(PROJECT).haddock \
# -t '$(PROJECT) API Manual' -h -o html $(HUGSCONVSOURCES) $(LHSCONVSOURCES)
mv dist/doc/html .

.PHONY: hugsbuild


clean:
-./setup clean
-rm -rf html `find . -name "*.o"` `find . -name "*.hi"` \
`find . -name "*~"` *.a setup dist testsrc/runtests \
local-pkg doctmp
-rm -rf testtmp/*

.PHONY: local-pkg
local-pkg: all
echo "[" > local-pkg
cat .installed-pkg-config >> local-pkg
echo "]" >> local-pkg

testsrc/runtests: all $(wildcard testsrc/*.hs) $(wildcard testsrc/*/*.hs) $(wildcard testsrc/*/*/*.hs)
cd testsrc && ghc --make -package hslogger -package filepath -package mtl -package HUnit $(GHCPARMS) -o runtests -i../dist/build:../src runtests.hs

test-ghc6: testsrc/runtests
testsrc/runtests

test-hugs:
runhugs -98 +o "-Fcpphs --noline" -P$(PWD)/src:$(PWD)/testsrc: testsrc/runtests.hs

interact-hugs:
hugs -98 +o -P$(PWD)/dist/build:

interact-ghci: all
ghci -idist/build -Ldist/build $(GHCPARMS)

interact: interact-hugs

test: test-ghc6 test-hugs

33 changes: 33 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions examples/simplegrep.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import MissingH.List
main = do
c <- getContents
putStr (unlines(filter (\line -> contains "Haskell" line)
(lines c)))

26 changes: 26 additions & 0 deletions examples/test2.hs
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions examples/test3.hs
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
basename p = reverse $ takeWhile (/= '/') $ reverse p

dirname p = case reverse $ dropWhile (/= '/') $ reverse p of
[] -> "."
p' -> p'

--------------------------------------------------

From: Mark Carroll <mark@ixod.org>
Date: Sat, 15 Jan 2005 19:17:09 -0500 (EST)
To: John Goerzen <jgoerzen@complete.org>
Subject: Re: [Haskell-cafe] Re: Utility functions

You can take the original, or this version, as being Copyright (c) 2004
Mark Carroll under the modified BSD license. At the time of writing, it's
the one at http://www.opensource.org/licenses/bsd-license.php

splitListBy :: (a -> Bool) -> [a] -> [[a]]

splitListBy isElement =
unfoldr splitter . (ignored :)
where
splitter [] = Nothing
splitter xs = Just (span isElement (tail xs))
ignored = error "internal failure in splitListBy"

-- Mark
Loading

0 comments on commit 71c337c

Please sign in to comment.