`seq` breaks the foldr/build-rule

2002-05-14 Thread Janis Voigtlaender
Hello, while we are talking about strange semantic inequalities in the presence of `seq` (supposed monads not satisfying the monad laws anymore...), I just wanted to reiterate a point I made in a previous post, namely that `seq` also makes the foldr/build-rule of shortcut deforestation [1] wrong.

Re: Haddock installing problems

2002-05-14 Thread Andre W B Furtado
Andre W B Furtado wrote: > > [Haddock cannot find perl] > This works for me, but I'm not a Cygwin/Windows expert so I'm not sure > what the canonical answer should be. On my system I have the Cygwin > perl.exe in /cygwin/bin, and this is also /bin under cygwin, because by > default Cygwin seems t

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Jay Cox
On Tue, 14 May 2002, Ken Shan wrote: > On 2002-05-14T12:32:30-0400, Jan-Willem Maessen wrote: > > And I'd really much rather we cleaned up the semantics of > > seq---or better yet, fixed the problems with lazy evaluation which > > make seq necessary in the first place. > > A general question: Wh

Re: How to get functional software engineering experience?

2002-05-14 Thread John Hughes
> > However, it appears that the only place (short of Ericsson) I can actually > work on a complex functional system is in academia. Unfortunately, this is > not an option, as I have no Ph.D., and going back to school is probably not > realistic. There are other companies using Erlang, if not on

(no subject)

2002-05-14 Thread LAURENT MPETI KABILA
REQUEST FOR URGENT BUSINESS ASSISTANCE -- I stumbled into your contact by stroke of luck after a long search for an honest and trust worthy person who could handle issue with high confidentiality. I was so dilghted when i got your contact and i decided to contac

Re: How to get functional software engineering experience?

