[Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Tim Newsham
A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Feedback appreciated. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-17 Thread ntupel
On Sat, 2007-10-13 at 18:33 -0300, Isaac Dupree wrote: GHC StdGen's random and randomR are somewhat slow. I found that changing to a custom ((x*a + b) `mod` c) random-generator (instance of RandomGen) much sped things up (since nothing depended on the random numbers being good quality).

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-17 Thread Henning Thielemann
On Tue, 16 Oct 2007, Peter Verswyvelen wrote: Concurrent Clean uses the ~ symbol for unary negation. That's also a way of fixing it. Personally I could also live with allowing no space between the minus sign and the number... If you leave a space, - becomes the subtract operator. Me

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-17 Thread Peter Verswyvelen
Duh, you're right... silly me. I always put spaces between the operator, but many people of course don't. Isaac Dupree wrote: Peter Verswyvelen wrote: Personally I could also live with allowing no space between the minus sign and the number... If you leave a space, - becomes the subtract

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-17 Thread Peter Verswyvelen
Yes, I guessed it would. Actually logging all those discussions is a good idea: I will make a wiki page containing all the discussions I have with my wife, and then - at the start of a new discussion - I can redirect her to the wiki page. Problem solved, no energy wasted ;-) Okay,

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Simon Marlow
Donn Cave wrote: On Oct 16, 2007, at 9:52 PM, Brandon S. Allbery KF8NH wrote: On Oct 17, 2007, at 0:39 , Donn Cave wrote: ... As for closing file descriptors explicitly - if I remember right what I've seen in the NetBSD source, the UNIX popen() implementation may years ago have closed all

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Simon Marlow
Donn Cave wrote: On Oct 16, 2007, at 1:48 PM, John Goerzen wrote: I have been trying to implement a Haskell-like version of shell pipelines using runInteractiveProcess. I am essentially using hGetContents to grab the output from one command, and passing that to (forkIO $ hPutStr) to write

Re: [Haskell-cafe] Re: Proposal: register a package asprovidingseveral API versions

2007-10-17 Thread Simon Marlow
Claus Reinke wrote: the idea was for the cabal file to specify a single provided api, but to register that as sufficient for a list of dependency numbers. so the package would implement the latest api, but could be used by clients expecting either the old or the new api. I don't see how that

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Simon Marlow
Neil Mitchell wrote: Hi I agree. = 1.0 isn't viable in the long term. Rather, a specific list, or bounded range of tested versions seems likely to be more robust. In general, if it compiles and type checks, it will work. It is rare that an interface stays sufficiently similar that the thing

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Andrea Rossato
On Tue, Oct 16, 2007 at 08:03:52PM -1000, Tim Newsham wrote: A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Feedback appreciated. Very clear and useful for me. Thank you for sharing it. Andrea

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Neil Mitchell
Hi In general, if it compiles and type checks, it will work. It is rare that an interface stays sufficiently similar that the thing compiles, but then crashes at runtime. Given that, shouldn't the tested versions be something a machine figures out - rather than something each library

[Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Big_Ham
Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would return [2,1] I couldn't find anything on a search, or anything in the librarys. Thanks BH. -- View this message in

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Stefan Holdermans
BH, Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would return [2,1] freq xs = map length (group xs) HTH, Stefan ___

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Dougal Stanton
On 17/10/2007, Big_Ham [EMAIL PROTECTED] wrote: Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would return [2,1] I couldn't find anything on a search, or anything in

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread Yitzchak Gale
John Meacham wrote: if anyone is interested, Although I bet this has been implemented a hundred times over, I have attached my lazy naturals module below just for larks. Nice, lots of fun! Wouldn't it be more convenient to allow them to be signed? True, you can't have laziness in certain

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread Stuart Cook
On 10/17/07, John Meacham [EMAIL PROTECTED] wrote: if anyone is interested, Although I bet this has been implemented a hundred times over, I have attached my lazy naturals module below just for larks. It is quite efficient as such things go and very lazy. for instance (genericLength xs 5)

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Dougal Stanton
On 17/10/2007, Dougal Stanton [EMAIL PROTECTED] wrote: No, but it is also trivial to create, with the 'group' function in Data.List. I'll stop there though, cos this could be a homework question. It's just occurred to me that answering questions like these is a bit like the prisoner's

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Big_Ham
you are indeed right Peter, that's what I was after, the frequency regardless of elements. It also doesn't matter if it outputs them as tuples, or as a separate list on their own because each value would belong to the first occurance of that element if you seem what I mean, so you could still

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Yitzchak Gale
Tim Newsham wrote: A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Nice! Perhaps you should add a link to this on the wiki: http://haskell.org/haskellwiki/Curry-Howard-Lambek_correspondence Thanks, Yitz

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Yitzchak Gale
Dougal Stanton wrote: It's just occurred to me that answering questions like these is a bit like the prisoner's dilemma... There's no way to win! :-) Yes there is. Just mention the following wiki page as part of your answer: http://haskell.org/haskellwiki/Homework_help -Yitz

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Stuart Cook
On 10/17/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: So in that case, the result should be a list of ordered pairs like: [(egg, 2), (cheese, 1)]. Or a pair of two lists, like ([egg, cheese), (2,1)]. Otherwise you would not know which frequency belongs to which element? However, I suspect

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Peter Verswyvelen
I'm a newbie here, so I'm not sure about my reply, but I think this is not the answer to his question. freq [egg, egg, cheese] indeed returns [2,1] but freq [egg, cheese, egg] returns [1,1,1] BH just mentioned he needed the frequenty of elements in the list, independent of their order. So

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Yitzchak Gale
Peter Verswyvelen wrote: However, I suspect the experts here will be able to make that much shorter and more efficient (maybe using Data.Map?) That makes it difficult to respond. I am definitely not claiming to be an expert. For one thing, my name is not Simon. But I'll say something anyway,

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Krzysztof Kościuszkiewicz
Tim, I have also enjoyed the article, it's well written and easy enough to follow (at least for me). Slightly offtopic - I am curious about the use of forall in some type signatures: subsume :: forall p q r. Prop (p := q) - Prop ((p :/\ q) :== p) subsume pIMPq = equivInj (impInj pq2p) (impInj

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Peter Verswyvelen
Nice!!! As I'm learning Arrows now, this is really useful :-) Stuart Cook wrote: import Control.Arrow import Data.List freqs = map (head length) . group . sort I have used this function quite a few times already. Stuart ___ Haskell-Cafe

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Yitzchak Gale
I wrote: When you can assume Ord, the standard solution is, as you suggest, something like... Oops, sorry, doesn't typecheck. Here it is corrected: import qualified Data.Map as M import Data.List histogram = M.toList . foldl' (\m x - M.insertWith' (+) x 1 m) M.empty This should work

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Simon Marlow
I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy It turned out there was a previous page written by Bulat that contained essentially this policy, but it wasn't linked from anywhere which explains why it was overlooked. I

[Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-17 Thread ajb
[Ccing to haskell-cafe; please direct any replies there instead of haskell] G'day all. First of all, once again well done to Sascha on a great tool. Just a few comments. Quoting Janis Voigtlaender [EMAIL PROTECTED]: - support for type classes (e.g., enter elem and note the generated

Re: [Haskell-cafe] Re: Proposal: register a package asprovidingseveralAPI versions

2007-10-17 Thread Claus Reinke
the idea was for the cabal file to specify a single provided api, but to register that as sufficient for a list of dependency numbers. so the package would implement the latest api, but could be used by clients expecting either the old or the new api. I don't see how that could work. If the

Re: [Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

2007-10-17 Thread Janis Voigtlaender
[EMAIL PROTECTED] wrote: Some of these respects-restrictions arent as useful as they might be, because they don't take into account easily-predictable invariants. For example, the type: (Eq a) = [a] - [a] generates the following restriction: g respects Eq if forall x :: t1.

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread manu
The problem there is that nub is O(n^2). Is there a place where one can look up the complexity of Standard Libraries functions ? E.D ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Yitzchak Gale
Is there a place where one can look up the complexity of Standard Libraries functions ? No. Some modules have it in their Haddock docs. Most don't. But the source code is available. :) -Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Brandon S. Allbery KF8NH
On Oct 17, 2007, at 1:32 , Donn Cave wrote: On Oct 16, 2007, at 9:52 PM, Brandon S. Allbery KF8NH wrote: Either implementation causes problems; security folks tend to prefer that all file descriptors other than 0-2 (0-4 on Windows?) be closed, and 0-2(4) be forced open (on /dev/null if

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Vitaliy Akimov
Very clear tutorial indeed. But why isn't propCC shown as Pierce's Law? And Excluded middle is proven on such basis. Vitaliy. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Ian Lynagh
On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy This says: If [...] instances were added or removed, then the new A.B must be greater than the previous

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Ross Paterson
On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy It turned out there was a previous page written by Bulat that contained essentially this policy, but it wasn't

Re: [Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Donn Cave
On Wed, 17 Oct 2007, Brandon S. Allbery KF8NH wrote: ... Well, security folks (professional paranoids :) tend to consider passing anything other than standard file descriptors to arbitrary subprocesses to be a potential uncontrolled information leak. There *are* times when you want to

Re: [Haskell-cafe] Re: Proposal: register a package asprovidingseveralAPI versions

2007-10-17 Thread Simon Marlow
Claus Reinke wrote: a few examples, of the top of my head: - consider the base split in reverse: if functionality is only repackaged, the merged base would also provide for the previously separate sub-package apis (that suggests a separate 'provides:' field, though, as merely

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Donn Cave
On Wed, 17 Oct 2007, Simon Marlow wrote: ... Note that forkProcess doesn't currently work with +RTS -N2 (or any value larger than 1), and it isn't likely to in the future. I suspect forkProcess should be deprecated. The POSIX spec is pretty strict about what system calls you can make in

Re: [Haskell-cafe] Re: Proposal: register a packageasprovidingseveralAPI versions

2007-10-17 Thread Claus Reinke
if that is your definition of compatible, you can never throw any packages away Is this a problem? apparently, yes. no two versions of base with ghc, only the newest set of core packages with each ghc release. and how much time do you want to spend on finding, re-building, and re-installing

[Haskell-cafe] Re: Proposal: register a package asprovidingseveralAPI versions

2007-10-17 Thread ChrisK
I disagree with Simon Marlow here. In practice I think Claus' definition of compatible is good enough: Simon Marlow wrote: Claus Reinke wrote: - consider adding a new monad transformer to a monad transformer library, or a new regex variant to a regex library - surely the new package

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Tim Newsham
Slightly offtopic - I am curious about the use of forall in some type signatures: If you specify the forall p q at the top level then the types used internally will use the same p and q. Otherwise the internal types will be new ps and qs and wont line up with the outer type declaration.

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Tim Newsham
Very clear tutorial indeed. But why isn't propCC shown as Pierce's Law? And Excluded middle is proven on such basis. Simply because I don't know that much about pierce's law. I've seen it mentioned a few times, but I'm not that familiar with it yet and I haven't read a good treatment of it

[Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Chad Scherrer
Big_Ham joymachine2001 at hotmail.com writes: Is there a library function to take a list of Strings and return a list of ints showing how many times each String occurs in the list. So for example: [egg, egg, cheese] would return [2,1] I couldn't find anything on a search, or

[Haskell-cafe] generic programming tutorial?

2007-10-17 Thread Greg Meredith
Haskellians, i feel like i'm chasing a rabbit down the rabbit hole, but here goes. i'm currently redoing my implementation of an evaluator for a reflective process calculus, using Haskell instead of OCaml, this time. i thought i'd give a James Cheney's FreshLib a whirl to - test out the state

Re: [Haskell-cafe] Functional Programming Books

2007-10-17 Thread Gour
On Tue, 16 Oct 2007 14:23:31 -0700 Don Stewart [EMAIL PROTECTED] wrote: Is on my wishlist :) Here is my wishlist: http://book.realworldhaskell.org/ :-) Sincerely, Gour signature.asc Description: PGP signature ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Suspected stupid Haskell Question

2007-10-17 Thread Dan Weston
Oh, why didn't you say you were learning Arrows? Then why not freqs = sort group map (head length) So much more readable, don't you think? ;) Either way, if you run into the dreaded monomorphism restriction: Ambiguous type variable `a' in the constraint: `Ord a' arising from use

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Lennart Augustsson
Check Wikipedia. Peirce law, law of excluded middle, double negation, ... they are all equivalent and it can be instructive to see how one can derive one from the other. On 10/17/07, Tim Newsham [EMAIL PROTECTED] wrote: Very clear tutorial indeed. But why isn't propCC shown as Pierce's Law?

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread Lennart Augustsson
The one in the numbers package is not quite as clever as John's; it's the naïve version of lazy naturals. On 10/17/07, Stuart Cook [EMAIL PROTECTED] wrote: On 10/17/07, John Meacham [EMAIL PROTECTED] wrote: if anyone is interested, Although I bet this has been implemented a hundred times

Re: [Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Daniel McAllansmith
On Thursday 18 October 2007 00:54, Simon Marlow wrote: I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy Is there technical reason for the major version number to consist of 2 components? Why not 3, 17 or (my preference)

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread Andrew Coppin
Hugh Perkins wrote: You're picking on Andrew Coppin? That's insane. He's got a sense of humour, and he's a lay (non-phd) person. Honestly, in one thread you've got Haskell is misunderstood! Its the greatest language in the world! Why does no-one use it and in another you're insulting one

[Haskell-cafe] Pixel plotter

2007-10-17 Thread Andrew Coppin
http://darcs.haskell.org/~lemmih/hsSDL/ http://darcs.haskell.org/%7Elemmih/hsSDL/ How do I use this? I've seen instructions floating around somewhere that if a library has a Setup.hs, you're supposed to do runhaskell Setup configure runhaskell Setup build runhaskell Setup install

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread John Goerzen
On 2007-10-17, Simon Marlow [EMAIL PROTECTED] wrote: Note that forkProcess doesn't currently work with +RTS -N2 (or any value larger than 1), and it isn't likely to in the future. I suspect forkProcess should be deprecated. That would be most annoying, and would render HSH unable to

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread John Goerzen
On 2007-10-17, Simon Marlow [EMAIL PROTECTED] wrote: they set FD_CLOEXEC or not. Would someone like to create a bug report? http://hackage.haskell.org/trac/ghc/ticket/1780 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread Brent Yorgey
Well anyway, as you can see, I'm back. Mainly because I have questions that I need answers for... glad you're back. =) This mailing list is the only place I know of that is inhabited by people who actually think Haskell is something worth persuing. don't forget about the IRC channel!

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread Felipe Lessa
On 10/17/07, Andrew Coppin [EMAIL PROTECTED] wrote: it. And it frustrates the hell out of me that 100% of the human population consider Haskell to be an irrelevant joke language. So I basically have this uncontrollably awsome thing in front of me that I spend all my time and energy interacting

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Dan Weston
That is a great tutorial. Thanks! But in the last two sentences of the introduction you say: We just need to find any program with the given type. The existence of a program for the type will be a proof of the corresponding proposition! Maybe you should make explicit that 1) the type is

Re: [Haskell-cafe] Pixel plotter

2007-10-17 Thread Bit Connor
There should be a WIN32 file with instructions for installing on windows. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Stack overflow in ghci

2007-10-17 Thread Tim Chevalier
On 10/17/07, Maurí­cio [EMAIL PROTECTED] wrote: Hi, I get this error message when testing a function in ghci: *** Exception: stack overflow I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say

[Haskell-cafe] Stack overflow in ghci

2007-10-17 Thread Maurí­cio
Hi, I get this error message when testing a function in ghci: *** Exception: stack overflow I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say something to ghci if I want it to use all available

[Haskell-cafe] building hslogger

2007-10-17 Thread Chris Hayden
Hello! I'm trying to build the most recent version of hslogger and have run into some issues. Below is the error message I receive. (I see that the same error has come up elsewhere: http://haskell.galois.com/packages/archive/hslogger/1.0.2/log). The hslogger

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Dan Weston
Also, I was wondering if the constructor and/or function arguments should be marked strict. Otherwise, types can be inhabited by defined arguments. Since Prop is not strict in its argument, we could have the (false) theorem andAlwaysTrue :: forall p q . p :/\ q andAlwaysTrue p q = And (Prop

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread jerzy . karczmarczuk
Felipe Lessa writes: On 10/17/07, Andrew Coppin [EMAIL PROTECTED] wrote: ... And it frustrates the hell out of me that 100% of the human population consider Haskell to be an irrelevant joke language. ... I feel this way as well, specially because one of the teachers here tell all students

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread jerzy . karczmarczuk
Tim Newsham writes: A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Feedback appreciated. Did I miss it (then I apologize), or that tutorial doesn't even mention Djinn (in which case the Author should). Jerzy Karczmarczuk

[Haskell-cafe] Re: New slogan for haskell.org

2007-10-17 Thread Maurí­cio
Nervous? Anxious? You found an irreproducable bug in your program and have to fix it until tomorrow? You feel that your code needs essential cleanup, but you postponed it for long in order to not introduce new bugs? You can hardly maintain the code as it grows and grows? Pause a

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread Felipe Lessa
On 10/17/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: We shall thus understand that a teacher who likes Fibonacci, is a representant of of the 100% of the human population. Sorry if I didn't understand very well the tone of your message or if I wasn't clear enough, however what I was trying

Re: [Haskell-cafe] Stack overflow in ghci

2007-10-17 Thread Brent Yorgey
On 10/17/07, Maurí­cio [EMAIL PROTECTED] wrote: Hi, I get this error message when testing a function in ghci: *** Exception: stack overflow I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread jerzy . karczmarczuk
Felipe Lessa writes: On 10/17/07, [EMAIL PROTECTED] We shall thus understand that a teacher who likes Fibonacci, is a representant of of the 100% of the human population. Sorry if I didn't understand very well the tone of your message or if I wasn't clear enough, however what I was trying to

[Haskell-cafe] ANNOUNCE: xmonad 0.4

2007-10-17 Thread Don Stewart
The xmonad dev team is pleased to announce the 0.4 release of xmonad! http://xmonad.org xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximising screen use. Window manager features are

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread John Meacham
On Wed, Oct 17, 2007 at 12:41:54PM +0200, Yitzchak Gale wrote: John Meacham wrote: if anyone is interested, Although I bet this has been implemented a hundred times over, I have attached my lazy naturals module below just for larks. Nice, lots of fun! Wouldn't it be more convenient to

[Haskell-cafe] Re: ANNOUNCE: xmonad 0.4

2007-10-17 Thread Maurí­cio
Don Stewart escreveu: The xmonad dev team is pleased to announce the 0.4 release of xmonad! http://xmonad.org That seems great. Is it possible to use it in a Gnome environment (for instance, my Ubuntu desktop)? Maurício

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread John Meacham
On Wed, Oct 17, 2007 at 09:16:47PM +0100, Lennart Augustsson wrote: The one in the numbers package is not quite as clever as John's; it's the naïve version of lazy naturals. it appears to also be left biased in general, mine are symmetric and commutative whenever possible and things like its

Re: [Haskell-cafe] Re: ANNOUNCE: xmonad 0.4

2007-10-17 Thread Don Stewart
briqueabraque: Don Stewart escreveu: The xmonad dev team is pleased to announce the 0.4 release of xmonad! http://xmonad.org That seems great. Is it possible to use it in a Gnome environment (for instance, my Ubuntu desktop)? Initial support for all the

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread David Benbennick
This module doesn't appear to be very lazy to me. For example, in ghci, *Util.LazyNum List genericLength (1:2:undefined) (1 :: Nat) *** Exception: Prelude.undefined How is this module intended to be used? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread John Meacham
On Wed, Oct 17, 2007 at 05:43:08PM -0700, David Benbennick wrote: This module doesn't appear to be very lazy to me. For example, in ghci, *Util.LazyNum List genericLength (1:2:undefined) (1 :: Nat) *** Exception: Prelude.undefined How is this module intended to be used? Oops, sorry, the

Re: [Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-17 Thread Stefan O'Rear
On Wed, Oct 17, 2007 at 08:46:41AM -0700, Donn Cave wrote: On Wed, 17 Oct 2007, Simon Marlow wrote: ... Note that forkProcess doesn't currently work with +RTS -N2 (or any value larger than 1), and it isn't likely to in the future. I suspect forkProcess should be deprecated. The

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-17 Thread Dipankar Ray
i fear that, at this point, this thread is a test: if I post a reply, it shows that I am a fool. ah well. JK, of course there are foolish teachers out there. I don't think Felipe was suggesting that this teacher had the right idea, nor that he himself was going to stop haskelling anytime

Re: [Haskell-cafe] Strange subtract operator behavior - and lazy naturals

2007-10-17 Thread David Benbennick
On 10/17/07, John Meacham [EMAIL PROTECTED] wrote: Oops, sorry, the version I posted was an intermediate one that had a different addition algorithm. here is a better one that fixes that issue: Zero + y = y Sum x n1 + y = Sum x (y + n1) note that it alternates the order in the recursive

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Stefan O'Rear
On Wed, Oct 17, 2007 at 03:06:33PM -0700, Dan Weston wrote: 2) the function must halt for all defined arguments fix :: forall p . (p - p) - p fix f = let x = f x in x consider: foo :: ((a - a) - a) - a foo x = x id foo is a valid proof of a true theorem, but does not halt for the defined

[Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread PR Stanley
Hi Do you trust mathematical materials on Wikipedia? Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Dan Weston
_|_ does not provide a witness to a theorem in any consistent logic (otherwise everything could be proved from it), yet it inhabits every type in Haskell. If the only invalid type instance is _|_, then a necessary and sufficient test for the C-H correspondence be the existence of a type

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Thomas Hartman
Since I'm interested in the stack overflow issue, and getting acquainted with quickcheck, I thought I would take this opportunity to compare your ordTable with some code Yitzchak Gale posted earlier, against Ham's original problem. As far as I can tell, they're the same. They work on lists up

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Dan Weston
It would seem that this induction on SN requires strictness at every stage. Or am I missing something? Stefan O'Rear wrote: On Wed, Oct 17, 2007 at 03:06:33PM -0700, Dan Weston wrote: 2) the function must halt for all defined arguments fix :: forall p . (p - p) - p fix f = let x = f x in x

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Stefan O'Rear
On Wed, Oct 17, 2007 at 06:45:04PM -0700, Dan Weston wrote: _|_ does not provide a witness to a theorem in any consistent logic (otherwise everything could be proved from it), yet it inhabits every type in Haskell. If the only invalid type instance is _|_, then a necessary and sufficient

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Stefan O'Rear
On Thu, Oct 18, 2007 at 02:31:10AM +0100, PR Stanley wrote: Hi Do you trust mathematical materials on Wikipedia? Paul Yes, unless they look like they were written by a crackpot. It's kinda hard to introduce errors when any sufficiently unobvious fact is accompanied by a proof sketch. Stefan

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Dan Piponi
The mathematics is probably the most reliable part of Wikipedia. -- Dan On 10/17/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Do you trust mathematical materials on Wikipedia? Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Dan Weston
I find the mathematics is more accurate on http://www.conservapedia.com Their facts get checked by the Almighty Himself! ;) Dan Piponi wrote: The mathematics is probably the most reliable part of Wikipedia. -- Dan On 10/17/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Do you trust mathematical

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Stefan O'Rear
On Wed, Oct 17, 2007 at 06:49:24PM -0700, Dan Weston wrote: It would seem that this induction on SN requires strictness at every stage. Or am I missing something? Yes you are missing something. Whether it exists in my message is less certain. First, note that the elements of SN[a] are

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Dipankar Ray
I like wikipedia for mathematics quite a lot. However, I thought I might direct attention to the in-progress Princeton Companion to Mathematics: http://gowers.wordpress.com/2007/09/06/hello-world/ On Wed, 17 Oct 2007, Dan Weston wrote: I find the mathematics is more accurate on

Re: [Haskell-cafe] Re: Suspected stupid Haskell Question

2007-10-17 Thread Chad Scherrer
Hmm, is insertWith' new? If I remember right, I think the stack overflows were happening because Map.insertWith isn't strict enough. Otherwise I think the code is the same. But I would expect intTable to be faster, since it uses IntMap, and there's no IntMap.insertWith' as of 6.6.1 (though it may

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Brandon S. Allbery KF8NH
On Oct 17, 2007, at 22:25 , Dan Weston wrote: I find the mathematics is more accurate on http://www.conservapedia.com Their facts get checked by the Almighty Himself! ;) I Kings 7:23? :p -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED] system administrator

[Haskell-cafe] Functional specification of DFS

2007-10-17 Thread Vimal
Hello Haskellers, Yesterday, my professor had asked this question in a quiz: Give a functional description of Depth First Search on a graph G. Use lisp. The first thing I wrote was: Let DFS(G, root) return the list of edges in the dfs spanning tree of G, rooted at root. Let n = |V| in: :) The

Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-17 Thread Nicolas Frisby
It is truly irresponsible to post such interesting links on a mailing list! :) I resent and thank you for the last couple hours. On 10/17/07, Dan Weston [EMAIL PROTECTED] wrote: I find the mathematics is more accurate on http://www.conservapedia.com Their facts get checked by the Almighty