Re: Type system compiler flags

2011-02-01 Thread Carsten Schultz
Am 01.02.11 12:34, schrieb Daniel Fischer: > On Tuesday 01 February 2011 11:45:58, Julian Bean wrote: >>> It indeed does, even though I doubted it at first. As far as I >>> remember the type in >>> >>>getnArrayST n bs :: ST s (Maybe (UArray Int Word8, [Word8])) = >>> >>> used to be necessary t

Re: Type system compiler flags

2011-02-01 Thread Carsten Schultz
Am 01.02.11 11:05, schrieb Daniel Fischer: > On Tuesday 01 February 2011 10:20:26, Carsten Schultz wrote: >> Hello everyone, >> >> I am trying to compile some code that I have written a long time ago >> (might have been for ghc 6.3), and I have not done much Haskell

Type system compiler flags

2011-02-01 Thread Carsten Schultz
Hello everyone, I am trying to compile some code that I have written a long time ago (might have been for ghc 6.3), and I have not done much Haskell in the meantime. I have trouble compiling the code, maybe only because I do not remember the necessary flags (yes, these should be in the source fil

Re: STM experiment

2009-10-12 Thread Carsten Schultz
Luca Ciciriello schrieb: > Thanks Carsten, I've compiled your example and all works as expected. > > Just a note. > If I load the module in GHCi (intead of compiling it) and launch main > function the result is quite strange. I obtain: > > He lwloorld So we actually observe the concurrency her

Re: STM experiment

2009-10-12 Thread Carsten Schultz
Brent Yorgey schrieb: > On Fri, Oct 02, 2009 at 06:16:49PM +0200, Luca Ciciriello wrote: >> Compiling this module with: >> >> ghc --make Main.hs -o Main >> >> and launcing ./Main the result is just: >> >> Terminal> world > > Also, the reason you only get "world" here is likely because the main > t

Re: Help with a Shootout program

2005-02-24 Thread Carsten Schultz
, otherwise it would be an opportuniy to reconsider the problems mentioned there. Take care, Carsten -- Carsten Schultz (2:38, 33:47) http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgpHPMFoJaYLE.pgp Description: PGP signature

Re: Waiting on Sockets or File Descriptors

2005-02-02 Thread Carsten Schultz
pic ;-) Just do an strace, if you want to know (and are running Linux). Take care, Carsten -- Carsten Schultz (2:38, 33:47) http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. ___ Glasgow-haskell-users

Re: recursive group context bug?

2005-01-17 Thread Carsten Schultz
Oops, I initially hit r instead of L... -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. --- Begin Message --- Hi! On Sun, Jan 16, 2005 at 06:17:24PM -0800, Ashley Yakeley wrote: >

Profiling code using HaXml

2004-10-22 Thread Carsten Schultz
Hi! Is there anybody who has compiled a profiling version of the HaXml libraries and might share a suitable make file? Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page

Re: Mutually recursive modules and derived instances of Data

2004-10-13 Thread Carsten Schultz
MyClass) should also be possible. The advantage would be that only the module defining the deriving would have to know about TH, not the one using it. On other systems, the deriving could then be realized via a pre-processor or similar means. Greetings, Carsten -- Carsten Schultz (2:38,

Re: -allow-extension-for-bottom

2004-10-11 Thread Carsten Schultz
imes)) then putStrLn "It is odd!" else putStrLn "It is 2!" Another example is in the use of `interact'. You dot not want to print a partial answer before a question is given. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http:/

Re: factoring `if'

