[Haskell-cafe] Documentation for OpenGL?

2010-08-12 Thread Eitan Goldshtrom
Hi everyone. I'm looking for something specific. I'm trying to figure out how to use the depthFunc StateVar and I can't find any official documentation for it. I did a ":t depthFunc" in ghci and got "depthFunc :: StateVar (Maybe ComparisonFunction)" so I looked up ComparisonFunction and couldn'

Re: [Haskell-cafe] Build failure for PortMidi on mac: incorrect Block.h

2010-08-12 Thread Stephen Tetley
Hello Brian Possibly you need to supply extra-include-dirs (and extra-lib-dirs) to cabal. It looks like a C header can't be parsed - the Haskell FFI preprocessor will try to compile pmmacosxcm.c by calling out to a C compiler before GHC compiles the Haskell source. Unless the C header is wrong -

Re: [Haskell-cafe] How do you change the mouse position?

2010-08-12 Thread Eitan Goldshtrom
Thanks. That is exactly what I was looking for. I really appreciate the help. -Eitan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How do you change the mouse position?

2010-08-12 Thread Stephen Sinclair
On Thu, Aug 12, 2010 at 10:50 PM, Eitan Goldshtrom wrote: > In C++, maybe Java, I remember using a Robot to change the location of the > mouse on the screen. My intention is to do something like in an FPS game > where the mouse is always centered to make sure it doesn't run into the > edges of the

[Haskell-cafe] How do you change the mouse position?

2010-08-12 Thread Eitan Goldshtrom
In C++, maybe Java, I remember using a Robot to change the location of the mouse on the screen. My intention is to do something like in an FPS game where the mouse is always centered to make sure it doesn't run into the edges of the screen. How can I do that in Haskell? I'm using OpenGL, so if

[Haskell-cafe] Trying to compile Glade Gtk2Hs demo / cabal install glade problem

2010-08-12 Thread Peter Schmitz
(I am posting this to Cafe and Gtk2Hs Users; if you subscribe to both, please reply to Cafe; but I will see your replies either place; thanks much.) I am trying to compile the Gtk2Hs demo program GladeTest.hs (located in the ...\demo\glade dir), under MS Windows XP. The error I get is: H:\proc\t

[Haskell-cafe] Build failure for PortMidi on mac: incorrect Block.h

2010-08-12 Thread Brian Victor
I'm trying to build PortMidi on the mac, and get the error shown below. It appears that an OSX header is trying to include a Block.h file and getting the GHC Block.h instead of the one it expects. I'm new to Haskell and even newer to cabal, so I'm not sure how to go about solving this. Incidental

