[Haskell-cafe] cabal install vs. profiling

2009-04-15 Thread David F. Place
Hi, Suppose I have installed a number of libraries and have written a program using them. Now, I want to profile my program. What is the best way to get the profiling versions of the libraries installed? Thanks, David ___ Haskell-Cafe mailing list

[Haskell-cafe] re: Why monoids will abide...

2009-01-24 Thread David F. Place
On Jan 20, 7:27 pm, Don Stewart d...@galois.com wrote: http://apfelmus.nfshost.com/monoid-fingertree.html Thanks Apfelmus for this inspiring contribution! For additional reading material on a use of Monoids may I suggest my article in the Monad.Reader issue 11 How to Refold a Map.

[Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
If you have a giant unboxed array that will never become garbage, it would be nice to put it somewhere where the GC won't bother with it. Since Data.Array.Storable arrays are allocated in the C heap, I thought it would be a good choice. However, I am getting very poor performance due to the GC

Re: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
On Tue, 2008-11-25 at 16:51 +0300, Bulat Ziganshin wrote: Hello David, Hello Bulat, Tuesday, November 25, 2008, 4:45:28 PM, you wrote: However, I am getting very poor performance due to the GC copying 6G in each run. The only explanation that I can think of is that it is copying my

Re: Re[2]: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
On Tue, 2008-11-25 at 17:32 +0300, Bulat Ziganshin wrote: Hello David, Tuesday, November 25, 2008, 5:27:51 PM, you wrote: When I was researching how to do this, I was really hoping for something like static areas from the Lisp Machine operating system. You could allocate any normal

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread David F. Place
On Sat, 2008-11-22 at 11:33 +, Thomas Schilling wrote: Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e :: MyErrorType) - case e of MyError1 _ - ..; MyError2 _ -

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread David F. Place
On Sat, 2008-11-22 at 15:27 +, Thomas Schilling wrote: *Main tryJust errorCalls $ print $ [] !! 23 tryJust errorCalls $ print $ [] !! 23^JLeft Prelude.(!!): index too large *Main tryJust errorCalls $ print $ throw NonTermination tryJust

[Haskell-cafe] Extensible Exceptions

2008-11-21 Thread David F. Place
Hi, All. I am trying to understand the new exceptions package in base-4 Control.Exceptions. The documentation for catchJust is the same as in Control.OldException including this example: result - catchJust errorCalls thing_to_try handler Control.OldException provides the predicate errorCalls,

[Haskell-cafe] Haskell as a scripting language.

2008-09-10 Thread David F. Place
Hi, All. I needed to make a batch of edits to some input files after a big change in my program. Normally, one would choose some scripting language, but I can't bear to program in them. The nasty thing about using Haskell is that giving regexes as string constants sometime requires two levels

Re: [Haskell-cafe] Haskell as a scripting language.

2008-09-10 Thread David F. Place
On Wed, 2008-09-10 at 16:57 -0500, John Goerzen wrote: Whoa, that is sneaky and clever. But it will fail the minute you try to run this on a compiled program, because then getProgName will give you the binary executable. So, I won't do that. In addition to getProgName getting the binary,

[Haskell-cafe] What's the best way to give up?

2008-09-06 Thread David F. Place
Hi, all. Say I have a function solve which is a constraint solver. It reconfigures its input to be a solution. If there is no solution, it returns the input. solve :: a - Either a a solve input output = maybe (Left input) Right $ solve' input If there is a solution, it finds it in a few

Re: [Haskell-cafe] What's the best way to give up?

2008-09-06 Thread David F. Place
On Sat, 2008-09-06 at 11:10 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Sep 6, at 7:30, David F. Place wrote: Say I have a function solve which is a constraint solver. It reconfigures its input to be a solution. If there is no solution, it returns the input. solve :: a - Either

[Haskell-cafe] Trouble compiling collections-0.3 (from Hackage)

2008-04-26 Thread David F. Place
Hi, I am not able to build collections-0.3 because on an error. I hope someone can give me a hint. Below, please find a short transcript with various version information. Cheers, David [EMAIL PROTECTED] ~]$ cd Desktop/collections-0.3 [EMAIL PROTECTED] collections-0.3]$ runghc Setup.hs

[Haskell-cafe] Local Search Module

2007-10-22 Thread David F. Place
---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Local Search Module - Renaissance polyphony

2007-10-22 Thread David F. Place
On Oct 22, 2007, at 10:56 AM, Henning Thielemann wrote: On Mon, 22 Oct 2007, David F. Place wrote: BTW, the problem I am working on is an automated approach to lifting pieces of Renaissance polyphony from 3-limit to 5-limit Just Intonation. I don't understand this sentence

