Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread John Meacham
On Tue, Nov 10, 2009 at 07:41:54PM -0800, Philippos Apolinarius wrote: I discovered a Haskell compiler that generates very small and fast code. In fact, it beats Clean. It has the following properties: Excellent. that was my goal ;) 1 --- One can cross-compile programs easily. For instance,

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-11-11 Thread Martin Hofmann
I still have problems and your code won't typecheck on my machine printing the following error: Test.hs:9:34: No instance for (Control.Monad.CatchIO.MonadCatchIO (InterpreterT IO)) arising from a use of `catch' at Test.hs:9:34-53 Possible fix: add an

Re: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Martijn van Steenbergen
Tony Morris wrote: I have two projects that I intend to put on hackage soon. One depends on the other. I have cabaled both. I am wondering how others work with this kind of set up where changes are made to both libraries as they work. You just update and re-upload the packages as necessary. It

[Haskell-cafe] caba install with external gcc toolchain not the ghc-bundled one

2009-11-11 Thread Daniel Kahlenberg
Hello friends, I have a question regarding one thing I can't get my head around: First my problem is, that wanted to install 'bindings-common' here on my Windows machine. Usually that is no problem with the help of the glorious cabal. Now, 'bindings-common' needs a higher version of gcc than the

Re: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Tony Morris
I don't want to have to upload every time I make a minor change as I am working. Surely there is an easier way. Martijn van Steenbergen wrote: Tony Morris wrote: I have two projects that I intend to put on hackage soon. One depends on the other. I have cabaled both. I am wondering how others

RE: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Sittampalam, Ganesh
To install a package from local sources, just run 'cabal install' in the directory with the package's .cabal file. Tony Morris wrote: I don't want to have to upload every time I make a minor change as I am working. Surely there is an easier way. Martijn van Steenbergen wrote: Tony Morris

Re: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Felipe Lessa
On Wed, Nov 11, 2009 at 10:26:32AM -, Sittampalam, Ganesh wrote: To install a package from local sources, just run 'cabal install' in the directory with the package's .cabal file. You can even have some kind of script like cd lib1 cabal install || exit 1 cd ../lib2 cabal install || exit 2

[Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Tillmann Vogt
Hi, I tried to use unboxed arrays for generating an antialiased texture. To make it easier to understand, here is the stripped down code that produces an error: import Control.Monad.ST import Data.Array.ST import Data.Array.Unboxed import Data.Word type BitMask = UArray Int Word16 -- for

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Svein Ove Aas
On Wed, Nov 11, 2009 at 12:58 PM, Tillmann Vogt tillmann.v...@rwth-aachen.de wrote: Hi, I tried to use unboxed arrays for generating an antialiased texture. To make it easier to understand, here is the stripped down code that produces an error: *snip* What do you think? It is generally

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Hemanth Kapila
On Wed, Nov 11, 2009 at 5:28 PM, Tillmann Vogt tillmann.v...@rwth-aachen.de wrote: Hi, I tried to use unboxed arrays for generating an antialiased texture. To make it easier to understand, here is the stripped down code that produces an error: import Control.Monad.ST import Data.Array.ST

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Philippos Apolinarius
Hi, John. I am trying JHC in a small embedded system (Medical instruments). The software is written in Clean, and I am translating to Haskell. You may want to take a look at my page: http://www.discenda.org/med/ I am writing because I found something in JHC that smells like a bug. The program

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Eugene Kirpichov
You might also look at how Data Parallel Haskell implements its arrays. IIRC, it implements an array of n-field records as n arrays. You can easily do that with typeclasses and type families. 2009/11/11 Tillmann Vogt tillmann.v...@rwth-aachen.de: Hi, I tried to use unboxed arrays for

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Tom Nielsen
There's a couple of things going on here: -If you use storablevector and storable-tuple, or uvector, you can store tuples of things. So your stupidArrayElement could be mimicked by (Int, Int). -But what you want to do is store a variable-sized data type. How would you do that in C? If you can

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-11-11 Thread Daniel Gorín
On Nov 11, 2009, at 5:39 AM, Martin Hofmann wrote: I still have problems and your code won't typecheck on my machine printing the following error: [...] I assume we are using different versions of some packages. Could you please send me the output of your 'ghc-pkg list'. Thanks, Martin

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Felipe Lessa
On Wed, Nov 11, 2009 at 04:32:05AM -0800, Philippos Apolinarius wrote: data Op = AND | OR | NOT deriving (Show, Read) data Tree= L Int | T Op [Tree] deriving (Show, Read)  Hmm, you see, phi...@desktop:~/jhctut$ ./jtree Give me a tree: T AND (L 1, L 2) jtree_code.c:2670: case fell off

Re: [Haskell-cafe] Help Haskell driving Medical Instruments

2009-11-11 Thread Ben Millwood
On Tue, Nov 10, 2009 at 5:04 AM, Philippos Apolinarius phi50...@yahoo.ca wrote: foreign import ccall rs232.h opencport opencport :: CInt - IO () foreign import ccall rs232.h closecport closecport :: CInt - CInt [...] Originally, I had the following line (that did not work properly):

Re: [Haskell-cafe] (state) monad and CPS

2009-11-11 Thread Nicolas Pouillard
Excerpts from jean-christophe mincke's message of Tue Nov 10 21:18:34 +0100 2009: Hello, Hello, I would like to get some advice about state monad (or any other monad I guess) and CPS. Here is to remarks somewhat off topic: [...] walk Empty acc k = k acc walk (Leaf _) acc k = k (acc+1)

Re: [Haskell-cafe] Static Linking Problem

2009-11-11 Thread MightyByte
On Tue, Nov 10, 2009 at 4:29 PM, Ketil Malde ke...@malde.org wrote: MightyByte mightyb...@gmail.com writes: After a bit of googling, I came to the conclusion that I needed to compile it with ghc --make -static -optl-static Foo.hs.  Using only -static or -optl-static by themselves did not

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-11-11 Thread Martin Hofmann
Thanks, using MonadCatchIO-mtl-0.2.0.0 and hint-0.3.2.0 did it. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: ANN: haskell-mode 2.6

2009-11-11 Thread Justin Bogner
Svein Ove Aas svein@aas.no writes: Haskell-mode 2.6 has been released. The first hit for haskell-mode is http://www.haskell.org/haskell-mode/ This still points to Stefan's home page as the place to find it, which then points to http://projects.haskell.org/haskellmode-emacs/ , which is the

Re: [Haskell-cafe] looking for a good algorithm

2009-11-11 Thread Tillmann Vogt
Hong Yang schrieb: The question is more about algorithm than Haskell. But I am going to code in Haskell which I am still learning. Suppose I have a large table, with hundreds of columns and thousands of rows. But not every cell has a value (of String, or Int, or Double type). I want to shuffle

[Haskell-cafe] Long running Haskell program

2009-11-11 Thread David Leimbach
As some of you may know, I've been writing commercial Haskell code for a little bit here (about a year and a half) and I've just recently had to write some code that was going to run have to run for a really long time before being restarted, possibly months or years if all other parts of the

Re: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Sönke Hahn
On Wednesday 11 November 2009 08:23:53 am Tony Morris wrote: I have two projects that I intend to put on hackage soon. One depends on the other. I have cabaled both. I am wondering how others work with this kind of set up where changes are made to both libraries as they work. What i did in

Re: [Haskell-cafe] Static Linking Problem

2009-11-11 Thread Svein Ove Aas
On Wed, Nov 11, 2009 at 3:22 PM, MightyByte mightyb...@gmail.com wrote: (.text+0x3068): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking But glibc is pretty standard, so I don't think this will be

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Philippos Apolinarius
you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]' as the tree, right? Hi, Felipe. You are right. This means that I gave the correct input to the program. As you can see, I typed 'T AND [L 1, L 2]'. Therefore, JHC was expected to parse and print it. However, it failed to parse

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Ross Mellgren
According to the paste you gave for the JHC test run: Here is what happens when I try to run it: phi...@desktop:~/jhctut$ ./jtree Give me a tree: T AND (L 1, L 2) jtree_code.c:2670: case fell off Aborted You gave it parens not square brackets. -Ross On Nov 11, 2009, at 11:45 AM, Philippos

