Re: [Haskell-cafe] X11 package bug: XClientMessageEvent long data

2011-03-16 Thread Spencer Janssen
On Wed, Mar 16, 2011 at 12:10:59AM -0400, Dylan Alex Simon wrote: Does anyone know the current maintenance status of the X11 package? I emailed Spencer Janssen a number of months ago and never heard back. So, I'll put this here in case any one else runs into it or can get it to the right

Re: [Haskell-cafe] X Haskell Bindings

2008-08-17 Thread Spencer Janssen
all of these be lumped together into one giant sum-type for errors and one for events? Take care, Antoine Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] IMAP and NNTP libraries

2008-06-23 Thread Spencer Janssen
, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] test driving cabal install... cabal install and normal install (runghc Setup) don't mix... two package.conf files...

2008-05-29 Thread Spencer Janssen
gobs of resources to compile -- my box actually ran out of memory attempting to build it. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Rotating backdrop (aka learning Haskell)

2008-05-20 Thread Spencer Janssen
Once this is done and I have commented to the code, I will be happy to put it onto the wiki as a teaching aid. Thanks. -- [EMAIL PROTECTED] -= H+ =- www.kierun.org PGP: 009D 7287 C4A7 FD4F 1680 06E4 F751 7006 9DE2 6318 Cheers, Spencer Janssen

Re: [Haskell-cafe] Two-iteration optimisation (was: GHC Predictability)

2008-05-19 Thread Spencer Janssen
. As far as I know, there is no access to strictness information in rule pragmas. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] GHC predictability

2008-05-13 Thread Spencer Janssen
, the algorithm is identical to what I'd write in C. Also, mean [1 .. 1e9] will actually work in Haskell, while in C you'll just run out of memory. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] problem building array package

2008-01-18 Thread Spencer Janssen
' Any ideas why? Thanks, Jim The array package isn't needed for GHC 6.6, as Data.Array.* is included in the base package. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Poisx select support

2008-01-16 Thread Spencer Janssen
Regards, Vasili For C's void *, I'd use Ptr (). Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Concurrency questions

2008-01-07 Thread Spencer Janssen
Control.Parallel.par. Mmm, OK. I'll try that. (I wasn't actually aware that STM is working yet...) STM has been available for quite awhile, as early as GHC 6.4 if memory serves. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] New to Haskell

2007-12-18 Thread Spencer Janssen
, it is The Final Word on all these semantic and syntactic questions. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-05 Thread Spencer Janssen
can't figure out why. No fancy specialization is needed. Since testBit is part of the Bits class, simply 'testBit = fastTestBit' in the instance for Integer. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Re: Waiting for thread to finish

2007-11-27 Thread Spencer Janssen
On Tuesday 27 November 2007 18:46:00 Brad Clow wrote: I was just watching top while executing this and noticed that it really only used one core (I am using GHC 6.8.1 on a MacBook). Does anyone know why? Did you compile with -threaded, and run with +RTS -N2? Cheers, Spencer Janssen

Re: [Haskell-cafe] Hosting of Haskell project

2007-10-10 Thread Spencer Janssen
is automatically generated for released packages on hackage.haskell.org. Have I missed anything? /M Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: bizarre memory usage with data.binary

2007-10-03 Thread Spencer Janssen
/ \/ \ EFE F That is correct, binary doesn't attempt to share substructures. If you'd like to do this, you'll need to do it by hand. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] How can I pass IOUArrays to FFI functions?

2007-08-20 Thread Spencer Janssen
Data.Array.Storable? It supports the MArray interface, and has the additional operation: withStorableArray :: StorableArray i e - (Ptr e - IO a) - IO a Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Bathroom reading

2007-08-14 Thread Spencer Janssen
the definition of filterM: filterM :: (Monad m) = (a - m Bool) - [a] - m [a] filterM _ [] = return [] filterM p (x:xs) = do flg - p x ys - filterM p xs return (if flg then x:ys else ys) Cheers, Spencer Janssen ___ Haskell

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Spencer Janssen
to tell) The program doesn't have much chance for parallelism as written. It uses the imperative ST monad and destructive update extensively. Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Spencer Janssen
on NDP/parrallel arrays. There's much discussion on schemes to efficiently pack data types into unboxed arrays. Cheers, Spencer Janssen (I somewhat suspect you'd have to bake this into the compiler itself it you wanted *arbitrary* types. Otherwise you'd have to write some special class

Re: [Haskell-cafe] Order of evaluation

2007-07-26 Thread Spencer Janssen
, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Spencer Janssen
not have any documentation on the page, but each identifier is a link to GHC specific modules that give more documentation. This is a bug in Haddock: it doesn't know how to include documentation from another package. Cheers, Spencer Janssen Documentation: http://www.haskell.org/ghc/docs/latest

Re: [Haskell-cafe] Haskell version of ray tracer code is much slower than the original ML