Re: [Haskell-cafe] Local Search Module

2007-10-22 Thread David F. Place
is already done. (I'm not surprised.) ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Local Search Module

2007-10-22 Thread David F. Place
to hackage Of course, that is all the non-fun parts :) j. ps. I have most of the code extracted into a .hs file already, if that helps. Thanks. I'll certainly take a look at it. Maybe I can find a way to make the non-fun parts more fun. ___ (---o---o-o-o---o-o-o( David F

Re: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread David F. Place
://hackage.haskell.org/cgi-bin/hackage-scripts/package/ EdisonCore-1.2.1 in the Data.Edison.Coll.EnumSet module. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Pure functional GUI (was a regressive view of support for imperativeprogramming in Haskell)

2007-08-08 Thread David F. Place
and non-standard, but the users of the application have taken it to a cult status even though it's purposefully kind of ugly. http://puredata.info/ ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED

[Haskell-cafe] Text.XHtml Documentation

2007-07-29 Thread David F. Place
-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-17 Thread David F. Place
://www.haskell.org/mailman/listinfo/haskell-cafe ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-17 Thread David F . Place
. (map tails) . inits ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-17 Thread David F. Place
). ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
want: *Main :t let untilM p f x = if p x then return x else untilM p f = f x in untilM let untilM p f x = if p x then return x else untilM p f = f x in untilM :: (Monad m) = (a - Bool) - (a - m a) - a - m a ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
So, the next question is: Why isn't this already in Control.Monad? On Mar 21, 2007, at 8:27 AM, Jules Bean wrote: David F. Place wrote: Interesting, but what if 'p' is also a monadic action? For instance, it might access the state of the State monad which 'f' is updating. Then I'd stop

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
a else return () I always wonder, when I have to do such things, if I just haven't studied the libraries well enough. ___ (---o---o-o-o---o-o-o( David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Is Haskell a Keynesian language?

2006-10-12 Thread David F. Place
David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Trouble compiling wxhaskell

2006-07-31 Thread David F. Place
Hi: I'm having trouble compiling wxhaskell 0.9.4 under both ghc 6.4.2 and ghc 6.5. Does anyone know where I should direct my queries? Thanks. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Why Haskell?

2006-07-23 Thread David F. Place
could write imperative code in Haskell to update the array in place non-persistently. So, the decision not to use Haskell for that part may be a case of premature optimization. Cheers, David David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell-cafe] The Marriage of Heaven and Hell: Type Classes and Bit-Twiddling

2006-04-13 Thread David F. Place
David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Counting bits: Sanity Check

2006-04-12 Thread David F. Place
omputer. It is much slower on my 32 bit PPC powerbook for obvious reasons. If you'd like to try it, I'll include an updated BitTwiddle.hs . Usage: time ./bits 200 300 64 BitTwiddle.hs Description: Binary data David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell-cafe] Counting bits: Sanity Check

2006-04-12 Thread David F. Place
The Marriage of Heaven and Hell.) I didn't make any changes to ones32 according to diff. Cheers, David David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

[Haskell-cafe] The Marriage of Heaven and Hell: Type Classes and Bit-Twiddling

2006-04-11 Thread David F. Place
| Quux deriving (Enum, Bounded) sizeTest1 :: (Set Test1) - Int sizeTest1 = sizeB Foo Cheers, David David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: Re[4]: [Haskell-cafe] Understanding allocation behavior

