Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 16:06 -0600, Derek Elkins wrote: On Sun, 2009-01-25 at 07:11 -0800, Jonathan Cast wrote: On Sun, 2009-01-25 at 10:46 +0100, Thomas Davie wrote: On 25 Jan 2009, at 10:08, Daniel Fischer wrote: Am Sonntag, 25. Januar 2009 00:55 schrieb Conal Elliott: It's

Re: [Haskell-cafe] ANN: filestore 0.1

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 23:09 +0100, Magnus Therning wrote: On Sun, Jan 25, 2009 at 10:47 AM, Derek Elkins derek.a.elk...@gmail.com wrote: On Sun, 2009-01-25 at 09:32 +, Magnus Therning wrote: Bulat Ziganshin wrote: Hello Gwern, Sunday, January 25, 2009, 2:56:07 AM, you wrote:

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Jonathan Cast
On Sat, 2009-01-24 at 01:30 +0300, Miguel Mitrofanov wrote: Seems like all telepath are on vacation, Now, now, you didn't let enough time elapse to know that for sure. jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Jonathan Cast
On Fri, 2009-01-23 at 22:58 +, Olex P wrote: Well if telepaths on vacation... class Vector v where (^+^) :: v - v - v data Vector3 = V3 !Double !Double !Double instance Vector Vector3 where (V3 x1 y1 z1) ^+^ (V3 x2 y2 z2) = V3 (x1 + x2) (y1 + y2) (z1 + z2) class

Re: [Haskell-cafe] Employment

2009-01-22 Thread Jonathan Cast
On Tue, 2009-01-20 at 21:01 +, Andrew Coppin wrote: Paul Johnson wrote: So next time I hear the you can't get the programmers line I'm going to respond with something like this: If you post an advert for a Haskell developer you will get 20 applicants. All of those people

Re: [Haskell-cafe] Employment

2009-01-22 Thread Jonathan Cast
On Tue, 2009-01-20 at 19:14 +, Andrew Coppin wrote: Jonathan Cast wrote: On Mon, 2009-01-19 at 21:04 +, Andrew Coppin wrote: I mean, heck, *I* use Haskell at work - and I'm not even supposed to be coding things! /me feels slightly relieved, if you'll forgive my saying so

Re: [Haskell-cafe] Employment

