Re: [GHC] #1571: type of synthesize in Data.Generics.Schemes is too restrictive

2007-08-01 Thread GHC
#1571: type of synthesize in Data.Generics.Schemes is too restrictive +--- Reporter: [EMAIL PROTECTED] |Owner: Type: bug | Status: closed Priority: normal

Re: [GHC] #1564: The fantastic Any type gets derived

2007-08-01 Thread GHC
#1564: The fantastic Any type gets derived --+- Reporter: [EMAIL PROTECTED] |Owner: Type: bug| Status: closed Priority: highest|Milestone:

Re: [GHC] #1542: Data/Time/Format/Parse cannot be compiled with -DDEBUG

2007-08-01 Thread GHC
#1542: Data/Time/Format/Parse cannot be compiled with -DDEBUG -+-- Reporter: [EMAIL PROTECTED] |Owner: Type: bug | Status: closed Priority: normal

Re: [GHC] #1525: :browse shouldn't print single-constructor data definitions twice

2007-08-01 Thread GHC
#1525: :browse shouldn't print single-constructor data definitions twice +--- Reporter: sorear |Owner: simonpj Type: feature request | Status: new Priority: high

Re: [GHC] #1526: -fobject-code is ignored for interactive compilation

2007-08-01 Thread GHC
#1526: -fobject-code is ignored for interactive compilation -+-- Reporter: sorear|Owner: Type: bug | Status: new Priority: normal|Milestone:

Re: [GHC] #1454: Confusing or bug: :t and :i don't return same type

2007-08-01 Thread GHC
#1454: Confusing or bug: :t and :i don't return same type --+- Reporter: [EMAIL PROTECTED] |Owner: Type: bug| Status: reopened Priority: normal |

[GHC] #1573: GADT and typeclass funcional dependencies not working well together

2007-08-01 Thread GHC
#1573: GADT and typeclass funcional dependencies not working well together ---+ Reporter: [EMAIL PROTECTED] | Owner: Type: bug | Status: new Priority: normal

Re: [GHC] #1572: Make it easy to find documentation for installed packages

2007-08-01 Thread GHC
#1572: Make it easy to find documentation for installed packages -+-- Reporter: simonpj |Owner: Type: task | Status: new Priority: normal|Milestone:

[GHC] #1574: Broken link

2007-08-01 Thread GHC
#1574: Broken link +--- Reporter: [EMAIL PROTECTED] | Owner: Type: bug| Status: new Priority: normal | Milestone: Component:

[GHC] #1575: Arrow: No match in record selector Var.tcTyVarDetails

2007-08-01 Thread GHC
#1575: Arrow: No match in record selector Var.tcTyVarDetails +--- Reporter: guest | Owner: Type: bug| Status: new Priority: normal |

Re: [GHC] #631: GHCi doesn't work unregisterised

2007-08-01 Thread GHC
#631: GHCi doesn't work unregisterised +--- Reporter: [EMAIL PROTECTED] |Owner: igloo Type: bug | Status: new Priority: normal |Milestone: 6.8

Re: [GHC] #631: GHCi doesn't work unregisterised

2007-08-01 Thread GHC
#631: GHCi doesn't work unregisterised +--- Reporter: [EMAIL PROTECTED] |Owner: igloo Type: bug | Status: new Priority: normal |Milestone: 6.8

Re: [GHC] #1526: -fobject-code is ignored for interactive compilation

2007-08-01 Thread GHC
#1526: -fobject-code is ignored for interactive compilation -+-- Reporter: sorear|Owner: Type: bug | Status: new Priority: normal|Milestone:

[GHC] #1577: Give TH the ability to get the info for a class name

2007-08-01 Thread GHC
#1577: Give TH the ability to get the info for a class name +--- Reporter: [EMAIL PROTECTED] | Owner: Type: feature request| Status: new Priority: normal |