2004-10-11 Thread Carsten Schultz
tion > meaning. If p x == _|_ and foo _|_ /= _|_, then (1) does not equal (2). > I have a large program which is easily written in the style of (1), > (and in many places it sets `case' instead of `if'). > Annoyingly, it prints out in a not a lazy manner. You get wh

reading text files

2004-10-04 Thread Carsten Schultz
Hi! I want to read a text file from a socket and process it as a String (using Parsec). Is hGetContent ok, or are there mor efficient alternatives available, even if I want a String anyway? Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de

Re: Bools are not unboxed

2004-10-03 Thread Carsten Schultz
_s1XA new_s; }; }; }; } in go10 1; }; SRT(T.$wfor2): [] T.for2 = \r [w w1] case w of w2 { GHC.Base.I# ww -> T.$wfor2 ww w1; }; SRT(T.for2): [] Playing with the code gene

Re: constant space `minimum'

2004-09-29 Thread Carsten Schultz
compare (L x) (L y) = compare x y compare (L _) (R _) = LT compare (R _) (L _) = GT compare (R x) (R y) = compare x y min (L x) (L y) = L (min x y) min (L x) (R _) = L x min (R _) (L x) = L x min (R x) (R y) = R (min x y) I think that it is completel

Deforestation of literal lists

2004-09-17 Thread Carsten Schultz
en discussed before? Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgpsSaU1emaMt.pgp Description: PGP signature ___ Glasgow-haskell-

unfold deforestation

2004-09-02 Thread Carsten Schultz
root) (concat . map kids) unfold :: (b -> Bool) -> (b -> a) -> (b -> b) -> b -> [a] unfold p h t = unfoldr u where u x | p x = Nothing | otherwise = Just (h x, t x) === Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://

Re: Announce: hs-plugins-0.9.6

2004-08-16 Thread Carsten Schultz
ld be good if ghc-users would > keep that in mind when writing portable Haskell code. Maybe someone should have a look at popen functionality in Python. IMHO Python seems to have quite good libraries which work on Windows and Unix. Greetings, Carsten -- Carsten Schultz (2:38, 33:47

Re: GHCI/FFI/GMP/Me madness

2004-08-10 Thread Carsten Schultz
/Custom-Allocation.html Be sure to call mp_set_memory_functions only when there are no active GMP objects allocated using the previous memory functions! Usually that means calling it before any other GMP function. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathem

Re: major missing piece to arrays?

2004-07-19 Thread Carsten Schultz
e we are not changing > behavior, just doing a pure type based optimization, perhaps RULES is > the better way to go. Exactly. > (can RULES even be used in this way? I think so: http://www.haskell.org/ghc/docs/latest/html/users_guide/pragmas.html#SPECIALIZE-PRAGMA Greetings, Carsten --

Re: major missing piece to arrays?

2004-07-19 Thread Carsten Schultz
(I have not done any testing, though.) Maybe some kind soul with knowledge of the ghc innards can provide an implementation that reduces to a memcpy call, at least for some specializations. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de

Re: Socket Options

2004-06-28 Thread Carsten Schultz
Option a where [...] instance SocketOption Debug [...] instance SocketOption SendBuffer [...] [...] setSocketOption :: SocketOption a => Socket -> a -> IO () getSocketOption :: SockerOption a => Socket -> IO a However, while quite clever :-), this would not be far from having a sep

Re: Understanding strictness of ghc output

2004-06-22 Thread Carsten Schultz
P.S.: Is there a special reason for the Simons on this list not to produce messages with proper References headers? *duck* -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgphSFv

Re: Understanding strictness of ghc output

2004-06-22 Thread Carsten Schultz
in that result. Thus, the function code itself here does > not force the evaluation of h. The point is that, because the function is strict, its implementation may force the evaluation of h, if it so chooses. This is up to the compiler, and as Simon pointed out, it actually does force h when com

Re: Understanding strictness of ghc output

2004-06-22 Thread Carsten Schultz
s strict in the first argument. I do not know, what the strictness analyzer makes of it, though. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgp1oAogFYQMJ.pgp Descr

Re: Executing external program

2004-06-06 Thread Carsten Schultz
Hi! On Sun, Jun 06, 2004 at 09:33:39PM +, Gerd M wrote: > Is there a simple way to execute a different process from a Haskell > program, waiting for it's termination and then continuing with the next IO > action? Have a look at the module System.Cmd. Greetings, Carste

Re: sizeFM type

2004-04-27 Thread Carsten Schultz
t; > problem on a 32 bit platform. > > In fact, the only way this will be a problem is if your list is lazy and > consumed by the length function, but it's hard to see how that could happen > except in strange example code. That is, it's hard to imagine when you'

Data.HashTable bug

2004-03-18 Thread Carsten Schultz
s the problem in Data.HashTable? I have tested, 6.0, 6.2, 6.2.20040304. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. module Main(main) where import qualified Data.HashTable as

Re: Haskell performance

2004-03-18 Thread Carsten Schultz
> compete with Python (which is rather... slow). You should look at the individual examples and see how relevant their results are for you. And keep in mind that strings tend to be slow in Haskell (being lazy lists of characters), a fact that may influence some of the tests. Greetings, Carsten

Re: [Haskell] performance tuning Data.FiniteMap

2004-03-02 Thread Carsten Schultz
portant. Just my humble opinion... Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgp0.pgp Description: PGP signature __

Re: GC behaviour in GHC

2004-02-23 Thread Carsten Schultz
problems are more in this area. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. pgp0.pgp Description: PGP signature ___

Re: Problem with ghc on Windows ME

2004-01-29 Thread Carsten Schultz
scape c(_, str) = (False, c : str) > Neat. If I understand the specs correctly, the following should also work. translate str = '"' : foldr escape ('"':[]) str where escape '"' t = '\\':'"':t escape &#x

Re: To show or not to show french accents

2003-12-18 Thread Carsten Schultz
s sufficient for english. > > I am talking about respect for non english speaking people. > > But if nobody cares ... I, too, speak a language that can't be fully expressed in ASCII, but I do not think that the behaviour of `show' should be changed in this respect. Greetings,

Re: What's difference between Integer and Int?

2003-08-19 Thread Carsten Schultz
[] === and replacing [1..] by (elementStrict [1..]). With that, the following program will also work. === module Main(main) where main = print (fibs!!20) fibs :: [Integer] fibs = 1 : elementStrict (map snd $ iterate (\(x,y) -> (y, x+y)) (1,1)) === It produces a result with 41798 decimal digits.

Using Template Haskell for deriving instances

2003-07-15 Thread Carsten Schultz
Hi, is any workable example code for using Template Haskell to generate instance declarations available, eg the function `genEq' mentioned in the Template Haskell paper? Greetings, Carsten -- Carsten Schultz (2:40, 33:47), FB Mathematik, FU Berlin http://carsten.fu-mathe-team.de/ PGP/GP

Dynamic Compilation

2003-06-11 Thread Carsten Schultz
erver written in Erlang that can compile and load Erlang code embedded in HTML files to produce dynamic pages. I have played with it a bit, and it seems useful to me, but I would prefer Haskell over Erlang. Greetings, Carsten -- Carsten Schultz (2:40, 33:47), FB Mathematik, FU Berlin http://www.ma

Specialization and complicated (?) types

2000-03-28 Thread Carsten Schultz
unnecessary? * If I add an {-# INLINE addSTcol #-} in module MatrixSparse and no paragmas in module RealStateMatrixMonads, does that make it less likely that addColOMC will be inlined in module Matrix? * What should the information in RealStateMonads.hi look like? Lots of questio

Re: tail-recurse `partition' ?

2000-01-18 Thread Carsten Schultz
[],[]) xs where select x ~(ts,fs) | p x = (x:ts,fs) | otherwise = (ts,x:fs) This is equivalent to the one given by Tom. Greetings, Carsten --- Carsten Schultz, Fachbereich Mathematik, FU Berlin http://www.math.fu-

Re: unlucky recursion

2000-01-15 Thread Carsten Schultz
I wrote > zipRem (0:_|_) [0] = (0,0):_|_. when I meant zipRem (0:_|_) [0] = ((0,0):_|_ , _|_ , _|_). Sorry. --- Carsten Schultz, Fachbereich Mathematik, FU Berlin http://www.math.fu-berlin.de/~cschultz/ "To match the silent eloquence of the created world I have had to learn

Re: {-# rules

1999-04-24 Thread Carsten Schultz
G, > #-} > may do the algebraic simplification, like > map ((x+1)+) [1,-1,-1-x] --> > [x+2,x,0]. [...] Ther same applies to our beloved monads. The compiler could be told about the monad laws. Carsten --- Carsten Schultz, Fachbereich Mathematik, FU Berlin "To matc