[Haskell-cafe] Re: looking for a good algorithm

2009-11-11 Thread Chung-chieh Shan
Hong Yang hyang...@gmail.com wrote in article f31db34d090452x7786572ay4482dffc4824a...@mail.gmail.com in gmane.comp.lang.haskell.cafe: I want to shuffle the rows to maximize the number of columns whose first 100 rows have at least one number Sounds like the maximum coverage problem, which

[Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread Andy Stewart
David Leimbach leim...@gmail.com writes: As some of you may know, I've been writing commercial Haskell code for a little bit here (about a year and a half) and I've just recently had to write some code that was going to run have to run for a really long time before being restarted,

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread Bryan O'Sullivan
On Wed, Nov 11, 2009 at 7:43 AM, David Leimbach leim...@gmail.com wrote: I recently ran into some serious space leak difficulties that would ultimately cause this program to crash some time after startup (my simulator is also written in Haskell, and runs a LOT faster than the real application

Re: [Haskell-cafe] Medical Instruments - Jason

2009-11-11 Thread Philippos Apolinarius
Hi, Jason. Thank you for your explanations. They were very useful. In the light of what you said, I modified the programs as shown below (commented lines failed to work). Forcing the C function to return a number, wrapping the returned number in IO,  and printing the number, I succeeded in

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread Matthew Pocock
Is there a state monad that is strict on the state but lazy on the computation? Of course, strictness in the state will force a portion of the computation to be run, but there may be significant portions of it which are not run. Would there be a way to write a state monad such that it is entirely

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Paolino
FWIW, I just compiled JHC 0.7.2 with ghc 6.12 , doing a couple of corrections to make it compile, which I don't think they are related to this *bug*. Testing the given code, it aborts for every inputs I give it L 1, T AND [L 1,L 2] included. I couldn't make it compile using function reads

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread David Menendez
On Wed, Nov 11, 2009 at 1:09 PM, Matthew Pocock matthew.poc...@ncl.ac.uk wrote: Is there a state monad that is strict on the state but lazy on the computation? Of course, strictness in the state will force a portion of the computation to be run, but there may be significant portions of it which

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread Paolino
Hello leimy, the only simple solution I have found to avoid a leaking state of a server is doing a periodical rnf of it, this implying the NFData constraint on its datatype. The reader should leak only if you nest forever the local function. paolino 2009/11/11 David Leimbach

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Lennart Augustsson
John, Do you use jhc when you develop jhc? I.e., does it compile itself. For me, this is the litmus test of when a compiler has become usable. I mean, if even the developers of a compiler don't use it themselves, why should anyone else? :) -- Lennart On Wed, Nov 11, 2009 at 3:37 AM, John

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Donn Cave
Quoth Lennart Augustsson lenn...@augustsson.net, Do you use jhc when you develop jhc? I.e., does it compile itself. For me, this is the litmus test of when a compiler has become usable. I mean, if even the developers of a compiler don't use it themselves, why should anyone else? :) Though

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread David Leimbach
On Wed, Nov 11, 2009 at 8:20 AM, Andy Stewart lazycat.mana...@gmail.comwrote: David Leimbach leim...@gmail.com writes: As some of you may know, I've been writing commercial Haskell code for a little bit here (about a year and a half) and I've just recently had to write some code that was

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread David Leimbach
On Wed, Nov 11, 2009 at 9:51 AM, Bryan O'Sullivan b...@serpentine.comwrote: On Wed, Nov 11, 2009 at 7:43 AM, David Leimbach leim...@gmail.com wrote: I recently ran into some serious space leak difficulties that would ultimately cause this program to crash some time after startup (my

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread David Leimbach
On Wed, Nov 11, 2009 at 10:29 AM, David Menendez d...@zednenem.com wrote: On Wed, Nov 11, 2009 at 1:09 PM, Matthew Pocock matthew.poc...@ncl.ac.uk wrote: Is there a state monad that is strict on the state but lazy on the computation? Of course, strictness in the state will force a portion

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread Don Stewart
leimy2k: I figured I was better off just creating a dependency in the evaluation, near the outermost portion of the program (the loop) that would cause a strict evaluation, and so far I was right :-) Program behaves very well now, and responds much better too. Do you know if

Re: [Haskell-cafe] Medical Instruments - Jason

2009-11-11 Thread Ben Millwood
On Wed, Nov 11, 2009 at 6:00 PM, Philippos Apolinarius phi50...@yahoo.ca wrote:  closecport :: Int - IO Int  closecport n= return (fromIntegral (c_closecport (fromIntegral n))) The return here doesn't do what you think it does - semantically, the value of c_closecport is still considered pure

Re: [Haskell-cafe] Hoogle is great but ...

2009-11-11 Thread Neil Mitchell
Following up on this rather old thread, if you want to see a module which has lots of input/output example pairs, and properties, in the documentation then look at filepath (hoogle for takeExtension as an example). These properties are also automatically transformed in to test cases, so filepath

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Lennart Augustsson
If by minority platform you mean platforms that are resource starved, like some embedded systems, then I would have to agree. -- Lennart On Wed, Nov 11, 2009 at 2:12 PM, Donn Cave d...@avvanta.com wrote: Quoth Lennart Augustsson lenn...@augustsson.net, Do you use jhc when you develop jhc?  

Re: [Haskell-cafe] Long running Haskell program

2009-11-11 Thread David Leimbach
On Wed, Nov 11, 2009 at 11:19 AM, Don Stewart d...@galois.com wrote: leimy2k: I figured I was better off just creating a dependency in the evaluation, near the outermost portion of the program (the loop) that would cause a strict evaluation, and so far I was right :-) Program behaves

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Donn Cave
Quoth Lennart Augustsson lenn...@augustsson.net, If by minority platform you mean platforms that are resource starved, like some embedded systems, then I would have to agree. Like anything but the platform the compiler developer(s) use. If you used a platform like that, you would certainly