2002-05-14 Thread Andrew J Bromage
G'day all. On Tue, May 14, 2002 at 04:47:13PM -0500, Jeffrey Palmer wrote: > Are there any options for people like me, or does my functional experience > remain limited to the hobby* work I can squeeze in at night and on weekends? > > Thoughts? The first thing you have to understand is that t

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Alastair Reid
Hal Daume <[EMAIL PROTECTED]> writes: > [seq is] useful for: > > debug :: Show a => a -> a > debug x = unsafePerformIO (hPutStrLn stderr (show x)) `seq` x > > (Presumably "trace" is defined similarly) > > One may ask the question: what is seq useful for not in conjunction with > unsafePerformI

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Hal Daume III
True, but using seq you can define deepSeq/rnf (depening on which camp you're from), which isn't misleading in this way. -- Hal Daume III "Computer science is no more about computers| [EMAIL PROTECTED] than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Tue, 14 May 20

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Iavor S. Diatchki
hello, this is misleading. seq only evaluates to whnf, i.e. the outermost lazy constructor (or lambda) and that only if the "seq ..." expression is actually evaluated, which is often tricky to ensure. furthermore, for non-functions one can get the same behaviour, by using a case with a pattern.

How to get functional software engineering experience?

2002-05-14 Thread Jeffrey Palmer
Hello all, I've got a not-quite-so-technically-detailed question for everyone. For the past ten or so years, I've been building relatively large "real-world" software systems, and I've always been interested in finding new and innovative ways to reduce complexity and improve system maintainabi

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Jorge Adriano
> One may ask the question: what is seq useful for not in conjunction with > unsafePerformIO, other than efficiency. That, I don't know the answer to. Here is an example. > main::IO() > main=do > time1 <- getCPUTime > w <- return $! calcSomething > time2 <- getCPUTime ... J

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Hal Daume III
It's useful for: debug :: Show a => a -> a debug x = unsafePerformIO (hPutStrLn stderr (show x)) `seq` x (Presumably "trace" is defined similarly) One may ask the question: what is seq useful for not in conjunction with unsafePerformIO, other than efficiency. That, I don't know the answer to.

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Ken Shan
On 2002-05-14T12:32:30-0400, Jan-Willem Maessen wrote: > And I'd really much rather we cleaned up the semantics of > seq---or better yet, fixed the problems with lazy evaluation which > make seq necessary in the first place. A general question: What is seq useful for, other than efficiency? --

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread S.M.Kahrs
> "S.M.Kahrs" wrote: > [snip] > > I don't think this really solves the problem with the left unit > > (not in general, and not for IO either), > > it merely pushes it to a different place. > [snip] > Not being a category theorist I find this all a bit confusing. Nothing to do with category theory

using error x as a placeholder

2002-05-14 Thread Hal Daume III
I've seen 'error "foo"' or simply 'undefined' used as a placeholder for elements in a structure which we, as programmers, know will be filled in soon. Often this makes the code clearer because the creation of the data structure and filling in its values is separated (you could argue with this, bu

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread George Russell
"S.M.Kahrs" wrote: [snip] > I don't think this really solves the problem with the left unit > (not in general, and not for IO either), > it merely pushes it to a different place. [snip] Not being a category theorist I find this all a bit confusing. Can you give an example where with GHC and the f

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Robert Ennals <[EMAIL PROTECTED]> wrote: > Surely that problem only arises if one insists on encoding all the relevant > information inside a string. This is pretty much the only option, because translators and programmers are different people. Translators can deal with simple text files with on

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Jan-Willem Maessen
Dylan Thurston <[EMAIL PROTECTED]> writes: > I don't think this is necessarily wise to drop this from the report > altogether. To me, it seems comparable to associativity of addition > for instances of Num; many instances don't satisfy it (e.g., Float), > but it's a useful guideline to keep in mi

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread S.M.Kahrs
George Russel wrote: [snip] > I presume it would not in fact be difficult to synthesise a left identity at > the cost of making things slower, thus (forgive any syntax errors, I'm not going to > test this). > > data MonadIO a = Action (IO a) | Return a > instance Monad (MonadIO a) where >retu

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Robert Ennals
> Robert Ennals <[EMAIL PROTECTED]> wrote: > > I personally much prefer the syntax currently used in Haskell, which is also > > essentially what is used in most other recent languages, including Java, C++, > > and (god help me) Perl. > > > > In the example given, I could write: > > > > "I have

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread George Russell
Dylan Thurston wrote: [snip] > I've often been bothered by the inconsistent treatment of laws in the > report; why are there laws for functors, monads, and quot/rem and > div/mod, and not much else? I'm pleased to see that the laws that are > given actually do have exceptions. [snip] Even the quo

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Robert Ennals <[EMAIL PROTECTED]> wrote: > I personally much prefer the syntax currently used in Haskell, which is also > essentially what is used in most other recent languages, including Java, C++, > and (god help me) Perl. > > In the example given, I could write: > > "I have " ++ action ++

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Dylan Thurston
On Tue, May 14, 2002 at 04:57:12PM +0200, George Russell wrote: > According to the report > > Instances of Monad should satisfy the following laws: > > > >return a >>= k = k > >m >>= return= m > >m >>= (\x -> k x >>= h) = (m >>= k) >>= h > so neither IO nor my even

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Dylan Thurston
On Tue, May 14, 2002 at 03:45:36PM +0100, Robert Ennals wrote: > Just thought I would jump in and say that, unlike (it seems) > everyone else, I hate printf in C. It is a horrible horrible > inextensible hack of a function that I find extremely awkward to > use. > ... > I personally much prefer th

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Martin Norbäck
tis 2002-05-14 klockan 16.45 skrev Robert Ennals: > > Martin Norbäck <[EMAIL PROTECTED]> wrote: > > > I agree that i18n needs positional arguments. > > > What's wrong with simply doing like this: > > > > > > printf "I have %. %. %.."["trained", show 1, "Jedi"] > > > printf "%2. %3. %1. I have

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread George Russell
Simon Marlow wrote [snip] > So the IO monad in Haskell, at least as we understand it, doesn't > satisfy the monad laws (or, depending on your point of view, seq breaks > the monad laws). [snip] Cheers Simon. One of the awkward things about the Haskell events I implemented is that although I make

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Robert Ennals
> Martin Norbäck <[EMAIL PROTECTED]> wrote: > > I agree that i18n needs positional arguments. > > What's wrong with simply doing like this: > > > > printf "I have %. %. %.."["trained", show 1, "Jedi"] > > printf "%2. %3. %1. I have." ["trained", show 1, "Jedi"] > > Nothing is exceptionally w

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Martin Norbäck <[EMAIL PROTECTED]> wrote: > I agree that i18n needs positional arguments. > What's wrong with simply doing like this: > > printf "I have %. %. %.."["trained", show 1, "Jedi"] > printf "%2. %3. %1. I have." ["trained", show 1, "Jedi"] Nothing is exceptionally wrong with it, ex

Apparel & Helmet Links - Super sales & Savings

2002-05-14 Thread PlanetMoto.com
MILLIONS of dollars in brand name high quality motorcycle accessories featured on this month’s sites. Some products are being liquidated at unbelievable blowout prices! Most products are being sold for significant discounts off of retail pricing. In some cases prices have been slashed up to 70% off

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Ross Paterson
On Tue, May 14, 2002 at 12:14:02PM +0100, Simon Marlow wrote: > The question we were considering was whether the following should hold > in the IO monad: > > (return () >>= \_ -> undefined) `seq` 42 == undefined > > [as implied by the left-identity monad law] > > This discrepancy applie

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread David Feuer
On Tue, May 14, 2002, Simon Marlow wrote: > An interesting revelation just occurred to Simon P.J. and myself while > wondering about issues to do with exceptions in the IO monad (see > discussion on [EMAIL PROTECTED] if you're interested). > > The question we were considering was whether the foll

State monads don't respect the monad laws in Haskell

2002-05-14 Thread Simon Marlow
An interesting revelation just occurred to Simon P.J. and myself while wondering about issues to do with exceptions in the IO monad (see discussion on [EMAIL PROTECTED] if you're interested). The question we were considering was whether the following should hold in the IO monad: (return

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Sebastien Carlier
On Tuesday, May 14, 2002, at 06:37 AM, anatoli wrote: > Brian Huffman <[EMAIL PROTECTED]> wrote: >> Here is a printf-style function that I hacked up this morning; it uses >> type >> classes but it doesn't need functional dependencies: > [snip] > > It's very nice and even extendable, though `cla

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Martin Norbäck
tis 2002-05-14 klockan 06.37 skrev anatoli: > Brian Huffman <[EMAIL PROTECTED]> wrote: > > Here is a printf-style function that I hacked up this morning; it uses type > > classes but it doesn't need functional dependencies: > [snip] > > It's very nice and even extendable, though `class Printf Str