[Haskell-cafe] Monad Transformer (Was: Just curios)

2007-06-11 Thread Henning Thielemann
On Mon, 11 Jun 2007, Andrew Coppin wrote: > Paul Hudak wrote: > > As reported in the recent HOPL paper, /A History of Haskell/, Haskell > > Brooks Curry actually didn't like his first name! I learned this when > > I visited his wife, Virginia Curry, at the time when we decided to > > name a lang

Re: [Haskell-cafe] found monad in a comic

2007-06-11 Thread Derek Elkins
On Tue, 2007-06-12 at 04:16 +0200, Marc A. Ziegert wrote: > > ( join /= coreturn ) > > IMHO this could be a beautiful and easy way to explain monads. > comments? > > - marc Reader IceCream ___ Haskell-Cafe mailing list Hask

[Haskell-cafe] found monad in a comic

2007-06-11 Thread Marc A. Ziegert
( join /= coreturn ) IMHO this could be a beautiful and easy way to explain monads. comments? - marc pgpTFyuRioL8Y.pgp Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.

[Haskell-cafe] Re: Existentials and type var escaping

2007-06-11 Thread Ben Rudiak-Gould
Roberto Zunino wrote: foo, as defined above does not work (lazy patterns not allowed), and in foo y = E (case y of E x -> x) a variable escapes. I also tried with CPS with no success. Is foo definable at all? I'm starting to think that it is not, and that there must be a very good reason for t

Re: [Haskell-cafe] Thought for today

2007-06-11 Thread Nicolas Frisby
The uncertainty seems appropriate for the popular difficulties controlling strictness: we're uncertain whether or not thunks have been evaluated. On the other hand, I'm a bit put off because Schrodinger's uncertainty has strong overtones of nondeterminism, which would be very misleading for peopl

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Thomas Schilling
On 6/11/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: "Of course, our biggest mistake was using the word 'monad'. We should have called it 'warm fuzzy thing'..." You know that thing called "Google"? ;) http://lambda-the-ultimate.org/node/92 Among others.

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Andrew Coppin
Paul Hudak wrote: As reported in the recent HOPL paper, /A History of Haskell/, Haskell Brooks Curry actually didn't like his first name! I learned this when I visited his wife, Virginia Curry, at the time when we decided to name a language after her husband. Yes... I recall reading that som

[Haskell-cafe] Thought for today

2007-06-11 Thread Andrew Coppin
"Data in Haskell is like Schrodinger's famous undead cat - it doesn't 'exist' until you 'obverse' it." I just thought I'd share this useful (?) metaphore for describing to people what lazy evaluation is all about. ;-) ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread Jon Fairbairn
"Simon Brenner" <[EMAIL PROTECTED]> writes: > The key is letting haskell be lazy and produce the output one item at > a time. True. > This solution goes up to 100k in 25M of heap and up to 400k in 200M of > heap. While working better, the space requirement seems to be (at > least almost) quadrati