[Haskell-cafe] Least common supertype?

2009-11-11 Thread Sean Leather
Is there a name for the following concept? Can you point me to any references on it? Suppose I have the following two functions ... swap1 :: (Int, Char) - (Char, Int) swap2 :: (Char, Int) - (Int, Char) ... and, for some reason, I think I can unify these into a single function. I think, hmm,

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread Eugene Kirpichov
Is the name of the concept Most general unifier (MGU) ? (See: Hindley-Milner type inference) 2009/11/11 Sean Leather leat...@cs.uu.nl: Is there a name for the following concept? Can you point me to any references on it? Suppose I have the following two functions ... swap1 :: (Int, Char)

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread minh thu
Least Common Generalization. Cheers, Thu 2009/11/11 Eugene Kirpichov ekirpic...@gmail.com: Is the name of the concept Most general unifier (MGU) ? (See: Hindley-Milner type inference) 2009/11/11 Sean Leather leat...@cs.uu.nl: Is there a name for the following concept? Can you point me

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread Wei Hu
I used to be a victim of GFW, so I can feel your pain. You may try to subscribe to http://leimy9.blogspot.com/feeds/posts/default in your Google Reader. In case that fails too, I've pasted the blog post below, with no images: I've been using Haskell in a serious way for about 2 years. Been using

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread minh thu
For some reference, I found some definition for the lcg function in papers from [1]. In fact, I began to implement the type inference algorithm of System CT (the version of 1999, it has been revised since) and I have an implementation of lcg in that setting. I plan to upload the code to github; I

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread Nicolas Pouillard
Excerpts from Sean Leather's message of Wed Nov 11 21:24:43 +0100 2009: Is there a name for the following concept? Can you point me to any references on it? Suppose I have the following two functions ... swap1 :: (Int, Char) - (Char, Int) swap2 :: (Char, Int) - (Int, Char) ... and,