Re: Annotation for unfolding wanted

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 09:42:54AM +0200, Georg Martius wrote: Hi, I am sorry for using the wrong terminology here. Let me ask again: Does it sound reasonable to extend the compiler with a pragma that specifies that a certain function should be compiled to a loop? And if the compiler can

Re: [Haskell] Type Lambdas in Gofer

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 07:57:48AM +0200, Wolfgang Lux wrote: Jim Apple wrote: data Rec f = In (f (Rec f)) type P f a = f (Rec f, a) mapP :: Functor f = (a - b) - P f a - P f b mapP g = fmap (\(x,a) - (x, g a)) instance Functor f = Functor (P f) where fmap = mapP Why did Gofer have

RE: [Haskell] type class instance selection search

2007-08-01 Thread Simon Peyton-Jones
Conal It certainly makes sense to do backward chaining, but I don't know any Haskell implementation that's tried it. It'd be more complicated in the presence of functional dependencies, since we must undo any unifications done as a result of discarded searches, much like the trail in a Prolog

[Haskell] Re: type class instance selection search

2007-08-01 Thread Chung-chieh Shan
If only for those watching from home, here are some references. jeff p [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.general: Better yet, how about LambdaProlog ( http://www.lix.polytechnique.fr/Labo/Dale.Miller/lProlog), which generalizes from Horn

[Haskell] type class instance selection search

2007-08-01 Thread Andrzej Jaworski
Simon Peyton-Jones [EMAIL PROTECTED] wrote: It certainly makes sense to do backward chaining, but I don't know any Haskell implementation that's tried it. It'd be more complicated in the presence of functional dependencies, since we must undo any unifications done as a result of discarded

Re: [Haskell] type class instance selection search

2007-08-01 Thread Claus Reinke
|My understanding is that this sort of instance collection doesn't work together because instance selection is based only on the matching the head of an instance declaration (part after the =). I'm wondering why not use the preconditions as well, via a Prolog-like, backward-chaining search for

[Haskell] Re: type class instance selection search

2007-08-01 Thread apfelmus
Conal Elliott wrote: I keep running into situations in which I want more powerful search in selecting type class instances. One example I raised in June, in which all of the following instances are useful. instance (Functor g, Functor f) = Functor (O g f) where fmap h (O gf) = O (fmap

Re: [Haskell] Re: type class instance selection search

2007-08-01 Thread Wolfgang Jeltsch
Am Mittwoch, 1. August 2007 14:41 schrieb apfelmus: […] The problem with the Functor/Cofunctor instances is that they are ambiguous as soon as a type constructor X is made an instance of both Functor and Cofunctor . Of course, such an X cannot exist in a mathematically useful way

Re: [Haskell] Type Lambdas in Gofer

2007-08-01 Thread Stefan Holdermans
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wolfgang, Why did Gofer have this power while Haskell does not? Quite probably they never bothered to test it. More probably ;-) they did test it and just swept it under the carpet in order

Re: [Haskell] Re: type class instance selection search

2007-08-01 Thread Conal Elliott
On 8/1/07, apfelmus [EMAIL PROTECTED] wrote: There are some fundamental problems/design choices for type classes in conjunction with separate compilation/modularity that need to be researched before trying anything like that. In particular, any ad-hoc Prolog, CHR or

Re: [Haskell] Re: type class instance selection search

2007-08-01 Thread Conal Elliott
On 7/31/07, jeff p [EMAIL PROTECTED] wrote: Hello, My understanding is that this sort of instance collection doesn't work together because instance selection is based only on the matching the head of an instance declaration (part after the =). I'm wondering why not use the

[Haskell] Call for Book Chapters: Process Algebra/Algebraic Languages/Specification-based AD

2007-08-01 Thread Michael Alexander
Apologies if you received multiple copies of this message CALL FOR BOOK CHAPTERS BOOK TITLE: Process Algebra for Parallel and Distributed Processing: Algebraic Languages in Specification-Based Software Development EDITORS: Michael Alexander, WU Wien Bill Gardner, University of Guelph The

Re: [Haskell] Quantified class constraints ( back-chaining)

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 05:29:19PM -0700, Conal Elliott wrote: Sadly, this solution runs into the problem of instance selection based only on head-matching, not back-chaining into constraints. For instance, I'd like also to use the following conflicting declaration. instance

[Haskell] Quantified class constraints ( back-chaining)

2007-08-01 Thread Conal Elliott
I'm developing a type constructor class and want the constraint forall a. Monoid (m a) (where m :: * - *), which is neither legal Haskell, nor supported by GHC. As a work-around, I used the first encoding suggested in Simulating Quantified Class Constraints (Valery Trifonov, Haskell Workshop

Re: [Haskell] Quantified class constraints ( back-chaining)

2007-08-01 Thread jeff p
Hello, It's something I've wanted... Got a link for hereditary Harrop formulas so I can add them to my to-implement-when-Qhc-is-good-enough list? Google isn't telling me much about them except how to add support for constaints, which isn't terribly helpful. This paper has a good description;

Re: [Haskell-cafe] Backpatching

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 03:44:32PM +1000, Thomas Conway wrote: This sounds like a common problem type. Is there a well known solution to this sort of problem? Mmm... logic programming? http://citeseer.ist.psu.edu/claessen00typed.html You'll only need the code for logic-variables, and even

[Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Kaveh Shahbazian
This is about to put a definition/description to test. So please cooperate! ;) Is this a useful – sufficient, not complete – definition/description for a monad; for an imperative mind: (?) A monad is like a loop that can run a new function against it's variable in each iteration. (I insist on

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Alexis Hazell
On Wednesday 01 August 2007 17:02, Kaveh Shahbazian wrote: This is about to put a definition/description to test. So please cooperate! ;) Is this a useful – sufficient, not complete – definition/description for a monad; for an imperative mind: (?) A monad is like a loop that can run a new

Re[2]: [Haskell-cafe] Re: HDBC or HSQL

2007-08-01 Thread Bulat Ziganshin
Hello Alex, Wednesday, August 1, 2007, 8:34:23 AM, you wrote: I am asking because I am trying to make HAppS a reasonable replacement for all contexts in which you would otherwise use an external relational database except those in which an external SQL database is a specific requirement.

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request?for?feedback

2007-08-01 Thread ChrisK
Discussion continues below quoted text... Stefan O'Rear wrote: On Tue, Jul 31, 2007 at 03:31:54PM -0700, David Roundy wrote: On Mon, Jul 30, 2007 at 11:47:46AM +0100, Jon Fairbairn wrote: ChrisK [EMAIL PROTECTED] writes: And the readability is destroyed because you cannot do any type

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request?for?feedback

2007-08-01 Thread Jon Fairbairn
David Roundy [EMAIL PROTECTED] writes: On Mon, Jul 30, 2007 at 11:47:46AM +0100, Jon Fairbairn wrote: [snippage] This is all very horrid, but as far as I can tell what I was proposing wouldn't lead to such a mess, except possibly via defaulting, which, as the least important aspect of

[Haskell-cafe] Re: Backpatching

2007-08-01 Thread ChrisK
Thomas Conway wrote: One of the things that gets messy is that in lots of places you can put either a thing or a reference to a thing (i.e. the name of a thing defined elsewhere). For example, consider the production: NamedNumber ::= identifier ( SignedNumber ) |

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Dougal Stanton
On 01/08/07, Andrew Wagner [EMAIL PROTECTED] wrote: This seems wrong to me. A monad is, first and foremost, a type constructor class. I'm not sure how you can really compare that to a loop. But perhaps the easiest way to test your definition would be to ask this: How is, for example, the Maybe

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread david48
On 8/1/07, Andrew Wagner [EMAIL PROTECTED] wrote: This seems wrong to me. A monad is, first and foremost, a type constructor class. I'm not sure how you can really compare that to a loop. But perhaps the easiest way to test your definition would be to ask this: How is, for example, the Maybe

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread david48
On 8/1/07, Andrew Wagner [EMAIL PROTECTED] wrote: you can imagine each of the calls to putStrLn gets implicitly passed a variable (here, the world ) and they happen in succession so it's like a loop. It breaks down further as soon as you add any amount of complexity to the code as well.

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Christopher L Conway
On 8/1/07, david48 [EMAIL PROTECTED] wrote: As a beginner haskeller coming from an imperative experience, I think I understood what he meant. say you have this code : putStrLn 1 putStrLn 2 putStrLn 3 you can imagine each of the calls to putStrLn gets implicitly passed a variable

Re: [Haskell-cafe] Backpatching

2007-08-01 Thread Jim Burton
Derek Elkins wrote: On Tue, 2007-07-31 at 23:04 -0700, Stefan O'Rear wrote: On Wed, Aug 01, 2007 at 03:44:32PM +1000, Thomas Conway wrote: This sounds like a common problem type. Is there a well known solution to this sort of problem? Mmm... logic programming?

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Andrew Wagner
say you have this code : putStrLn 1 putStrLn 2 putStrLn 3 you can imagine each of the calls to putStrLn gets implicitly passed a variable (here, the world ) and they happen in succession so it's like a loop. It breaks down further as soon as you add any amount of complexity to the

Re: Re : Re : Re : [Haskell-cafe] Indentation woes

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 16:05 +0200, david48 wrote: On the topic of indenting, it would be nice if there was a way to tell the compiler the size of the tab characters. The way it is now, I have to use space characters to indent. Good! You're doing exactly the right thing according to the

[Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Andy Gimblett
Hi all, Is this a reasonable way to compute the cartesian product of a Set? cartesian :: Ord a = S.Set a - S.Set (a,a) cartesian x = S.fromList [(i,j) | i - xs, j - xs] where xs = S.toList x It's a fairly obvious way to do it, but I wondered if there were any hidden gotchas. I'm

FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread peterv
Kaveh A monad is like a loop that can run a new function against its variable in each iteration. I’m an imperative programmer learning Haskell, so I’m a newbie, but I’ll give it a try ☺ Making mistakes is the best way to learn it ;) There are lots of different kinds of monads, but let’s stick

Re: Re : Re : Re : [Haskell-cafe] Indentation woes

2007-08-01 Thread david48
On the topic of indenting, it would be nice if there was a way to tell the compiler the size of the tab characters. The way it is now, I have to use space characters to indent. It's not really a problem though. ___ Haskell-Cafe mailing list

Re: Re : Re : Re : [Haskell-cafe] Indentation woes

2007-08-01 Thread Brandon S. Allbery KF8NH
On Aug 1, 2007, at 10:05 , david48 wrote: On the topic of indenting, it would be nice if there was a way to tell the compiler the size of the tab characters. The way it is now, I have to use space characters to indent. The problem with that is, while there's a standard for the width of a

[Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Greg Meredith
Haskellians, Though the actual metaphor in the monads-via-loops doesn't seem to fly with this audience, i like the spirit of the communication and the implicit challenge: find a pithy slogan that -- for a particular audience, like imperative programmers -- serves to uncover the essence of the

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Andrew Wagner
That's great, unless the imperative programmer happens to be one of the 90% of programmers that isn't particularly familiar with group theory... On 8/1/07, Greg Meredith [EMAIL PROTECTED] wrote: Haskellians, Though the actual metaphor in the monads-via-loops doesn't seem to fly with this

Re: Re : Re : Re : [Haskell-cafe] Indentation woes

2007-08-01 Thread david48
On 8/1/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On Aug 1, 2007, at 10:05 , david48 wrote: On the topic of indenting, it would be nice if there was a way to tell the compiler the size of the tab characters. The way it is now, I have to use space characters to indent. The

Re: [Haskell-cafe] Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread Justin Bailey
On 7/31/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: jgbailey: Also, be sure to compare against a naive search, optimised for strict and lazy bytestrings, http://hpaste.org/1803 If its not faster than those 2, then you're doing something wrong :) -- Don Yes, I was really hoping

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Dan Piponi
On 8/1/07, Andrew Wagner [EMAIL PROTECTED] wrote: For me, I think the key to monads is to really understand 2 things about them: ... 2.) Monads are about sequencing Now I disagree on 2. Monads are no more about sequencing than binary operators are about sequencing. Sure, if you want to, you

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Andrew Wagner
an IO monad is a delayed action that will be executed as soon as that action is needed for further evaluation of the program. I'm not sure I like this, as it seems to confuse the issue. An expert should correct me if I'm wrong, but monads in and of themselves don't depend on laziness.

Re: [Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Joachim Breitner
Hi, Am Mittwoch, den 01.08.2007, 15:28 +0100 schrieb Andy Gimblett: Hi all, Is this a reasonable way to compute the cartesian product of a Set? cartesian :: Ord a = S.Set a - S.Set (a,a) cartesian x = S.fromList [(i,j) | i - xs, j - xs] where xs = S.toList x It's a fairly

Re: [Haskell-cafe] Exiting GLUT application

2007-08-01 Thread Dave Tapley
Unfortunately whilst the new code is returning me to a 'Main ' prompt as required another problem has come up. The issue here is found when the code is executed in both GHCi (6.6) and hugs (20050308). Once the code below is loaded evaluating main opens an unfilled window as required. However if

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Seth Gordon
My own perspective on monads is this: In procedural and OO languages, when dealing with compound data structures, we think in terms of getters (*taking data out* of the structure) and setters (*putting data in* to the structure). Languages with some impure functional features (Lisp, Scheme,

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Jeff Polakow
Hello, On 8/1/07, Andrew Wagner [EMAIL PROTECTED] wrote: For me, I think the key to monads is to really understand 2 things about them: ... 2.) Monads are about sequencing Now I disagree on 2. Monads are no more about sequencing than binary operators are about sequencing. Sure, if

Re: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread alpheccar
Kaveh A monad is like a loop that can run a new function against its variable in each iteration. I’m an imperative programmer learning Haskell, so I’m a newbie, but I’ll give it a try ☺ Making mistakes is the best way to learn it ;) I was a newbie not so long ago so I can understand

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Greg Meredith
Andrew, ;-) Agreed! As i said in my previous post, i can't address the imperative programmer. i really don't think that way and have a hard time understanding people who do! (-; Best wishes, --greg On 8/1/07, Andrew Wagner [EMAIL PROTECTED] wrote: That's great, unless the imperative

[Haskell-cafe] Re: Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread ChrisK
Justin Bailey wrote: On 7/31/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: jgbailey: Also, be sure to compare against a naive search, optimised for strict and lazy bytestrings, http://hpaste.org/1803 If its not faster than those 2, then you're doing something wrong :) -- Don

Re: [Haskell-cafe] Re: HDBC or HSQL

2007-08-01 Thread Isto Aho
Hi, I'd like to store small matrices into a db. Number of rows and columns may vary in a way not known in advance. One might use a relation (matrixId, col, row, value) or something like that but if it is possible to put a matrix in one command into db, some queries will be easier. E.g., one

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 11:31 -0700, Bryan O'Sullivan wrote: Alex Jacobson wrote: If you create a Data.Map or Data.Set larger than fits in physical memory, will OS level swapping enable your app to behave reasonably or will things just die catastrophically as you hit a memory limit?

[Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-08-01 Thread apfelmus
Thomas Conway wrote: This got me thinking that it would be cool to make an infinite terrain generator using a zipper, so you can zoom in/out infinitely, and by implication, infinitely in any direction. After some pondering, I think it's indeed possible and the zipper is the right tool for the

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Bryan O'Sullivan
Alex Jacobson wrote: If you create a Data.Map or Data.Set larger than fits in physical memory, will OS level swapping enable your app to behave reasonably or will things just die catastrophically as you hit a memory limit? Relying on the OS to page portions of your app in and out should

[Haskell-cafe] Re: monads and groups -- instead of loops

2007-08-01 Thread Greg Meredith
Haskellians, But, along these lines i have been wondering for a while... the monad laws present an alternative categorification of monoid. At least it's alternative to monoidoid. In the spirit of this thought, does anyone know of an expansion of the monad axioms to include an inverse action?

[Haskell-cafe] Re: Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread ChrisK
I am still working on improving your code. And I have a Is this a bug? question: The lookup = computeLookup pat defines lookup to take an Int which represents the index into pat, where this index is 0 based and the 0th item is the head of pat. Now look at matchLength :: Int; matchLength = let

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Seth Gordon
Alex Jacobson wrote: Ok, so for low throughput applications, you actually need a disk strategy. Got it. Ok, is there a standard interface to BerkleyDB or some other disk based store? I would absolutely kvell if there were some way to use a disk-based store to back Haskell objects without

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 12:32 -0700, Alex Jacobson wrote: Ok, so for low throughput applications, you actually need a disk strategy. Got it. Ok, is there a standard interface to BerkleyDB or some other disk based store? Well on hackage there's anydbm and BerkeleyDB. The former is probably

[Haskell-cafe] How can I optimize pattern matching on views?

2007-08-01 Thread Ryan Ingram
Background: I participated in this year's ICFP programming contesthttp://www.icfpcontest.organd our team did quite well, coming in 37th. Our simulator (in somewhat naive C++ with a good algorithm) took about 45 seconds to run the original problem, and afterwards one of my coworkers took the same

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Alex Jacobson
Ok, so for low throughput applications, you actually need a disk strategy. Got it. Ok, is there a standard interface to BerkleyDB or some other disk based store? -Alex- Duncan Coutts wrote: On Wed, 2007-08-01 at 11:31 -0700, Bryan O'Sullivan wrote: Alex Jacobson wrote: If you create a

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Dan Weston
Here's my rant about the way monads are explained in Haskell tutorials (which are much too polluted with nuclear waste to be safely approached): It is a big mistake to start with the IO monad. It pollutes and misdirects the understanding of what a monad is. The dreaded nuclear waste metaphor

[Haskell-cafe] Re: Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread ChrisK
My optimized (and fixed) version of the code is attached. I benchmarked it with: module Main(main) where import KMPSeq import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.Char8 as BC infile = endo.dna Modified by one character from the original copied from

Re: [Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Dan Weston
Andy Gimblett wrote: Hi all, Is this a reasonable way to compute the cartesian product of a Set? cartesian :: Ord a = S.Set a - S.Set (a,a) cartesian x = S.fromList [(i,j) | i - xs, j - xs] where xs = S.toList x It's a fairly obvious way to do it, but I wondered if there were any hidden

[Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread David Pollak
Howdy, I'm considering building a desktop app using Haskell. The primary target for the app is Windows, but if it runs on Linux and Mac (Intel and PPC), that'd be a bonus. I've got a bunch of questions that hopefully folks can answer. Well, before I start, you might well be asking Gee David,

Re: [Haskell-cafe] Backpatching

2007-08-01 Thread Daniel McAllansmith
On Wednesday 01 August 2007 17:44, Thomas Conway wrote: This sounds like a common problem type. Is there a well known solution to this sort of problem? Have you looked into Tying the Knot? http://www.haskell.org/haskellwiki/Tying_the_Knot A simple example: module Knot where import Data.Char

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Jeff Polakow
Hello, 'Monad' is a type class. So what's 'IO'? Is the correct terminology 'instance' as in 'IO is an instance of Monad'. I consider 'IO' to be 'a monad' as that fits with mathematical terminology. I agree with this. But what about an actual object of type 'IO Int', say? I usually

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Cale Gibbard
On 01/08/07, Greg Meredith [EMAIL PROTECTED] wrote: Haskellians, Though the actual metaphor in the monads-via-loops doesn't seem to fly with this audience, i like the spirit of the communication and the implicit challenge: find a pithy slogan that -- for a particular audience, like

Re: [Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Andy Gimblett
On Wed, Aug 01, 2007 at 01:42:52PM -0700, Dan Weston wrote: Andy Gimblett wrote: cartesian :: Ord a = S.Set a - S.Set (a,a) cartesian x = S.fromList [(i,j) | i - xs, j - xs] where xs = S.toList x Your list comprehension always generates a sorted list, so changing S.fromList to its

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 01:48:07PM -0700, David Pollak wrote: Howdy, I'm considering building a desktop app using Haskell. The primary target for the app is Windows, but if it runs on Linux and Mac (Intel and PPC), that'd be a bonus. I've got a bunch of questions that hopefully folks can

Re: [Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Rodrigo Queiro
toList generates a sorted list since it is implemented as toList = toAscList, but it's probably bad form to rely on that. On 01/08/07, Andy Gimblett [EMAIL PROTECTED] wrote: On Wed, Aug 01, 2007 at 01:42:52PM -0700, Dan Weston wrote: Andy Gimblett wrote: cartesian :: Ord a = S.Set a -

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 13:48 -0700, David Pollak wrote: So... on to the questions: First of all I recommend you check out these resources: The standard libraries: http://haskell.org/ghc/docs/latest/html/libraries/ A large collection of other libraries: http://hackage.haskell.org/ Another

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread David Pollak
Stefan, Thanks for the wicked quick response! On 8/1/07, Stefan O'Rear [EMAIL PROTECTED] wrote: - I found a package to do HTTP requests in Haskell but it does not seem to support HTTPS. Is there an HTTPS client package for Haskell? Maybe soon; the current HTTP package is widely

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Claus Reinke
a Monad is a type constructor with two operations, implementing a standard interface and following a few simple rules. the Monad type class tells you the interface (what operations you've got, and their types), the Monad laws tell you what all types implementing that interface should have in

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread David Pollak
Duncan, Many thanks to you as well! On 8/1/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2007-08-01 at 13:48 -0700, David Pollak wrote: * Can GHC generate stand-alone executables with all the dependencies linked in such that I can distribute the single file

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread Stefan O'Rear
On Wed, Aug 01, 2007 at 03:31:56PM -0700, David Pollak wrote: Duncan, Many thanks to you as well! On 8/1/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2007-08-01 at 13:48 -0700, David Pollak wrote: * Can GHC generate stand-alone executables with all the

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread David Pollak
On 8/1/07, Stefan O'Rear [EMAIL PROTECTED] wrote: On Wed, Aug 01, 2007 at 03:31:56PM -0700, David Pollak wrote: Duncan, Many thanks to you as well! On 8/1/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2007-08-01 at 13:48 -0700, David Pollak wrote: * Can GHC

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 15:31 -0700, David Pollak wrote: Duncan, Many thanks to you as well! On 8/1/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2007-08-01 at 13:48 -0700, David Pollak wrote: * Can GHC generate stand-alone executables with all the

Re: [Haskell-cafe] Backpatching

2007-08-01 Thread Thomas Conway
On 8/2/07, Daniel McAllansmith [EMAIL PROTECTED] wrote: On Wednesday 01 August 2007 17:44, Thomas Conway wrote: This sounds like a common problem type. Is there a well known solution to this sort of problem? Have you looked into Tying the Knot?

Re: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Dan Weston
I knew someone was going to catch me wandering into the deep end of the pool! Having read large parts of your blog, I would never presume to tell you anything about Haskell or category theory, but what the hell... I mostly sympathise with your rant, but I think you need to be clearer about

Re: [Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-08-01 Thread Thomas Conway
On 8/2/07, apfelmus [EMAIL PROTECTED] wrote: That concludes the infinite terrain generation for one dimension. For higher dimension, one just needs to use 2D objects instead of intervals to split into two or more pieces. For instance, one can divide equilateral triangles into 4 smaller ones.

Re: [Haskell-cafe] Cartesian product of a Set

2007-08-01 Thread Dan Weston
Since S.toAscList x is sorted (and yes, as another poster points out, you should use toAsciList to get that sorting guarantee), you can prove that your cartesian product list is also sorted. Data.Set will almost certainly always have access to the sorted list, but even if not, length x

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-08-01 Thread Isaac Dupree
Simon Peyton-Jones wrote: When you install packages A,B,C, the documentation for A,B,C (and nothing else) ought to be locally available as an integrated whole, much as at the GHC web site. I don't know whether Cabal does, or could do, that, but it's surely what one would expect. and would

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread David Pollak
Duncan, Okay... I'm pretty darned impressed. I downloaded the packages and got my first Haskell/Glade app running in about the same amount of time as it took me to get my first VS.Net app up and running. Thanks for the pointer to GTK2hs. I hope to have a nice app to add to the list of Haskell

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Alexis Hazell
On Thursday 02 August 2007 08:17, Claus Reinke wrote: a Monad is a type constructor with two operations, implementing a standard interface and following a few simple rules. . . . . and this is one of the best definitions i've seen yet. Thanks Claus! i think we need to be looking at What is a

Re: [Haskell-cafe] Some Haskell platformish questions

2007-08-01 Thread Duncan Coutts
On Wed, 2007-08-01 at 17:29 -0700, David Pollak wrote: Duncan, Okay... I'm pretty darned impressed. I downloaded the packages and got my first Haskell/Glade app running in about the same amount of time as it took me to get my first VS.Net app up and running. Excellent :-) Thanks for

Re: [Haskell-cafe] Re: monads and groups -- instead of loops

2007-08-01 Thread Arie Peterson
Math alert: mild category theory. Greg Meredith wrote: But, along these lines i have been wondering for a while... the monad laws present an alternative categorification of monoid. At least it's alternative to monoidoid. I wouldn't call monads categorifications of monoids, strictly speaking.

Re: [Haskell-cafe] GHC, GLUT and OS X

2007-08-01 Thread Alan Mock
This works fine for me on PPC and x86 10.4.10. Which GLUT implementation are you using? Does the code hang or does it crash? Alan Mock On Aug 1, 2007, at 7:55 PM, Paul L wrote: I'm trying to get cross platform GLUT/OpenGL program to run, but even the simplest code hang on OS X with GHC

Re: [Haskell-cafe] Re: Knuth Morris Pratt for Lazy Bytestrings implementation

2007-08-01 Thread ajb
G'day all. Quoting ChrisK [EMAIL PROTECTED]: My optimized (and fixed) version of the code is attached. By the way. I don't know if this is relevant, but I'm curious if this approach is any faster: http://72.14.253.104/search?q=cache:kG4zvvkZPLYJ:www.haskell.org/hawiki/RunTimeCompilation I

Re: [Haskell-cafe] GHC, GLUT and OS X

2007-08-01 Thread Paul L
I use x86 10.4.9, and loading it in GHCi doesn't work at all. It hang after the window pops up. BTW, compiling it using GHC to binary form seems to work. But unfortunately this is not acceptable as loading in GHCi is crucial for the purpose. I'm doing a port of the SOE Graphics from HGL to

[Haskell-cafe] Installing FreeGLUT

2007-08-01 Thread Ronald Guida
Hi, I am trying to use freeglut with GHCi 6.6.1, and I'm stuck. I downloaded freeglut 2.4.0 and compiled it. I am on a Windows XP machine, and I found that freeglut compiled out of the box in MS Visual Studio.Net 2003. My difficulty is that GHCi is finding GLUT 2.2.1 and not freeglut.

  1   2   >