Re: [Haskell-cafe] Re: Explaining monads

2007-08-13 Thread Derek Elkins
On Mon, 2007-08-13 at 22:29 +0200, Benjamin Franksen wrote: Brian Brunswick wrote: One thing that I keep seeing people say (not you), is that monads /sequence/ side effects. This is wrong, or at least a limited picture. /All/ of the above structures are about combining compatible

RE: [Haskell-cafe] Explaining monads

2007-08-13 Thread Derek Elkins
On Mon, 2007-08-13 at 19:31 +0200, peterv wrote: When I read side-effects, I understand it as unwanted effects, like aliasing, and effects depending on the order of execution. I'm not sure if my understanding here is correct. I hope Haskell does not allow side-effects but only effects, meaning

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Derek Elkins
On Tue, 2007-08-14 at 09:55 -0500, Lanny Ripple wrote: Having just gone through all the tutorials and things (again but this time I think it stuck) the Haskell community is on the wrong track as far as teaching Monads to new programmers. If I were teaching addition and multiplication to

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Derek Elkins
On Tue, 2007-08-14 at 12:40 -0500, Lanny Ripple wrote: Derek Elkins wrote: What people need to do is stop reading two page blog posts by someone who's just got monads and read the well-written peer-reviewed papers I have taught many people to program in group settings and individually

Re: [Haskell-cafe] Newbie question: Where is StackOverflow on the Wiki?

2007-08-18 Thread Derek Elkins
On Sat, 2007-08-18 at 20:35 +0200, Peter Verswyvelen wrote: When reading an article about tail recursion (http://themechanicalbride.blogspot.com/2007/04/haskell-for-c-3-programmers. html) I came across the follow statements: If you can write a non-recursive function that uses the colon

Re: [Haskell-cafe] #haskell irc channel reaches 400 users

2007-08-22 Thread Derek Elkins
On Wed, 2007-08-22 at 23:24 +0200, Marc A. Ziegert wrote: i interpret it as this: all [ usage x usage y || fun_to_talk_about x fun_to_talk_about y | let lang=[minBound .. maxBound] -- C++,Haskell,Java,etc. , x-lang , y-lang , irc_channel_users x irc_channel_users y

Re: [Haskell-cafe] help understanding lazy evaluation

2007-08-22 Thread Derek Elkins
[*] Which notation do you use for functions in text? is f() ok? Sure, although a little unusual for Haskell where f() means f applied to the empty tuple. Some people use |f| (generally those who use latex), but generally it can be inferred from the context what is a function Neil's

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Derek Elkins
On Thu, 2007-08-23 at 10:17 +1000, Donald Bruce Stewart wrote: overdrigzed: Using the fromInteger (and fromRational) axioms should only *increase* precission, I don't see how that is such a bad thing. I think it's bad if the behaviour of your program depends on the optimisation

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Derek Elkins
On Sat, 2007-08-25 at 22:51 +0100, Philippa Cowderoy wrote: On Sat, 25 Aug 2007, Andrew Coppin wrote: Would be nice if I could build something in Haskell that overcomes these. OTOH, does Haskell have any way to talk to the audio hardware? It would definitely be nice if someone wrote a

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Derek Elkins
On Sat, 2007-08-25 at 23:36 +0200, [EMAIL PROTECTED] wrote: Evan Laforge writes: Indeed, you can write certain DSP algorithms beautifully in Haskell. Now, if only it could talk to the audio hardware... (Or just use common file formats even.) Oh, that's easy. I wrote an FFI

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-26 Thread Derek Elkins
On Sun, 2007-08-26 at 14:50 +0200, manu wrote: Hello, After reading Peter Norvig's take on writing a Sudoku solver (http:// norvig.com/sudoku.html) I decided that I would port his program to Haskell, without changing the algorithm, that'll make a nice exercise I thought and should be

Re: [Haskell-cafe] Newbie terminology for partial application

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 16:29 +0200, Peter Verswyvelen wrote: A while ago I confused currying with partial application, which was pointed out by members of this community, and the wiki pages got adapted so that newbies like me don't make the same mistake twice ;) That's great. Anyway, at the

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 17:56 +0200, Peter Verswyvelen wrote: Look at Template Haskell. Intuitively Template Haskell provides new language features that allow us to convert back and forth between concrete syntax, i.e. what Gee coming from C++ that was the last thing I expected templates to

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Derek Elkins
On Thu, 2007-08-30 at 11:34 +0800, Hugh Perkins wrote: On 8/26/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: Game developers are really struggling to get performance out of the Playstation 3 console. This console has a single PowerPC CPU with 6 Cell SPU coprocessors, all running at 3.3GHz.

Re: [Haskell-cafe] let and fixed point operator

2007-08-30 Thread Derek Elkins
On Thu, 2007-08-30 at 18:17 +0200, Peter Hercek wrote: Hi, I find the feature that the construct let x = f x in expr assigns fixed point of f to x annoying. The reason is that I can not simply chain mofifications a variable like e.g. this: f x = let x = x * scale in let x = x

Re: [Haskell-cafe] let and fixed point operator

2007-08-30 Thread Derek Elkins
On Thu, 2007-08-30 at 23:58 +0200, [EMAIL PROTECTED] wrote: Dan Piponi writes: In mathematics, if you write x = f y you mean that these two expressions are equal. In Haskell, if you say x = f y you mean *make* then equal! Haskell is a declarative language, not an imperative

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Derek Elkins
On Sun, 2007-09-02 at 22:52 +0800, Hugh Perkins wrote: Sooo.. what is the modern equivalent of Prolog? Because no one has said it quite this way: The modern equivalent of Prolog is Prolog. Most of the advancement in logic programming has either been folded back into Prolog or has been advanced

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 14:57 +0200, Henning Thielemann wrote: In the current Haskell Wiki (haskell.org/haskellwiki) I found references to articles of the old Hawiki (haskell.org/hawiki), like OnceAndOnlyOnce and SeparationOfConcerns. Are the files still available somewhere? Bring back HaWiki!

Re: [Haskell-cafe] Closures and pointfree functions

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 19:47 +0200, Lars Oppermann wrote: Dear all, In the Haskell Wiki at http://www.haskell.org/haskellwiki/Closure there is an example for a function returning a closure given as f x = (\y - x + y) Another way to achieve the same effect would be to write f' x = (+)

Re: [Haskell-cafe] Closures and pointfree functions

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 20:44 +0200, Lars Oppermann wrote: Ah, thanks... However, I think I have just become more confused as to what makes a closure a closure. The defining principle seems to go along the lines some kind of context that is enclosed within the closure object. It was argued

Re: [Haskell-cafe] Code from Why Functional Programming Matters

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 15:35 -0400, Andrew Wagner wrote: I've been reading the classic Why functional programming matters paper [1] lately, particularly looking at the alpha beta stuff. I've ported all his code to haskell, but I have a question. His algorithm takes a board position, creates a

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 21:56 +0200, Henning Thielemann wrote: On Tue, 4 Sep 2007, Donald Bruce Stewart wrote: lemming: ... and there was unfortunately no support in porting the stuff. I guess some simple program (perl -p -e 's/{{{/hask/g' :-) could have simplified a lot. Its

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Tue, 2007-09-04 at 09:38 +1200, Daniel McAllansmith wrote: On Tuesday 04 September 2007 08:29, Neil Mitchell wrote: Hi There are two entirely separate issues in this thread - let's not confuse them. 1) The old HaWiki content is good and unavailable. I want it made available, in

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 23:50 +0200, Henning Thielemann wrote: On Mon, 3 Sep 2007, Derek Elkins wrote: The issue is that we don't know what the license is for the -content- of HaWiki. HaskellWiki explicitly states that all the content in it has a specific license. We can't take the old

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Derek Elkins
On Wed, 2007-09-05 at 13:21 +1000, Thomas Conway wrote: On 9/2/07, Andrew Coppin [EMAIL PROTECTED] wrote: One of standard exercices in Prolog is the construction of the meta-interpreter of Prolog in Prolog. While this is cheating, I recommend it to you. It opens eyes. Ever tried

Re: [Haskell-cafe] Help understanding type error

2007-09-07 Thread Derek Elkins
On Sat, 2007-09-08 at 12:24 +1000, Stuart Cook wrote: On 9/8/07, Ryan Ingram [EMAIL PROTECTED] wrote: This does what you want, I think: {-# LANGUAGE ExistentialQuantification #-} module Exist where data Showable = forall a. (Show a) = Showable a instance Show Showable where

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Derek Elkins
On Sun, 2007-09-09 at 15:09 +0200, Peter Verswyvelen wrote: Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Why? Well, why are binary operators allowed and unary operators not? Isn't that some kind of discrimination? In math, many many

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread Derek Elkins
On Mon, 2007-09-10 at 00:49 +0100, Neil Mitchell wrote: Hi (Some list operations are too expensive with ByteString but for most string processing it's perfectly fine and much faster than String). I'm sure it's true, but it's quite irrelevant to my question, which is why is using

Re: [Haskell-cafe] Comments and/or Criticisms

2007-09-10 Thread Derek Elkins
On Mon, 2007-09-10 at 15:47 +1000, Stuart Cook wrote: On 9/10/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Any comments and/or criticisms would be most appreciated: --count the occurrences of char in string countC :: Char - [Char] - Int countC x xs = sum [1 | c - xs, c == x] That's a

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Derek Elkins
On Tue, 2007-09-11 at 16:48 -0700, Don Stewart wrote: byorgey: On 9/11/07, Don Stewart [EMAIL PROTECTED] wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it

Re: [Haskell-cafe] Re: Monad.Reader 8: Haskell, the new C++

2007-09-12 Thread Derek Elkins
On Wed, 2007-09-12 at 23:36 +, Aaron Denney wrote: On 2007-09-12, Don Stewart [EMAIL PROTECTED] wrote: ok: I've been told that functional dependencies are old hat and there is now something better. I suspect that better here means worse. Better here means better -- a functional

Re: [Haskell-cafe] Monad.Reader 8: Haskell, the new C++

2007-09-13 Thread Derek Elkins
On Thu, 2007-09-13 at 11:12 -0700, Don Stewart wrote: Better here means better -- a functional language on the type system, to type a functional language on the value level. -- Don For a taste, see Instant Insanity transliterated in this functional language:

Re: [Haskell-cafe] MonadGL - Partitioning effects without giving up type inference

2007-09-13 Thread Derek Elkins
On Thu, 2007-09-13 at 19:34 +0100, Jules Bean wrote: Any comments? I'm sure this has been shown before but I don't remember where. The Monad Transformer Library essentially does this, the types you get are along the lines of: foo :: (Monad m, MonadState s m, MonadReader r m) = m Int

Re: [Haskell-cafe] transparent parallelization

2007-09-18 Thread Derek Elkins
On Tue, 2007-09-18 at 18:13 +0200, Thomas Girod wrote: Hi there. Beeing rather new to the realm of Haskell and functional programming, I've been reading about how is easier it is to parallelize code in a purely functional language (am I right saying that ?). My knowledge of parallelization

Re: [Haskell-cafe] are some of these reverse algos better than others? is there a quick and dirty way to reveal this fact?

2007-09-22 Thread Derek Elkins
On Sat, 2007-09-22 at 21:14 -0700, Thomas Hartman wrote: I came up with the following functions to do reverse. The first one is obviously bad, because of the expensive list concat. The last one, myreverse, I think is the reference implementation you get in the prelude. The ones between, I'm

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

2007-09-23 Thread Derek Elkins
On Sun, 2007-09-23 at 20:03 -0400, Cale Gibbard wrote: On 23/09/2007, Neil Mitchell [EMAIL PROTECTED] wrote: Hi The haskell-cafe@ mailing list is more appropriate for messages such as this. haskell@ is just for announcements (it should be called haskell-annouce@ !) * Lambda

Re: [Haskell-cafe] Composition Operator

2007-09-24 Thread Derek Elkins
On Mon, 2007-09-24 at 19:11 -0700, Dan Weston wrote: Well, I did footnote in my first e-mail that: [1] I used the asterisk in the category name Hask* to exclude undefined values or partial functions [Although I think I may have flipped the asterisk convention.] I see what you mean by

Re: [Haskell-cafe] Re: Very crazy

2007-09-25 Thread Derek Elkins
On Tue, 2007-09-25 at 12:24 +0100, Andrew Coppin wrote: Chaddaï Fouché wrote: 2007/9/25, Andrew Coppin [EMAIL PROTECTED]: This is why I found it so surprising - and annoying - that you can't use a 2-argument function in a point-free expression. For example, zipWith (*) expects two

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

2007-09-25 Thread Derek Elkins
On Tue, 2007-09-25 at 16:18 -0500, Creighton Hogg wrote: On 9/25/07, Philippa Cowderoy [EMAIL PROTECTED] wrote: On Tue, 25 Sep 2007, Seth Gordon wrote: Are Benjamin C. Pierce's _Types and Programming Languages_ and/or _Basic Category Theory for

Re: [Haskell-cafe] Re: Very crazy

2007-09-26 Thread Derek Elkins
On Wed, 2007-09-26 at 18:50 -0400, Steven Fodstad wrote: Andrew Coppin wrote: Chaddaï Fouché wrote: 2007/9/25, Andrew Coppin [EMAIL PROTECTED]: This is why I found it so surprising - and annoying - that you can't use a 2-argument function in a point-free expression. For example,

Re: [Haskell-cafe] Haskell Cheat Sheet?

2007-09-26 Thread Derek Elkins
On Wed, 2007-09-26 at 17:23 -0700, Dan Weston wrote: Not to beat a dead horse, but I wasn't suggesting to rename the fix function that everyone knows and loves: fix :: (a - a) - a fix f = let f' = f f' in f' I was merely trying to suggest that it would be wise to rename the function in

Re: [Haskell-cafe] Order of Declaration

2007-09-29 Thread Derek Elkins
On Sat, 2007-09-29 at 17:58 +0100, PR Stanley wrote: Hi in C type languages a function must be declared before its application. Would I be right in thinking that this isn't the case in Functional languages? For example: transmit :: String - String transmit = decode . channel . encode

Re: [Haskell-cafe] Assignment, Substitution or what?

2007-10-02 Thread Derek Elkins
On Wed, 2007-10-03 at 01:42 +0100, PR Stanley wrote: f x = x + x Is the x use to create a pattern in the definition and when f is called it's replaced by a value? Those equation-like definitions are syntactic sugar for lambda abstractions. f could as well be defined as f = \x -

Re: [Haskell-cafe] Curry and uncurry

2007-10-03 Thread Derek Elkins
On Wed, 2007-10-03 at 22:31 +1000, Stuart Cook wrote: On 10/3/07, PR Stanley [EMAIL PROTECTED] wrote: Without looking at the standard prelude, define the higher-order library function curry that converts a function on pairs into a curried function, and

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

2007-10-08 Thread Derek Elkins
On Mon, 2007-10-08 at 20:54 +1000, Thomas Conway wrote: I just had a conversation today that seems relevant to this thread. I was chatting with a friend who is working in the academic sector, and I was observing that Melbourne Uni (my old school), is switching in the new year from teaching

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

2007-10-10 Thread Derek Elkins
On Wed, 2007-10-10 at 23:48 +0100, Philippa Cowderoy wrote: On Wed, 10 Oct 2007, Andrew Coppin wrote: (I'm less sold on whether you really need to learn a particular dialect well enough to *program* in it...) If you don't then you won't be able to see how complicated things actually

Re: [Haskell-cafe] more functions to evaluate

2007-10-13 Thread Derek Elkins
On Fri, 2007-10-12 at 16:20 -0700, Dan Weston wrote: I like that name, and will henceforth use it myself until someone sees fit to add it to the Prelude! Maxime Henrion wrote: Isaac Dupree wrote: Dan Weston wrote: applyNtimes :: (a - a) - Int - a - a This sounds like it should be

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

2007-10-14 Thread Derek Elkins
On Sun, 2007-10-14 at 15:22 +0100, Andrew Coppin wrote: Vimal wrote: I think you have got a very good point in your mail that I overlooked all along ... Why was Haskell created? is a question that I havent tried looking for a answer :) To avoid success at all costs? (No,

Re: [Haskell-cafe] haskell-curry, classical logic, excluded middle

2007-10-14 Thread Derek Elkins
On Sun, 2007-10-14 at 15:20 -0600, Luke Palmer wrote: On 10/14/07, Tim Newsham [EMAIL PROTECTED] wrote: I've been struggling with this for the last day and a half. I'm trying to get some exercise with the type system and with logic by playing with the curry-howard correspondence. I got

Re: Laziness (was: [Haskell-cafe] Performance problem with random numbers)

2007-10-14 Thread Derek Elkins
On Sun, 2007-10-14 at 18:14 -0400, Brandon S. Allbery KF8NH wrote: On Oct 14, 2007, at 17:54 , ntupel wrote: Now my problem still is, that I don't know how to speed things up. I tried putting seq and $! at various places with no apparent improvement. Maybe I need to find a different

Re: [Haskell-cafe] haskell-curry, classical logic, excluded middle

2007-10-14 Thread Derek Elkins
On Sun, 2007-10-14 at 17:19 -1000, Tim Newsham wrote: On Sun, 14 Oct 2007, Roberto Zunino wrote: (Warning: wild guess follows, I can not completely follow CPS ;-)) Adding a couple of forall's makes it compile: propCC :: ((forall q . p - Prop r q) - Prop r p) - Prop r p func1 :: (forall q

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-16 Thread Derek Elkins
On Tue, 2007-10-16 at 17:02 +0100, Neil Mitchell wrote: Hi (/ 10) means the function that divides its argument by 10 (- 10) however is just the number -10, even if I put a space between the - and 10. How can I create a function that subtracts 10 from its argument in a clean way

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

2007-10-21 Thread Derek Elkins
On Wed, 2007-10-17 at 15:06 -0700, Dan Weston wrote: That is a great tutorial. Thanks! But in the last two sentences of the introduction you say: We just need to find any program with the given type. The existence of a program for the type will be a proof of the corresponding

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

2007-10-21 Thread Derek Elkins
On Mon, 2007-10-22 at 01:12 +0100, Lennart Augustsson wrote: There's nothing wrong with Haskell types. It's the terms that make Haskell types an inconsistent logic. Logics are what are consistent or not, so saying the logic Haskell's type system corresponds to is inconsistent is all that can

Re: [Haskell-cafe] What algorithm to use ?

2007-10-22 Thread Derek Elkins
On Mon, 2007-10-22 at 10:09 +0200, manu wrote: Hello I am not sure it is appropriate to post to this mailing list to inquire about a peculiar algorithm, if not let me know... I was looking at one particular puzzle posted on the Facebook site, 'Wiretaps'

Re: [Haskell-cafe] string literals and haskell'

2007-10-22 Thread Derek Elkins
On Mon, 2007-10-22 at 17:12 +0100, Neil Mitchell wrote: Hi I can see problems with this. This comes up when typing windows file path's: C:\path to my\directory\boo If this now reports no errors, who wants to guess which come up as escape codes, and which don't. The way other languages

Re: [Haskell-cafe] lazily traversing a foreign data structure

2007-10-25 Thread Derek Elkins
On Thu, 2007-10-25 at 11:30 -0400, Graham Fawcett wrote: Hi folks, I'm writing a Gnu DBM module as an exercise for learning Haskell and its FFI. I'm wondering how I might write a function that returns the database keys as a lazy list. I've wrapped the two relevant foreign functions:

Re: [Haskell-cafe] newbie optimization question

2007-10-28 Thread Derek Elkins
On Sun, 2007-10-28 at 10:23 -0400, Prabhakar Ragde wrote: Jaak Randmets wrote: On 10/28/07, Prabhakar Ragde [EMAIL PROTECTED] wrote: For the purposes of learning, I am trying to optimize some variation of the following code for computing all perfect numbers less than 1. divisors i =

Re: [Haskell-cafe] newbie optimization question

2007-10-28 Thread Derek Elkins
On Sun, 2007-10-28 at 12:01 -0700, Don Stewart wrote: jerzy.karczmarczuk: Stefan O'Rear adds to the dialogue: Prabhakar Ragde wrote: Jerzy Karczmarczuk wrote: Just a trivial comment... 1. Don't speak about comparing *languages* when you compare *algorithms*, and in

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-28 Thread Derek Elkins
On Sun, 2007-10-28 at 23:34 +0100, Peter Hercek wrote: Don Stewart wrote: C++ version times: 1.109; 1.125; 1.125 Int32 cpu times: 1.359; 1.359; 1.375 Int64 cpu times: 11.688; 11.719; 11.766 Integer cpu times: 9.719; 9.703; 9.703 Great result from ghc. What Haskell program were

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Derek Elkins
On Wed, 2007-10-31 at 23:44 +0100, Henning Thielemann wrote: On Wed, 31 Oct 2007, Dan Piponi wrote: But every day, while coding at work (in C++), I see situations where true partial evaluation would give a big performance payoff, and yet there are so few languages that natively support

Re: [Haskell-cafe] Why does GHC limit stack size?

2007-11-04 Thread Derek Elkins
On Sat, 2007-11-03 at 11:40 +, Adrian Hey wrote: Bulat Ziganshin wrote: because program that require 8mb stack, will probably require 8gb when processing more data :) So.. what? You could say the same about heap, which was rather the point of the earlier thread. I personally would

Re: [Haskell-cafe] Haskell performance question

2007-11-09 Thread Derek Elkins
On Thu, 2007-11-08 at 22:54 -0800, Don Stewart wrote: bulat.ziganshin: definitely, it's a whole new era in low-level ghc programming victory! Now I want a way of getting (well-used) SIMD instructions and such, and with some luck some high-level approach as well.

Re: [Haskell-cafe] Disable echo in POSIX terminal

2007-11-09 Thread Derek Elkins
On Fri, 2007-11-09 at 17:41 +0100, Alfonso Acosta wrote: I this there's no need for a binding How about this? import Control.Monad (when) import System.IO getpasswd :: Handle - IO String getpasswd h = do wasEnabled - hGetEcho h when wasEnabled

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

2007-11-12 Thread Derek Elkins
On Mon, 2007-11-12 at 15:51 -0800, Donn Cave wrote: On Nov 12, 2007, at 12:00 PM, Galchin Vasili wrote: I am looking for (objective.. i.e. not juts FPL cheerleading) opinions as to why Wall Street ( http://www.janestcapital.com/) and banking are now using OCaml and Haskell. I really

Re: [Haskell-cafe] Performance help

2007-11-13 Thread Derek Elkins
On Tue, 2007-11-13 at 14:21 -0800, Ryan Ingram wrote: On 11/13/07, Ryan Ingram [EMAIL PROTECTED] wrote: Also, what stops getRule from going off the end of the array? I didn't see anything that prevented that in the code, and you're using unsafeAt, which seems like a

Re: [Haskell-cafe] let vs. where

2007-11-13 Thread Derek Elkins
On Tue, 2007-11-13 at 13:51 -0800, Dan Piponi wrote: On Nov 13, 2007 1:24 PM, Ryan Ingram [EMAIL PROTECTED] wrote: I tend to prefer where, but I think that guards function declarations are more readable than giant if-thens and case constructs. Up until yesterday I had presumed that guards

Re: [Haskell-cafe] What is the role of $!?

2007-11-14 Thread Derek Elkins
On Wed, 2007-11-14 at 16:27 -0800, Justin Bailey wrote: It's: f $! x = x `seq` f x That is, the argument to the right of $! is forced to evaluate, and then that value is passed to the function on the left. The function itself is not strictly evaluated (i.e., f x) I don't believe.

Re: [Haskell-cafe] MD5?

2007-11-17 Thread Derek Elkins
On Sat, 2007-11-17 at 16:40 +, Andrew Coppin wrote: Thomas DuBuisson wrote: BTW, while I'm here... I sat down and wrote my own MD5 implementation. How is the performance on this new MD5 routine? Ask me *after* I modify it to give the correct answers. ;-) Interesting

Re: [Haskell-cafe] Re: Knot tying vs monads

2007-11-17 Thread Derek Elkins
On Sat, 2007-11-17 at 13:30 -0500, John D. Ramsdell wrote: ... It seems rather hard to avoid lazyness in the current version of Haskell when it's not wanted. I hope one of the proposals for deep strictness makes it into Haskell prime. In my application, there is one datastructure, such that

Re: [Haskell-cafe] Re: [Haskell] AmeroHaskell

2007-11-17 Thread Derek Elkins
On Sat, 2007-11-17 at 16:45 -0800, Tim Chevalier wrote: On 11/17/07, Derek Elkins [EMAIL PROTECTED] wrote: However, to put things in motion for something concrete at all, we're hoping to put together a meeting taking place in the Portland area as that seems most convenient to the most

Re: [Haskell-cafe] Re: [Haskell] AmeroHaskell

2007-11-17 Thread Derek Elkins
On Sat, 2007-11-17 at 17:38 -0800, Tim Chevalier wrote: On 11/17/07, Derek Elkins [EMAIL PROTECTED] wrote: Don mentioned that. However, something specifically Haskell and aimed at a wider audience than just the Portland area is desirable. It's also a different tone than a user group

Re: [Haskell-cafe] expanded standard lib

2007-11-19 Thread Derek Elkins
On Mon, 2007-11-19 at 21:47 +0100, Radosław Grzanka wrote: 2007/11/19, brad clawsie [EMAIL PROTECTED]: The problem is that only one person gets to comment on the quality of a library, the author, who is about the least objective person. by rolling certain libraries into a base

Re: [Haskell-cafe] How to abort a computation within Continuation Monad?

2007-11-19 Thread Derek Elkins
On Tue, 2007-11-20 at 00:18 -0500, Dimitry Golubovsky wrote: Hi, I have been using plain non-monadic CPS for a while in my web-browser related stuff. Now I am tempted to switch from plain CPS to syntactically sweetened monadic style based on Continuation Monad, but I feel stuck with one

Re: [Haskell-cafe] Re: How to abort a computation within Continuation Monad?

2007-11-20 Thread Derek Elkins
On Tue, 2007-11-20 at 13:22 +0200, Gleb Alexeyev wrote: Dimitry Golubovsky wrote: If I have callCC $ \exit - do foo ... I cannot jump to `exit' from within foo unless `exit' is given to foo as an argument. As Derek Elkins has written, one of the options is to use

Re: [Haskell-cafe] How to abort a computation within Continuation Monad?

2007-11-22 Thread Derek Elkins
On Thu, 2007-11-22 at 01:01 -0500, Dimitry Golubovsky wrote: Hi, I finally was able to write a function which grabs the remainder of the computation in Cont monad and passes it to some function, in the same time forcing the whole computation to finish by returning a final value. I am not

Re: [Haskell-cafe] Polymorphic dynamic typing

2007-11-23 Thread Derek Elkins
On Fri, 2007-11-23 at 18:45 +, Paulo Silva wrote: Hello, Type representations using GADTs are being used to achieve dynamic typing in Haskell. However, representing polymorphic types is problematic. Does anyone know any work about including polymorphism in dynamic typing? Look at

Re: [Haskell-cafe] Re: An interesting monad: Prompt

2007-11-23 Thread Derek Elkins
On Fri, 2007-11-23 at 21:11 -0800, Ryan Ingram wrote: On 11/22/07, apfelmus [EMAIL PROTECTED] wrote: A context passing implementation (yielding the ContT monad transformer) will remedy this. Wait, are you saying that if you apply ContT to any monad that has the

Re: [Haskell-cafe] Re: An interesting monad: Prompt

2007-11-24 Thread Derek Elkins
On Sat, 2007-11-24 at 11:10 +0100, apfelmus wrote: Derek Elkins wrote: Ryan Ingram wrote: apfelmus wrote: A context passing implementation (yielding the ContT monad transformer) will remedy this. Wait, are you saying that if you apply ContT to any monad

Re: [Haskell-cafe] return in Monad class necessary?

2007-11-26 Thread Derek Elkins
On Tue, 2007-11-27 at 00:15 +0100, Chris Eidhof wrote: On 26 nov 2007, at 19:48, Henning Thielemann wrote: I wonder whether it is a typical mistake of beginners to write 'return' within a do-block (that is, not at the end) and if it is possible to avoid this mistake by clever typing. In a

Re: [Haskell-cafe] What is the role of $!?

2007-11-30 Thread Derek Elkins
On Thu, 2007-11-29 at 07:29 +, Thomas Davie wrote: On 29 Nov 2007, at 06:32, PR Stanley wrote: Hi Thanks for the response. JCC: In most languages, if you have some expression E, and when the computer attempts to evaluate E it goes in to an infinite loop, then when the

Re: [Haskell-cafe] Modelling a mutable variable store

2007-12-01 Thread Derek Elkins
On Sun, 2007-12-02 at 03:29 +, Robin Green wrote: On Sat, 01 Dec 2007 21:22:53 -0600 Derek Elkins [EMAIL PROTECTED] wrote: There's also the issue of finding a more elegant way of threading the Store through my evaluator, but I'm not concerned too much about that at this point. I

Re: [Haskell-cafe] Possible Improvements

2007-12-02 Thread Derek Elkins
On Sun, 2007-12-02 at 21:54 -0800, Don Stewart wrote: catamorphism: On 12/2/07, Don Stewart [EMAIL PROTECTED] wrote: prstanley: Hi data Tree = Leaf Int | Node Tree Int Tree occurs :: Int - Tree - Bool occurs m (Leaf n) = m == n occurs m (Node l n r) = m == n || occurs

Re: [Haskell-cafe] Trees

2007-12-03 Thread Derek Elkins
On Mon, 2007-12-03 at 16:56 +0200, Yitzchak Gale wrote: Adrian Neumann wrote: data Tree a = Leaf a | Node a [Tree a] example: given a tree t and two nodes u,v, find the first common ancestor. In Java this is really simple, because each node has a parent reference... In Haskell however

Re: [Haskell-cafe] Possible Improvements

2007-12-03 Thread Derek Elkins
On Mon, 2007-12-03 at 10:48 +0100, Ketil Malde wrote: Johan Tibell [EMAIL PROTECTED] writes: It would be great if someone could exemplify these rules of thumb, e.g. Primitive types such as Int should be strict unless in the three canonical examples X, Y and Z. My strictness radar is still

Re: [Haskell-cafe] foild function for expressions

2007-12-03 Thread Derek Elkins
On Mon, 2007-12-03 at 19:13 -0800, Stefan O'Rear wrote: On Mon, Dec 03, 2007 at 09:18:18AM -0800, Carlo Vivari wrote: Hi! I'm a begginer in haskell and I have a problem with an exercise, I expect someone could help me: In one hand I have a declaration of an algebra data, like this:

Re: [Haskell-cafe] Why is this strict in its arguments?

2007-12-05 Thread Derek Elkins
On Wed, 2007-12-05 at 10:01 +0100, Pablo Nogueira wrote: Hasn't Ryan raised an interesting point, though? Bottom is used to denote non-termination and run-time errors. Are they the same thing? Up to observational equality, yes. To me, they're not. A non-terminating program has different

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Derek Elkins
On Sat, 2007-12-08 at 16:39 -0800, Bryan O'Sullivan wrote: Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could

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

2007-12-11 Thread Derek Elkins
On Tue, 2007-12-11 at 23:06 -0500, [EMAIL PROTECTED] wrote: On 2007.12.12 03:29:13 +0100, Wolfgang Jeltsch [EMAIL PROTECTED] scribbled 1.6K characters: Am Mittwoch, 12. Dezember 2007 03:12 schrieb [EMAIL PROTECTED]: FWIW to the discussion about changing the main page, I was reading the

Re: [Haskell-cafe] Re: Monads that are Comonads and the role of Adjunction

2007-12-16 Thread Derek Elkins
On Sun, 2007-12-16 at 13:49 +0100, apfelmus wrote: Dan Weston wrote: newtype O f g a = O (f (g a)) -- Functor composition: f `O` g instance (Functor f, Functor g) = Functor (O f g) where ... instance Adjunction f g = Monad (O g f) where ... instance Adjunction f g =

Re: [Haskell-cafe] data vs newtype (was: OOP'er with (hopefully) trivial questions)

2007-12-17 Thread Derek Elkins
On Mon, 2007-12-17 at 13:51 +, Bayley, Alistair wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark To recap... type introduces a synonym for another type, no new type is createdit's for readabilities sake. Newtype introduces an

Re: [Haskell-cafe] Re: Monads that are Comonads and the role of Adjunction

2007-12-17 Thread Derek Elkins
On Mon, 2007-12-17 at 09:58 -0500, David Menendez wrote: On Dec 17, 2007 4:34 AM, Yitzchak Gale [EMAIL PROTECTED] wrote: Derek Elkins wrote: There is another very closely related adjunction that is less often mentioned. ((-)-C)^op

Re: [Haskell-cafe] OOP'er with (hopefully) trivial questions.....

2007-12-17 Thread Derek Elkins
On Mon, 2007-12-17 at 22:12 +0300, Miguel Mitrofanov wrote: There's a third way, too, and I haven't seen anybody mention it yet I've noticed it, but there are some problems with this representation, so I decided not to mention it. It's OK as far as we don't want functions working on two

Re: [Haskell-cafe] Is StateT what I need?

2007-12-17 Thread Derek Elkins
On Mon, 2007-12-17 at 21:22 -0200, Andre Nathan wrote: On Mon, 2007-12-17 at 17:33 -0200, Andre Nathan wrote: Hello (Newbie question ahead :) Thanks everyone for the great suggestions. The code is much cleaner now (not to mention it works :) This is the first non-tutorial program I'm

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-19 Thread Derek Elkins
On Tue, 2007-12-18 at 23:04 -0800, Don Stewart wrote: jules: Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt =

Re: [Haskell-cafe] Why does this blow the stack?

2007-12-21 Thread Derek Elkins
On Fri, 2007-12-21 at 09:13 -0800, Justin Bailey wrote: Given this function: dropTest n = head . drop n $ [1..] I get a stack overflow when n is greater than ~ 550,000 . Is that inevitable behavior for large n? Is there a better way to do it? A similar example is discussed on

Re: [Haskell-cafe] Why does this blow the stack?

2007-12-21 Thread Derek Elkins
On Fri, 2007-12-21 at 09:56 -0800, David Benbennick wrote: On Dec 21, 2007 9:51 AM, Justin Bailey [EMAIL PROTECTED] wrote: I think its [1..] which is building up the unevaluated thunk. Using this definition of dropTest does not blow the stack: It also works if you do [(1::Int) ..] !! n,

Re: [Haskell-cafe] Printing and Referential transparency excuse

2007-12-25 Thread Derek Elkins
On Mon, 2007-12-24 at 11:15 +0200, Cristian Baboi wrote: While reading the Haskell language report I noticed that function type is not an instance of class Read. I was told that one cannot define them as an instance of class Show without breaking referential transparency or printing a

Re: [Haskell-cafe] Wikipedia on first-class object

2008-01-06 Thread Derek Elkins
On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote: Programming languages are generally classified into three groups, imperative, functional, and logical. The difference is in the style of programming encouraged (or mandated, for older languages) by the language. Usually the

Re: [Haskell-cafe] Quanta. Was: Wikipedia on first-class object

2008-01-06 Thread Derek Elkins
On Sun, 2007-12-30 at 12:27 +0100, [EMAIL PROTECTED] wrote: [...] I don't understand your point. We know what swimming is: floating and moving autonomously. Thinking is different, since our thinking is (at least for some of us) conscious, and we have no idea what is the conscience. For

  1   2   3   4   5   6   >