Re: [Haskell-cafe] pure crisis :)

2009-02-04 Thread Seth Gordon
Bulat Ziganshin wrote: Hello haskell-cafe, pure functional denotation for crisis: (_|_) Buy ⊥, sell ⊤! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] PRE-ANNOUNCE: cabal-debian (automatically debianize cabal packages)

2008-08-22 Thread Seth Gordon
Ketil Malde wrote: Christopher Lane Hinson <[EMAIL PROTECTED]> writes: Having a debianized cabal-install would be the biggest win in my book. If there were an unofficial debianized mirror of hackage, I probably wouldn't use it anyway. I might. I would. (I run Ubuntu at home, Debian on my

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Seth Gordon
PR Stanley wrote: Blimey! Talk about rearranging the deckchairs :-) Today's xkcd seems apropos: http://xkcd.com/438/ It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the H

Re: [Haskell-cafe] ANNOUNCE: Well-Typed LLP - The Haskell Consultants

2008-04-07 Thread Seth Gordon
Ian Lynagh wrote: Fellow Haskellers, We (Björn Bringert, Duncan Coutts and Ian Lynagh) are pleased to announce that we have recently set up a Haskell consultancy company, Well-Typed LLP (http://www.well-typed.com/). Congratulations! Do you have a plan to market your services to people who mig

Re: [Haskell-cafe] Re: US Homeland Security program language security risks

2008-01-09 Thread Seth Gordon
Daniel Fischer wrote: Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider: That's an interesting task: Design a non-touring complete, restricted language in which every expression is decidable, without making the language unusable for usual programming problems. I'm not a logician, but di

Re: [Haskell-cafe] Why are OCaml and Haskell being used at these companies?

2007-11-14 Thread Seth Gordon
Jon Harrop wrote: When functional languages achieve these goals I believe the total number of users will increase dramatically as scientists and engineers adopt them alongside their standard tools. Bioinformaticians are among the first to adopt functional programming languages but I believe m

Re: [Haskell-cafe] Best Linux for Haskell?

2007-11-06 Thread Seth Gordon
Peter Verswyvelen wrote: Each year I give Linux a try. And usually I kick it off my harddrive after a month, and stick to Windows. However, it does get better each year, so… So which kind Linux works best for running GHC (6.8.1) and related tools? (I want to give Yi a go, I can’t get it to

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

2007-10-10 Thread Seth Gordon
Aha! Instead of the lambda surrounded by mathematical stuff as the haskell.org logo, we need a picture of a medicine bottle. "Haskell. Fewer headaches. No side effects." Alternatively, a picture of a red pill with an embossed lambda... ___ Haske

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

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

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

2007-10-09 Thread Seth Gordon
Henning Thielemann wrote: In my experience only the other way round works: Let people use C, Perl and Python until they find their programs unmaintainable. Then they will become interested in style and discipline and programming languages which _support_ good style. Perhaps this could be the

[Haskell-cafe] Pierce on type theory and category theory

2007-09-25 Thread Seth Gordon
Are Benjamin C. Pierce's _Types and Programming Languages_ and/or _Basic Category Theory for Computer Scientists_ suitable for self-study? (Do they have problem sets that can be checked by either looking up answers in The Back of the Book, or by trying to compile/run some code that the student

Re: [Haskell-cafe] Shouldnt this be lazy too?

2007-09-24 Thread Seth Gordon
Vimal wrote: Hi all, I was surprised to find out that the following piece of code: length [1..] > 10 isnt lazily evaluated! I wouldnt expect this to be a bug, but in this case, shouldnt the computation end when the length function evaluation goes something like: 10 + length [11..] I susp

Re: [Haskell-cafe] Re: [Haskell] Math behind Haskell

2007-09-24 Thread Seth Gordon
I'm spending my Copious Free Time going through the Graham/Knuth/Patashnik _Concrete Mathematics_ textbook. This is the textbook used at one of Stanford's "on-beyond-calculus math for CS majors" classes. If nothing else, the discipline of doing the homework problems at the end of each chapte

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Seth Gordon
Dougal Stanton wrote: On 12/09/2007, Seth Gordon <[EMAIL PROTECTED]> wrote: I � Unicode. Was it intentional that the central character appears as a little '?', even though the aleph on the line above worked? It was intentional. If I ♡ed Unicode, I wo

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Seth Gordon
Andrea Rossato wrote: What puzzles me is the behavior of putStrLn. putStrLn is sending the following bytes to standard output: 97, 98, 195, 168, 195, 168, 195, 168, 10 Since the code that renders characters in your terminal emulator is expecting UTF-8[*], each (195, 168) pair of bytes is ren

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Seth Gordon
Andrea Rossato wrote: Hi, supposed that, in a Linux system, in an utf-8 locale, you create a file with non ascii characters. For instance: touch abèèè Now, I would expect that the output of a shell command such as "ls ab*" would be a string/list of 5 chars. Instead I find it to be a list of 8

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Seth Gordon
Sebastian Sylvan wrote: On 14/08/07, Dan Piponi <[EMAIL PROTECTED]> wrote: If I was one of your students and you said that monads are recipes I would immediately ask you where the monads are in my factorial program regardless of whether you had introduced one or two different analogies for recip

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

2007-08-08 Thread Seth Gordon
Kim-Ee Yeoh wrote: Seth Gordon wrote: Functors are a generalization from lists to "things that can be mapped over" in general, and then monads are a generalization of functors. Way to go! That way lies true co/monadic enlightenment. I feel like I still don't understand com

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 witho

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, Perl,

Re: [Haskell-cafe] New HaskODell user groups

2007-04-27 Thread Seth Gordon
Donald Bruce Stewart wrote: > > P.S. Some obvious user group candidates, in my opinion, would be a > Portland group, a Bay Area group and something at Chalmers... ;-) Are there any other Haskellers in the Boston area? ___ Haskell-Cafe mailing list Has

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-18 Thread Seth Gordon
Paul Johnson wrote: >> You cannot win over the entrepreneur with promises of "easier and more >> robust". This translates to "anyone can do it" and the valuable "trade >> secret" of arcane wizardry is now devalued. > > I suggest reading extracts from "Beating the Averages" by Paul Graham. > Then

Re: [Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Seth Gordon
Thomas Hartman wrote: > Thanks. I incorporated these changes, and it cranks longer now before > failing. But still fails, now with a seg fault. > * > gcc: Internal error: Segmentation fault (program cc1) > Please submit a full bug report. > See http://gcc.gnu.org/bugs.html> for instruct

Re: [Haskell-cafe] A "real" Haskell Cookbook

2007-02-23 Thread Seth Gordon
P. R. Stanley wrote: > I'm referring to math symbols which do not get successfully > translated into an intelligible symbol in the screen reader browse buffer. Is there a way to make the symbols both look right on a screen and sound right from a screen reader? E.g., Σ _

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Seth Gordon
> I assume that there is no way to change the date for *this* conference; > it would require renegotiating agreements and rejuggling schedules with > too many actors (hotels, restaurants, important speakers, etc.). > > But I would like everyone involved in planning *future* conferences to > keep t

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Seth Gordon
Murray Gross wrote: > First, I suspect that the date is now cast in stone and cannot be > changed, and it is fair to suspect that holiday observance is going to > reduce attendance (at the very least, in the later afternoon). I assume that there is no way to change the date for *this* conference;

Re: [Haskell-cafe] TFP 2007: Registration and Program

2007-02-22 Thread Seth Gordon
TFP 2007 wrote: > > Dear Colleagues, > > You may now resgister for TFP 2007! TFP 2007 will be held April 2-4, > 2007 in New York City, USA. Aaargh! April 2 is the first night of Passover. This is not one of those obscure holidays whose names are Hebrew for "alternate-side parking suspended"[*]

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Seth Gordon
Jefferson Heard wrote: > > Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves > me with some rather non-intuitive strategies for achieving execution time > efficiency. Anyone care to point me in the direction of a document on > efficiency in Haskell? I found this pa

Re: [Haskell-cafe] still wrestling with io

2007-02-08 Thread Seth Gordon
Martin DeMello wrote: > Code here: http://zem.novylen.net/anagrid.html > > I've got an instance of IO appearing unexpectedly and I can't figure > out where from. It throws up the following error: > > $ ghc --make test.hs > Chasing modules from: test.hs > Compiling Main ( test.hs, test

Re: [Haskell-cafe] IO is not a monad

2007-02-08 Thread Seth Gordon
Aaron McDaid wrote: > Could seq be changed so that it will not give an error if it finds > undefined? Am I right in thinking that seq is supposed to > theoretically do nothing, but simply give a hint to the compiler so to > speak? If that is true, it should merely attempt to evaluate it, but > igno

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-31 Thread Seth Gordon
Ketil Malde wrote: > Using a lazy fold may not be the best choice. Although it may > sound enticing to delay washing until a clean dish is actually required > (and having the dirty dishes removed by the garbage collector, hopefully > before they start naturally decomposing), you will quickly run o

Re: [Haskell-cafe] Strings in Haskell

2007-01-24 Thread Seth Gordon
John Meacham wrote: > On Mon, Jan 22, 2007 at 09:37:21PM -0500, Bryan Donlan wrote: > >>Or you can get the best of both worlds by using Data.ByteString.Lazy :) >>Even with laziness, all the indirections that String causes hurts >>performance. > > > actually, strictness analysis is really good a

Re: [Haskell-cafe] IO is not a monad (and seq, and in general _|_)

2007-01-23 Thread Seth Gordon
Brandon S. Allbery KF8NH wrote: > Can someone explain to me, given that (a) I'm not particularly expert > at maths, (b) I'm not particularly expert at Haskell, and (c) I'm a bit > fuzzybrained of late: Me too... > Given that _|_ represents in some sense any computation not > representable in a

Re: [Haskell-cafe] New (simple) Lazy Evaluation tutorial

2007-01-18 Thread Seth Gordon
Andrew Wagner wrote: > Hi all, > > An interesting question came up in #haskell the other day, and I took > the resulting discussion and wrapped it up into a simple tutorial for > the wiki. Since I'm quite a newbie to haskell myself, I'd appreciate > any double-checking of my logic and, of course,

[Haskell-cafe] an advanced foldification problem

2007-01-11 Thread Seth Gordon
I have a data type "Group", representing a group of geographic information that is all referring to the same location, and a function "mergeGroups" that tries to merge two groups: mergeGroups :: Group -> Group -> Maybe Group Then I have a function "mergeGroupToList" that tries to merge its fi

Re: [Haskell-cafe] HaskellForge?

2007-01-11 Thread Seth Gordon
Yitzchak Gale wrote: > tphyahoo wrote: > >> I think people want something like CPAN. This implies a centralized >> "official" repository > > > I agree. > > I think we also need a notion of a canonical > standard package for each popular category. For some categories, it might be better to have

Re: [Haskell-cafe] Composing functions with runST

2007-01-03 Thread Seth Gordon
David House wrote: > >> So I can't just tell someone who's just starting to learn Haskell that >> "f $ g y" is equivalent to "f (g y)"; I have to say "those two are >> *almost always* equivalent, but if you use $ and the compiler complains >> about not being able to match the expected and the infe

Re: [Haskell-cafe] Composing functions with runST

2007-01-03 Thread Seth Gordon
Simon Peyton-Jones wrote: > Conor and others are right; it's all to do with type inference. There is > nothing wrong with the program you are writing, but it's hard to design a > type inference algorithm that can figure out what you are doing. > > The culprit is that you want to instantiate a p

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project [Was: Re: What is a hacker?]

2006-12-19 Thread Seth Gordon
Joachim Durchholz wrote: >> Trying to fully evaluate an infinite data structure will result in >> looping or memory exhaustion, and you have that possibilities in almost >> all languages. > > Yes, but I suspect that Haskell makes it easier to make that kind of bug. > Worse, it's easy to introduce

Re: [Haskell-cafe] Type problem with simple takusen code (was: Trivial database access in Haskell)

2006-12-12 Thread Seth Gordon
Paul Moore wrote: > db.hs:10:64: >Couldn't match expected type `forall mark. DBM mark Session a' > against inferred type `a1 b' >In the second argument of `($)', namely >`do r <- doQuery > (sql "select username from all_users") query1Iteratee [] >

Re: [Haskell-cafe] Writing "Haskell For Dummies Or At Least For People Who Feel Like Dummies When They See The Word 'Monad'"

2006-12-12 Thread Seth Gordon
Paul Hudak wrote: > Hi Sebastian. As a writer of one of those "academic" Haskell textbooks, > I've been following this thread with some interest. BTW, I found your textbook very helpful. The first time I tried to learn Haskell, I got the Bird and Wadler textbook, and got bogged down about halfwa

Re: [Haskell-cafe] Good Haskell introduction for an Ocaml programmer?

2006-12-12 Thread Seth Gordon
Brian Hurt wrote: > > Greetings, all. I'm an experienced Ocaml programmer, looking to broaden > my horizons yet further and pick up Haskell, and I'm wondering if > there's a good introduction to Haskell for me. Okasaki's _Purely Functional Data Structures_ discusses (among other things) the pros

Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-12 Thread Seth Gordon
Taral wrote: > On 12/11/06, Paul Moore <[EMAIL PROTECTED]> wrote: > >> F:\cabal-1.1.6.1>runhaskell Setup.lhs install >> Installing: C:\Program Files\Haskell\Cabal-1.1.6.1\ghc-6.6 & >> C:\Program Files\Haskell\bin Cabal-1.1.6.1... >> Setup.lhs: Error: Could not find module: Distribution.Compiler wi

Re: [Haskell-cafe] Aim Of Haskell

2006-12-12 Thread Seth Gordon
Donald Bruce Stewart wrote: > > Who wants to join the Lisp is not functional programming movement with me? Oh, lordy. As if the "Scheme is not Lisp" flames on comp.lang.lisp weren't enough... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:

Re: [Haskell-cafe] strange type mismatch when trying to use takusen

2006-11-24 Thread Seth Gordon
Taral wrote: Ah, the dreaded $ with existential types problem. $ is not quite equivalent to application -- the type checker does something funny with forall types. Just take out the $ and you'll be fine. Is this a ghc bug, or some subtlety of the type system that I don't understand?

[Haskell-cafe] strange type mismatch when trying to use takusen

2006-11-23 Thread Seth Gordon
I have a simple test program for takusen and PostgreSQL: import Database.Enumerator import Database.PostgreSQL.Enumerator import Control.Monad.Trans gazdbSession dbname = connect [CAdbname dbname] resultCollector :: (Monad m) => String -> IterAct m [String] resultCollector str accum = result'

Re: [Haskell-cafe] the case of the 100-fold program speedup

2006-11-15 Thread Seth Gordon
As Lily Tomlin would say, neVERmind. Simon P-J asked me, in email, whether the deforestation was the thing that actually made the program faster or whether it was just the thing that made me think about how to solve the problem. I realized that my fast program had *another* difference from the ea

Re: [Haskell-cafe] the case of the 100-fold program speedup

2006-11-15 Thread Seth Gordon
Henning Thielemann wrote: > On Tue, 14 Nov 2006, Seth Gordon wrote: > > >>It took me a week to figure out the right algorithm for combining these >>two procedures and write some almost-working code that implemented it. >>It took a co-worker of mine another few day

[Haskell-cafe] the case of the 100-fold program speedup

2006-11-14 Thread Seth Gordon
One of Alan Perlis's "Epigrams in Programming" is "A language that doesn't affect the way you think about programming, is not worth knowing". I recently had an experience that demonstrated this principle. I had to write some code that took a polygon (encoded in WKT, a standard format for geograph

Re: [Haskell-cafe] Newbie and working with IO Int and Int

2006-10-17 Thread Seth Gordon
Víctor A. Rodríguez wrote: > Hi all, > > I'm really newbie to Haskell, and working on a program I'm trying to make > some testing. > I make some test on certain know values ( e.g. adding 10 to 15 must return > 25) and some test on random values (eg. adding rnd1 to rnd2 must return > rnd1+rnd2). >

Re: [Haskell-cafe] getting a DB library working with ghc 6.6 and PostgreSQL 7.4.7

2006-10-17 Thread Seth Gordon
> I installed HDBC, but when I tried running a simple program that used > it, I get the error message > > ghc-6.6: > /usr/local/lib/HDBC-postgresql-1.0.1.0/ghc-6.6/HSHDBC-postgresql-1.0.1.0.o: > unknown symbol `PQserverVersion' Ah, I figured it out. The PQserverVersion function is documented in

[Haskell-cafe] getting a DB library working with ghc 6.6 and PostgreSQL 7.4.7

2006-10-16 Thread Seth Gordon
I'm looking for an alternative to HSQL for database connectivity -- the lack of prepared statements in HSQL is particularly worrisome. I installed HDBC, but when I tried running a simple program that used it, I get the error message ghc-6.6: /usr/local/lib/HDBC-postgresql-1.0.1.0/ghc-6.6/HSHDBC-

Re: [Haskell-cafe] Re: tail-recursing through an associative list

2006-10-12 Thread Seth Gordon
[EMAIL PROTECTED] wrote: > For logarithmic access times, you should use a binary search tree like > Data.Map or similar. The problem in your case could be that matchKeys is > only approximate and your keys cannot be ordered in suitable fasion. That is precisely the problem that I was dealing with.

[Haskell-cafe] tail-recursing through an associative list

2006-10-12 Thread Seth Gordon
In my first posting, I mentioned that I was going to try to translate some of our code to Haskell and see how it worked. Well, I don't have a stunning demonstration of the power of pure functional programming, but I do have an interesting problem. I chose to port a program that we use in our buil

[Haskell-cafe] ghc 6.2.2 seems to ignore -package when there's a -prof option

2006-10-11 Thread Seth Gordon
I have a program using HSQL that I'm trying to profile. When I do ghc program.hs -package hsql -o program it compiles fine, but when I do ghc -prof -auto-all program.hs -package hsql -o program I get error messages saying "failed to load interface for `Database.HSQL'" and so forth, the same wa

Re: [Haskell-cafe] Re: a monad for secret information

2006-10-10 Thread Seth Gordon
David Roundy wrote: Try module Secret (Secret, classify, declassify) where data Secret a = Secret String a classify :: String -> a -> Secret a classify pw x = Secret pw x declassify :: Secret a -> String -> Maybe a declassify (Secret pw x) pw' | pw' == pw = Just x declassify (Secret _ _) _ =

Re: [Haskell-cafe] a monad for secret information

2006-10-10 Thread Seth Gordon
> data Secret a = Secret {password :: String, value :: a} > > classify :: String -> a -> Secret a > classify = Secret > > declassify :: String -> Secret a -> Maybe a > declassify guess (Secret pw v) | guess == pw = Just v > | otherwise = Nothing > > Pu

Re: [Haskell-cafe] a monad for secret information

2006-10-10 Thread Seth Gordon
Cale Gibbard wrote: > Why not just: > > secret :: a -> Classification String a > secret = Classification "xyzzy" > > The password string isn't part of the type, it doesn't even > necessarily exist at compile time. You might have just got confused > between type and data constructors for a moment.

[Haskell-cafe] a monad for secret information

2006-10-09 Thread Seth Gordon
I finally (think I) understand monads well enough to make one up: module Secret (Secret, classify, declassify) where data Secret a = Secret a classify :: a -> Secret a classify x = Secret x declassify :: Secret a -> String -> Maybe a declassify (Secret x) "xyzzy" = Just x declassify (Secret x

Re: [Haskell-cafe] Re: Greetings

2006-09-30 Thread Seth Gordon
Paul Johnson wrote: I've done some stuff with maybe 50k rows at a time. A few bits and pieces: 1: I've used HSQL (http://sourceforge.net/project/showfiles.php?group_id=65248) to talk to ODBC databases. Works fine, but possibly a bit slowly. I'm not sure where the delay is: it might just be

Re: [Haskell-cafe] Greetings...

2006-09-30 Thread Seth Gordon
jeff p wrote: Hello, So before I embark on day 1 of the project, I thought I should check and see if anyone on this list has used Haskell to munge a ten-million-row database table, and if there are any particular gotchas I should watch out for. One immediate thing to be careful about is how y

[Haskell-cafe] Greetings...

2006-09-29 Thread Seth Gordon
I've finally gotten enough round tuits to learn Haskell, and now that I've done some of the exercises from _The Haskell School of Expression_ and I finally (think I) understand what a monad is, the language is making a lot more sense to me (although my code is not always making so much sense to the