[Haskell-cafe] Re: [Haskell] [Fwd: undecidable & overlapping instances: a bug?]

2007-10-18 Thread Mark P Jones
[Sorry, I guess this should have been in the cafe ...] Simon Peyton-Jones wrote: The trouble is that a) the coverage condition ensures that everything is well behaved b) but it's too restrictive for some uses of FDs, notably the MTL library c) there are many possibilities for more generous condi

[Haskell-cafe] Class invariants/laws

2007-10-18 Thread Janis Voigtlaender
Ryan Ingram wrote: These invariants are basically impossible to enforce by the compiler, but nonetheless certain classes have laws which are expected to hold, and I would not be surprised if (for example) GHC optimization RULES depended on them. I, in fact, would be surprised if there were suc

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

2007-10-18 Thread Bertram Felgenhauer
Thomas Hartman wrote: > 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

[Haskell-cafe] Re: [Haskell] [Fwd: undecidable & overlapping instances: a bug?]

2007-10-18 Thread Martin Sulzmann
Mark P Jones writes: > [Sorry, I guess this should have been in the cafe ...] > > Simon Peyton-Jones wrote: > > The trouble is that > > a) the coverage condition ensures that everything is well behaved > > b) but it's too restrictive for some uses of FDs, notably the MTL library > > c) ther

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

2007-10-18 Thread ajb
G'day all. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: Okay, it is quite natural to take this stand. But as you say, there is no such commitment in the language definition. And even if there were, I doubt it would be possible to enforce such invariants in a compiler. So there would be "ille

[Haskell-cafe] Re: [Haskell] [Fwd: undecidable & overlapping instances: a bug?]

2007-10-18 Thread Martin Sulzmann
Sorry, forgot to add [2] http://www.comp.nus.edu.sg/~sulzmann/publications/jfp-fds-revised.pdf Martin Martin Sulzmann writes: > Mark P Jones writes: > > [Sorry, I guess this should have been in the cafe ...] > > > > Simon Peyton-Jones wrote: > > > The trouble is that > > > a) the c

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

2007-10-18 Thread Gour
On Wed, 17 Oct 2007 21:59:41 +0100 Andrew Coppin <[EMAIL PROTECTED]> wrote: > Well anyway, as you can see, I'm back. Mainly because I have > questions that I need answers for... Welcome back ;) > This mailing list is the only place I know of that is inhabited by > people who actually think Haske

[Haskell-cafe] Class invariants/laws

2007-10-18 Thread Janis Voigtlaender
[EMAIL PROTECTED] wrote: Agreed. I was about to answer that the situation is the same with the monad laws not being valid for some monad we all love, and still we do not consider the resulting programs illegal. I do! The H98 report says that all Monad instances must obey the monad laws. If t

[Haskell-cafe] Re: [Haskell] [Fwd: undecidable & overlapping instances: a bug?]

2007-10-18 Thread Iavor Diatchki
Hello, I believe that this "weak coverage condition" (which is also called "the dependency condition" somewhere on the wiki) is exactly what GHC 6.4 used to implement but than in 6.6 this changed. According to Simon's comments on the trac ticket, this rule requires FDs to be "full" to preserve th

[Haskell-cafe] RE: [Haskell] [Fwd: undecidable & overlapping instances: a bug?]

2007-10-18 Thread Simon Peyton-Jones
| I believe that this "weak coverage condition" (which is also called | "the dependency condition" somewhere on the wiki) is exactly what GHC | 6.4 used to implement but than in 6.6 this changed. According to | Simon's comments on the trac ticket, this rule requires FDs to be | "full" to preserve

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

2007-10-18 Thread Ketil Malde
Daniel McAllansmith <[EMAIL PROTECTED]> writes: > 3. Otherwise, major.minor MUST remain the same (other version components MAY > change). Is it an option to say SHOULD rather than MUST here? There are other reasons for a version bump than breaking compatibility. -k -- If I haven't seen furthe

RE: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread Simon Peyton-Jones
| > These invariants are basically impossible to enforce by the compiler, | > but nonetheless certain classes have laws which are expected to hold, | > and I would not be surprised if (for example) GHC optimization RULES | > depended on them. | | I, in fact, would be surprised if there were such de

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