[Haskell-cafe] Sometimes pinned memory?

2009-11-11 Thread Gregory Crosswhite
Hey everyone! Do you have any suggestions for how I might allocate an aligned block of memory that I can pin while making foreign calls, but leave unpinned the rest of the time to potentially improve allocation and garbage collector performance? Or is this even a good idea? Thanks, Greg

Re: [Haskell-cafe] Sometimes pinned memory?

2009-11-11 Thread Don Stewart
gcross: Hey everyone! Do you have any suggestions for how I might allocate an aligned block of memory that I can pin while making foreign calls, but leave unpinned the rest of the time to potentially improve allocation and garbage collector performance? Or is this even a good idea?

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Philippos Apolinarius
Hi, Ross. Ops, the paste is wrong, but the bug is real. I mean, if I try to run the program with the right input, the program aborts in the same place, with the same error message: phi...@desktop:~/jhctut$ ./jtestarbo Give me a tree: T AND [L 1, L 2] jtestarbo_code.c:2670: case fell off

Re: [Haskell-cafe] Sometimes pinned memory?

2009-11-11 Thread Bulat Ziganshin
Hello Gregory, Thursday, November 12, 2009, 12:14:56 AM, you wrote: Hey everyone! Do you have any suggestions for how I might allocate an aligned block of memory that I can pin while making foreign calls, but leave unpinned the rest of the time to potentially improve allocation and garbage

Re: [Haskell-cafe] Sometimes pinned memory?