Re: [Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread Simon Brenner
The key is letting haskell be lazy and produce the output one item at a time. My solution below generates a list of all indices to be inversed (with indices being duplicated as appropriate), then for each index in that list inverses the corresponding element in the array. The list can be written c

[Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread Jon Fairbairn
H. <[EMAIL PROTECTED]> writes: > Jon Fairbairn cl.cam.ac.uk> writes: > > The idea in Haskell is not to think of stepping through the > > array. Look at accumArray and ixmap. > > Thanks for your answer. > > But I can't really see how the calc-function can be written more efficiently > with acc

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Tom Schrijvers
On Mon, 11 Jun 2007, Stephen Forrest wrote: On 6/10/07, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: You're pretty close, actually :) Names derived from Hebrew were fairly common in the Bible belt back when he was born. ("Haskell" from , wisdom. I half suspect "Curry" has a Biblical

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Fritz Ruehr
For what it's worth, a handful of people who have ordered Haskell merchandise from the CafePress store over the years have had "Haskell" as a surname. I assume they look at the designs before they buy, and I can't imagine what they think of some of them, but I guess the allure of having you

[Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread H .
Jon Fairbairn cl.cam.ac.uk> writes: > The idea in Haskell is not to think of stepping through the > array. Look at accumArray and ixmap. Thanks for your answer. But I can't really see how the calc-function can be written more efficiently with accumArray or ixmap, perhaps you can write it as an

Re: [Haskell-cafe] Head and tail matching question

2007-06-11 Thread Simon Brenner
Why not do something like this instead? untab [] = [] untab xs = head : untab (drop 1 tail) where (head, tail) = break (== '\t') xs BTW, going the extra step through unfoldr seems unnecessary to me - is there any special reason to prefer unfolds over simple recursive functions here? (Of cours

Re: [Haskell-cafe] More on the random idea

2007-06-11 Thread John Meacham
On Sat, May 26, 2007 at 10:59:10AM +0100, Andrew Coppin wrote: > However, when you consider that the result type could be "IO ()" or "IO > String" or "IO [Either (Maybe Int, (String, Bool)) [Either (Int -> > String) (Complex Integer)]]", and the expression itself may well contain > the "::" sequ

[Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread Jon Fairbairn
H. <[EMAIL PROTECTED]> writes: > Hello @ all, > > Sometimes one has an imperative algorithm, and wants to write a program in > Haskell which do has the same effect... > > So the question is - how a construct as the following can efficiently be > written? > > -- > Pseudo code: > n[1..1]

Re: [Haskell-cafe] Head and tail matching question

2007-06-11 Thread Jules Bean
Olivier Boudry wrote: Hi all, I'm trying to write a untab function that would split a string on tabs and return a list. Code is here. import Data.List (break, unfoldr) import Data.Char (String) untab :: String -> [String] untab s = unfoldr untab' s untab' :: String -> Maybe (String, String) u

Re: [Haskell-cafe] Examples of OpenAL and ALUT?

2007-06-11 Thread Henning Thielemann
On Thu, 7 Jun 2007, Dan Piponi wrote: > Does anyone have any sample Haskell code they'd like to share for > doing things like creating a waveform from a list of samples or a > mathematical function and playing them using these libraries (or > indeed any easy to install on MacOS X Haskell library)

[Haskell-cafe] Head and tail matching question

2007-06-11 Thread Olivier Boudry
Hi all, I'm trying to write a untab function that would split a string on tabs and return a list. Code is here. import Data.List (break, unfoldr) import Data.Char (String) untab :: String -> [String] untab s = unfoldr untab' s untab' :: String -> Maybe (String, String) untab' s | s == "" = Not

Re: [Haskell-cafe] LaTeX

2007-06-11 Thread tom
I got this from the Literate Haskell page on the Emacs Wiki[1]: \usepackage{listings} \lstloadlanguages{Haskell} \lstnewenvironment{code} {\lstset{}% \csname [EMAIL PROTECTED] {\csname [EMAIL PROTECTED] \lstset{ basicstyle=\small\ttfamily, flexiblecolumns=false, basewidth={0

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Stephen Forrest
On 6/10/07, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: You're pretty close, actually :) Names derived from Hebrew were fairly common in the Bible belt back when he was born. ("Haskell" from השקל, wisdom. I half suspect "Curry" has a Biblical origin as well, from קרי.) Bible belt

[Haskell-cafe] tail recursion ?

2007-06-11 Thread H .
Hello @ all, Sometimes one has an imperative algorithm, and wants to write a program in Haskell which do has the same effect... So the question is - how a construct as the following can efficiently be written? -- Pseudo code: n[1..1] = false for (1..1) |i| for (i,2*i..1) |j

Re: [Haskell-cafe] OSCON 2007, who's going?

2007-06-11 Thread Christopher Milton
--- Evan Lenz <[EMAIL PROTECTED]> wrote: > I'll be there for the Haskell tutorial (and Damian Conway's Vim > tutorial). I've been to OSCON one other time (2005) and that was to > present a tutorial on XSLT. I won't be staying for the conference though. > > Portland is nice. I live in Seattle, an

Re: [Haskell-cafe] Just curios

2007-06-11 Thread Paul Hudak
As reported in the recent HOPL paper, A History of Haskell, Haskell Brooks Curry actually didn't like his first name!  I learned this when I visited his wife, Virginia Curry, at the time when we decided to name a language after her husband. By the way, Haskell Curry's mother's name was Anna Ba

Re: [Haskell-cafe] Which regular syntax does Text.Regex use?

2007-06-11 Thread haskell
L.Guo wrote: > Hi All: > > I wrote this func : > > match = matchRegex . mkRegex > > And when using it, I found that I have not even know the syntax of Regex. > > Eager for your hint. > The Text.Regex documentation at http://www.haskell.org/ghc/docs/latest/html/libraries/regex-compat/Text-Re

Re: [Haskell-cafe] Shim missing Distribution.Verbosity

2007-06-11 Thread Pepe Iborra
Thanks for the report. That was an error I introduced in a previous patch, just pushed the fix. By the way, there is a Shim mailing list at http://shim.haskellco.de Cheers pepe On 11/06/2007, at 9:22, Johan Grönqvist wrote: Hi, I am trying to install shim (http://shim.haskellco.de/trac/wi

[Haskell-cafe] Shim missing Distribution.Verbosity

2007-06-11 Thread Johan Grönqvist
Hi, I am trying to install shim (http://shim.haskellco.de/trac/wiki) on windows XP (GHC 6.6.1). When I run "./Setup.lhs build", ghc tells me that the module Distribution.Verbosity can not be found. The module is imported by Shim.GhcCompat. ghcii also tells me that Distribution.Verbosity can