2007-10-18 Thread jerzy . karczmarczuk
Dan Weston writes: I find the mathematics is more accurate on http://www.conservapedia.com Their facts get checked by the Almighty Himself! ;) Since decent people here pointed out how my sarcasm may be blessing and useless, I must ask (living so far from the Bible Belt that I miss all stan

[Haskell-cafe] Re: Bug in runInteractiveProcess?

2007-10-18 Thread Simon Marlow
John Goerzen wrote: 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

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

2007-10-18 Thread Ketil Malde
PR Stanley <[EMAIL PROTECTED]> writes: > Do you trust mathematical materials on Wikipedia? Generally, yes. Another site you might want to cross check with is Wolfram Research's Mathworld: http://mathworld.wolfram.com/ -k -- If I haven't seen further, it is by standing in the footpr

[Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
I recently bumped into a problem with the feed on my WordPress blog. The problem was an extra empty line at the top of the XML file which some parsers choked on. I suspected there was some PHP file that contained an extra empty line at the top or bottom of the file so I hacked up this: hasEmp

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

2007-10-18 Thread Daniel McAllansmith
On Thursday 18 October 2007 21:15, you wrote: > Daniel McAllansmith <[EMAIL PROTECTED]> writes: > > 3. Otherwise, major.minor MUST remain the same (other version components > > MAY change). > > Is it an option to say SHOULD rather than MUST here? Of course, SHOULD is an option just like MAY is. B

[Haskell-cafe] About scandalous teaching

2007-10-18 Thread jerzy . karczmarczuk
Dipankar Ray decided to invest himself after my last grumbling concerning the uselessnes of recalling that Haskell may be presented in schools in a very bad way. JK, of course there are foolish teachers out there. I don't think Felipe was suggesting that this teacher had the right idea, nor tha

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

2007-10-18 Thread Simon Marlow
ChrisK wrote: I disagree with Simon Marlow here. In practice I think Claus' definition of compatible is good enough: I don't think you're disagreeing with me :-) In fact, you agreed that extending an API can break a client: One can write such a module. But that is only a problem if the ol

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

2007-10-18 Thread Simon Marlow
Ross Paterson wrote: 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 pol

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread Stuart Cook
On 10/18/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > I don't believe GHC relies on any class laws. It'd be pretty dangerous to do > so, I think. Incidentally, I consider it a slight infelicity that the H98 spec doesn't seem to mention the implied laws of classes like Eq and Ord, not even

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

2007-10-18 Thread Aaron Denney
On 2007-10-18, Ketil Malde <[EMAIL PROTECTED]> wrote: > PR Stanley <[EMAIL PROTECTED]> writes: > >> Do you trust mathematical materials on Wikipedia? > > Generally, yes. Another site you might want to cross check with is > Wolfram Research's Mathworld: > >http://mathworld.wolfram.com/

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

2007-10-18 Thread Jon Fairbairn
"David Benbennick" <[EMAIL PROTECTED]> writes: > 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 +

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-18 Thread Ross Paterson
On Tue, Oct 16, 2007 at 10:56:27AM +1000, Manuel M T Chakravarty wrote: > Lennart Augustsson wrote, >> And Haskell embedded a logical programming language on accident. > > Well, we are just trying to fix that :) Since types are inferred using unification, and classes are still present, adding func

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

2007-10-18 Thread Ketil Malde
Daniel McAllansmith <[EMAIL PROTECTED]> writes: >> There are other reasons for a version bump than breaking compatibility. > Technical reasons? Well - say I refactor everything, and use algorithms with different run-time complexities, and possibly introduce different bugs than the ones the appli

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Matthew Brecknell
Magnus Therning: > hasEmpty s = let > _first_empty = s !! 0 == '\n' > _last_empty = (reverse s) !! 1 == '\n' > in _first_empty || _last_empty > > loadAndCheck fp = liftM hasEmpty $ readFile fp > > main = getArgs >>= filterM loadAndCheck >>= mapM_ putStr

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Jules Bean
Is there some (easy) way to avoid this while still using readFile? readFile' f = do s <- readFile f return (length s `seq` s) (and curse the fact that the default readFile is unsafelazy). Jules ___ Haskell-Cafe mailing list Haskell-C

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

2007-10-18 Thread Yitzchak Gale
Hi Chad, Chad Scherrer wrote: > I think the stack overflows > were happening because Map.insertWith isn't strict enough. > Otherwise I think the code is the same. They are visibly almost identical - except that you do an extra lookup to get your strictness, while insertWith' has internal access a

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