2009-11-11 Thread Gregory Crosswhite
Thanks, Don. What made me think that this might be possible was the existence of Foreign.StablePtr, since that seems to take a Haskell expression and pin it down. Could this mechanism be harness to pin down arrays, or am I misunderstanding how it works? (Is StablePtr really just making a

Re: [Haskell-cafe] Sometimes pinned memory?

2009-11-11 Thread Don Stewart
gcross: Thanks, Don. What made me think that this might be possible was the existence of Foreign.StablePtr, since that seems to take a Haskell expression and pin it down. Could this mechanism be harness to pin down arrays, or am I misunderstanding how it works? (Is StablePtr really just

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Philippos Apolinarius
Hi, John. I am sending you this second email because the first one has a worng paste.  However, if I use the right input, I gent the same error. In fact, it gives exactly the same error for any input, right or wrong.  {- file: tree.hs -} {- compile: jhc tree.hs -dc -o jtree } import System

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Henning Thielemann
Stephen Tetley schrieb: Why speak nonsense when you can test it? // module nonsense import StdEnv nonsense = map ((^) 2) Start = nonsense [1,2,3] //

Re: [Haskell-cafe] a problem defining a monad instance

2009-11-11 Thread Henning Thielemann
On Fri, 6 Nov 2009, Petr Pudlak wrote: Hi all, (This is a literate Haskell post.) I've encountered a small problem when trying to define a specialized monad instance. Maybe someone will able to help me or to tell me that it's impossible :-). To elaborate: I wanted to define a data type

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Stephen Tetley
Hi Henning I spotted that (and also that Clean doesn't have sections) after my blood pressure returned to normal. Best wishes Stephen [2,4,8] I think they wanted square numbers, not powers of two. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] looking for a good algorithm

2009-11-11 Thread Hong Yang
Thanks. I actually prototyped in Perl the SA method intuitively (though I do not know its name). But it is way slow. So I want to improve the speed by means of both algorithm and language. Hong On Wed, Nov 11, 2009 at 9:36 AM, Tillmann Vogt tillmann.v...@rwth-aachen.de wrote: Hong Yang

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Thomas DuBuisson
Like paolino, I did a couple tests and found: data TreeX = Leaf Int | NotLeaf Int deriving (Show, Read)     [to...@mavlo Test]$ ./jtree     Give me a tree:     Leaf 5     jtree_code.c:2572: case fell off     Aborted     [to...@mavlo Test]$ ./jtree     Give me a tree:     NotLeaf    

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread Richard O'Keefe
On Nov 12, 2009, at 9:24 AM, Sean Leather wrote: Is there a name for the following concept? [Generalising from (Int, Char) - (Char, Int) (Char, Int) - (Int, Char) to (x,y ) - (y, x )] It's the least specific generalisation, also known as anti- unification.

Re: [Haskell-cafe] looking for a good algorithm

2009-11-11 Thread Casey Hawthorne
So, as I understand it, you have a very large sparse table, thousands of rows and hundreds of columns, of which each cell within a column of type String, Int, or Double can contain one of those types or nothing. Then you to want to shuffle the rows to maximize the number of columns whose first

[Haskell-cafe] What does the `forall` mean ?

2009-11-11 Thread zaxis
import Text.ParserCombinators.Parsec data PermParser tok st a = Perm (Maybe a) [Branch tok st a] data Branch tok st a = forall b. Branch (PermParser tok st (b - a)) (GenParser tok st b) I have hoogled the `forall` but i cannot find any appropriate answer! thanks! - fac n = foldr (*)

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-11 Thread Joe Fredette
Forall means the same thing as it means in math, it means for any type -- call it `b` -- then the type of the following it `Branch (PermParser tok st (b - a)` `tok`, `st` and `a` are all given by the declaration of the datatype itself. Hope that makes sense, /Joe On Nov 11, 2009, at

[Haskell-cafe] ANNOUNCE: simple-observer-0.0.1, a simple implementation of the observer design pattern

2009-11-11 Thread Andy Gimblett
Hi all, Further to earlier discussion on this topic, I've just released a first version of this package to hackage: http://hackage.haskell.org/package/simple-observer It is a fairly simple implementation of subject/observer which I've recently used to good effect in an GUI written using

Re: [Haskell-cafe] Medical Instruments - Jason

2009-11-11 Thread Jason Dusek
First of all, I find it striking that you are using the declaration:  foreign import ccall unsafe rs232.h closecport c_closecport :: CInt - CInt and that it actually works. I would think the only workable declaration would be:   foreign import stdcall unsafe rs232.h closecport

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-11 Thread Dan Piponi
On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote: data Branch tok st a     = forall b. Branch (PermParser tok st (b - a)) (GenParser tok st b) I have hoogled the `forall` but i cannot find any appropriate answer! That's an example of an existential type. What that line is saying is

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread sterl
Richard O'Keefe wrote: On Nov 12, 2009, at 9:24 AM, Sean Leather wrote: Is there a name for the following concept? [Generalising from (Int, Char) - (Char, Int) (Char, Int) - (Int, Char) to(x,y ) - (y, x )] It's the least specific generalisation, also known as

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Daniel Fischer
Am Mittwoch 11 November 2009 23:50:21 schrieb Thomas DuBuisson: Like paolino, I did a couple tests and found: So the read for that does not work... but surprisingly... data TreeX = Leaf Int | NotLeaf deriving (Show, Read) Dropping the Int from the second constructor works (ignore the

[Haskell-cafe] Package Woes

2009-11-11 Thread Daniel Fischer
Sorry, slightly off-topic. I wanted to install LHC to compare that to GHC and JHC, but alas: da...@linux-mkk1:~/Haskell/LHC/lhc-0.8 cabal install -fwith-libs -flhc-regress Resolving dependencies... Configuring libffi-0.1... cabal: The pkg-config package libffi is required but it could not be

[Haskell-cafe] ANNOUNCE: dbus-core 0.6 and dbus-client 0.2

2009-11-11 Thread John Millikin
This is the second public release of my D-Bus implementation. dbus-core is an implementation of the D-Bus protocol, and dbus-client is a set of wrappers and utility computations to simplify writing basic clients. Interesting changes to dbus-core * Performance

Re: [Haskell-cafe] faster compiling for ghc

2009-11-11 Thread Bulat Ziganshin
Hello Evan, Thursday, November 12, 2009, 4:02:17 AM, you wrote: Recently the go language was announced at golang.org. There's not a lot in there to make a haskeller envious, except one real big one: compilation speed. The go compiler is wonderfully speedy. are you seen hugs, for example? i

Re: [Haskell-cafe] (state) monad and CPS

2009-11-11 Thread wren ng thornton
Nicolas Pouillard wrote: Excerpts from jean-christophe mincke's message of Tue Nov 10 21:18:34 +0100 2009: do acc - get put (acc+1) ... Since this pattern occurs often 'modify' is a combination of get and put: do modify (+1) ... Though the caveat about laziness applies here as

Re: [Haskell-cafe] faster compiling for ghc

2009-11-11 Thread David Virebayre
On Thu, Nov 12, 2009 at 7:18 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Evan, Thursday, November 12, 2009, 4:02:17 AM, you wrote: Recently the go language was announced at golang.org.  There's not a lot in there to make a haskeller envious, except one real big one:

[Haskell-cafe] Problem about hidden package again.

2009-11-11 Thread Magicloud Magiclouds
Hi, Today, when I compiled gtk2hs, I got this: cairo/Graphics/Rendering/Cairo.hs.pp:264:0: Failed to load interface for `Data.Array.Base': it is a member of the hidden package `array-0.2.0.0' Use -v to see a list of the files searched for. As usual, I searched for the

[Haskell-cafe] lambda-bot installation problem: gentoo trickery problem

2009-11-11 Thread Евгений Пермяков
When I try cabal-install lambdabot (gentoo linux/amd64, ghc installed with portage), it runs fine until compiler tries to link readline package (some template haskell?). The problem caused by dirty trick, used in gentoo: the /usr/lib64/libreadline is a fake with script, redirecting ld to /lib64 .

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread wren ng thornton
sterl wrote: Richard O'Keefe wrote: On Nov 12, 2009, at 9:24 AM, Sean Leather wrote: Is there a name for the following concept? [Generalising from (Int, Char) - (Char, Int) (Char, Int) - (Int, Char) to(x,y ) - (y, x )] It's the least specific generalisation, also known

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-11 Thread zaxis
Without `forall`, the ghci will complain: Not in scope: type variable `b' It is clear now. thank you! Dan Piponi-2 wrote: On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote: data Branch tok st a     = forall b. Branch (PermParser tok st (b - a)) (GenParser tok st b) I have

[Haskell-cafe] Wrestling the inliner beast

2009-11-11 Thread Bryan O'Sullivan
I did a little bit of Data.Text benchmarking the other day, and I was shocked to find that decoding a UTF-8 stream proceeded at a sedate 3MB/sec. On investigation, the culprit was that I'd marked both the outer function and the inner (a loop) as INLINE. Because the inner loop was marked as INLINE,

Re: [Haskell-cafe] Least common supertype?

2009-11-11 Thread wren ng thornton
wren ng thornton wrote: sterl wrote: IANTT (I am not a type theorist) but... If you're talking about supertypes and subtypes, then I think this can be classified as a least upper bound. It is a least upper bound, but only in a particular sense. The particular sense is (of course)

Re: [Haskell-cafe] Static Linking Problem

2009-11-11 Thread David Virebayre
On Wed, Nov 11, 2009 at 5:44 PM, Svein Ove Aas svein@aas.no wrote: My recommendation would be to take glibc off the list of statically linked libraries. How do you do that ? David. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org