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
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
- 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
(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
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
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
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)
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.
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
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.
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
Well deserved.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
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
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
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
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%
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
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
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
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
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
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
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
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
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
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
, 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
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
___
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
... 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.
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])
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
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
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
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
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
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
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
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
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,
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
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
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
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
___
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
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
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
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
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
___
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
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
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
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
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
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
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
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
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
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
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
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
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
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
86 matches
Mail list logo