Re: [Haskell-cafe] what is the status of haskell's mail libraries?

2010-12-29 Thread Robert Wills
Sure -- I'll look at doing that. No time today but should be able to look at that on Friday. -Rob On Wed, Dec 29, 2010 at 6:02 AM, Michael Snoyman mich...@snoyman.com wrote: This looks very good, thank you! One comment: do you think it would be possible to add a function for sending a

[Haskell-cafe] The IO monad is 45 years old

2010-12-29 Thread oleg
The unabated debate about exactly how much category theory one needs to know to understand that strange beast of IO prompts a thought if monads, like related continuations, are the things that are destined to be rediscovered time and time again. An old (1994) paper on category theory monads and

Re: [Haskell-cafe] ghc +RTS -M and -A behaving strange

2010-12-29 Thread Daniel Fischer
On Tuesday 28 December 2010 20:37:50, Johannes Waldmann wrote: Hello. When I run a program compiled with ghc-6.12.3 like this: ... +RTS -A2G -M8G -s I get as an answer: Heap exhausted; Current maximum heap size is 0 bytes (0 MB); use `+RTS -Msize' to increase it. Overflow, I'm almost

Re: [Haskell-cafe] multi type addition

2010-12-29 Thread Henning Thielemann
On Tue, 28 Dec 2010, aditya siram wrote: The problem here is that unfortunately the Haskell type system cannot do coercion. I'd omit the unfortunately. For me it is a good thing that Haskell does not silently apply lossy number conversions, as e.g. MatLab does. 'realToFrac' allows

Re: [Haskell-cafe] [Haskell] haskell.org migration complete

2010-12-29 Thread Henning Thielemann
On Sun, 5 Dec 2010, Henning Thielemann wrote: Thomas Schilling schrieb: I created http://www.haskell.org/haskellwiki/MigratingWikiContent to list known issues and workarounds. Please feel free to extend that page where needed. ... I did not like to add these items while having to log in

Re: [Haskell-cafe] ghc +RTS -M and -A behaving strange

2010-12-29 Thread Johannes Waldmann
ghci (8000*2^20) `mod` (2^32) 4093640704 Seems GHC uses Word for the allocation figures Interesting. Then how can I set the memory bounds that I want? The machine has 12 GB, and if I leave out any RTS options, then the ghc-compiled program will happily consume it all. and you have a

Re: [Haskell-cafe] Incrementially updating an array

2010-12-29 Thread Henning Thielemann
On Wed, 29 Dec 2010, Robert Clausecker wrote: Am Mittwoch, den 29.12.2010, 13:29 +0100 schrieb Henning Thielemann: I don't know, I hope it's doing its best. :-) You might compare speed of Array.accum with a manually written foldl with (//). At a glance onto it's sourcecode it actually

[Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
From: Control.Monad.Reader type Reader r = ReaderT r IdentityThe parameterizable reader monad. Computations are functions of a shared environment. The return function ignores the environment, while = passes the inherited environment to both subcomputations Is there an

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Ryan Ingram
On Wed, Dec 29, 2010 at 8:06 AM, michael rice nowg...@yahoo.com wrote: Is there an unparameterizable reader monad? I'm not sure this is the answer you are looking for, but it seems like the obvious one. Pick an r, say String. Now Reader String is an unparameterizable reader monad that passes

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
Hi, Ryan. Since I'm trying to understand Reader, I wanted to be aware of all cases of Reader.  == From the docs (and tuts) newtype creates a new type out of an existing type and gives a single constructor for doing so. From: http://www.haskell.org/tutorial/moretypes.html   newtype

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Henning Thielemann
On Wed, 29 Dec 2010, michael rice wrote: In the case of ReaderT and StateT newtype ReaderT r m a = ReaderT {     -- | The underlying computation, as a function of the environment.     runReaderT :: r - m a     } newtype StateT s m a = StateT { runStateT :: s - m (a, s) } what is the

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Michael Lazarev
2010/12/29 michael rice nowg...@yahoo.com From the docs (and tuts) newtype creates a new type out of an existing type and gives a single constructor for doing so. what is the existing type? Michael, you may want to see this section:

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
I think of (r - m a) as a type signature and Int or Bool by themselves as types. So, all type signatures are themselves types? Michael --- On Wed, 12/29/10, Henning Thielemann lemm...@henning-thielemann.de wrote: From: Henning Thielemann lemm...@henning-thielemann.de Subject: Re:

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Tillmann Rendel
Hi, Michael Rice wrote: I think of (r - m a) as a type signature and Int or Bool by themselves as types. So, all type signatures are themselves types? Yes. In Haskell, functions are first class, so function types like (r - m a) are themselves types. Tillmann

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
Hi, Michael. Yes, I'd already noticed that ReaderT preceded Reader. Guess I'll have to check out the Indentity monad too. I hope it's not dependent upon yet another monad.  ;-) Thanks for the link. I go there a lot. Michael --- On Wed, 12/29/10, Michael Lazarev lazarev.mich...@gmail.com

Re: [Haskell-cafe] ghc +RTS -M and -A behaving strange

2010-12-29 Thread Daniel Fischer
On Wednesday 29 December 2010 15:41:22, Johannes Waldmann wrote: ghci (8000*2^20) `mod` (2^32) 4093640704 Seems GHC uses Word for the allocation figures Looking at the rts-code, maxHeapSize is in blocks (4096 bytes, as far as I can see) and the code for setting it uses double and

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Daniel Fischer
On Wednesday 29 December 2010 19:30:11, michael rice wrote: Yes, I'd already noticed that ReaderT preceded Reader. Guess I'll have to check out the Indentity monad too. I hope it's not dependent upon yet another monad.  No, the Identity monad stands alone. And as the name suggests, it's pretty

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
Hi, Daniel. I had an Aha! moment and it all makes sense now. Just as the State monad can hold a generator (which can change) and pass it down a calculation chain, a Reader monad can hold an environment (which doesn't change) and pass it down a calculation chain. I was wondering how I could

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Albert Y. C. Lai
On 10-12-29 12:50 PM, michael rice wrote: I think of (r - m a) as a type signature and Int or Bool by themselves as types. So, all type signatures are themselves types? http://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-620004 In particular gendecl → vars :: [context =] type

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Michael Lazarev
2010/12/29 Albert Y. C. Lai tre...@vex.net On 10-12-29 12:50 PM, michael rice wrote: I think of (r - m a) as a type signature and Int or Bool by themselves as types. So, all type signatures are themselves types? http://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-620004

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Michael Lazarev
2010/12/29 michael rice nowg...@yahoo.com I had an Aha! moment and it all makes sense now. Just as the State monad can hold a generator (which can change) and pass it down a calculation chain, a Reader monad can hold an environment (which doesn't change) and pass it down a calculation

Re: [Haskell-cafe] The IO monad is 45 years old

2010-12-29 Thread Vinod Grover
Indeed, one might think that there is very little new :) I also recommend the following handy book on functional programming (based on Landin's ideas among others ) by William H Burge called recursive Programming Techniques from 1975.

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread David Leimbach
On Wed, Dec 29, 2010 at 1:48 PM, Michael Lazarev lazarev.mich...@gmail.comwrote: 2010/12/29 michael rice nowg...@yahoo.com I had an Aha! moment and it all makes sense now. Just as the State monad can hold a generator (which can change) and pass it down a calculation chain, a Reader monad can

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread Michael Lazarev
2010/12/30 David Leimbach leim...@gmail.com: Reader Writer State is commonly needed in big applications so transformers provides one for us: http://hackage.haskell.org/packages/archive/transformers/0.2.2.0/doc/html/Control-Monad-Trans-RWS-Lazy.html Pretty cool stuff if you ask me.  I often

[Haskell-cafe] Manatee-0.1.6 release!

2010-12-29 Thread Andy Stewart
Hi all, Manatee-0.1.6 release, sorry for late, I was tired of the many trivial this month. http://www.youtube.com/watch?v=weS6zys3U8k hackage.haskell.org/package/manatee New version Manatee support customize and hot-swap, like elisp for Emacs, but much much fast and safe. Please look

[Haskell-cafe] What are these comments for {-# SCC Mangler #-}

2010-12-29 Thread Aaron Gray
What are these comments for in Happy ? {-# SCC Mangler #-} Many thanks in advance, Aaron ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What are these comments for {-# SCC Mangler #-}

2010-12-29 Thread aditya siram
Check out the Time Profiling of the Chapter 25 of Real World Haskell [1] for a detailed explanation. -deech [1] http://book.realworldhaskell.org/read/profiling-and-optimization.html On Wed, Dec 29, 2010 at 6:48 PM, Aaron Gray aaronngray.li...@gmail.com wrote: What are these comments for in

[Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Mark Spezzano
Hi, Presently I am going through AJT Davie's text An Introduction to Functional Programming Systems Using Haskell. On page 84, regarding formal definitions of FREE and BOUND variables he gives Defn 5.2 as The variable X is free in the expression E in the following cases a) omitted b) If E

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Antoine Latter
Was there a typo in your email? Because those two definitions appear identical. I could be missing something - I haven't read that book. Antoine On Wed, Dec 29, 2010 at 9:05 PM, Mark Spezzano mark.spezz...@chariot.net.au wrote: Hi, Presently I am going through AJT Davie's text An Introduction

[Haskell-cafe] Incorrectly inferring type [t]

2010-12-29 Thread william murphy
Hi All, I've spent a lot of time trying to write a version of concat, which concatenates lists of any depth: So: concat'' [[[1,2],[3,4]],[[5]]] would return: [1,2,3,4,5] The code is: concat'' :: [a] - [b] concat'' ((y:ys):xs) = (concat'' (y:ys)) ++ (concat'' xs) concat'' []

Re: [Haskell-cafe] [Haskell-beginners] Tying the knot

2010-12-29 Thread Antoine Latter
On Wed, Dec 29, 2010 at 7:22 PM, aditya siram aditya.si...@gmail.com wrote: My brain turns into strange braid when I see this kind of thing. I don't quite understand it and I've never used it in real world code but I'll try and explain anyway. Caveat emptor. Once when I was parsing a group of

[Haskell-cafe] How to make such code?

2010-12-29 Thread Magicloud Magiclouds
Hi, In Haskell's way, normally, we write: if condition then expression_true else expression_false But I just heard that, in fancy way, we could do: do ifNeedToDo doIt bluh May I have any clue here? -- 竹密岂妨流水过 山高哪阻野云飞 ___ Haskell-Cafe

Re: [Haskell-cafe] Incorrectly inferring type [t]

2010-12-29 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/29/10 22:05 , william murphy wrote: I've spent a lot of time trying to write a version of concat, which concatenates lists of any depth: So: concat'' [[[1,2],[3,4]],[[5]]] would return: [1,2,3,4,5] You can't do that, at least

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Mark Spezzano
Duh, Sorry. Yes, there was a typo the second one should read If E is a combination E1 E2 then X is bound in E if and only if X is bound in E1 or is bound in E2. Apologies for that oversight! Mark On 30/12/2010, at 1:21 PM, Antoine Latter wrote: Was there a typo in your email? Because

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Gregg Reynolds
On Wed, Dec 29, 2010 at 9:22 PM, Mark Spezzano mark.spezz...@chariot.net.au wrote: Duh, Sorry. Yes, there was a typo the second one should read If E is a combination E1 E2 then X is bound in E if and only if X is bound in E1 or is bound in E2. Seems odd. I recommend you always work from

Re: [Haskell-cafe] How to make such code?

2010-12-29 Thread Antoine Latter
Hi, You're looking for 'when' as in: do condition - something when condition $ other things more things http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Monad.html#v:when It is quite handy. Take care, Antoine On Wed, Dec 29, 2010 at 10:14 PM, Magicloud

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Mark Spezzano
Hi all, Thanks for your comments Maybe I should clarify... For example, 5.2 FREE: If E1 = \y.xy then x is free If E2 = \z.z then x is not even mentioned So E = E1 E2 = x (\z.z) and x is free as expected So E = E2 E1 = \y.xy and x is free as expected 5.3 BOUND: = If E1 =

Re: [Haskell-cafe] what is the status of haskell's mail libraries?

2010-12-29 Thread Michael Steele
Note, that this will not run on Windows, as it gives command  /usr/sbin/sendmail It sounds like mime-mail may be getting native support soon, but until then you may try what I've had success with on Windows. Grab a sendmail replacement like the one at http://glob.com.au/sendmail/. It's just a

Re: [Haskell-cafe] Incorrectly inferring type [t]

2010-12-29 Thread Lennart Augustsson
First, what type would such a function have? Certainly not [a]-[b], because that type say that it can take a list of any type and turn it into a list of any other type, e.g., [Int]-[Bool]. On Thu, Dec 30, 2010 at 4:05 AM, william murphy will.t.mur...@gmail.comwrote: Hi All, I've spent a lot

[Haskell-cafe] ; in do

2010-12-29 Thread Daryoush Mehrtash
Why do people put ; in do {}, or , in data fields, at the beginning of the line? -- Daryoush Weblog: http://onfp.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] SampleVar semantics, documentation vs. source

2010-12-29 Thread Eric Stansifer
Hi, doc:   http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/Control-Concurrent-SampleVar.html source:   http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/src/Control-Concurrent-SampleVar.html The documentation for Control.Concurrent.SampleVar implies

Re: [Haskell-cafe] ; in do

2010-12-29 Thread Antoine Latter
I started for cleaner diffs and easier editing - I can add/remove a line at the end without editing any other line. Eventually I grew to like the look of it. Both styles are common, from what I can tell. Antoine On Wed, Dec 29, 2010 at 11:40 PM, Daryoush Mehrtash dmehrt...@gmail.com wrote: Why

Re: [Haskell-cafe] Data.Typeable TypeRep Ord instance.

2010-12-29 Thread Andreas Baldeau
On 01:08 Sun 05 Dec , Serguey Zefirov wrote: Why TypeRep does have equality and doesn't have ordering? It would be good to have that. I think the problem is, that it's hard to give an ordering that stays the same for all runs of your program. If you don't need this property you could use

[Haskell-cafe] V.I.P.s and the associativity of merge'

2010-12-29 Thread Leon Smith
Ok, after mulling over the issues that Will Ness has brought up in the last few days [1], I think I have a partial explanation for the apparent tension between Will's observations and Heinrich Apfelmus's Implicit Heaps article [2], which both concern the implementation of mergeAll [3]. The

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Stefan Holdermans
Mark, Whether a variable is bound or free depends on the scope under consideration. In (\x. x) (\y. x) the variable x is bound in \x. x, but free in \y. x; hence, it's free in (\x. x) (\y. x) as a whole. However, in \x. (\x. x) (\y. x) it's bound... HTH, Stefan