Re: [Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread Dan Doel
On Thursday 12 August 2010 7:59:09 pm wren ng thornton wrote: > Not quite. Strong-sigma is a dependent pair where you can project both > elements. Weak-sigma is a dependent pair where you can only project the > first element (because the second is erased). Existentials are dependent > pairs where y

Re: [Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread wren ng thornton
Joshua Ball wrote: Hi, If I have a universally quantified type mapInt :: forall a. (Int -> a) -> [Int] -> [a] I can instantiate that function over a type and get a beta-reduced version of the type mapInt [String] :: (Int -> String) -> [Int] -> [String] (I'm borrowing syntax from Pierce here

Re: [Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread wren ng thornton
Daniel Peebles wrote: The existential is a pair where one component is a type, and the type of the second component depends on the value (i.e., which type went in the first component) of the first. It's often called a sigma type when you have full dependent types. Not quite. Strong-sigma is a d

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Tillmann Rendel
Hi, the reading is not needed to make it happen. main = writeFile "output" blackhole where blackhole = blackhole In fact, writing is not needed either. main = bracket (openFile "output" WriteMode) hClose (\hdl -> blackhole `seq` return ()) blackhole = blackhole Note that wr

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Hans Aberg
On 12 Aug 2010, at 20:46, Gaius Hammond wrote: its not for those that also installs standard distributions, it seems. But what's wrong with the binaries listed here: http://haskell.org/ghc/ Fairly easy to install. Yes and no; on OSX 10.5.8 it works better to install GHC from the binary th

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
Sebastian Fischer wrote: >    process = process Nice! > What about the other part of the solution: >> What is the cause of the error? > Of course, the cause is the black hole. But why is it not reported? Hmm. On second thought, perhaps it was a good idea after all that I did not exclude GHC team

[Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Sebastian Fischer
Wei Hu wrote: nonTermination _ = blackhole where blackhole = blackhole My original example was actually: process :: String -> String process = let x = x in x process = process works just as well. What about the other part of the solution: What is the cause of the error? Of course,

Re: [Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread aditya siram
When I tried this it never returned, there was no error. -deech On Thu, Aug 12, 2010 at 4:04 PM, Yitzchak Gale wrote: > Pierre-Etienne Meunier wrote: > > Does it still work with : > > writeFile "output" $! process inp > > You're right, that changes things. Then the program prints: > > <> > > Tha

Re: [Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
Pierre-Etienne Meunier wrote: > Does it still work with : > writeFile "output" $! process inp You're right, that changes things. Then the program prints: <> That would have given it away, of course. :) Regards, Yitz ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
Wei Hu wrote: > nonTermination _ = blackhole where blackhole = blackhole My original example was actually: process :: String -> String process = let x = x in x Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/

Re: [Haskell-cafe] ADT patch/update

2010-08-12 Thread Nathan Howell
There is an existing implementation on hackage: http://hackage.haskell.org/packages/archive/gdiff/1.0/doc/html/Data-Generic-Diff.html On Thu, Aug 12, 2010 at 11:45 AM, Sergey Mironov wrote: > 2010/8/8 Stephen Tetley : >> Maybe this paper is close? >> >> Type-safe diff for families of datatypes >

[Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
Simon Marlow wrote: > process xs = blackhole where blackhole = tail blackhole We have a winner! Perhaps I should have stipulated that members of the GHC team and their family members are not eligible to participate. Regards, Yitz ___ Haskell-Cafe maili

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Wei Hu
Threaded or not doesn't seem to make a difference. I just noticed with optimization turned on, RTS does detect the loop. On Thu, Aug 12, 2010 at 4:28 PM, Jason Dagit wrote: > > > On Thu, Aug 12, 2010 at 1:25 PM, Wei Hu wrote: >> >> Anyone care to explain why? I also tested a slightly changed pro

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Jason Dagit
On Thu, Aug 12, 2010 at 1:25 PM, Wei Hu wrote: > Anyone care to explain why? I also tested a slightly changed program > pasted below, and am very confused. > > > main = do > > -- This call doesn't terminate, why? > > print $ nonTermination "a" > > -- Comment the above line to test the rest

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Wei Hu
Anyone care to explain why? I also tested a slightly changed program pasted below, and am very confused. > main = do > -- This call doesn't terminate, why? > print $ nonTermination "a" > -- Comment the above line to test the rest of the code > -- RTS detects the loop and bails out > prin

[Haskell-cafe] ANNOUNCE: Sifflet visual programming language, release 1.0!

2010-08-12 Thread gdweber
Sifflet 1.0 is now available on Hackage. Sifflet is a visual, functional programming language and support system for students learning about recursion. Sifflet programmers define functions by drawing diagrams, and the Sifflet interpreter uses diagrams to show how the function calls are evaluated.

[Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Simon Marlow
On 12/08/10 15:09, Yitzchak Gale wrote: The file "error_puzzle.hs" begins like this: main = do inp<- readFile "input" writeFile "output" $ process inp process :: String -> String When compiled with GHC 6.12.3 and run, it gives the following result: $ ./error_puzzle error_puzzle: output

Re: [Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread Tillmann Rendel
Hi, to understand forall and exists in types, I find it helpful to look at the terms which have such types. Joshua Ball wrote: mapInt :: forall a. (Int -> a) -> [Int] -> [a] I can instantiate that function over a type and get a beta-reduced version of the type mapInt [String] :: (Int -> Str

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-12 Thread Ben Moseley
> > it's clear that FP ideas are becoming mainstream >_without_ any need of help from the financial community > This is far from clear - unless you want to deny that the financial community has had any impact on FP... > due to Objective C with its Smalltalk influence ...and it's interesting to

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Gaius Hammond
On 12 Aug 2010, at 12:52, Hans Aberg wrote: its not for those that also installs standard distributions, it seems. But what's wrong with the binaries listed here: http://haskell.org/ghc/ Fairly easy to install. Yes and no; on OSX 10.5.8 it works better to install GHC from the binary

Re: [Haskell-cafe] ADT patch/update

2010-08-12 Thread Sergey Mironov
2010/8/8 Stephen Tetley : > Maybe this paper is close? > > Type-safe diff for families of datatypes > Eelco Lempsink Sean Leather Andres Löh > Thanks a lot! Just what I need.. and more trickier than I thought. They represent any ADT as a tree and use diff algorithm for trees to build 'EditScripts'

Re: [Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
Sebastian Fischer wrote: >    process _ = error "output: hClose: illegal operation (handle is > finalized)" Haha, very good! But I'm thinking of a case where GHC really does print out the error message. -Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread Daniel Peebles
The existential is a pair where one component is a type, and the type of the second component depends on the value (i.e., which type went in the first component) of the first. It's often called a sigma type when you have full dependent types. So your exists a. (Int -> a) -> [Int] -> [a] type might

[Haskell-cafe] universal quantification is to type instantiations as existential quantification is to what

2010-08-12 Thread Joshua Ball
Hi, If I have a universally quantified type mapInt :: forall a. (Int -> a) -> [Int] -> [a] I can instantiate that function over a type and get a beta-reduced version of the type mapInt [String] :: (Int -> String) -> [Int] -> [String] (I'm borrowing syntax from Pierce here since I don't think H

Re: [Haskell-cafe] hackage.haskell.org cannot be accessed?

2010-08-12 Thread Christopher Done
We can only be so immutable. ;-) /groan On 12 August 2010 17:50, Don Stewart wrote: > ivan.miljenovic: >> On 12 August 2010 16:45, Magicloud Magiclouds >> wrote: >> > Hi, >> >  Today I found out that I cannot access hackage.haskell.org. I have >> > tried vpn/proxy to see if my network has someth

Re: [Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread Sebastian Fischer
Give a definition for process and an input file that reproduce this result. Quite probably not the intended solution: process :: String -> String process _ = error "output: hClose: illegal operation (handle is finalized)" Have fun! Sebastian -- Underestimating the novelty of th

Re: [Haskell-cafe] hackage.haskell.org cannot be accessed?

2010-08-12 Thread Don Stewart
ivan.miljenovic: > On 12 August 2010 16:45, Magicloud Magiclouds > wrote: > > Hi, > >  Today I found out that I cannot access hackage.haskell.org. I have > > tried vpn/proxy to see if my network has something wrong. No luck. > > http://downforeveryoneorjustme.com/http://hackage.haskell.org agrees

Re: [Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread Pierre-Etienne Meunier
Hi, readFile is lazy IO, so the unsafePerformIO or equivalents are already there. It should be enough to invent a strict process function, but which ghc 6.12.3 isn't able to figure out that it is strict. Does it still work with : writeFile "output" $! process inp This raises another question :

[Haskell-cafe] A GHC error message puzzle

2010-08-12 Thread Yitzchak Gale
The file "error_puzzle.hs" begins like this: main = do inp <- readFile "input" writeFile "output" $ process inp process :: String -> String When compiled with GHC 6.12.3 and run, it gives the following result: $ ./error_puzzle error_puzzle: output: hClose: illegal operation (handle is final

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Hans Aberg
On 12 Aug 2010, at 14:08, Ozgur Akgun wrote: On http://wiki.github.com/mxcl/homebrew/installation it says: delete /usr/local/include and/usr/local/lib So its not for those that also installs standard distributions, it seems. I thought this was just a recommendation. It also says: We’ve

[Haskell-cafe] Workshop on ML 2010 - Call for Participation

2010-08-12 Thread Matthew Fluet
The 2010 ACM SIGPLAN Workshop on ML http://www.cs.rit.edu/~mtf/ml2010 Baltimore, Maryland, United States Sunday, September 26, 2010 co-located with ICFP 2010 Call for Participat

Re: [Haskell-cafe] Is there a pure Haskell gzip/bzip compression module out there?

2010-08-12 Thread C K Kashyap
It's for a purely academic purpose :) On Thu, Aug 12, 2010 at 5:30 PM, Yuras Shumovich wrote: > 2010/8/12 Max Bolingbroke : > > On 12 August 2010 12:10, C K Kashyap wrote: > > > http://hackage.haskell.org/packages/archive/zlib/0.4.0.2/doc/html/Codec-Compression-GZip.html > > It is not pure haske

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Ozgur Akgun
On 12 August 2010 12:52, Hans Aberg wrote: > On > http://wiki.github.com/mxcl/homebrew/installation > it says: > delete /usr/local/include and/usr/local/lib > So its not for those that also installs standard distributions, it seems. > I thought this was just a recommendation. -- Ozgur Akgun

Re: [Haskell-cafe] Is there a pure Haskell gzip/bzip compression module out there?

2010-08-12 Thread Yuras Shumovich
2010/8/12 Max Bolingbroke : > On 12 August 2010 12:10, C K Kashyap wrote: > http://hackage.haskell.org/packages/archive/zlib/0.4.0.2/doc/html/Codec-Compression-GZip.html It is not pure haskell implementation. As I know there are no pure implementation. But why not to use binding to foreign libra

Re: [Haskell-cafe] Is there a pure Haskell gzip/bzip compression module out there?

2010-08-12 Thread Max Bolingbroke
On 12 August 2010 12:10, C K Kashyap wrote: > I looked at Hackage and found a couple of pure Haskell modules for > un-compression. Are there any for comression? I found Huffman compression - > but what I need is something that I can uncompress with standard tools. The zlib package provides GZip c

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Max Bolingbroke
On 12 August 2010 12:17, Ozgur Akgun wrote: > sounds good to me. where can I find the list of packages (or whatever they > call them in homebrew, formula?) available? Homebrew only makes available GHC and the Platform: http://github.com/mxcl/homebrew/blob/master/Library/Formula/ghc.rb http://git

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Hans Aberg
On 12 Aug 2010, at 12:49, Benedict Eastaugh wrote: On 11 August 2010 15:49, Ozgur Akgun wrote: Personally, I'd like to use the macports version, if the ghc version there was resonably recent (having 2 versions, a stable and an edge could be a good idea?) You could use Homebrew instead.

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Ozgur Akgun
sounds good to me. where can I find the list of packages (or whatever they call them in homebrew, formula?) available? On 12 August 2010 11:49, Benedict Eastaugh wrote: > On 11 August 2010 15:49, Ozgur Akgun wrote: > > > Personally, I'd like to use the macports version, if the ghc version > the

[Haskell-cafe] Is there a pure Haskell gzip/bzip compression module out there?

2010-08-12 Thread C K Kashyap
Hi All, I looked at Hackage and found a couple of pure Haskell modules for un-compression. Are there any for comression? I found Huffman compression - but what I need is something that I can uncompress with standard tools. -- Regards, Kashyap ___ Haske

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Benedict Eastaugh
On 11 August 2010 15:49, Ozgur Akgun wrote: > Personally, I'd like to use the macports version, if the ghc version there > was resonably recent (having 2 versions, a stable and an edge could be a > good idea?) You could use Homebrew instead. That has a fairly up-to-date version of GHC and the Ha

Re: [Haskell-cafe] On documentation

2010-08-12 Thread David Waern
2010/7/23 Ivan Miljenovic : > On 22 July 2010 18:33, David Waern wrote: > > [snip] > >> We currently only support concrete examples (i.e. unit tests), but the >> plan is to add support for QuickCheck properties. > > Would you have some kind of inbuilt time limit (similar to what mueval > has) for

Re: [Haskell-cafe] Accepting and returning polyvariadic functions

2010-08-12 Thread Will Jones
Hi Tillmann, That's worked a treat -- thanks ever so much :) Will On Wed, Aug 11, 2010 at 7:50 PM, Tillmann Rendel < ren...@mathematik.uni-marburg.de> wrote: > Will Jones wrote: > >> > f :: Int -> IO () >> > f = undefined >> >> > g :: Int -> Int -> IO () >> > g = undefined >> >> > h :: Int