2009-01-22 Thread Jonathan Cast
On Thu, 2009-01-22 at 20:02 -0500, Andrew Wagner wrote: That's..evil I know. I'm evil too, though. So it's cool. jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-21 Thread Jonathan Cast
On Wed, 2009-01-21 at 13:38 -0600, Jake McArthur wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gleb Alexeyev wrote: | Mauricio wrote: | | data SomeNum = SN (forall a. a) | | [...] | | you cannot do anything to the value you extract Maybe. Say you construct (SN x). If you

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Jonathan Cast
On Tue, 2009-01-20 at 23:41 +0100, Henning Thielemann wrote: On Thu, 15 Jan 2009, John Goerzen wrote: One thing that does annoy me about Haskell- naming. Say you've noticed a common pattern, a lot of data structures are similar to the difference list I described above, in that they

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote: Hello, The multitude of newtypes in the Monoid module are a good indication that the Monoid class is not a good fit for the class system I would say rather that the class system is not a good fit for Monoid. Proposals for local

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 19:33 +, Andrew Coppin wrote: rocon...@theorem.ca wrote: I noticed the Bool datatype isn't well documented. Since Bool is not a common English word, I figured it could use some haddock to help clarify it for newcomers. My only problem with it is that it's

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 12:10 -0800, Iavor Diatchki wrote: I usually avoid using the newtype trick as I find it inconvenient: usually the newtype does not have the same operations as the underlying type and so it cannot be used directly, and if you are going to wrap thing just when you

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 21:31 +, Ross Paterson wrote: On Mon, Jan 19, 2009 at 01:13:37PM -0800, Jonathan Cast wrote: (On the other hand, your hunch that lift = return is correct --- so you get a cookie for that; it's just that return here is neither the return of the monad for m nor

Re: [Haskell-cafe] Employment

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 21:04 +, Andrew Coppin wrote: Erik de Castro Lopo wrote: Its proabably a little harder to find a company that wants a Haskell hacker than it is to find a company where Haskell and other sane languages can be worked in over time. I think you're probably

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 20:55 +, Andrew Coppin wrote: Dan Piponi wrote: On Mon, Jan 19, 2009 at 11:33 AM, Andrew Coppin andrewcop...@btinternet.com wrote: My only problem with it is that it's called Bool, while every other programming language on Earth calls it Boolean. (Or at

Re: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Jonathan Cast
On Sun, 2009-01-18 at 11:23 +, Andrew Coppin wrote: Jonathan Cast wrote: On Sat, 2009-01-17 at 12:04 +, Andrew Coppin wrote: instance (Monad m) = Functor m where fmap f ma = do a - ma; return (f a) While that's quite interesting from a mathematical point

Re: [Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Jonathan Cast
On Sun, 2009-01-18 at 11:11 +, Andrew Coppin wrote: Heinrich Apfelmus wrote: Andrew Coppin wrote: instance (Monad m) = Functor m where fmap f ma = do a - ma; return (f a) While that's quite interesting from a mathematical point of view, how is this useful for

Re: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-17 Thread Jonathan Cast
On Sat, 2009-01-17 at 12:04 +, Andrew Coppin wrote: Eugene Kirpichov wrote: No, a functor is a more wide notion than that, it has nothing to do with collections. An explanation more close to truth would be A structure is a functor if it provides a way to convert a structure over X to

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-17 Thread Jonathan Cast
On Sat, 2009-01-17 at 11:07 +, Andrew Coppin wrote: Anton van Straaten wrote: Niklas Broberg wrote: I still think existential quantification is a step too far though. :-P Seriously, existential quantification is a REALLY simple concept, that you would learn week two (or maybe three)

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-17 Thread Jonathan Cast
On Sat, 2009-01-17 at 10:47 +0100, david48 wrote: On Fri, Jan 16, 2009 at 4:04 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Fri, 2009-01-16 at 14:16 +0100, david48 wrote: Part of the problem is that something like a monoid is so general that I can't wrap my head around why going

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-16 Thread Jonathan Cast
On Fri, 2009-01-16 at 14:16 +0100, david48 wrote: Part of the problem is that something like a monoid is so general that I can't wrap my head around why going so far in the abstraction. For example, the writer monad works with a monoid; using the writer monad with strings makes sense because

Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-16 Thread Jonathan Cast
to combine configuration parameters/flags, monoids in writers, etc. Show how using the abstract monoid class is an advantage over a less abstract class/type with concrete examples. Jonathan Cast wrote: To accumulate a running count, maybe? A fairly common pattern for counting

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-16 Thread Jonathan Cast
On Fri, 2009-01-16 at 18:14 -0500, Anton van Straaten wrote: Niklas Broberg wrote: I still think existential quantification is a step too far though. :-P Seriously, existential quantification is a REALLY simple concept, that you would learn week two (or maybe three) in any introductory

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 09:34 -0600, John Goerzen wrote: Hi folks, Don Stewart noticed this blog post on Haskell by Brian Hurt, an OCaml hacker: http://enfranchisedmind.com/blog/2009/01/15/random-thoughts-on-haskell/ It's a great post, and I encourage people to read it. I'd like to

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 10:56 -0600, John Goerzen wrote: Lennart Augustsson wrote: Most people don't understand pure functional programming either. Does that mean we should introduce unrestricted side effects in Haskell? The key is to introduce concepts to them in terms they can understand.

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 21:17 +, Andrew Coppin wrote: Sebastian Sylvan wrote: On Thu, Jan 15, 2009 at 7:46 PM, Andrew Coppin andrewcop...@btinternet.com mailto:andrewcop...@btinternet.com wrote: The sad thing is, it's not actually complicated. The documentation just makes

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 21:29 +, Andrew Coppin wrote: Jonathan Cast wrote: Where, in the history of western civilization, has there ever been an engineering discipline whose adherents were permitted to remain ignorant of the basic mathematical terminology and methodology

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 21:59 +, Thomas DuBuisson wrote: How does forcing them to learn proposed terminology such as `Appendable' help here? Learners of Haskell do still need to learn what the new word means. The contention is that 'Appendable' is an intuitive naming that people will

RE: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 17:13 +, Sittampalam, Ganesh wrote: Lennart Augustsson wrote: Most people don't understand pure functional programming either. Does that mean we should introduce unrestricted side effects in Haskell? No, just that we should seek to minimise the new stuff they

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 16:16 -0600, John Goerzen wrote: On Thu, Jan 15, 2009 at 01:50:11PM -0800, Jonathan Cast wrote: On Thu, 2009-01-15 at 10:56 -0600, John Goerzen wrote: Lennart Augustsson wrote: Most people don't understand pure functional programming either. Does that mean we

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 15:25 -0800, Max Rabkin wrote: On Thu, Jan 15, 2009 at 3:16 PM, Cale Gibbard cgibb...@gmail.com wrote: However, Appendable carries baggage with it which is highly misleading. Consider, for instance, the monoid of rational numbers under multiplication (which, by the

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Jonathan Cast
On Thu, 2009-01-15 at 17:06 -0500, Steve Schafer wrote: On Thu, 15 Jan 2009 13:21:57 -0800, you wrote: Where, in the history of western civilization, has there ever been an engineering discipline whose adherents were permitted to remain ignorant of the basic mathematical terminology and

Re: [Haskell-cafe] Stack Overflow, tail recursion and CPS

2009-01-14 Thread Jonathan Cast
On Wed, 2009-01-14 at 19:19 +0100, Günther Schmidt wrote: Hello Neil, thanks, that did indeed work. I guess I shot myself in the foot a bit here ... Cause my real problem isn't actually with Map but with IxSet (from HAppS) which to my knowledge does not have some sort of strict insert

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Jonathan Cast
On Wed, 2009-01-14 at 11:06 -0800, Max Rabkin wrote: On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: Do you have an example of a macro that can't be replaced by higher-order functions and laziness? I believe I do: one macro I found useful when writing

Re: [Haskell-cafe] Haskell and C++ program

2009-01-14 Thread Jonathan Cast
On Wed, 2009-01-14 at 12:45 -0800, Sukit Tretriluxana wrote: Hi all, I was looking around Stroustrup's website and found a simple program that he showed how standard library can be used to make the program succinct and safe. See http://www.research.att.com/~bs/bs_faq2.html#simple-program. I

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Jonathan Cast
On Wed, 2009-01-14 at 18:59 -0500, Brandon S. Allbery KF8NH wrote: On 2009 Jan 14, at 10:26, Neil Mitchell wrote: As an example: foo = uabc\N{VULGAR FRACTION ONE HALF} Hmm, looks nice, and sensible. But as soon as you've got \N{} syntax I want: foo\E{show i}bar i.e.

Re: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Jonathan Cast
On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira Pinto wrote: Last night I was thinking on what makes monads so hard to take, and came to a conclusion: the lack of a guided tour on the implemented monads. ... Inspired by the paper Functional Programming with Overloading

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 0.4.8

2009-01-09 Thread Jonathan Cast
On Fri, 2009-01-09 at 18:38 +0100, Niklas Broberg wrote: Thanks all for the suggestions! VIM and I have never gone together well, probably mostly my fault I know. Maybe some day... Emacs isn't my favorite either. I do have Notepad++, but it only seems to support a small portion of the

Re: [Haskell-cafe] Inconsistency in support for phantom types?

2009-01-08 Thread Jonathan Cast
On Thu, 2009-01-08 at 20:11 +, DavidA wrote: Hi, I have run into what appears to be an inconsistency in the support for using phantom types to parameterize other types. Here's an example (don't pay too much attention to the maths, it's just there to motivate the example). I want to

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Jonathan Cast
On Fri, 2009-01-02 at 23:48 +0300, Miguel Mitrofanov wrote: module Main where import qualified QName as Q import qualified Element as E ... Q.name ... E.name ... I'm using this pattern of writing code and, so far, I find it very convenient. Yet, the code is likely to be spread

Re: [Haskell-cafe] Stupid question #852: Strict monad

2009-01-01 Thread Jonathan Cast
On Thu, 2009-01-01 at 14:25 -0500, Brian Hurt wrote: First off, let me apologize for this ongoing series of stupid newbie questions. Haskell just recently went from that theoretically interesting language I really need to learn some day to a language I actually kinda understand and can

Re: [Haskell-cafe] Stupid question #852: Strict monad

2009-01-01 Thread Jonathan Cast
On Thu, 2009-01-01 at 13:44 -0700, Luke Palmer wrote: On Thu, Jan 1, 2009 at 1:31 PM, David Menendez d...@zednenem.com wrote: 2009/1/1 Luke Palmer lrpal...@gmail.com: So that's the answer: there already is a Strict monad. And an attempt to make a

Re: [Haskell-cafe] Stupid question #852: Strict monad

2009-01-01 Thread Jonathan Cast
On Thu, 2009-01-01 at 17:03 -0500, David Menendez wrote: On Thu, Jan 1, 2009 at 4:30 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Thu, 2009-01-01 at 13:44 -0700, Luke Palmer wrote: In my reply I missed the important consideration of the strictness of (=), irrsepective

Re: [Haskell-cafe] bottom case in proof by induction

2008-12-31 Thread Jonathan Cast
On Thu, 2009-01-01 at 03:50 +, ra...@msn.com wrote: I am afraid I am still confused. foo [] = ... foo (x:xs) = ... There is an implied: foo _|_ = _|_ The right side cannot be anything but _|_. If it could, then that would imply we could solve the halting problem: in a

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jonathan Cast
On Fri, 2008-12-26 at 11:51 +, Thomas DuBuisson wrote: Hello cafe, This is just a small thought, but its been bugging me. We have these things called type classes for a reason (I like to think). Type classes were invented for two reasons: 1) To imitate mathematical convention. Addition,

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jonathan Cast
On Fri, 2008-12-26 at 13:55 -0600, Jeff Heard wrote: I don't think that making Show a type class was a mistake. I think that we have long since overloaded the meaning of Show and made it ambiguous. There are multiple distinct reasons people use Show, and this gets confusing. It would be

Re: [Haskell-cafe] A hell of a question

2008-12-22 Thread Jonathan Cast
On Mon, 2008-12-22 at 17:14 -0800, Jason Dusek wrote: Andrzej Jaworski hims...@poczta.nom.pl wrote: First let me disassociate Haskell from Taoism which to may taste has left us in an unhealthy climate. It suffices to say that Taoism is a school of clever trics and cute aphorisms but

Re: intimidating terminology (was: Re: [Haskell-cafe] Time for a new logo?)

2008-12-19 Thread Jonathan Cast
On Fri, 2008-12-19 at 09:13 +, Lennart Augustsson wrote: When accurate names for Haskell concepts already exist we should use them (as we have tried in the past). There has been too much invention of misleading terminology in computing already. There are two possible cases (this applies

Re: [Haskell-cafe] Time for a new logo?

2008-12-17 Thread Jonathan Cast
On Wed, 2008-12-17 at 21:31 +, Andrew Coppin wrote: Jonathan Cast wrote: {-# LANGUAGE ExistentialQuantification #-} Hmm, now if this was Perl or something, that would be HiddenTypeVariables or something. Much less fearsom-sounding. No, it's cute. Repulsively so

Re: [Haskell-cafe] Time for a new logo?

2008-12-17 Thread Jonathan Cast
On Wed, 2008-12-17 at 23:00 +0100, Daniel Fischer wrote: Am Mittwoch, 17. Dezember 2008 22:35 schrieb Jonathan Cast: On Wed, 2008-12-17 at 21:31 +, Andrew Coppin wrote: In other words, you want to keep Haskell elitist. I think there's value in having elites around. Yes

Re: [Haskell-cafe] Time for a new logo?

2008-12-16 Thread Jonathan Cast
On Tue, 2008-12-16 at 20:23 +, Andrew Coppin wrote: Malcolm Wallace wrote: Andrew Coppin andrewcop...@btinternet.com wrote: To him, apparently, the current logo says Haskell is all about arcane and obscure mathematical constructs. In fact, we think that complicated

Re: [Haskell-cafe] Haskell as a religion

2008-12-16 Thread Jonathan Cast
On Tue, 2008-12-16 at 20:38 +, Andrew Coppin wrote: Don Stewart wrote: I think of Haskell more as a revolutionary movement LOL! Longest revolution EVER, eh? No. Das Kapital publication 1867. Russian Revolution 1917. FTW. jcc ___

Re: [Haskell-cafe] Origins of '$'

2008-12-08 Thread Jonathan Cast
On Mon, 2008-12-08 at 09:58 -0800, Mark P. Jones wrote: Don Stewart wrote: Which suggests that $ was already in the 1.0 report going to SIGPLAN. Perhaps Paul or Simon could shed light on it? Anyone have the 1.0 report lying around to check if it was in earlier? As far as Haskell is

Re: [Haskell-cafe] Reading showables

2008-12-07 Thread Jonathan Cast
On Mon, 2008-12-08 at 11:16 +1100, John Ky wrote: Hi Thomas, So show . read and \x - show (read x) are actually mean different things? No. Of course not. But there's no guarantee that show (read x) = x either. Also, I never suspected that something like this should succeed:

Re: [Haskell-cafe] Re: Functional version of this OO snippet

2008-12-05 Thread Jonathan Cast
On Fri, 2008-12-05 at 18:50 +0100, Thomas Davie wrote: On 5 Dec 2008, at 17:46, Duncan Coutts wrote: On Fri, 2008-12-05 at 17:06 +0100, Thomas Davie wrote: On 5 Dec 2008, at 17:00, Duncan Coutts wrote: On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote: Sure, and he could then

Re: [Haskell-cafe] How to define Show [MyType] ?

2008-12-04 Thread Jonathan Cast
On Fri, 2008-12-05 at 01:27 +0300, Dmitri O.Kondratiev wrote: I am trying to define instance Show[MyType] so show (x:xs :: MyType) would return a single string where substrings corresponding to list elements will be separated by \n. This would allow pretty printing of MyType list in several

Re: [Haskell-cafe] How to define Show [MyType] ?

2008-12-04 Thread Jonathan Cast
On Thu, 2008-12-04 at 14:46 -0800, Ryan Ingram wrote: If you really, really wanted to define Show [ShipInfo], then putting {-# LANGUAGE FlexibleInstances, OverlappingInstances #-} at the beginning of your file would work. At the cost of using overlapping instances, of course. And

Re: [Haskell-cafe] gmp license == no commercial/closed source haskell software ??

2008-12-03 Thread Jonathan Cast
On Wed, 2008-12-03 at 15:36 +0100, Lionel Barret De Nazaris wrote: I've just discovered the GMP license problem. (see http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes) From my understanding, the gmp is GPL, GHC statically links it on windows. Lesser GPL:

Re: [Haskell-cafe] monads with take-out options

2008-11-26 Thread Jonathan Cast
On Wed, 2008-11-26 at 19:09 +, Jules Bean wrote: Greg Meredith wrote: Haskellians, Some monads come with take-out options, e.g. * List * Set In the sense that if unit : A - List A is given by unit a = [a], then taking the head of a list can be used to retrieve

Re: [Haskell-cafe] Interactive

2008-11-25 Thread Jonathan Cast
On Tue, 2008-11-25 at 18:43 +, Andrew Coppin wrote: Thomas DuBuisson wrote: Here are the links that hold the information you desire: http://www.haskell.org/haskellwiki/Frag http://www.cse.unsw.edu.au/~pls/thesis/munc-thesis.pdf http://www.cse.unsw.edu.au/%7Epls/thesis/munc-thesis.pdf

Re: [Haskell-cafe] monads with take-out options

2008-11-25 Thread Jonathan Cast
On Mon, 2008-11-24 at 15:06 -0800, Greg Meredith wrote: Jonathan, Nice! Thanks. In addition to implementations, do we have more mathematical accounts? Let me expose more of my motives. * i am interested in a first-principles notion of data. Hunh. I have to say I'm not. The difference

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Jonathan Cast
On Mon, 2008-11-24 at 14:06 -0800, Greg Meredith wrote: Haskellians, Some monads come with take-out options, e.g. * List * Set In the sense that if unit : A - List A is given by unit a = [a], then taking the head of a list can be used to retrieve values from inside the monad.

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-18 Thread Jonathan Cast
On Tue, 2008-11-18 at 19:05 +0100, Peter Hercek wrote: David Menendez wrote: On Sun, Nov 16, 2008 at 7:09 PM, Luke Palmer [EMAIL PROTECTED] wrote: On Sun, Nov 16, 2008 at 5:06 PM, Peter Hercek [EMAIL PROTECTED] wrote: ... and the only value the function can return is bottom. Is there any

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread Jonathan Cast
On Mon, 2008-11-17 at 16:39 -0200, Maurí­cio wrote: (...) GHC says that the type of the result of 'function' is both determined by the rigid type from MyClass and the rigid type from MyData. But why can't both be the same? are you OOPer? :) What is an OOPer? Object-Oriented

Re: [Haskell-cafe] Re: [off-topic] OOPer?

2008-11-17 Thread Jonathan Cast
On Mon, 2008-11-17 at 21:49 -0200, Maurí­cio wrote: (...) I don't recall where I found the following example, but copied it locally as compelling evidence that the functional solution can be much clearer and shorter than the same solution modeled with objects and inheritance.

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Jonathan Cast
On Wed, 2008-11-12 at 10:50 -0800, Don Stewart wrote: tux_rocker: 2008/11/11 Dave Tapley [EMAIL PROTECTED]: So I should clarify I'm not a troll and do see the Haskell light. But one thing I can never answer when preaching to others is what does Haskell not do well? Let's say

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
On Wed, 2008-11-12 at 22:16 +, David MacIver wrote: On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson [EMAIL PROTECTED] wrote: Actually, unsafeInterleaveIO is perfectly fine from a RT point of view. Really? It seems easy to create things with it which when passed to ostensibly pure

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
On Wed, 2008-11-12 at 23:02 +, David MacIver wrote: On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote: david.maciver: On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson [EMAIL PROTECTED] wrote: Actually, unsafeInterleaveIO is perfectly fine from a RT point of

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
On Wed, 2008-11-12 at 23:18 +, David MacIver wrote: On Wed, Nov 12, 2008 at 11:05 PM, Jonathan Cast [EMAIL PROTECTED] wrote: On Wed, 2008-11-12 at 23:02 +, David MacIver wrote: On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote: david.maciver: On Wed, Nov 12

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
On Wed, 2008-11-12 at 18:47 -0500, Dan Doel wrote: On Wednesday 12 November 2008 6:18:38 pm David MacIver wrote: To put it a different way, in the absence of unsafeInterleaveIO the IO monad has the property that if f and g are observably equal up to termination then x = f and x = g are

Re: [Haskell-cafe] generalized list comprehensions

2008-11-10 Thread Jonathan Cast
On Mon, 2008-11-10 at 18:20 +, Andrew Coppin wrote: Mitchell, Neil wrote: In general: if boolean then [value] else [] Can be written as: [value | boolean] Is there any specific reason why this is valid? Is there any specific reason to dis-allow it? The grammar here

Re: [Haskell-cafe] generalized list comprehensions

2008-11-10 Thread Jonathan Cast
On Mon, 2008-11-10 at 18:19 +, Andrew Coppin wrote: Duncan Coutts wrote: On Sun, 2008-11-09 at 19:18 +, Andrew Coppin wrote: Generalised? Heck, I don't use list comprehension at all! :-P Perhaps you should! :-) When I first started with Haskell I kind of had the

Re: [Haskell-cafe] generalized list comprehensions

2008-11-10 Thread Jonathan Cast
On Mon, 2008-11-10 at 18:48 +, Andrew Coppin wrote: Jonathan Cast wrote: On Mon, 2008-11-10 at 18:20 +, Andrew Coppin wrote: Mitchell, Neil wrote: In general: if boolean then [value] else [] Can be written as: [value | boolean] Is there any

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Jonathan Cast
On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? If the function is partial on some elements of the list. (3 /), for

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Jonathan Cast
On Tue, 2008-11-04 at 18:26 +0100, Achim Schneider wrote: Martijn van Steenbergen [EMAIL PROTECTED] wrote: Does anyone have any experience with this? What's the best way to achieve this? For anything remotely connected to parsing, always use parsec. I'd not be surprised if the beast

Re: [Haskell-cafe] Re: Array bug?

2008-11-03 Thread Jonathan Cast
On Mon, 2008-11-03 at 20:21 +0100, Ketil Malde wrote: Achim Schneider [EMAIL PROTECTED] writes: -funsafe-optimization -fno-paranoia -fno-rd ? -fpermit-program-to-crash jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Jonathan Cast
On Fri, 2008-10-31 at 18:43 -0200, Mauricio wrote: Hi, After a lot of thinking, I can't get what I am doing wrong in this code: -- data ( RandomGen g ) = RandomMonad g a = RandomMonad (g - a) instance Monad (RandomMonad g) where return = RandomMonad . const RandomMonad f1 =

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 15:02 +1300, Richard O'Keefe wrote: On 16 Oct 2008, at 12:09 pm, Jonathan Cast wrote: I am not sure how say in a Java language a constructor can conjure up a value of an unknown type. Well, that's the point. It can't, in Haskell or in Java. If you understand

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 09:48 -0700, Robert Greayer wrote: On Thu, 2008-10-16 at 15:02 +1300, Richard O'Keefe wrote: On 16 Oct 2008, at 12:09 pm, Jonathan Cast wrote: I am not sure how say in a Java language a constructor can conjure up a value of an unknown type. Well

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 10:02 -0700, Robert Greayer wrote: --- On Thu, 10/16/08, Jonathan Cast [EMAIL PROTECTED] wrote: Can I have HashSetInteger? Could I construct HashSet?, if I did? Yes: HashSet? blah = (HashSet?) hashSetClass.newInstance(); ... compiles, and won't throw

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 11:41 -0700, Robert Greayer wrote: --- On Thu, 10/16/08, Jonathan Cast [EMAIL PROTECTED] wrote: But I can't say new HashSet?()? No... but you can say 'new HashSetT()' where T is a type variable, and then put a value of type T into your set, which is probably

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 12:27 -0700, Robert Greayer wrote: --- On Thu, 10/16/08, Jonathan Cast [EMAIL PROTECTED] wrote: So if I say void wrong(List? foo, List? bar) I get two /different/ type variables implicitly filled in? If I declare a generic class, and then have a method

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-16 Thread Jonathan Cast
On Thu, 2008-10-16 at 16:25 -0500, Derek Elkins wrote: On Thu, 2008-10-16 at 13:53 -0700, Daryoush Mehrtash wrote: So does this mean that the reason for complexity of generics is the Java inheritance? BTW, in addition to the article I posted, This site:

Re: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-15 Thread Jonathan Cast
On Wed, 2008-10-15 at 11:56 -0700, Daryoush Mehrtash wrote: The equivalent won't compile in Haskell, because the actual return type does matter, and *is determined by the calling code*. Our fictional GetListOfData can't return a List or a Mylist

Re: [Haskell-cafe] An irritating Parsec problem

2008-10-15 Thread Jonathan Cast
On Wed, 2008-10-15 at 20:22 +0100, Andrew Coppin wrote: I like Parsec. I use it for everything. But it does have one irritating problem. Consider the following parser: expressions = many1 expression Suppose this is the top-level parser for my language. I always wrap my top-level

Re: Re[2]: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-15 Thread Jonathan Cast
On Wed, 2008-10-15 at 13:01 -0700, Daryoush Mehrtash wrote: I am having hard time understanding this statement: Haskell types lack constructors, so the user never expects to be able to conjure up a value of an unknown type. I am not sure how say in a Java language

Re: [Haskell-cafe] Linking and unsafePerformIO

2008-10-14 Thread Jonathan Cast
On Tue, 2008-10-14 at 12:31 -0400, David Roundy wrote: On Tue, Oct 14, 2008 at 05:20:35PM +0100, Jules Bean wrote: David Roundy wrote: On Tue, Oct 14, 2008 at 04:05:23PM +0100, Jules Bean wrote: Constants are mathematical and universal, like pi. That is what the semantics of haskell say.

Re: [Haskell-cafe] What I wish someone had told me...

2008-10-14 Thread Jonathan Cast
On Tue, 2008-10-14 at 18:15 +0100, John Lato wrote: Are you advocating introducing existential types to beginning Haskellers? I think something with the scary name Invalid argument. existential quantification would greatly increase the head'splodin' on the learnin' slope. Invalid

Re: [Haskell-cafe] What I wish someone had told me...

2008-10-14 Thread Jonathan Cast
On Tue, 2008-10-14 at 22:28 +0400, Alexey Romanov wrote: On Tue, Oct 14, 2008 at 9:14 PM, Jonathan Cast [EMAIL PROTECTED] wrote: On Tue, 2008-10-14 at 18:15 +0100, John Lato wrote: Are you advocating introducing existential types to beginning Haskellers? I think something with the scary

Re: [Haskell-cafe] Still stacking monad transformers

2008-10-13 Thread Jonathan Cast
On Mon, 2008-10-13 at 18:28 +0100, Andrew Coppin wrote: Reid Barton wrote: It's not difficult: the operation is called mplus :: MyMonad a - MyMonad a - MyMonad a and already exists (assuming the author of ListT has not forgotten to write a MonadPlus instance). I see... I was

Re: [Haskell-cafe] Re: Interesting new user perspective

2008-10-13 Thread Jonathan Cast
On Mon, 2008-10-13 at 18:38 +0100, Andrew Coppin wrote: Ryan Ingram wrote: I would go further than that. To Andrew's question, I say: Yes, we want to encourage these people to learn Haskell. We want to smash all their expectations into tiny little pieces. We want their brains to

Re: [Haskell-cafe] Still stacking monad transformers

2008-10-13 Thread Jonathan Cast
On Mon, 2008-10-13 at 18:58 +0100, Andrew Coppin wrote: Jonathan Cast wrote: I see... I was under the impression that mplus is just any arbitrary binary operation over a given monad. How do you know what it does for a specific monad? Process of elimination. Sometimes

Re: [Haskell-cafe] Very silly

2008-10-13 Thread Jonathan Cast
On Mon, 2008-10-13 at 19:51 +0100, Andrew Coppin wrote: {-# LANGUAGE FlexibleInstances #-} module Overload where class Silly s where go :: s instance Silly ([x] - [x]) where go = reverse instance Silly (Int - Int) where go = (+1) Don't even ask. Suffice it to

Re: [Haskell-cafe] couple of questions on monads

2008-10-13 Thread Jonathan Cast
On Mon, 2008-10-13 at 13:37 -0700, Daryoush Mehrtash wrote: Question 1: Why are there lazy and strict modules of some monads? (e.g. Control.Monad.State) Because both are useful, for different purposes. (For the same reason that it's helpful, in general, to have both eager and lazy evaluation

Re: [Haskell-cafe] Interesting new user perspective

2008-10-12 Thread Jonathan Cast
On Fri, 2008-10-10 at 18:13 -0500, John Goerzen wrote: On Fri, Oct 10, 2008 at 02:29:54PM -0700, Jonathan Cast wrote: I've got a Haskell book here (Hutton, 170 pages) that doesn't even mention how to open a file! That short, and you expect minor features like

Re: [Haskell-cafe] Interesting new user perspective

2008-10-12 Thread Jonathan Cast
On Sun, 2008-10-12 at 21:34 -0500, John Goerzen wrote: On Sun, Oct 12, 2008 at 06:39:58PM -0700, Jonathan Cast wrote: On Fri, 2008-10-10 at 18:13 -0500, John Goerzen wrote: On Fri, Oct 10, 2008 at 02:29:54PM -0700, Jonathan Cast wrote: I've got a Haskell book here (Hutton, 170

Re: [Haskell-cafe] [] vs [()]

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 10:59 -0700, Daryoush Mehrtash wrote: I was in fact trying to figure out how guard worked in the do. The interesting (for a beginner) insight is that: [()] map f = [f] I don't think any clarity is added by made-up notation. I think you mean map f [()] =

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 19:08 +0100, Iain Barnett wrote: On 9 Oct 2008, at 9:33 pm, Andrew Coppin wrote: I think it's just the teaching of the language that needs work, not so much the language itself. As a newer user myself, I'd agree with this statement. I'd like to see far more

Re: [Haskell-cafe] [] vs [()]

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 11:14 -0700, Daryoush Mehrtash wrote: I don't think any clarity is added by made-up notation. I think you mean In fact I was trying to be correct on this. Great! Is it wrong to show: [()] f = f as was doing: [()] map f = [f] Yes.

Re: [Haskell-cafe] Interesting new user perspective

2008-10-10 Thread Jonathan Cast
On Fri, 2008-10-10 at 15:00 -0500, Tommy M. McGuire wrote: On 10 Oct 2008, at 7:05 pm, Jonathan Cast wrote: Parsec makes recursive descent parsers as easy to use in Haskell as regexps are in Perl. No reason not to expose newcomers to Haskell to the thing it does best. Is it wrong

<    1   2   3   4   5   6   >