[Haskell-cafe] Map Reduce spec in Haskell

2013-04-18 Thread John D. Ramsdell
I'm learning about the Map Reduce computation frequently used with big data. For the fun of it, I decided to write a very high-level spec of Map Reduce. Here is what I came up with. Enjoy. John module MapReduce where import Data.List (nub) A high-level specification of Map Reduce as a

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-28 Thread John D. Ramsdell
Read. At least S-expression parsing is easy. John On Thu, Feb 28, 2013 at 3:02 AM, Ganesh Sittampalam gan...@earth.li wrote: Hi, On 27/02/2013 20:38, John D. Ramsdell wrote: How does one create a value of type System.IO.Handle for reading that takes its input from a string instead of a file

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-28 Thread John D. Ramsdell
- Simon's buffer class rewrite should have made this possible, I think. http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/GHC-IO-BufferedIO.html On Feb 27, 2013 10:52 PM, Gregory Collins g...@gregorycollins.net wrote: On Wed, Feb 27, 2013 at 9:38 PM, John D. Ramsdell ramsde

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-28 Thread John D. Ramsdell
(Data.ByteString.Char8.pack s) [note the complete disregard of encoding issues in the use of Data.ByteString.Char8] Cheers, Ganesh On 28/02/2013 13:32, John D. Ramsdell wrote: I think I wasn't clear about my question. I want something that creates a value of type System.IO.Handle. You

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-28 Thread John D. Ramsdell
for a Handle. Regards, Erik On Thu, Feb 28, 2013 at 2:32 PM, John D. Ramsdell ramsde...@gmail.com wrote: I think I wasn't clear about my question. I want something that creates a value of type System.IO.Handle. You see, I have a high performance S-expression parser that I'd like to use

[Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-27 Thread John D. Ramsdell
How does one create a value of type System.IO.Handle for reading that takes its input from a string instead of a file? I'm looking for the equivalent of java.io.StringReader in Java. Thanks in advance. John ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Makefile for a Haskell Project

2013-01-15 Thread John D. Ramsdell
This is the Makefile used by CPSA. It requires GNU make. John # Haskell/Cabal Makefile # Requires GNU Make # The all target creates a default configuration if need be. PACKAGE := $(wildcard *.cabal) CONFIG = dist/setup-config SETUP = runhaskell Setup.hs all:$(CONFIG) $(SETUP)

Re: [Haskell-cafe] Solving integer equations in Haskell

2012-10-17 Thread John D. Ramsdell
For Linear integer equations, I think you want http://hackage.haskell.org/packages/archive/agum/2.4/doc/html/Algebra-AbelianGroup-IntLinEq.html The algorithm used to find solutions is described in Vol. 2 of The Art of Computer Programming / Seminumerical Alorithms, 2nd Ed., 1981, by Donald E.

Re: [Haskell-cafe] Linear Diaphantine equation solver bug

2012-05-12 Thread John D. Ramsdell
of equations instead of just one, and uses the underlying SMT solver to find the minimal solutions. I see it as a nice complement to your work, where one can check the results of your solver against the SBV produced one for extra assurance if needed. On Wed, Apr 25, 2012 at 7:09 PM, John D. Ramsdell

[Haskell-cafe] Linear Diaphantine equation solver bug

2012-04-25 Thread John D. Ramsdell
I uploaded a new version of the ACU unifier in package cmu. It includes a Linear Diaphantine equation solver that now handles inhomogeneous equations. What's interesting is the algorithm is based on a paper by Contejean and Devie. That paper includes a proof of correctness of their algorithm.

Re: [Haskell-cafe] Best platform for development with GHC?

2011-06-15 Thread John D. Ramsdell
On Wed, Jun 15, 2011 at 3:02 AM, Ketil Malde ke...@malde.org wrote: Dmitri O.Kondratiev doko...@gmail.com writes: Which platform - Mac OS X, Linux or Win32 is best for development with GHC today? How are things with Ubuntu? I use Ubuntu.  Most stuff is fairly up-to-date, but even with

Re: [Haskell-cafe] SIGPLAN Programming Languages Software Award

2011-06-08 Thread John D. Ramsdell
Well deserved. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How to install GhC on a Mac without registering?

2011-06-05 Thread John D. Ramsdell
But you don't need Xcode 4, do you?  The Xcode 3 that comes with the install DVD will work fine! I'm still looking for the install DVD that my wife has carefully put aside for safe keeping. All-in-all, casual use of Haskell seems much easier on Linux and Windows. John

[Haskell-cafe] How to install GhC on a Mac without registering?

2011-06-03 Thread John D. Ramsdell
I rarely use a Mac because it is too cute, but I bought one for my wife. I'd like to install GHC on her Mac just to test Haskell Platform and cabal install. (I rarely use Windows too, but testing GHC cabal install is completely painless.) To do a quick test, do I really have to register as an

Re: [Haskell-cafe] Parallel Haskell stories

2011-03-10 Thread John D. Ramsdell
On Wed, Mar 9, 2011 at 11:18 AM, Simon Peyton-Jones simo...@microsoft.com wrote:        could you contribute a little vignette or story        about using Haskell in a *parallel/concurrent* application        that I could use to illustrate my talk? The Cryptographic Protocol Shapes Analyzer

Re: [Haskell-cafe] Parallel Haskell stories

2011-03-10 Thread John D. Ramsdell
On Thu, Mar 10, 2011 at 6:04 PM, John D. Ramsdell ramsde...@gmail.com wrote: At the code level, all that is done is replace one map call with a parallelized version of map that I saw in one of your papers: #if defined HAVE_PAR parMap :: (a - b) - [a] - [b] parMap _ [] = [] Opps. Please

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-24 Thread John D. Ramsdell
On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde ke...@malde.org wrote: So I still think the 80% rule is pretty good - it's simple, and although it isn't optimal in all cases, it's conservative in that any larger bound is almost certainly going to thrash. Did you get a chance to test the 80%

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-18 Thread John D. Ramsdell
with the search keys of linux free and reclaimable memory /proc/meminfo. The results will contain many URLs of interest. John On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde ke...@malde.org wrote: John D. Ramsdell ramsde...@gmail.com writes: In absence of any explicit limits, I think a sensible default

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-18 Thread John D. Ramsdell
On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde ke...@malde.org wrote: So I still think the 80% rule is pretty good - it's simple, and although it isn't optimal in all cases, it's conservative in that any larger bound is almost certainly going to thrash. Please test the 80% rule, and report the

Re: [Haskell-cafe] DNS problems at haskell.org?

2010-12-18 Thread John D. Ramsdell
I think someone failed to pay a bill for using the domain name haskell.org. John On Fri, Dec 17, 2010 at 12:05 PM, aditya siram aditya.si...@gmail.com wrote: I have the same problem. -deech On Fri, Dec 17, 2010 at 8:01 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Hello. For a

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-18 Thread John D. Ramsdell
On Thu, Dec 16, 2010 at 4:13 AM, Simon Marlow marlo...@gmail.com wrote: If your program has large memory requirements, you might also benefit from parallel GC in the old generation: +RTS -N2 -qg1.l Testing shows this advice did not help in my case. The program that implements the undecidable

Re: [Haskell-cafe] Layout styles and EclipseFP evolution.

2010-12-18 Thread John D. Ramsdell
Note to community. Design the syntax of a language to support auto indenting. Don't make me repeatedly hit the tab key. John On Thu, Dec 16, 2010 at 8:48 PM, Scott Michel scooter@gmail.com wrote: Disclaimer: I'm not looking to start a favorite IDE flame war, or resurrect Emacs vs. VIM

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-16 Thread John D. Ramsdell
On Thu, Dec 16, 2010 at 4:45 AM, Ketil Malde ke...@malde.org wrote: In absence of any explicit limits, I think a sensible default is to set maximum total memory use to something like 80%-90% of physical RAM. This would be a poor choice on Linux systems. As I've argued previously in this

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-15 Thread John D. Ramsdell
On Wed, Dec 15, 2010 at 7:59 AM, Simon Marlow marlo...@gmail.com wrote:  The -M flag causes the GC algorithm to switch from copying (fast but hungry) to compaction (slow but frugal) as the limit approaches. Ah, so that's what it's doing. My measurements say that part of the code is working

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-14 Thread John D. Ramsdell
On Tue, Dec 14, 2010 at 1:48 PM, Peter Simons sim...@cryp.to wrote: I beg your pardon? I didn't say anything about 32M. I said that designing software to rely on a GHC-enforced memory limit as a means of dealing with infinite loops feels really not like a particularly good solution. Sorry

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-13 Thread John D. Ramsdell
On Mon, Dec 13, 2010 at 10:17 AM, Mathieu Boespflug mb...@tweag.net wrote: Hi John, Why don't you use ulimit for this job? By default, the GHC runtime will allocate memory beyond what it takes for takes to cause thrashing on a Linux box. However, if you give the GHC runtime a limit with the

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-13 Thread John D. Ramsdell
On Mon, Dec 13, 2010 at 10:45 AM, Peter Simons sim...@cryp.to wrote: Hi Mathieu, ... There really ought to be a better way to catch an infinite loop that this. It all comes down to picking the correct memory limit. How do you propose to do it? How did you come up with the number 32M? That

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-10 Thread John D. Ramsdell
, Dec 9, 2010 at 11:36 PM, John D. Ramsdell ramsde...@gmail.com wrote: I found out how to compute a good memory limit for the GHC runtime on Linux systems.  One opens /proc/meminfo, and sums the free memory with the reclaimable memory.  The memory allocated to file buffers and the disk cache

[Haskell-cafe] Setting runtime memory limits on GHC programs to avoid thrashing

2010-12-10 Thread John D. Ramsdell
Enclosed is a simple script that sets GHCRTS and provides a reasonable memory limit on systems that have /proc/meminfo. By default, the GHC runtime will grow to a size that can cause thrashing. John memfree.sh Description: Bourne shell script ___

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-09 Thread John D. Ramsdell
I found out how to compute a good memory limit for the GHC runtime on Linux systems. One opens /proc/meminfo, and sums the free memory with the reclaimable memory. The memory allocated to file buffers and the disk cache are reclaimable, and can be added to the memory of a growing GHC process.

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-05 Thread John D. Ramsdell
I forgot to say what performance I got out of the new version of the compiler on my application. I turns out a standard benchmark ran ever so slightly slower after being compiled by 7.0.1 as compared with 6.12.1. Nothing exciting to report here. John

[Haskell-cafe] Cabal sdist bug patch

2010-12-01 Thread John D. Ramsdell
So as far as I can tell, it's easy to fix the cabal sdist bug. The module that generates a distribution simply has to use insntallOrdinaryFile when copying files, not the version of copyFile that is exported by Distribution.Simple.Util. I'll respond to the open ticket with this patch later

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-30 Thread John D. Ramsdell
On Tue, Nov 30, 2010 at 9:24 AM, Ryan Ingram ryani.s...@gmail.com wrote: I suggest that we should be able to specify RTS options at compile/link time, or as pragmas in the Main module. So if I wrote a really good, stable Haskell program, and made it available in binary form, people ten years

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-29 Thread John D. Ramsdell
On Mon, Nov 29, 2010 at 3:36 AM, Simon Peyton-Jones simo...@microsoft.com wrote: | The irony of this situation is deep.  CPSA is a program that analyzes | cryptographic protocols in an effort to expose security flaws.  To | ensure that the program does not crash a user's machine, I have to use

[Haskell-cafe] Why does cabal sdist still make tarballs with incorrect file modes?

2010-11-28 Thread John D. Ramsdell
As I played with GHC 7.0.1, I noticed that Cabal sdist is still hosed. Since ten months ago, cabal sdist fails to preserve the file mode bits of the source files put into the tarball being generated (Ticket #627 reported by draconx). An executable shell script and a source file world readable

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-25 Thread John D. Ramsdell
On Thu, Nov 25, 2010 at 6:07 AM, Nils Anders Danielsson n...@cs.nott.ac.uk wrote: Is CPSA intended to be run by untrusted users (for instance with the setuid bit set)? http://hackage.haskell.org/trac/ghc/ticket/3910

[Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-24 Thread John D. Ramsdell
A quick review of GHC 7.0.1 revealed two challenges for developers. I downloaded the GHC 7.0.1 sources, configured for a home directory install, and built and installed the compiler. Very close to the end, my machine froze, perhaps due to memory exhaustion. In any event, a reboot allowed me to

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-27 Thread John D. Ramsdell
I just see what Emacs Haskell mode suggests, and pick one of its suggestions. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Search for documentation as data fails with Haskell Platform on Windows 7

2010-07-29 Thread John D. Ramsdell
I contributed the CPSA package to Hackage, and tried using it on a PC running Windows 7. The package installs six executables and documentation as PDF and XHTML into the package's data directory. Haskell Platform with Cabal installs the package without a problem. It was actually quite smooth and

Re: [Haskell-cafe] PDF generation?

2010-06-02 Thread John D. Ramsdell
Don't forget about generating MetaPost and using mpost to generate graphics. It's really nice to let MetaPost solve linear equations for you that determine the layout instead of doing it in Haskell. Linux users should install texlive-pictures and texlive-context to make it all work. A makefile

Re: [Haskell-cafe] ANN: CPSA - Cryptographic Protocol Shapes Analyzer

2010-04-28 Thread John D. Ramsdell
We are working towards a version of CPSA with the property that whenever it successfully terminates, every possible execution is described by its output.  However, the current implementation occasionally fails to find some executions. That is concerning - is it due to ... We have formally

[Haskell-cafe] ANN: CPSA - Cryptographic Protocol Shapes Analyzer

2010-03-15 Thread John D. Ramsdell
locate the package's data directory by searching for the file cpsauser.html. New users should study the documentation and the sample inputs in the data directory. The theory and algorithm used by CPSA was developed with the help of Joshua D. Guttman, John D. Ramsdell, Jon C. Herzog, Shaddin F

[Haskell-cafe] Hackage vs. legacy support in Cabal files

2010-03-05 Thread John D. Ramsdell
I'd like to support Hackage and GHC 6.8 with one source distribution. The enclosed Cabal file would do the trick if Hackage would simply evaluate the Cabal file using the default flag values. Instead, it chokes on a hack required to support GHC 6.8. The directory containing the autogen files has

[Haskell-cafe] How to find unused exported symbols?

2010-02-15 Thread John D. Ramsdell
I would like to find symbols exported from each module in a program that are not used outside the module. I'm worried my program is accumulating cruft. I'm looking for suggestions on how to find unused exported symbols. Do I have to analyse .hi files? Thanks in advance. John

Re: [Haskell-cafe] How to find unused exported symbols?

2010-02-15 Thread John D. Ramsdell
on the Wiki. John On Mon, Feb 15, 2010 at 10:42 PM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 16 February 2010 02:22, John D. Ramsdell ramsde...@gmail.com wrote: I would like to find symbols exported from each module in a program that are not used outside the module.  I'm worried my program

Re: [Haskell-cafe] Using Cabal during development

2010-02-10 Thread John D. Ramsdell
On Tue, Feb 9, 2010 at 8:48 AM, Limestraël limestr...@gmail.com wrote: Cabal/cabal-install are good tools for distribution and installation, but I was wondering -- as I was starting to learn how to use Cabal -- how do usually Haskell developpers build their softwares I add the enclosed

[Haskell-cafe] Cabal HackORama -- how to handle par and pseq on stable platforms

2009-11-10 Thread John D. Ramsdell
I am writing a Cabal file for an application that uses par and pseq. I want to support both modern distributions of GHC and the version that comes with Ubuntu Hardy Heron, a Long Term Support version of Ubuntu that will be retired in April 2011. It provides GHC 6.8.2 with Cabal 1.2.3.0 and no

Re: [Haskell-cafe] Haskell for Physicists

2009-10-02 Thread John D. Ramsdell
Haskell for closing the gap between specification and code On Wed, Sep 30, 2009 at 1:42 PM, ed...@ymonad.com wrote: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists.

Re: [Haskell-cafe] Debugging Haskell code

2009-09-28 Thread John D. Ramsdell
On Sun, Sep 27, 2009 at 3:50 PM, Paul Moore p.f.mo...@gmail.com wrote: The problem is that I have *no idea* how to begin debugging this. I've had great success debugging a large program by loading the Main module into ghci after setting GHC extensions, changing the search path, and setting

Re: [Haskell-cafe] Peano axioms

2009-09-17 Thread John D. Ramsdell
I don't understand your goal. Isn't Peano arithmetic summarized in Haskell as: data Peano = Zero | Succ Peano deriving Eq This corresponds to a first-order logic over a signature that has equality, a constant symbol 0, and a one-place successor function symbol S. Function symbols such as and

[Haskell-cafe] ANN: Unification in a Commutative Monoid (cmu 1.1) and a new release of Abelian group unification and matching (agum 2.2)

2009-09-17 Thread John D. Ramsdell
Package cmu 1.1 provides unification in a commutative monoid, also know as ACU-unification. The core computation finds the minimal non-zero solutions to homogeneous linear Diaphantine equations. The linear equation solver has been place in a separate module so it can be used for other

[Haskell-cafe] Re: Unifcation and matching in Abelian groups

2009-08-28 Thread John D. Ramsdell
I cleaned up the code, partitioned it into a library and an executable, and made the package available on hackage as agum-1.0. Enjoy. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-24 Thread John D. Ramsdell
... Haskell is old and has the optional offset rule: do { prob - getLine     ; test prob     ; main} It's interesting to see people put semicolons at the begining of a line of code. In 1970s, people used to draw lines on printouts of Ada and Pascal code to connect the begins with the ends.

[Haskell-cafe] Re: Unifcation and matching in Abelian groups

2009-08-23 Thread John D. Ramsdell
The patch avoids a redundant zeroing of c[i]. $ diff -u {a,b}/Main.lhs --- a/Main.lhs 2009-08-23 21:07:08.0 -0400 +++ b/Main.lhs 2009-08-23 21:09:54.0 -0400 @@ -255,12 +255,11 @@ -- where n is the length of c. --x[n] = sum[j] (c[j] div c[i] * x[j])

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-23 Thread John D. Ramsdell
On Sat, Aug 22, 2009 at 8:30 PM, Lennart Augustssonlenn...@augustsson.net wrote: Even if you are only slightly irritated by offset syntax, why are you using it? {;} works fine. I hadn't thought about that option. I'll give it a try on my next program. John

Re: [Haskell-cafe] Converting typeset mathematics into Haskell ?

2009-08-21 Thread John D. Ramsdell
The purpose of mathematic syntax is to comunicate mathematical ideas between humans. Programmirng languages both communicate mathmatical ideas among humans and specify sequences of operations performed by computing machinery to achieve a goal. The trouble is is the first goal is often

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-21 Thread John D. Ramsdell
is not parallel, I've thought about how to make it so. And isn't thinking parallelism iour future? I think so. John On Thu, Aug 20, 2009 at 10:04 AM, Jules Beanju...@jellybean.co.uk wrote: John D. Ramsdell wrote: On Thu, Aug 20, 2009 at 9:08 AM, Jules Beanju...@jellybean.co.uk wrote: I don't find

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-20 Thread John D. Ramsdell
On Wed, Aug 19, 2009 at 8:32 AM, Jules Beanju...@jellybean.co.uk wrote: Do not blame haskell, blame emacs, if emacs is so stupid. How can you blame emacs? Do you expect emacs to read programmer's minds? John ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Unifcation and matching in Abelian groups

2009-08-20 Thread John D. Ramsdell
On Wed, Aug 19, 2009 at 11:38 PM, Chung-chieh Shanccs...@post.harvard.edu wrote: Thanks!  Another small change that might shorten the code is to use Data.Map for linear combinations: I chose to use association lists because I did not want to explain the adjust function one would use to

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-20 Thread John D. Ramsdell
On Thu, Aug 20, 2009 at 9:08 AM, Jules Beanju...@jellybean.co.uk wrote: I don't find layout a problem, with good editor support. I agree it's a problem, with poor editor support. That's all I meant. Let's put this issue in perspective. For those few Haskell programmers that do find layout

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-20 Thread John D. Ramsdell
On Thu, Aug 20, 2009 at 9:08 AM, Jules Beanju...@jellybean.co.uk wrote: I don't find layout a problem, with good editor support. I agree it's a problem, with poor editor support. That's all I meant. Let's put this issue in perspective. For those few Haskell programmers that do find layout

[Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-19 Thread John D. Ramsdell
and matching in Abelian groups -- John D. Ramsdell -- August 2009 module Main (main, test) where import Data.Char (isSpace, isAlpha, isAlphaNum, isDigit) import Data.List (sort) import System.IO (isEOF) -- Chapter 8, Section 5 of the Handbook of Automated Reasoning by -- Franz Baader and Wayne

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-19 Thread John D. Ramsdell
On Wed, Aug 19, 2009 at 6:16 AM, Neil Mitchellndmitch...@gmail.com wrote: Why not:  if done then return () else    do prob - getLine       test prob       main I've given up on using if-then-else in do expressions. They confuse emacs. There is a proposal for Haskell' to fix the problem,

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-19 Thread John D. Ramsdell
On Wed, Aug 19, 2009 at 6:51 AM, Neil Mitchellndmitch...@gmail.com wrote: F# is new and has the offset rule. Haskell is old and has the optional offset rule: I thought F# uses OCaml syntax. Emacs does well with OCaml syntax. Guy Steele told this story at a conference. As part of the

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
Usually I include the example program in the package, but make its compilation conditional using a Cabal flag like buildExamples. But then the binaries generated from the example program get installed. I think the poster wants to share the source code, not install a demo. I haven't figure

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
On Sun, Aug 9, 2009 at 8:15 PM, Thomas DuBuissonthomas.dubuis...@gmail.com wrote: ... Another option: test code (or any other source) can easily be included in the source dist by adding them to the extra-source-files: line in the .cabal file. But then cabal doesn't know how to build binaries

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
Maybe in addition to having a buildable boolean in a library or executable section, there should be an installable boolean. It would default to true, but when false, the library or executable section is ignored during package installation. John ___

[Haskell-cafe] Parallel term reduction---solution

2009-03-27 Thread John D. Ramsdell
On February 1, I sent a message to this list asking for advice on how to write a parallel term reduction system. I now have a semi-explicit parallelised version of a term reduction system that makes effective use of multiple CPUs. The enclosed code describes the solution, even though its

Re: [Haskell-cafe] Parallel term reduction

2009-02-02 Thread John D. Ramsdell
On Sun, Feb 1, 2009 at 9:26 PM, John D. Ramsdell ramsde...@gmail.com wrote: I have a reduction system in which a rule takes a term and returns a set of terms. The reduction system creates a tree that originates at a starting value called the root. For most problems, the reduction system

Re: [Haskell-cafe] Parallel term reduction

2009-02-02 Thread John D. Ramsdell
Luke, I read your solution but didn't understand how it applies to my problem. I must not have explained the problem well enough. Let me try again. I have a reduction system in which a rule takes a term and returns a set of terms. The terms can be compared for equality, but they are not

[Haskell-cafe] Parallel term reduction

2009-02-01 Thread John D. Ramsdell
I have a reduction system in which a rule takes a term and returns a set of terms. The reduction system creates a tree that originates at a starting value called the root. For most problems, the reduction system terminates, but a step count limit protects from non-termination. Rule application is

Re: Re[2]: [Haskell-cafe] GHC on Fedora 10 - getMBlock: mmap: Permission denied

2008-12-03 Thread John D. Ramsdell
I had fun with SELinux when using Haskell for CGI programs. The default SELinux policy forbids CGI programs that execute code in their data segment. I had to write a policy module that allowed httpd_sys_script_t self:process execmem. Oh joy. John ___

Re: [Haskell-cafe] permutations and performance

2008-08-17 Thread John D. Ramsdell
On Sun, Aug 17, 2008 at 11:27 AM, Yitzchak Gale [EMAIL PROTECTED] wrote: There, Twan van Laarhoven designs the implementation of the permutations function that is slated to be included in GHC 6.10. I look forward to Twan's design. I found the Haskell 1.3 definition. -- permutations xs

Re: [Haskell-cafe] permutations and performance

2008-08-17 Thread John D. Ramsdell
On Sat, Aug 16, 2008 at 5:28 PM, Henning Thielemann [EMAIL PROTECTED] wrote: There is _one_ permutation with no elements, namely [], thus it must be | n == 0 = [[]] I see. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] permutations and performance

2008-08-16 Thread John D. Ramsdell
I tried to replace a permutation generator with one that generates each permutation from the previous one, in a stream-like fashion. I had hoped the stream-based algorithm would be more efficient because I use only one permutation at a time, so only the permutation and the previous one need be in

Re: [Haskell-cafe] Associative Commutative Unification

2008-07-11 Thread John D. Ramsdell
Are you aware of Term Rewriting and all That? It describes how to do associative commutative unification; whether it satisfies your 'obviously correct' criterion I don't know. Oh yes, I know about term rewriting. If your equations can be expressed as a set of confluent rewrite rules, one can

Re: [Haskell-cafe] Associative Commutative Unification

2008-07-11 Thread John D. Ramsdell
I think Edsko was more specifically referring to the book Term Rewriting and all That by Baader and Nipkow. Thanks for pointing this out--I was confused. I notice the book has a chapter on equational unification that includes a section on AC unification. This book looks like a winner. Thank

Re: [Haskell-cafe] Associative Commutative Unification

2008-07-11 Thread John D. Ramsdell
CIMe[1] might be useful to solve the generated diophantine equations. It also has AC unification, and it probably wouldn't be all that hard to translate our code into OCaml. I think CiME isn't supported anymore. Still it's worth considering. It's quite large. The source distribution compiled

Re: [Haskell-cafe] Associative Commutative Unification

2008-07-08 Thread John D. Ramsdell
The Haskell typechecker contains a nice example of a unifier for freely generated terms. My focus is on equational unification, but thanks anyway. John On Sun, Jul 6, 2008 at 10:38 PM, Don Stewart [EMAIL PROTECTED] wrote: ramsdell0: I'd like to write an obviously correct implementation of a

[Haskell-cafe] Associative Commutative Unification

2008-07-06 Thread John D. Ramsdell
I'd like to write an obviously correct implementation of a unifier, a program that when given two terms, finds a substitution that makes the two terms equal. The phrase obviously correct is meant to imply that the clarity of the code trumps efficiency. As near as I can tell, high performance

[Haskell-cafe] Santana on my evil ways

2008-07-04 Thread John D. Ramsdell
My son's nickname is Rama, so let me adopt it. I am a functional programmer, even when I use languages such as C. Scheme facilitated my development into a functional programmer, however, I appreciate the benefits of pure function programming at times. Yet when I use Haskell, I hear reminders of

Re: [Haskell-cafe] Re: Knot tying vs monads

2007-11-20 Thread John D. Ramsdell
Chris, You answer was quite a bit more than I expected for a simple style question. Thanks. On Nov 19, 2007 12:27 PM, ChrisK [EMAIL PROTECTED] wrote: The data dependency is circular. Yes, thus the need for the knot. I gather your answer to my style question is you prefer knot tying over

Re: [Haskell-cafe] Re: Knot tying vs monads

2007-11-20 Thread John D. Ramsdell
On Nov 19, 2007 11:42 AM, apfelmus [EMAIL PROTECTED] wrote: Thanks. The interesting case of nested blocks still needs to be specified, but with this description in mind and judging from the code, I guess it behaves as follows: either a block fits entirely on the remaining line (no line breaks

Re: [Haskell-cafe] Re: Knot tying vs monads

2007-11-19 Thread John D. Ramsdell
On Nov 17, 2007 3:04 PM, apfelmus [EMAIL PROTECTED] wrote: Unfortunately, I don't have Paulson's book (or any other ML book :) at home. I'm too lazy to figure out the specification from the source code, I guess the code is too opaque, as my colleague claimed. The layout the algorithm

Re: [Haskell-cafe] Re: Knot tying vs monads

2007-11-17 Thread John D. Ramsdell
Thank you for your interesting reply. I found it enlightening. Compared to that, I'm missing the specification part for your pretty printer. How's it supposed to lay out? The specification is in Paulson's book. The pretty printer is used with S-Expressions, and the block layout generates

[Haskell-cafe] Knot tying vs monads

2007-11-16 Thread John D. Ramsdell
This is another Haskell style question. I had some trouble with the pretty printer that comes with GHC, so I translated one written in Standard ML. I have already translated the program into C, so rewriting it in Haskell was quick and easy for me. The Standard ML version uses a reference cell