2007-10-18 Thread Yitzchak Gale
I wrote: >> Nice, lots of fun! >> Wouldn't it be more convenient to allow them >> to be signed? John Meacham wrote: > Well, a couple reasons. One is that Natural numbers are a pretty useful > type in and of themselves, often times when used with lazy evaluation. > The other is that it is unclear w

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
On Thu, Oct 18, 2007 at 12:05:40 +0100, Jules Bean wrote: >>Is there some (easy) way to avoid this while still using readFile? > >readFile' f = do s <- readFile f >return (length s `seq` s) > >(and curse the fact that the default readFile is unsafelazy). :( Doesn't work. I'm start

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
On Thu, Oct 18, 2007 at 20:58:45 +1000, Matthew Brecknell wrote: >Magnus Therning: >> hasEmpty s = let >> _first_empty = s !! 0 == '\n' >> _last_empty = (reverse s) !! 1 == '\n' >> in _first_empty || _last_empty >> >> loadAndCheck fp = liftM hasEmpty $ readF

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Matthew Brecknell
Magnus Therning: > Still no cigar :( Yes, this is a little more subtle than I first thought. Look at liftM and filterM: liftM f m1 = do { x1 <- m1; return (f x1) } filterM :: (Monad m) => (a -> m Bool) -> [a] -> m [a] filterM _ [] = return [] filterM p (x:xs) = do flg <- p x ys <- filterM

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Jules Bean
Magnus Therning wrote: On Thu, Oct 18, 2007 at 12:05:40 +0100, Jules Bean wrote: Is there some (easy) way to avoid this while still using readFile? readFile' f = do s <- readFile f return (length s `seq` s) (and curse the fact that the default readFile is unsafelazy). :( Doe

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread David Roundy
On Thu, Oct 18, 2007 at 01:16:37PM +0100, Magnus Therning wrote: > On Thu, Oct 18, 2007 at 20:58:45 +1000, Matthew Brecknell wrote: > >For a less hackish solution, you need to do a bit more work. Again, this > >is untested. > > > >> loadAndCheck fn = bracket (openFile fn ReadMode) hClose checkConte

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
On Thu, Oct 18, 2007 at 09:25:32 -0400, David Roundy wrote: >On Thu, Oct 18, 2007 at 01:16:37PM +0100, Magnus Therning wrote: >> On Thu, Oct 18, 2007 at 20:58:45 +1000, Matthew Brecknell wrote: >> >For a less hackish solution, you need to do a bit more work. Again, this >> >is untested. >> > >> >>

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
On Thu, Oct 18, 2007 at 22:58:48 +1000, Matthew Brecknell wrote: >Magnus Therning: >> Still no cigar :( > >Yes, this is a little more subtle than I first thought. Look at liftM >and filterM: > >liftM f m1 = do { x1 <- m1; return (f x1) } > >filterM :: (Monad m) => (a -> m Bool) -> [a] -> m [a] >fil

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

2007-10-18 Thread Stefan O'Rear
On Thu, Oct 18, 2007 at 03:36:01AM -0400, [EMAIL PROTECTED] wrote: > (As an aside: The H98 report still list the right-zero law as being > a law for MonadPlus, even though most MonadPlus instances don't obey > it. That's actually a defect in the report.) All the MonadPlus I can think of (IO,Maybe

Re: [Haskell-cafe] Re: Proposal: register a package as providing several API versions

2007-10-18 Thread Brandon S. Allbery KF8NH
On Oct 18, 2007, at 4:57 , Simon Marlow wrote: depend on API versions (including minor versions) that you haven't tested, or (b) use explicit import lists and allow minor version changes only. Incedentally, this reminds me that GHC should have a warning for not using explicit import lists

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

2007-10-18 Thread Philippa Cowderoy
On Thu, 18 Oct 2007, PR Stanley wrote: > Hi > Do you trust mathematical materials on Wikipedia? > Paul > To a first approximation - trust but verify. -- [EMAIL PROTECTED] "I think you mean Philippa. I believe Phillipa is the one from an alternate universe, who has a beard and programs in BASI

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

2007-10-18 Thread David Barton
The trustworthy articles on Wikipedia have references that can be checked, and read. The ones without references are not to be trusted.. Dave Barton - Original Message - From: "Philippa Cowderoy" <[EMAIL PROTECTED]> To: "PR Stanley" <[EMAIL PROTECTED]> Cc: Sent: Thursday, October

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

2007-10-18 Thread Philippa Cowderoy
On Thu, 18 Oct 2007, [EMAIL PROTECTED] wrote: > 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 w

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Magnus Therning
On Thu, Oct 18, 2007 at 22:58:48 +1000, Matthew Brecknell wrote: >Magnus Therning: >> Still no cigar :( > >Yes, this is a little more subtle than I first thought. Look at liftM >and filterM: > >liftM f m1 = do { x1 <- m1; return (f x1) } > >filterM :: (Monad m) => (a -> m Bool) -> [a] -> m [a] >fil

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

2007-10-18 Thread Thomas Hartman
> But I would expect intTable to be faster, But if I understand correctly, intTable can only deal with integer keys, whereas BH's original question would have wanted string keys, and I can't see a way to convert string to int and back. t. "Chad Scherrer" <[EMAIL PROTECTED]> 10/17/2007 11:

[Haskell-cafe] Re: building hslogger

2007-10-18 Thread John Goerzen
On 2007-10-17, Chris Hayden <[EMAIL PROTECTED]> wrote: > 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/hslog

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

2007-10-18 Thread jerzy . karczmarczuk
David Barton writes: The trustworthy articles on Wikipedia have references that can be checked, and read. The ones without references are not to be trusted.. Let's apply (illegally) some recursive reasoning. Why should we trust Dave Barton? He didn't give any references either! Seriou

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

2007-10-18 Thread Claus Reinke
Which reminds me that it would be nice to be able to ask for a list of what imports I need to specify (i.e. what names from the module are actually used). A case in point would be the example of "non- monadic I/O" I sent to the list the other day: I wanted to specify minimal imports, but c

Re: [Haskell-cafe] About scandalous teaching

2007-10-18 Thread Dipankar Ray
On Thu, 18 Oct 2007, [EMAIL PROTECTED] wrote: Dipankar Ray decided to invest himself after my last grumbling concerning the uselessnes of recalling that Haskell may be presented in schools in a very bad way. sadly, I'm neither the rabbi from minsk nor the one from pinsk. I just happened to b

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

2007-10-18 Thread Claus Reinke
These two cases could be solved by re-exports, no extra mechanism is required. yes, good support for re-export would be nice to have. the reason it has so many applications is that it is a way to explain connections between providers, apis, and clients to the package manager. - consider adding

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

2007-10-18 Thread Claus Reinke
Incedentally, this reminds me that GHC should have a warning for not using explicit import lists (perhaps only for external package imports). for package-level imports/exports, that sounds useful. claus ___ Haskell-Cafe mailing list Haskell-Cafe@haske

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

2007-10-18 Thread Martin Percossi
http://www.conservapedia.com/Examples_of_Bias_in_Wikipedia -- if not ordained directly from the Almighty, then at least by his earth-bound agents! No, but seriously, I agree with Le Hacker Soleil, news of wikipedia's inaccuracies is greatly exaggerated. Martin [EMAIL PROTECTED] wrote: Dav

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Matthew Brecknell
Magnus Therning: > Just out of curiosity, how would I go about finding this myself? > (Ideally it'd be an answer other than "read the source for the libraries > you are using". :-) Well, I can at least try to expand a little on "read the source". :-) You'll first need a solid understanding of laz

Re: [Haskell-cafe] Automatic file closing after readFile

2007-10-18 Thread Don Stewart
magnus: > On Thu, Oct 18, 2007 at 12:05:40 +0100, Jules Bean wrote: > >>Is there some (easy) way to avoid this while still using readFile? > > > >readFile' f = do s <- readFile f > > return (length s `seq` s) > > > >(and curse the fact that the default readFile is unsafelazy). > > :(

[Haskell-cafe] Re: Functional specification of DFS

2007-10-18 Thread Vimal
> So add another argument containing all nodes seen in any path, and > maintain that properly. You're going to need to make your DFS > > routine > tail-recursive. > The problem is efficiency. I don't know if it can be done in > linear time > without state (and something like arrays with O(1) acces

[Haskell-cafe] SYB3 codebase

2007-10-18 Thread Greg Meredith
Haskellians, Does anyone know the status of SYB3 codebase? It appears that FreshLib critically depends on it, but the code downloadable from http://homepages.cwi.nl/~ralf/syb3/code.html dies in make test on the first test with lgmaclt:~/work/src/projex/biosimilarity/HS1/Process/haskell/SYB3 lgm$

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

2007-10-18 Thread Tim Chevalier
On 10/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Dan Weston writes: > > > I find the mathematics is more accurate on > > > > http://www.conservapedia.com > > > > Their facts get checked by the Almighty Himself! ;) > > Since decent people here pointed out how my sarcasm may be blessing an

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

2007-10-18 Thread Andrew Coppin
Brent Yorgey wrote: 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.

Re: [Haskell-cafe] Pixel plotter

2007-10-18 Thread Andrew Coppin
Bit Connor wrote: There should be a WIN32 file with instructions for installing on windows. Thanks. I didn't spot that... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2007-10-18 Thread Andrew Coppin
Steven Fodstad wrote: FWIW, other people feel about Haskell the way you feel about calculus and the continuation monad, and your opinions of these other powerful, but difficult, tools is what got you into this mess. On the contrary, other people's misinterpretation of my opinions on these mat

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

2007-10-18 Thread Dan Weston
> Now that I look at it, the report notes that: > > -- Note that (min x y, max x y) = (x,y) or (y,x) > > but never says that this requirement is mandatory. That's because the comment applies only to the default implementation, not in general. The report does require that "The Ord class is

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

2007-10-18 Thread Don Stewart
andrewcoppin: > 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 i

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

2007-10-18 Thread Ketil Malde
"Claus Reinke" <[EMAIL PROTECTED]> writes: >> Incedentally, this reminds me that GHC should have a warning for not >> using explicit import lists (perhaps only for external package >> imports). > for package-level imports/exports, that sounds useful. Isn't there a secret key combination in haske

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

2007-10-18 Thread Albert Y. C. Lai
Thomas Hartman wrote: 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.

[Haskell-cafe] Re: Functional specification of DFS

2007-10-18 Thread jerzy . karczmarczuk
Vimal writes: ... Now, I face some problem which i think is due to Lazy evaluation. I tried adding strictness in as many meaningful places as possible, but it doesnt work :( I have sat with the code for a long time, and yet I am not able to come up with a convincing reason as to why it doesn

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

2007-10-18 Thread Dan Weston
Thank you for that clarification, and I hope you will have patience for a follow-up question. I am really eager to fully understand this correspondence and appreciate any help. Your strong normalization induction does deconstruct function application but seemingly not constructor application,

[Haskell-cafe] Using type-level programming to tag functions with time and space complexity

2007-10-18 Thread Daniel McAllansmith
I was wondering if anyone had done work on tagging functions at the type level with their time or space complexity and, if it's even feasible, calculating the complexity of compound functions. Any pointers? Cheers Daniel ___ Haskell-Cafe mailing list

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

2007-10-18 Thread Tim Newsham
I'm fairly new to this and struggling to follow along so I might be a little off base here... I assume you mean then that it is a valid proof because it halts for *some* argument? Suppose I have: thm1 :: (a -> a) -> a thm1 f = let x = f x in x There is no f for which (thm1 f) halts (for the s

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

2007-10-18 Thread Dan Weston
> The function needs to be total. You seem to be using Haskell to execute > a function to see if it terminates as a proof of totality. Is that > fair? This approach might work for some simple examples, but if the > function doesn't terminate immediately then what? I would assume that > proof of

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

2007-10-18 Thread jerzy . karczmarczuk
Tim Newsham quotes somebody /I didn't follow this thread!/: I assume you mean then that it is a valid proof because it halts for *some* argument? Suppose I have: thm1 :: (a -> a) -> a thm1 f = let x = f x in x There is no f for which (thm1 f) halts (for the simple reason that _|_ is the on

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

2007-10-18 Thread Dan Weston
It was I that he quoted, and now I am totally flummoxed: thm1 :: (a -> a) -> a thm1 f = let x = f x in x > thm1 (const 1) 1 I *thought* that the theorem ((a => a) => a) is not derivable (after all, 0^(0^0) = 0^1 = 0), but it appears somehow that thm1 is a proof of its type. Help, I just unl

Re: [Haskell-cafe] Using type-level programming to tag functions with time and space complexity

2007-10-18 Thread Jeremy Shaw
Hello, Oleg, Chung-chieh Shan, and others have done some work close to this area. On this page, see the "Monads parameterized by time" section: http://okmij.org/ftp/Haskell/number-parameterized-types.html Also see this page: http://okmij.org/ftp/Haskell/types.html#ls-resources The new type fam

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

2007-10-18 Thread jerzy . karczmarczuk
Dan Weston writes: ... now I am totally flummoxed: thm1 :: (a -> a) -> a thm1 f = let x = f x in x > thm1 (const 1) 1 I *thought* that the theorem ((a => a) => a) is not derivable (after all, 0^(0^0) = 0^1 = 0), but it appears somehow that thm1 is a proof of its type. Help, I just unl

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread Ryan Ingram
Just today I was looking at the implementation of Arrows and noticed this: {-# RULES "compose/arr" forall f g . arr f >>> arr g = arr (f >>> g) ... other rules ... #-} But consider this "Arrow": newtype (a :>> b) = LA2 { runLA2 :: [a] -> [b] } instance Arrow (:>>) where

Re: [Haskell-cafe] data Bin = Zero | One

2007-10-18 Thread Roel van Dijk
To convert to and from integrals you could define two functions: binToNum :: Num a => Bin -> a binToNum Zero = 0 binToNum One = 1 numToBin :: Num a => a -> Bin numToBin 0 = Zero numToBin _ = One Or you could derive Enum for your Bin type. This wil automatically associate integers with the constr

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread Janis Voigtlaender
Ryan Ingram wrote: Just today I was looking at the implementation of Arrows and noticed this: {-# RULES "compose/arr" forall f g . arr f >>> arr g = arr (f >>> g) ... other rules ... #-} But consider this "Arrow": newtype (a :>> b) = LA2 { runLA2 :: [a] -> [b] } instance Arrow

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

2007-10-18 Thread R Hayes
shai dorsai On Oct 18, 2007, at 5:00 PM, Brandon S. Allbery KF8NH wrote: On Oct 18, 2007, at 19:53 , John Meacham wrote: On Thu, Oct 18, 2007 at 02:31:10AM +0100, PR Stanley wrote: Do you trust mathematical materials on Wikipedia? Certainly! I honestly think wikipedia is one of man's gr

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread ajb
G'day all. Quoting Janis Voigtlaender <[EMAIL PROTECTED]>: Yes. But actually what we would need would be that it checks as well that we have implemented at *most* a minimal set of operations. Otherwise, we are back to the point where I can implement both (==) and (/=), and in a way that the sup

Re: [Haskell-cafe] Re: Functional specification of DFS

2007-10-18 Thread Vimal
> First, the suspicion that lazy evaluation may lead to a non-termination > of such algorithm is almost surely wrong, and in any case it is against > my religious beliefs [some twisted smiley here]. > Sorry to have clubbed both lazy evaluation and non-termination. I meant that Lazy eval could have

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

2007-10-18 Thread Dan Weston
Some content I have found beneficial in the past when I have stumbled into misunderstandings: http://en.wikipedia.org/wiki/Wikipedia:Assume_good_faith http://en.wikipedia.org/wiki/Wikipedia_talk:Assume_good_faith [EMAIL PROTECTED] wrote: PR Stanley writes: One of the reasons I'm interested in

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

2007-10-18 Thread PR Stanley
At 01:48 19/10/2007, you wrote: On Fri, Oct 19, 2007 at 02:45:45AM +0200, [EMAIL PROTECTED] wrote: > PR Stanley writes: >> One of the reasons I'm interested in Wikipedia and Wikibook is because >> you're more likely to find Latex source code used for typesetting the >> maths. >> Latex is the one

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

2007-10-18 Thread Stefan O'Rear
On Fri, Oct 19, 2007 at 03:06:21AM +0200, [EMAIL PROTECTED] wrote: > Stefan O'Rear writes: > >> ... Latex page sources are >> infinitely superior to unadorned images of unknown providence. > > Of course, most certainly! > But I failed to understand the relation to Wikipedia. > OK, I see. If you lo

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

2007-10-18 Thread Dipankar Ray
PR: I think that an email to Tim Gowers would yield LaTeX source for the pdf articles in his Princeton Companion to Mathematics, in case it has articles on topics you care about: http://gowers.wordpress.com/category/princeton-companion-to-mathematics/ On Thu, 18 Oct 2007, Stefan O'Rear wrot

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

2007-10-18 Thread jerzy . karczmarczuk
PR Stanley writes: One of the reasons I'm interested in Wikipedia and Wikibook is because you're more likely to find Latex source code used for typesetting the maths. Latex is the one and only 100% tool right now. A lot of publishers use Latex but try to get anything from them in electronic f

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

2007-10-18 Thread Stefan O'Rear
On Thu, Oct 18, 2007 at 08:39:04PM -0400, David Menendez wrote: > On 10/18/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > > On Thu, Oct 18, 2007 at 03:36:01AM -0400, [EMAIL PROTECTED] wrote: > > > (As an aside: The H98 report still list the right-zero law as being > > > a law for MonadPlus, even th

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

2007-10-18 Thread Brandon S. Allbery KF8NH
On Oct 18, 2007, at 19:53 , John Meacham wrote: On Thu, Oct 18, 2007 at 02:31:10AM +0100, PR Stanley wrote: Do you trust mathematical materials on Wikipedia? Certainly! I honestly think wikipedia is one of man's greatest achievements, and it is just in its infancy. For what it's worth, I'm

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

2007-10-18 Thread John Meacham
On Thu, Oct 18, 2007 at 02:31:10AM +0100, PR Stanley wrote: > Do you trust mathematical materials on Wikipedia? Certainly! I honestly think wikipedia is one of man's greatest achievements, and it is just in its infancy. John -- John Meacham - ⑆repetae.net⑆john⑈ _

Re: [Haskell-cafe] Class invariants/laws

2007-10-18 Thread Janis Voigtlaender
[EMAIL PROTECTED] wrote: Yes. But actually what we would need would be that it checks as well that we have implemented at *most* a minimal set of operations. Otherwise, we are back to the point where I can implement both (==) and (/=), and in a way that the supposed invariant is broken. Except

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

2007-10-18 Thread John Meacham
On Thu, Oct 18, 2007 at 01:58:14PM +0200, Yitzchak Gale wrote: > - Zero really means 0, not "0 or negative". Actually, zero does mean zero. There is no such thing as negative numbers in the naturals so it doesn't make sense to say '0 or negative'. Subtraction is necessarily defined differently of

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

2007-10-18 Thread Stefan O'Rear
On Fri, Oct 19, 2007 at 02:45:45AM +0200, [EMAIL PROTECTED] wrote: > PR Stanley writes: >> One of the reasons I'm interested in Wikipedia and Wikibook is because >> you're more likely to find Latex source code used for typesetting the >> maths. >> Latex is the one and only 100% tool right now. >

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

2007-10-18 Thread PR Stanley
Hi thank you for all your replies. One of the reasons I'm interested in Wikipedia and Wikibook is because you're more likely to find Latex source code used for typesetting the maths. Latex is the one and only 100% tool right now. A lot of publishers use Latex but try to get anything from them i

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

2007-10-18 Thread David Menendez
On 10/18/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > On Thu, Oct 18, 2007 at 03:36:01AM -0400, [EMAIL PROTECTED] wrote: > > (As an aside: The H98 report still list the right-zero law as being > > a law for MonadPlus, even though most MonadPlus instances don't obey > > it. That's actually a defe

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

2007-10-18 Thread jerzy . karczmarczuk
Stefan O'Rear writes: ... Latex page sources are infinitely superior to unadorned images of unknown providence. Of course, most certainly! But I failed to understand the relation to Wikipedia. OK, I see. If you look at the sources, several pages have the accompagnied by the source... Ho

[Haskell-cafe] data Bin = Zero | One

2007-10-18 Thread PR Stanley
Hi data Bin = Zero | One As suggested by someone on this list. It's a really neat idea although I'm wondering how I can apply this to my int to binary function. The Zero or One declaration is saying that Bin is a data type that can hold either a one or a zero. I tried testing this with a

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

2007-10-18 Thread ajb
G'day. Quoting Stefan O'Rear <[EMAIL PROTECTED]>: All the MonadPlus I can think of (IO,Maybe,[]) satisfy it. Were you thinking of right distribution? No monad transformer can satisfy it, because lift m >> mzero is not mzero. Cheers, Andrew Bromage ___