[Haskell-cafe] build problem (X11 under cabal)

2007-09-29 Thread Jens Blanck
Not being very savvy in building things I got stuck when trying to build xmonad. It needs X11 1.2.2, so I tried to build that. Configuration step went fine (I believe), but buiding failed: runhaskell Setup.hs build Preprocessing library X11-1.2.2...

[Haskell-cafe] cabal problem?

2007-11-14 Thread Jens Blanck
I have problems building X11. I just installed ghc 6.8 but I got the same behaviour when asking it to use the old compiler. Jens runghc Setup.hs configure Configuring X11-1.3.0.2007... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C

[Haskell-cafe] Integers v ints

2010-04-01 Thread Jens Blanck
I was wondering if someone could give me some references to when and why the choice was made to default integral numerical literals to Integer rather than to Int in Haskell. Also, if you are aware of similar discussions in other languages. I'd like to use this information to make an analogous

Re: [Haskell-cafe] Integers v ints

2010-04-01 Thread Jens Blanck
On 1 April 2010 10:53, Ivan Lazar Miljenovic ivan.miljeno...@gmail.comwrote: Jens Blanck jens.bla...@gmail.com writes: I was wondering if someone could give me some references to when and why the choice was made to default integral numerical literals to Integer rather than to Int

Re: [Haskell-cafe] Integers v ints

2010-04-05 Thread Jens Blanck
Thanks for your replies. In particular to Jon for the reference to the Haskell 98 standard and the comment about language design. If anyone has further references to Haskell 98 or Erlang, I'm still interested. Regarding cost, I do see the difference in factors (Integer - Int, and computable

[Haskell-cafe] Re: Genuine Eratosthenes sieve [Was: Optimization fun]

2007-02-20 Thread Jens Blanck
The point about Eratosthenes's sieve is that it does not specify algorithmically how to find the next number to be crossed. It does not even define how to store (crossed) numbers, it stores them on paper. But , I believe that Eratosthenes's sieve does specify how to store numbers and how to

Re: [Haskell-cafe] fast integer base-2 log function?

2008-02-26 Thread Jens Blanck
{-# LANGUAGE MagicHash #-} import GHC.Exts import Data.Bits -- experiment with using a LUT here (hint: FFI + static arrays in C) ilog2i0, ilog2i1, ilog2i2, ilog2i3, ilog2i4 :: Int - Int - Int ilog2i0 k x | x .. 0x /= 0 = ilog2i1 (k + 16) (x `shiftR` 16) | otherwise

[Haskell-cafe] Data types and Haskell classes

2005-05-16 Thread Jens Blanck
How would I introduce number classes that are extended with plus and minus infinity? I'd like to have polymorphism over these new classes, something like a signature f :: (Real a, Extended a b) = b - b which clearly is not part of the current syntax, but I hope you get the picture. What are the

Re: [Haskell-cafe] Data types and Haskell classes

2005-05-17 Thread Jens Blanck
How would I introduce number classes that are extended with plus and minus infinity? I'd like to have polymorphism over these new classes, something like a signature f :: (Real a, Extended a b) = b - b which clearly is not part of the current syntax, but I hope you get the picture.

[Haskell-cafe] least fixed points above something

2009-03-19 Thread Jens Blanck
Hi, I found myself writing the following leastFixedPoint :: (Eq a) = (a - a) - a - a leastFixedPoint f x = fst . head . dropWhile (uncurry (/=)) $ zip l (tail l) where l = iterate f x and was a bit surprised that I couldn't get any matches on hoogle for the type above. The closest one is

Re: [Haskell-cafe] least fixed points above something

2009-03-23 Thread Jens Blanck
On Friday 20 March 2009 5:23:37 am Ryan Ingram wrote: On Fri, Mar 20, 2009 at 1:01 AM, Dan Doel dan.d...@gmail.com wrote: However, to answer Luke's wonder, I don't think fixAbove always finds fixed points, even when its preconditions are met. Consider: f [] = [] f (x:xs)

[Haskell-cafe] Map Monoid instance (was commutative monoid?)

2011-06-25 Thread Jens Blanck
I don't think the original question really is about commutativity, but rather the choice of Monoid instance. Not being especially mathematically inclined, every once and a while I get a little panicked when I notice that, e.g. Data.Map mappend is a plain left-biased union, and doesn't actually