2007-06-25 Thread Spencer Janssen
98% cpu 25.831 total 63a359e5c388f2004726d83d4337f56b - % (time ./mlray) | md5sum ./mlray 25.63s user 0.04s system 98% cpu 25.981 total 63a359e5c388f2004726d83d4337f56b - Cheers, Spencer Janssen ray_pragma.dpatch Description: Binary data ___ Haskell

Re: [Haskell-cafe] Collections

2007-06-19 Thread Spencer Janssen
-- Haskell lets us use lists not only as a data structure, but as control structures as well. Also, lists or Data.Map are often close enough. Who needs a bag when Map a Int gets the job done? What good is a heap when Data.Map supports findMin? Cheers, Spencer Janssen Does writing software in Haskell

[Haskell-cafe] ANNOUNCE: xmonad 0.2

2007-05-30 Thread Spencer Janssen
and community resources are available from: http://xmonad.org Xmonad is available from hackage, and via darcs. Happy hacking! The Xmonad Team: Spencer Janssen Don Stewart Jason Creighton Xmonad has also received patches from: Alec Berryman Chris Mears Daniel Wagner

Re: [Haskell-cafe] Should do 1 compile

2007-05-23 Thread Spencer Janssen
Although then you are relying on the Monad laws more than you possibly should. You could also have: monady :: Monad m = m a - m a monady x = x do x == monady x How about: do x == (x :: Monad m = m a) Or even: do x == (asTypeOf x (return ())) Cheers, Spencer Janssen

Re: [Haskell-cafe] Poor first impression

2007-04-27 Thread Spencer Janssen
with broken compiler installers. Byebye FC Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ANNOUNCE: xmonad 0.1

2007-04-22 Thread Spencer Janssen
from hackage, and via darcs. Happy hacking! The Xmonad Team: Spencer Janssen Don Stewart Jason Creigh ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Parallel executing of actions

2007-04-15 Thread Spencer Janssen
the semantics of the program. Of course the semantics of the program will change, the order in which the actions are executed is unknown! Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] SmallCheck and parser testing

2007-04-03 Thread Spencer Janssen
for each. You can then check that the parses match the expected results. \begin{code} knownParses :: [(String, Style)] knownParses = ??? prop_unitTest = all (uncurry parseEq) knownParses \end{code} Cheers, Spencer Janssen I thought of the following property (thanks sjanssen) prop_parse p

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-13 Thread Spencer Janssen
It looks like you forgot to pass a compiler flag, namely -fglasgow-exts. Cheers, Spencer Janssen On Tue, 13 Mar 2007 22:20:20 -0700 (PDT) SevenThunders [EMAIL PROTECTED] wrote: I have the pleasure of porting a good sized Haskell application to linux. So far the Haskell code has compiled

Re: [Haskell-cafe] ANNOUNCE: The Monad.Reader - Issue 6

2007-02-01 Thread Spencer Janssen
Yet another higher order solution: dropWhile' p0 xs = foldr f (const []) xs $ p0 where f y ys p | p y = ys p | otherwise = y : ys (const False) Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] newbie timing question

2007-01-26 Thread Spencer Janssen
that takes 8 seconds to complete, returns (True,4600) Remember that Haskell is lazy -- res won't be evaluated until it is forced. See the evaluate function in Control.Exception to force a value in the IO monad. Spencer Janssen ___ Haskell-Cafe

Re: [Haskell-cafe] Strings in Haskell

2007-01-22 Thread Spencer Janssen
, and is also available as a standalone package. Data.ByteString represents strings as packed arrays of bytes, so the overhead is about 1 byte per character. This library exhibits fantastic performance, rivaling C's speed while maintaining the elegance of Haskell. Cheers, Spencer Janssen

Re: [Haskell-cafe] an advanced foldification problem

2007-01-11 Thread Spencer Janssen
Take this obscure function: \begin{code} func :: (a - a - Maybe a) - a - [a] - [a] func f s0 xs0 = foldr (\x xs s - maybe (xs s) ((x:) . xs) (f s x)) return xs0 s0 \end{code} And mergeGroupToList becomes: \begin{code} mergeGroupToList g xs = func mergeGroups g xs \end{code} Cheers, Spencer

Re: [Haskell-cafe] MissingH: profiler support?

2007-01-11 Thread Spencer Janssen
The typical way to add profiling support to a Cabal lib is to add -p at configure time (ie runhaskell Setup.hs configure -p). Have you tried this? Cheers, Spencer Janssen On Jan 8, 2007, at 4:13 PM, Chris Eidhof wrote: Hey all, I'm trying to profile my application, which makes use

[Haskell-cafe] The Data.Array.* hierarchy is unsafe (or, Segfaulting for fun and profit)

2006-12-01 Thread Spencer Janssen
need to know how to find the length of Hugs array primitives too. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Command line utility that shrinks/simplifies functions applications ?

2006-11-30 Thread Spencer Janssen
I believe you're talking about the `pl' plugin for lambdabot. Lambdabot has an offline mode, visit the homepage for the source: http://www.cse.unsw.edu.au/~dons/lambdabot.html There is also a web interface to lambdabot, but I can't seem to find the link. Cheers, Spencer Janssen

