Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Daniil Elovkov
2007/7/10, Andrew Coppin <[EMAIL PROTECTED]>: I stand in awe of people who actually understand what "universal" and "existential" actually mean... To me, these are just very big words that sound impressive. The following is only my own understanding, please correct me if it's totally wrong! (

[Haskell-cafe] Haskell and GnuPG?

2007-07-10 Thread Magnus Therning
Continuing my "life up-side-down"¹ I'm looking for a Haskell wrapper around GPGME. Is there such a beast? /M ¹) That's the life where I turn to Haskell before turning to Python. -- Magnus Therning (OpenPGP: 0xAB4DFBA4) [EMAIL PROTECTED] Jabber: [EMAIL PR

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Henning Thielemann
On Tue, 10 Jul 2007, Donald Bruce Stewart wrote: > These smaller NP problems really love the list monad. here's roconnor's > solution from #haskell: > > import Control.Monad > > menu = [("Mixed Fruit",215),("French Fries",275) >,("Side Salad",335),("Hot Wings",355) >

Re: [Haskell-cafe] Haskell and GnuPG?

2007-07-10 Thread Donald Bruce Stewart
magnus: > Continuing my "life up-side-down"? I'm looking for a Haskell wrapper > around GPGME. Is there such a beast? > Don't think there's such a binding yet. Would make a good contribution though! -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@ha

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Donald Bruce Stewart
lemming: > > On Tue, 10 Jul 2007, Donald Bruce Stewart wrote: > > > These smaller NP problems really love the list monad. here's roconnor's > > solution from #haskell: > > > > import Control.Monad > > > > menu = [("Mixed Fruit",215),("French Fries",275) > >,("Side Salad",335),

[Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Tony Morris
Is there a performance penalty to be paid when using CPS instead of pattern matching? CPS often "feels more concise" but I suspect that it incurs a cost because of the accumulating stack that pattern matching wouldn't. When you you use maybe :: b -> (a -> b) -> Maybe a -> b instead of pattern matc

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: > When you you use maybe :: b -> (a -> b) -> Maybe a -> b instead of > pattern matching a returned Maybe value? > > Is there something a bit more concrete on this issue? You mean, versus using 'case' or sugar for case? It'll just inline to the same code. For example: maybe 10 (\n -

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Tony Morris
Thanks Don, Is your explanation specific to maybe? Or does that apply to all functions? Suppose the following function for lists: f :: [a] -> b -> (a -> [a] -> b) -> b ...instead of pattern matching [] and (x:xs) Tony Morris http://tmorris.net/ Donald Bruce Stewart wrote: > tmorris: >> When

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Henning Thielemann
On Tue, 10 Jul 2007, Tony Morris wrote: > Is your explanation specific to maybe? Or does that apply to all functions? > > Suppose the following function for lists: > > f :: [a] -> b -> (a -> [a] -> b) -> b > > ...instead of pattern matching [] and (x:xs) A foldr without recursion. I use such fun

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: > Thanks Don, > Is your explanation specific to maybe? Or does that apply to all functions? > > Suppose the following function for lists: > > f :: [a] -> b -> (a -> [a] -> b) -> b > > ...instead of pattern matching [] and (x:xs) It really depends on the body of 'f'. If they're simple w

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
lemming: > > On Tue, 10 Jul 2007, Tony Morris wrote: > > > Is your explanation specific to maybe? Or does that apply to all functions? > > > > Suppose the following function for lists: > > > > f :: [a] -> b -> (a -> [a] -> b) -> b > > > > ...instead of pattern matching [] and (x:xs) > > A foldr

[Haskell-cafe] Re: GHC threads and SMP

2007-07-10 Thread Simon Marlow
Donald Bruce Stewart wrote: ninegua: replying to my own message... the behavior is only when -O is used during compilation, otherwise they both run on 2 cores but at a much lower (1/100) speed. Hmm, any change with -O2? Is the optimiser changing the code such that the scheduler doesn't get to

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Henning Thielemann
On Tue, 10 Jul 2007, Donald Bruce Stewart wrote: > lemming: > > > > On Tue, 10 Jul 2007, Tony Morris wrote: > > > > > Is your explanation specific to maybe? Or does that apply to all > > > functions? > > > > > > Suppose the following function for lists: > > > > > > f :: [a] -> b -> (a -> [a] ->

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Bruno Oliveira
Hello, On Tue, 10 Jul 2007 10:53:35 +0200 (MEST), Henning Thielemann wrote: >On Tue, 10 Jul 2007, Tony Morris wrote: >> Is your explanation specific to maybe? Or does that apply to all functions? >> >> Suppose the following function for lists: >> >> f :: [a] -> b -> (a -> [a] -> b) -> b >> >> .

Re: [Haskell-cafe] reading existential types

2007-07-10 Thread Andrea Rossato
On Mon, Jul 09, 2007 at 09:41:32PM +0100, Claus Reinke wrote: > i'm not sure i understand the problem correctly, but note that the branches > in 'readMT' have identical implementations, the only difficulty is > instantiating > them at different hidden types, so that they try the appropriate 'R

Re: [Haskell-cafe] "no-coding" functional data structures via lazyness

2007-07-10 Thread Janis Voigtlaender
Jonathan Cast wrote: On Tuesday 10 July 2007, Dave Bayer wrote: On Jul 9, 2007, at 6:52 PM, Donald Bruce Stewart wrote: bayer: Learning Haskell, the Prelude.ShowS type stood out as odd, exploiting the implementation of lazy evaluation to avoid explicitly writing an efficient concatenable li

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Malte Milatz
Justin Bailey: > I'm please to announce HCL 1.0 - a library for building command line > interfaces. [...] > Included with the library is a hangman game, so if nothing else you > can enjoy that. When building on Linux something gets confused because of filenames in Windows style. Namely, hangman be

[Haskell-cafe] Re: "no-coding" functional data structures via lazyness

2007-07-10 Thread apfelmus
Dave Bayer wrote: > Learning Haskell, the Prelude.ShowS type stood out as odd, exploiting > the implementation of lazy evaluation to avoid explicitly writing an > efficient concatenable list data structure. ShowS has nothing to do with lazy evaluation, the same trick can be done in a call-by-value

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Neil Mitchell
Hi When building on Linux something gets confused because of filenames in Windows style. Namely, hangman becomes hangman^M Your Cabal file should be in Unix format, i.e. without \r\n's in it, just \n's. Arguably this is either a Cabal bug, or something that Cabal-upload should be checking. Th

[Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-10 Thread wp
Hi all, I will soon be doing my last year in computer science. One part of our last year encompasses quite a big project which will go over 3 terms and will account for 3 modules (45 credits). I was thinking in doing something using functional languages (preferably Haskell, as it's the one I know

[Haskell-cafe] A really bad way to say "all isSpace"

2007-07-10 Thread Neil Mitchell
Hi, Reading through the code to read: read s = case [x | (x,t) <- reads s, ("","") <- lex t] of [x] -> x [] -> error "Prelude.read: no parse" _ -> error "Prelude.read: ambiguous parse" Reading through the code to lex, it appear that it will return [

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Jonathan Cast
On Tuesday 10 July 2007, Tony Morris wrote: > Thanks Don, > Is your explanation specific to maybe? Or does that apply to all functions? > > Suppose the following function for lists: > > f :: [a] -> b -> (a -> [a] -> b) -> b > > ...instead of pattern matching [] and (x:xs) Of course. GHC doesn't k

Re: [Haskell-cafe] Need for speed: the Burrows-Wheeler Transform

2007-07-10 Thread Carl Mäsak
Andrew (>): I was reading Wikipedia, and I found this: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform Maybe it would be a nice idea to add back one of the implementations of the transform to the Wikipedia article... just to show how a Haskell version can be shorter, more readable and

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Nicolas Frisby
This might be a feasible appropriation of the term "destructor". On 7/10/07, Bruno Oliveira <[EMAIL PROTECTED]> wrote: On Tue, 10 Jul 2007 10:53:35 +0200 (MEST), Henning Thielemann wrote: >On Tue, 10 Jul 2007, Tony Morris wrote: >A foldr without recursion. I use such functions frequently in orde

[Haskell-cafe] Sequence Classes

2007-07-10 Thread Jonathan Cast
I was just meditating on array fusion using streams, and list fusion using streams, and it struck me: the definition of the list functions over arrays is the same as that of the list functions over lists. From the ByteString paper, we get: map f = transformerBi (mapS f) foldr f z = consumerDn

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Jonathan Cast
On Tuesday 10 July 2007, Nicolas Frisby wrote: > This might be a feasible appropriation of the term "destructor". Co-constructor? Jonathan Cast http://sourceforge.net/projects/fid-core http://sourceforge.net/projects/fid-emacs ___ Haskell-Cafe mailing

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Bryan O'Sullivan
Neil Mitchell wrote: When building on Linux something gets confused because of filenames in Windows style. Namely, hangman becomes hangman^M Your Cabal file should be in Unix format, i.e. without \r\n's in it, just \n's. I'm surprised that our resident Windows hacker would advocate this, in

Re: [Haskell-cafe] Constraints on data-types, mis-feature?

2007-07-10 Thread Jim Apple
On 7/9/07, Jonathan Cast <[EMAIL PROTECTED]> wrote: GADTs don't change anything (at least, not the last time I checked). GHC (in HEAD, at least) eliminates this wart for any datatype declared with GADT syntax. http://www.haskell.org/ghc/dist/current/docs/users_guide/data-type-extensions.html#g

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Neil Mitchell
Hi > Your Cabal file should be in Unix format, i.e. without \r\n's in it, > just \n's. I'm surprised that our resident Windows hacker would advocate this, instead of a more tolerant approach to line ending conventions :-) Line endings should be one character long, they always should have been

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Tony Morris
Thanks for the explanations - fully understood. Tony Morris http://tmorris.net/ Jonathan Cast wrote: > On Tuesday 10 July 2007, Tony Morris wrote: >> Thanks Don, >> Is your explanation specific to maybe? Or does that apply to all functions? >> >> Suppose the following function for lists: >> >>

Re: [Haskell-cafe] reading existential types

2007-07-10 Thread Jim Apple
reading existentials (or gadts, for that matter) is an interesting problem. sometimes too interesting.. http://www.padsproj.org/ is a project that allows automated reading codde for even some dependently-typed data. Perhaps it has something to offer for automatic deriving of Read instances for

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Justin Bailey
On 7/10/07, Neil Mitchell <[EMAIL PROTECTED]> wrote: Your Cabal file should be in Unix format, i.e. without \r\n's in it, just \n's. Arguably this is either a Cabal bug, or something that Cabal-upload should be checking. I've uploaded a new version with LF only in the cabal file. Please let me

Re: [Haskell-cafe] Constraints on data-types, mis-feature?

2007-07-10 Thread Jonathan Cast
On Tuesday 10 July 2007, Jim Apple wrote: > On 7/9/07, Jonathan Cast <[EMAIL PROTECTED]> wrote: > > GADTs don't change anything (at least, not the last time I checked). > > GHC (in HEAD, at least) eliminates this wart for any datatype declared > with GADT syntax. > > http://www.haskell.org/ghc/dist

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Hugh Perkins
This is a compact solution, but it produces multiple permutations of the same solution, which increases runtime. I let it run for 10 seconds, then ctrl-c'd. Here's a solution that produces all 2 (or three, if you include Barbecue Sandwich) solutions instantly: Output: = *Xkcd287> go Menu 1

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Andrew Coppin
Stefan O'Rear wrote: On Mon, Jul 09, 2007 at 10:01:06PM +0100, Andrew Coppin wrote: Is it safe to install two versions of GHC at once? :-. Certainly. I have no less than twelve. [EMAIL PROTECTED]:~$ ls -l /usr/bin/ghc-6* /usr/local/bin/ghc-6* lrwxrwxrwx 1 root root 30 2007-05-26 08

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Andrew Coppin
Stefan O'Rear wrote: On Mon, Jul 09, 2007 at 09:57:14PM +0100, Andrew Coppin wrote: (BTW... How in the hell do you get symbols like that in plain ASCII??) You can't, but the most commonly used replacement for ASCII (Unicode-UTF8) supports them just fine. Wait... I thought Unicode was

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Neil Mitchell
Hi > The worst problem that comes of this is a slow loss of disk space, but > I don't think I'll ever be able to fill this 80G disk :) > ...OK...and when you tell GHC to compile something, exactly which compiler does it run? o_O It picks whichever one you have first on your $(PATH). On linux

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Andrew Coppin
Conor McBride wrote: Hi all It's true that some systems are better characterised as corecursive "coprograms", rather than as recursive "programs". This is not a popular or well-understood distinction. In my career as an advocate for total programming (in some carefully delineated fragment of a l

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Andrew Coppin
Neil Mitchell wrote: Hi ...OK...and when you tell GHC to compile something, exactly which compiler does it run? o_O It picks whichever one you have first on your $(PATH). ...right. Presumably this is isomorphic to "whichever one was installed the most recently"? (Oh, wait... IIRC, on Win

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Stefan O'Rear
On Tue, Jul 10, 2007 at 08:10:32PM +0100, Andrew Coppin wrote: > Neil Mitchell wrote: >>> ...OK...and when you tell GHC to compile something, exactly which >>> compiler does it run? o_O >> >> It picks whichever one you have first on your $(PATH). > > ...right. Presumably this is isomorphic to "whic

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Jonathan Cast
On Tuesday 10 July 2007, Andrew Coppin wrote: > Stefan O'Rear wrote: > > On Mon, Jul 09, 2007 at 09:57:14PM +0100, Andrew Coppin wrote: > >> (BTW... How in the hell do you get symbols like that in plain ASCII??) > > > > You can't, but the most commonly used replacement for ASCII > > (Unicode-UTF8)

[Haskell-cafe] Very freaky

2007-07-10 Thread Andrew Coppin
OK, so technically it's got nothing to do with Haskell itself, but... I was reading some utterly incomprehensible article in Wikipedia. It was saying something about categories of recursive sets or some nonesense like that, and then it said something utterly astonishing. By playing with the l

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Albert Y. C. Lai
Marc A. Ziegert wrote: i see only two solutions. let menu = [215, 275, 335, 355, 420, 580] let run x menu = [[c]|c<-menu,c==x]++[c:cs|c<-menu,c [[215,215,215,215,215,215,215],[215,355,355,580]] You are right, I saw many solutions but they were all equivalent to just those two. I did not avoid

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Stefan O'Rear
On Tue, Jul 10, 2007 at 08:08:52PM +0100, Andrew Coppin wrote: > Erm... Wait a sec... coroutines, comonads, coprograms, codata... what in > the name of goodness does "co" actually *mean* anyway?? Nothing. When mathematicians find a new thing completely unlike an OldThing, but related by some sym

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Hugh Perkins
On 7/8/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: I was wittering on about stream fusion and how great it is, and I got a message from Mr C++. (Mr C++ develops commercial games, and is obsessed with performance. For him, the only way to achieve the best performance is to have total control ov

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Creighton Hogg
On 7/9/07, Dan Piponi <[EMAIL PROTECTED]> wrote: On 7/8/07, Thomas Conway <[EMAIL PROTECTED]> wrote: > The basic claim appears to be that discrete mathematics is a bad > foundation for computer science. I suspect the subscribers to this > list would beg to disagree. Wearing my tin foil hat for

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Hugh Perkins
By the way, if you enjoy these problems, there are tons of these at topcoder.com I cant help thinking it'd be neat to have topcoder-like competitions for Haskell, either by pursuading topcoder to integrate support for Haskell, or hosting our own. ___ Ha

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Jonathan Cast
On Tuesday 10 July 2007, Andrew Coppin wrote: > OK, so technically it's got nothing to do with Haskell itself, but... Actually, it does: the basic technologies underlying Haskell (combinatory logic and the Hindley-Milner type system) were originally invented in the course of this stream of resea

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Creighton Hogg
On 7/9/07, Conor McBride <[EMAIL PROTECTED]> wrote: Hi all On 9 Jul 2007, at 06:42, Thomas Conway wrote: > I don't know if you saw the following linked off /. > > http://www.itwire.com.au/content/view/13339/53/ [..] > The basic claim appears to be that discrete mathematics is a bad > foundat

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Andrew Coppin
Albert Y. C. Lai wrote: You are right, I saw many solutions but they were all equivalent to just those two. I did not avoid permutation-induced redundancy. I was unsure how to eliminate that redundancy. After reading your algorithm, I see it. Here is my algorithm modified. In general, I find

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Stefan O'Rear
On Tue, Jul 10, 2007 at 08:19:53PM +0100, Andrew Coppin wrote: > OK, so technically it's got nothing to do with Haskell itself, but... > > I was reading some utterly incomprehensible article in Wikipedia. It was > saying something about categories of recursive sets or some nonesense like > that,

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Hugh Perkins <[EMAIL PROTECTED]> wrote: On 7/8/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: > I was wittering on about stream fusion and how great it is, and I got a > message from Mr C++. > > (Mr C++ develops commercial games, and is obsessed with performance. For > him, the

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Hugh Perkins
There's a good tutorial on pruning at: http://www.cs.nott.ac.uk/~gmh/book.html (Section "Slides", number 11) In general, I find this kind of stuff really hard to avoid... :-S ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Andrew Coppin
Jonathan Cast wrote: On Tuesday 10 July 2007, Andrew Coppin wrote: Wait... I thought Unicode was still an experimental prototype? Since when does it work in the real world?? Are you serious? Unicode has been a (more-or-less) working reality on Linux for several years now. . . La

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Neil Mitchell
Hi > It picks whichever one you have first on your $(PATH). ...right. Presumably this is isomorphic to "whichever one was installed the most recently"? (Oh, wait... IIRC, on Windoze the GHC installer doesn't actually add GHC to the PATH variable. You have to do it by hand...) It does. Thank

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Hugh Perkins
You're talking to someone who spent his teenage years doing assembler because that's what l33t games developers did, and I wanted to be like them. Sure, you can still find assembler around the place, but even l33t games developers dont use it any more. On 7/10/07, Alex Queiroz <[EMAIL PROTECTED]

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Last time I looked, everything treats "text" as being 8 bits per character. (Or, more commonly, 7, and if the MSB isn't 0, weird things happen...) That's why (for example) HTML has lots of weird constructs such as "…" in it, instead of

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Dan Piponi
On 7/10/07, Creighton Hogg <[EMAIL PROTECTED]> wrote: Okay Mr. Piponi, as a math geek I can't let that comment about the web slide without further explanation. Is it just the idea that coalgebras can capture the idea of side affects (a -> F a) or is there something more specific that you're thin

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Andrew Coppin
Stefan O'Rear wrote: On Tue, Jul 10, 2007 at 08:19:53PM +0100, Andrew Coppin wrote: So is this all a huge coincidence? Or have I actually suceeded in comprehending Wikipedia? Yup, you understood it perfectly. This is a rare event... I must note it on my calendar! o_O This is pre

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Alex Queiroz <[EMAIL PROTECTED]> wrote: Hallo, On 7/10/07, Hugh Perkins <[EMAIL PROTECTED]> wrote: > On 7/8/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: > > I was wittering on about stream fusion and how great it is, and I got a > > message from Mr C++. > > > > (Mr C++ develops comm

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Andrew Coppin
Dan Piponi wrote: First a quick bit of background on algebras. If F is a functor, an F-algebra is an arrow FX->X. For example if we choose FX = 1+X+X^2 (using + to mean disjoint union) then an F-algebra is a function 1+X+X^2->X. The 1->X part just picks out a constant, the image of 1. The X^2->X

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Dan Piponi
On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: But what does, say, "Maybe x -> x" say? Maybe X is the same as "True or X", where True is the statement that is always true. Remember that the definition is data Maybe X = Nothing | Just X You can read | as 'or', 'Just' as nothing but a wra

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Albert Y. C. Lai
Andrew Coppin wrote: Wait... I thought Unicode was still an experimental prototype? Since when does it work in the real world?? That myth is as old as "Haskell is an experimental prototype". "Old" as in "that's an old one". Windows has been well supporting Unicode since 2000. That is pretty

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Stefan O'Rear
On Tue, Jul 10, 2007 at 08:59:16PM +0100, Andrew Coppin wrote: >> http://haskell.org/haskellwiki/Curry-Howard-Lambek_correspondence might >> be interesting - same idea, but written for a Haskell audience. >> > > An interesting read - although again a little over my head. > > I find myself wonder

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: I highly doubt that. For two reasons: 1. People can only cling to unproductive and clumsy tools for so long (we don't write much assembly any more...). Capitalism works to ensure this; people who are willing to switch to more effic

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Andrew Coppin
Stefan O'Rear wrote: On Tue, Jul 10, 2007 at 08:08:52PM +0100, Andrew Coppin wrote: Erm... Wait a sec... coroutines, comonads, coprograms, codata... what in the name of goodness does "co" actually *mean* anyway?? Nothing. When mathematicians find a new thing completely unlike an OldTh

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Andrew Coppin
Stefan O'Rear wrote: On Tue, Jul 10, 2007 at 08:59:16PM +0100, Andrew Coppin wrote: I find myself wondering... A polymorphic type signature such as (a -> b) -> a -> b says "given that a implies b and a is true, b is true". But what does, say, "Maybe x -> x" say? Given that x may or ma

[Haskell-cafe] Re: Very freaky

2007-07-10 Thread Aaron Denney
On 2007-07-10, Dan Piponi <[EMAIL PROTECTED]> wrote: > On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: >> But what does, say, "Maybe x -> x" say? > > Maybe X is the same as "True or X", where True is the statement that > is always true. Remember that the definition is > > data Maybe X = Nothin

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Andrew Coppin
Albert Y. C. Lai wrote: Andrew Coppin wrote: Wait... I thought Unicode was still an experimental prototype? Since when does it work in the real world?? That myth is as old as "Haskell is an experimental prototype". "Old" as in "that's an old one". Windows has been well supporting Unicode si

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Alex Queiroz <[EMAIL PROTECTED]> wrote: Hallo, On 7/10/07, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: > > I highly doubt that. For two reasons: > 1. People can only cling to unproductive and clumsy tools for so long > (we don't write much assembly any more...). Capitalism works to

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Hugh Perkins
On 7/10/07, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: While I personally think that the productivity argument should be enough to "make the switch", the killer-app (the app that will kill C, that is :-)) is concurrency. C is just not a tractable tool to program highly concurrent programs, unle

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Dan Piponi
On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Stefan O'Rear wrote: > On Tue, Jul 10, 2007 at 08:08:52PM +0100, Andrew Coppin wrote: > >> Erm... Wait a sec... coroutines, comonads, coprograms, codata... what in >> the name of goodness does "co" actually *mean* anyway?? > Nothing. > When mat

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Andrew Coppin
Hugh Perkins wrote: Yeah I agree with this. C# totally rocks, but threading is an unsolved problem. I have repeatedly attempted to discover what C# actually is, all to no avail. Still, that probably means I don't need it... If you can get to the stage where you can get a non-optimized, rea

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Hugh Perkins wrote: > Yeah I agree with this. C# totally rocks, but threading is an > unsolved problem. I have repeatedly attempted to discover what C# actually is, all to no avail. Still, that probably means I don't need it... > If you can

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Andrew Coppin
Dan Piponi wrote: (I got lost somewhere with the levels of quotation there...) It's more specific than this. Coalgebra, cohomology, codata, comonads and so on derive their name from the fact that they can be described using category theory. In category theory you draw lots of diagrams with arrow

[Haskell-cafe] CGI test

2007-07-10 Thread Andrew Coppin
Greetings. Can somebody write a trivial (as in: small) program so I can test my CGI stuff without having to actually install and configure Apache? (Basically, I'd like something I can compile into a small binary, so when I double-click it, it will listen on port 80, and when it gets a HTTP r

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Hugh Perkins
We can consider three "families" of character sets: - ASCII: 127 characters, some of which are escape codes like "bell" etc - regional encodings: china uses GB2312, Europe uses ISO-8859-1, America uses ... something - unicode: UTF-8, UTF-16 The regional encodings are optimized for their region, a

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: That might eliminate the concurrency imperative (for a while!), but it doesn't adress the productivity point. My hypothesis is this: People don't like using unproductive tools, and if they don't have to, they won't. So you th

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Jon Harrop
On Tuesday 10 July 2007 21:02:45 Sebastian Sylvan wrote: > While I personally think that the productivity argument should be > enough to "make the switch", the killer-app (the app that will kill C, > that is :-)) is concurrency. C is just not a tractable tool to program > highly concurrent programs

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-10 Thread Dan Piponi
On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Sounds a lot like the Boolean duality principle. That is, in fact, very closely related. -- Dan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Dan Piponi
On 7/10/07, Dan Piponi <[EMAIL PROTECTED]> wrote: On 7/10/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: > But what does, say, "Maybe x -> x" say? Silly me. You reversed the arrows and I copied you. (Could it be something to do with the other conversation we were having?) I meant to say: So x -

[Haskell-cafe] function unique

2007-07-10 Thread Alexteslin
Hi, i am a beginner to Haskell and i have a beginner's question to ask. An exercise asks to define function unique :: [Int] -> [Int], which outputs a list with only elements that are unique to the input list (that appears no more than once). I defined a function with list comprehension which wor

Re: [Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-10 Thread Hugh Perkins
rpc layer, like .Net Remoting or ICE (but preferably without needing configuration/interface files) Course, if you know what you're doing, that's more like 1 week than one year, but you could do that and then see where it takes you. If you want something really challenging, rewrite OSMP ( http:/

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Alex Queiroz <[EMAIL PROTECTED]> wrote: Hallo, On 7/10/07, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: > > That might eliminate the concurrency imperative (for a while!), but it > doesn't adress the productivity point. My hypothesis is this: People > don't like using unproductive to

Re: [Haskell-cafe] function unique

2007-07-10 Thread Brent Yorgey
The problem with your second implementation is that elements which occur more than once will eventually be included, when the part of the list remaining only has one copy. For example: unique2 [1,1,2,4,1] = unique2 [1,2,4,1] = unique2 [2,4,1] = 2 : unique2 [4,1] = 2 : 4 : unique2 [1] = 2 : 4 : 1

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Andrew Coppin
Hugh Perkins wrote: There's a good tutorial on pruning at: http://www.cs.nott.ac.uk/~gmh/book.html (Section "Slides", number 11) In general, I find this kind of stuff really hard to avoid... :-S ...and indeed, countdown was what I was attemp

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Andrew Coppin
Sebastian Sylvan wrote: That might eliminate the concurrency imperative (for a while!), but it doesn't adress the productivity point. My hypothesis is this: People don't like using unproductive tools, and if they don't have to, they won't. When "the next mainstream language" comes along to "solv

Re: [Haskell-cafe] function unique

2007-07-10 Thread Alexteslin
I'v got it - it produces the right output. Thank you. Brent Yorgey wrote: > > The problem with your second implementation is that elements which occur > more than once will eventually be included, when the part of the list > remaining only has one copy. For example: > > unique2 [1,1,2,4,1] > =

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Andrew Coppin
Sebastian Sylvan wrote: On 10/07/07, Alex Queiroz <[EMAIL PROTECTED]> wrote: So you think we use C because we like it? :-) When this revolutionary tool of yours arrive that compiles Haskell to PIC devices, I'm gonna be the first to use it. No, you use it because you have to, there is ver

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Sebastian Sylvan wrote: > That might eliminate the concurrency imperative (for a while!), but it > doesn't adress the productivity point. My hypothesis is this: People > don't like using unproductive tools, and if they don't have to, they > wo

[Haskell-cafe] Floating phi, round and even Fibonnaci numbers

2007-07-10 Thread Brian L. Troutwine
I'm rather new to Haskell and need, in typical newbie style, a bit of help understanding the type system. The Nth even Fibonacci number, EF(n) can be defined by the recursive relation EF(0) = 2, EF(n) = [EF(n-1) * (phi**3)], where phi is the golden ratio and [] is the nearest integer function. An

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Sebastian Sylvan wrote: > On 10/07/07, Alex Queiroz <[EMAIL PROTECTED]> wrote: >> So you think we use C because we like it? :-) When this >> revolutionary tool of yours arrive that compiles Haskell to PIC >> devices, I'm gonna be the firs

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Jon Harrop
On Tuesday 10 July 2007 21:19:42 Andrew Coppin wrote: > Hugh Perkins wrote: > > Yeah I agree with this. C# totally rocks, but threading is an > > unsolved problem. > > I have repeatedly attempted to discover what C# actually is... Take Java. Make it Windows only. Fix some mistakes. Tweak performa

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Sebastian Sylvan
On 10/07/07, Jon Harrop <[EMAIL PROTECTED]> wrote: On Tuesday 10 July 2007 21:19:42 Andrew Coppin wrote: > Hugh Perkins wrote: > > Yeah I agree with this. C# totally rocks, but threading is an > > unsolved problem. > > I have repeatedly attempted to discover what C# actually is... Take Java. Ma

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Andrew Coppin
Jonathan Cast wrote: On Tuesday 10 July 2007, Andrew Coppin wrote: OK, so technically it's got nothing to do with Haskell itself, but... Actually, it does I rephrase: This isn't *specifically* unique to Haskell, as such. Now, Wikipedia seems to be suggesting something really rem

Re: [Haskell-cafe] Floating phi, round and even Fibonnaci numbers

2007-07-10 Thread Tim Chevalier
On 7/10/07, Brian L. Troutwine <[EMAIL PROTECTED]> wrote: I'm rather new to Haskell and need, in typical newbie style, a bit of help understanding the type system. The Nth even Fibonacci number, EF(n) can be defined by the recursive relation EF(0) = 2, EF(n) = [EF(n-1) * (phi**3)], where phi is

Re: [Haskell-cafe] CGI test

2007-07-10 Thread Jim Burton
Andrew Coppin wrote: > > Greetings. > > Can somebody write a trivial (as in: small) program so I can test my CGI > stuff without having to actually install and configure Apache? > > [...] > You could adapt the TCP server from this tutorial -> http://sequence.complete.org/node/258 Regards,

Re: [Haskell-cafe] Floating phi, round and even Fibonnaci numbers

2007-07-10 Thread haskell
Brian L. Troutwine wrote: phi :: (Floating t) => t phi = (1+sqrt(5))/2 even_fibs :: (Num t) => [t] even_fibs = iterate (\x -> round(x * (phi**3))) 2 *Main> :t iterate iterate :: forall a. (a -> a) -> a -> [a] *Main> :t round round :: forall a b. (RealFrac a, Integral b) => a -> b So the 'x

Re: [Haskell-cafe] Floating phi, round and even Fibonnaci numbers

2007-07-10 Thread haskell
But that also depended on phi defaulting to Double in even_fibs. To be clearer: even_fibs :: (Integral t) => [t] even_fibs = iterate (\x -> round(fromIntegral x * (dp**3))) 2 where dp :: Double dp = phi The above is equivalent to the previous. The below uses less precision: even

Re: [Haskell-cafe] Very freaky

2007-07-10 Thread Neil Davies
I means that you can view programming as constructing "witnesses" to "proofs" - programs becoming the (finite) steps that, when followed, construct a proof. Intuitionism only allows you to make statements that can be proved directly - no "Reductio ad absurdum" only good, honest to goodness constr

  1   2   >