2006-04-09 Thread David F. Place
wonder what you think of this. Also, I wonder what would be a good test to demonstrate this possible interaction with the cache. Cheers, David ps. Thanks for the tip about UArray. David F. Place mailto:[EMAIL PROTECTED

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread David F. Place
as set Or: bitcount :: Word - Int bitcount 0 = 0 bitcount x = 1 + bitcount (x .. (x-1)) -- | /O(1)/. The number of elements in the set. size :: Set a - Int size (Set w) = bitcount w David F. Place mailto:[EMAIL PROTECTED

Re: Re[2]: [Haskell-cafe] Understanding allocation behavior

2006-04-08 Thread David F. Place
| i `seq` bs `seq` z `seq` False = undefined Indeed, I had tried this. It is slower for reasons that are mysterious to me. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Understanding allocation behavior

2006-04-07 Thread David F. Place
obvious edits; repeat until 0 errors I had it running in a few minutes. I can't imagine doing that in any other programming environment! Cheers, David David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing

Re: [Haskell-cafe] EnumSet with a BSD license

2006-04-06 Thread David F. Place
Please feel free to port it. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-06 Thread David F. Place
it a whirl, I'd love to know the result. incrsud.hs Description: Binary data David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] EnumSet with a BSD license

2006-04-05 Thread David F. Place
Hi All, Since there is some interest in my EnumSet module, I am reposting it here with a BSD license in anticipation of its rebirth as Data.Set.Enum. Cheers, David EnumSet.hs Description: Binary data David F. Place mailto:[EMAIL PROTECTED

[Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
example program (a sudoku solver) runs several times faster. I'll be grateful for any feedback on this. Perhaps something like it would be useful included in the standard libraries. Cheers, David EnumSet.hs Description: Binary data David F. Place mailto

Re: [Haskell-cafe] Re: Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
compare (LCA a) (LCA b) | a == b = EQ | a b = LT | a b = GT Perverted, but possible. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
flawlessly. I do quality work. I'm thinking of removing the UniverseSet class though. It seems to me that Bounded serves the purpose just right. Does that mean we lose the unary `complement` function? I am rather fond of that. David F. Place mailto:[EMAIL

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-03-23 Thread David F. Place
Thanks for your helpful suggestions. I took them to heart and incorporated many of them in a new version. sudoku.hs Description: Binary data David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing

[Haskell-cafe] Code Review: Sudoku solver

2006-03-22 Thread David F. Place
and say if any unidiomatic usages pop out. It solves sudoku puzzles. (What pleasure do people get by doing these in their heads?!?) Cheers, David sudoku.hs Description: Binary data David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell-cafe] Bit streams programs in Haskell

2006-03-22 Thread David F. Place
request your help in noticing obvious NO-NOs and stupid mistakes that we might have made. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

[Haskell-cafe] Re: PrefixMap is a Trie

2006-02-28 Thread David F. Place
idn't find that implementation.  Perhaps, as you suggest in your code, it's time for Data.Trie. -------- David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listin

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread David F. Place
. :-) Your suggestion cleans up the code quite nicely. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] PrefixMap: code review request

2006-02-27 Thread David F. Place
use whatever emacs suggests. Is that not a good strategy? David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] In for a penny, in for a pound.

2006-01-08 Thread David F. Place
:x9:x1:xs rotate 10 (x1:x2:x3:x4:x5:x:6:x7:x8:x9:x10:xs) = x2:x3:x4:x5:x: 6:x7:x8:x9:x10:x1:xs rotate n (x:xs) = rot' n xs where rot' 1 xs = x:xs rot' n (x:xs) = x:rot' (n-1) xs Cheers, David David F. Place mailto:[EMAIL PROTECTED

[Haskell-cafe] Expanding do notation

2006-01-07 Thread David F. Place
( 0.00s elapsed) Total time4.54s ( 5.88s elapsed) %GC time 49.3% (53.6% elapsed) Alloc rate106,180,977 bytes per MUT second Productivity 50.7% of total user, 39.1% of total elapsed David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell-cafe] Expanding do notation

2006-01-07 Thread David F. Place
. Cheers, David David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Expanding do notation

2006-01-07 Thread David F. Place
with Haskell is that the let p = creates source code *shorthand*. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Expanding do notation

2006-01-07 Thread David F. Place
involve variables at all. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Re[2]: [Haskell-cafe] Expanding do notation

2006-01-07 Thread David F . Place
of it in the DFP reference document. Thanks. i attached here two letters from july's dicussion on topic Confused about Cyclic struture. hope this will help David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list

[Haskell-cafe] Fannkuch Entry

2006-01-06 Thread David F. Place
elapsed -- David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fannkuch Entry

2006-01-06 Thread David F . Place
of optimizations that hurt clarity, but in this case don't seem to help performance. Cheers, David David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

[Haskell-cafe] How to read this syntax?

2005-12-29 Thread David F. Place
= arr (f1 . fst) arr (f2 . snd) = (arr fst arr f1) (arr snd arr f2) I can't find any reference to the syntax where the function left hand side is just space. I'd greatly appreciate any insight. David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread David F. Place
that I can depend on compilers to tail- merge. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place
the extremely contrived example of a metacircular interpreter, what are some examples of the benefits of this feature of lisp? What are some examples of language features that are easy to add? David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place
(and without having to write your own monadic versions of existing functions). David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place
can do anything. Lisp has no advantage there. On Sep 20, 2005, at 5:45 PM, Bill Wood wrote: All of these made non-trivial extensions to Lisp, and all were of arguably great utility. David F. Place mailto:[EMAIL PROTECTED

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread David F. Place
. David F. Place mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe