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

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

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 "temp

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

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 >

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

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'

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 argu

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

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/{{{//g' :-) could have simplified > > > a lot.

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 > > a

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 >

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. > >

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 Showab

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 ope

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 > > "wh

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

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] > >

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"

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 > > langu

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 paralleli

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,

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@ !) > > > > >

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 me

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, "zipWi

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

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 expres

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 > fu

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 . en

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 b

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

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

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 so

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? > >

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.

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 di

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 ::

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 cl

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' (http://www.facebook.com/

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 la

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. > >> >

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 *algorit

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 H

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 sup

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 w

RE: [Haskell-cafe] FP design

2007-11-07 Thread Derek Elkins
On Thu, 2007-11-08 at 13:21 +1100, Tim Docker wrote: > levi.stephen wrote: > > My concern (which may be inexperience ;) ) is with the monads here > > though. What if I hadn't seen that the IO monad (or any other Monad) > > was going to be necessary in the type signatures? > > > You'd have some re

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 wasEnab

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 rea

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

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 th

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. ;-) > > Inter

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 t

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 > > t

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 > &

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

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 on

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 > &g

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

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? Lo

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

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. >

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.

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 >

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

2007-12-01 Thread Derek Elkins
On Sun, 2007-12-02 at 03:11 +, Kannan Goundan wrote: > I'm implementing an interpreter for the lambda calculus augmented with > mutable variables. I'm having problems doing the mutable state stuff in > Haskell. Here's what I have so far: > > type Expr= ... terms in the language ... >

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

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

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... > >> I

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

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

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 > diffe

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.

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

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

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"

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

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 o

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

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 > > > > > >n

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 http:

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) ..]

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 printin

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 di

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 good

Re: [Haskell-cafe] Basic question concerning the category Hask (was: concerning data constructors)

2008-01-06 Thread Derek Elkins
On Wed, 2008-01-02 at 15:49 +0200, Yitzchak Gale wrote: [...] > Some people are worried that this version of Hask is missing > certain nice properties that one would like to have. For > example, it was recently claimed on this list that tuples > are not products in that category. (Or some such. I

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

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 16:19 +0100, Daniel Fischer wrote: > Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider: > > Daniel Fischer <[EMAIL PROTECTED]> wrote: > > > Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin: > > > > Daniel Fischer wrote: > > > > > Just because I don't know: > > > >

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

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 09:45 -0800, Jonathan Cast wrote: > On 6 Jan 2008, at 3:02 AM, Derek Elkins wrote: > > > On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote: > > > >> Programming languages are generally classified into three groups, > >> imper

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

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 22:31 +0100, [EMAIL PROTECTED] wrote: > Derek Elkins writes: > > > Jonathan Cast wrote: > >> I find the term `declarative' to be almost completely meaningless. > > > > I was originally thinking of having the final sentence: "Th

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

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 13:48 -0800, Jonathan Cast wrote: > On 6 Jan 2008, at 1:31 PM, [EMAIL PROTECTED] wrote: > > > Derek Elkins writes: > >> Jonathan Cast wrote: > >>> I find the term `declarative' to be almost completely meaningless. > >> I was o

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

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 23:28 +0100, [EMAIL PROTECTED] wrote: > Derek Elkins writes: > > > Jonathan Cast wrote: > > >> I find the only > >> similarity between Haskell and Prolog to be that neither is imperative. > > > > Indeed, you've discov

Re: [Haskell-cafe] Implicit parameters and Arrows/Yampa?

2008-01-06 Thread Derek Elkins
On Sun, 2008-01-06 at 23:44 +0100, Peter Verswyvelen wrote: > If I understand it correctly, implicit parameters in Haskell allow you > to pass values to functions with explicitly adding a parameter to each > of the functions being “called” (I appologize for my imperative > terminology here. How wou

Re: [Haskell-cafe] what does @ mean?.....

2008-01-06 Thread Derek Elkins
On Fri, 2007-12-28 at 09:51 -0700, Luke Palmer wrote: > On Dec 28, 2007 9:35 AM, Jules Bean <[EMAIL PROTECTED]> wrote: > > In particular, adding sharing can stop something being GCed, which can > > convert an algorithm which runs in linear time and constant space to one > > which runs in linear spa

<    1   2   3   4   5   6   >