Re: [Haskell-cafe] Priority Queue?

2006-11-26 Thread Spencer Janssen
I recommend the Edison library, which has several heap implementations. http://www.eecs.tufts.edu/~rdocki01/edison.html Cheers, Spencer Janssen On Nov 26, 2006, at 3:58 PM, Ken Takusagawa wrote: Is there a Haskell implementation of an efficient priority queue (probably heap-based) out

Re: [Haskell-cafe] Unicode strings

2006-11-05 Thread Spencer Janssen
around in the wild, hopefully someone will chime in with a code snippet soon. Also, I seem to remember that Bulat's Streams library supports some Unicode encodings, perhaps you can check there? Cheers, Spencer Janssen On Nov 5, 2006, at 12:17 PM, Pupeno wrote: Hello, I am trying to make

Re: [Haskell-cafe]Prime Generator time limit exceeded

2006-11-01 Thread Spencer Janssen
/= 0] Spencer Janssen On Nov 1, 2006, at 10:49 AM, alaiyeshi wrote: Hi I'm new to Haskell. I found this site on the Haskell wiki https://www.spoj.pl. But I got some trouble on trying to solve the problem titled Prime Generator https://www.spoj.pl/problems/PRIME1. The online-judge system

Re: [Haskell-cafe] Type level functions (type of decreasing list)

2006-10-17 Thread Spencer Janssen
Here's an attempt with GADTs: \begin{code} {-# OPTIONS_GHC -fglasgow-exts #-} data Succ a data Zero data Seq a b where Cons :: a - Seq a b - Seq a (Succ b) Nil :: Seq a Zero \end{code} Seems to work for me. Spencer Janssen On Oct 17, 2006, at 6:37 PM, Greg Buchholz wrote: I'm

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Spencer Janssen
correctly with this data declaration? Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Filtering a big list into the IO monad

2006-08-03 Thread Spencer Janssen
ys) Cheers, Spencer Janssen On 8/3/06, Gabriel Sztorc [EMAIL PROTECTED] wrote: | Hello, | | I want to filter a list with a predicate that returns a IO value, | something that filterM is supposed to do. The problem is, filterM | overflows the stack for really big lists and I couldn't come up

Re: [Haskell-cafe] heap issues

2006-07-27 Thread Spencer Janssen
ghci keeps the value of your last computation in a special variable called it. Therefore, the value of your last run can't be garbage collected until the current run is finished. Try print run or type in a dummy expression in between runs. Cheers, Spencer Janssen On 7/27/06, Jeff Polakow

Re: Re[2]: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-24 Thread Spencer Janssen
I've been writing a Stringable class for my SoC project. You can check out the code at http://darcs.haskell.org/SoC/fps-soc/Data/Stringable.hs. Spencer Janssen On 7/23/06, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Brian, Sunday, July 23, 2006, 1:20:36 AM, you wrote: instance IString

Re: [Haskell-cafe] Why Haskell?

2006-07-22 Thread Spencer Janssen
(note the underscore) function, it should be a big win here. Cheers, Spencer Janssen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] lists as instances of a class?

2006-07-10 Thread Spencer Janssen
. I've run into this restriction several times myself, and I'm also curious whether this will change in Haskell'. Spencer Janssen On 7/10/06, David Roundy [EMAIL PROTECTED] wrote: (This email is a literate haskell program that fails to compile without -fglasgow-exts.) I'm sure I'm missing

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-15 Thread Spencer Janssen
) highestBitMask :: Word32 - Word32 highestBitMask x = case (x .|. shiftR x 1) of x - case (x .|. shiftR x 2) of x - case (x .|. shiftR x 4) of x - case (x .|. shiftR x 8) of x - case (x .|. shiftR x 16) of x - (x `xor` (shiftR x 1)) Cheers, Spencer Janssen On 6/15/06

[Haskell-cafe] Re: Am I lazy enough?

2006-05-03 Thread Spencer Janssen
approximately the same as yours. Note the getLinesLazily function. I've only tested that it typechecks, I haven't run it yet. Spencer Janssen -- Program begins here import System.IO import System.IO.Unsafe (unsafeInterleaveIO) import qualified Data.ByteString.Char8 as B import

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

2006-03-27 Thread Spencer Janssen
evaluation. Improvements and discussion are solicited. Feel free to include this code in your website, if you'd like. Spencer Janssen On 3/22/06, Per Gustafsson [EMAIL PROTECTED] wrote: Haskell gurus, We have made a proposal to extend the Erlang `binary' data type from being a sequence of bytes

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

2006-03-27 Thread Spencer Janssen
is still at http://cse.unl.edu/~sjanssen/huffman.hs. The old main is left for reference, renamed to main'. Run time (in seconds) for 10 iterations: O'Caml: 35.9 Old Haskell: 25.6 New Haskell: 8.8 Spencer Janssen ___ Haskell-Cafe mailing list