Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Issue with lazy eval + trace (Daniel Fischer) 2. Re: Issue with lazy eval + trace (Hugo Ferreira) 3. Re: Issue with lazy eval + trace (Daniel Fischer) 4. Search for docs on operator '<+>'. (Allen S. Rout) 5. Re: Search for docs on operator '<+>'. (David McBride) 6. Re: Search for docs on operator '<+>'. (Daniel Fischer) 7. Re: Search for docs on operator '<+>'. (Brent Yorgey) 8. Couple of problems with leksah (Peter Hall) 9. Re: Search for docs on operator '<+>'. (Jared Wigmore) 10. Re: Couple of problems with leksah (Daniel Fischer) ---------------------------------------------------------------------- Message: 1 Date: Mon, 7 Nov 2011 14:47:14 +0100 From: Daniel Fischer <daniel.is.fisc...@googlemail.com> Subject: Re: [Haskell-beginners] Issue with lazy eval + trace To: beginners@haskell.org Message-ID: <201111071447.14845.daniel.is.fisc...@googlemail.com> Content-Type: Text/Plain; charset="iso-8859-1" On Monday 07 November 2011, 09:41:24, Hugo Ferreira wrote: > Hello, > > I am using "import Debug.Trace" to debug some code but it is > not working as expected. I believe this is due to lazy evaluation. > But I cannot see how I can circumvent it. To exemplify I have > the following function: > > tagFun :: (POSTags -> Tag) -> POSTags -> POSTags > tagFun f corpus = Z.foldlz' tag Z.empty corpus > where > tag acc z = Z.insert newTag acc > where > (token, correctTag, _proposdTag) = trace "cursor " Z.cursor z > proposed = trace "proposed tag" (f z) > newTag = ( token, correctTag, proposed ) > > > If I place tracing at: > > tag acc z = trace ("tag "++token++" = "++ show newTag) Z.insert > newTag acc > > then it works ok. However the lines > > (token, correctTag, _proposdTag) = trace "cursor " Z.cursor z > proposed = trace "proposed tag" (f z) > > don't work. They only appear once. I assume they should appear with > every element in the zipper. Can anyone explain why? You're compiling with optimisations, aren't you? You need the trace strings to depend on the input, otherwise the optimiser sees no reason to repeat the work. (The constant part is lifted out of the lambda, a consequence of unsafePerformIO.) The line `trace "cursor " Z.cursor z' actually shouldn't print multiple traces even without optimisations, since it's (trace "cursor " Z.cursor) z so the trace applies to the evaluation of the function Z.cursor, which should only be done once. ------------------------------ Message: 2 Date: Mon, 07 Nov 2011 16:11:10 +0000 From: Hugo Ferreira <h...@inescporto.pt> Subject: Re: [Haskell-beginners] Issue with lazy eval + trace To: Daniel Fischer <daniel.is.fisc...@googlemail.com> Cc: beginners@haskell.org Message-ID: <4eb8031e.1040...@inescporto.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 11/07/2011 01:47 PM, Daniel Fischer wrote: > On Monday 07 November 2011, 09:41:24, Hugo Ferreira wrote: >> Hello, >> >> I am using "import Debug.Trace" to debug some code but it is >> not working as expected. I believe this is due to lazy evaluation. >> But I cannot see how I can circumvent it. To exemplify I have >> the following function: >> >> tagFun :: (POSTags -> Tag) -> POSTags -> POSTags >> tagFun f corpus = Z.foldlz' tag Z.empty corpus >> where >> tag acc z = Z.insert newTag acc >> where >> (token, correctTag, _proposdTag) = trace "cursor " Z.cursor z >> proposed = trace "proposed tag" (f z) >> newTag = ( token, correctTag, proposed ) >> >> >> If I place tracing at: >> >> tag acc z = trace ("tag "++token++" = "++ show newTag) Z.insert >> newTag acc >> >> then it works ok. However the lines >> >> (token, correctTag, _proposdTag) = trace "cursor " Z.cursor z >> proposed = trace "proposed tag" (f z) >> >> don't work. They only appear once. I assume they should appear with >> every element in the zipper. Can anyone explain why? > > You're compiling with optimisations, aren't you? Not that I am aware of. I did not set up any compilation flags in the cabal file. > You need the trace strings to depend on the input, otherwise the optimiser > sees no reason to repeat the work. (The constant part is lifted out of the > lambda, a consequence of unsafePerformIO.) > Ok, I understand now. Should have appended some output to the trace output string (thats what the working trace does). > The line `trace "cursor " Z.cursor z' actually shouldn't print multiple > traces even without optimisations, since it's > > (trace "cursor " Z.cursor) z > Ooops, thats a bug 8-( > so the trace applies to the evaluation of the function Z.cursor, which > should only be done once. > Ok, think I got it. Thank you, Hugo F. ------------------------------ Message: 3 Date: Mon, 7 Nov 2011 17:56:35 +0100 From: Daniel Fischer <daniel.is.fisc...@googlemail.com> Subject: Re: [Haskell-beginners] Issue with lazy eval + trace To: Hugo Ferreira <h...@inescporto.pt> Cc: beginners@haskell.org Message-ID: <201111071756.35570.daniel.is.fisc...@googlemail.com> Content-Type: Text/Plain; charset="iso-8859-1" On Monday 07 November 2011, 17:11:10, Hugo Ferreira wrote: > > You're compiling with optimisations, aren't you? > > Not that I am aware of. I did not set up any compilation flags in the > cabal file. cabal defaults to compiling with -O unless otherwise specified ($ cabal build -v2 emits the command lines used to build, if you want to check), so you most likely do. ------------------------------ Message: 4 Date: Mon, 07 Nov 2011 13:16:51 -0500 From: "Allen S. Rout" <a...@ufl.edu> Subject: [Haskell-beginners] Search for docs on operator '<+>'. To: beginners@haskell.org Message-ID: <j997ak$5mr$1...@dough.gmane.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Google seems to barf on '<+>'. I've found a haskell "list of operators", and it's not mentioned. Could some kind soul point me at documentation for this thing? - Allen S. Rout ------------------------------ Message: 5 Date: Mon, 7 Nov 2011 13:26:00 -0500 From: David McBride <toa...@gmail.com> Subject: Re: [Haskell-beginners] Search for docs on operator '<+>'. To: "Allen S. Rout" <a...@ufl.edu> Cc: beginners@haskell.org Message-ID: <CAN+Tr42byh=R=w-gqzuaqxup1qdxjhyx2jokgrvjcdnejyw...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 http://www.haskell.org/hoogle/?hoogle=%3C%2B%3E On Mon, Nov 7, 2011 at 1:16 PM, Allen S. Rout <a...@ufl.edu> wrote: > > > Google seems to barf on '<+>'. ? I've found a haskell "list of operators", > and it's not mentioned. > > Could some kind soul point me at documentation for this thing? > > - Allen S. Rout > > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > ------------------------------ Message: 6 Date: Mon, 7 Nov 2011 19:39:54 +0100 From: Daniel Fischer <daniel.is.fisc...@googlemail.com> Subject: Re: [Haskell-beginners] Search for docs on operator '<+>'. To: beginners@haskell.org Cc: "Allen S. Rout" <a...@ufl.edu> Message-ID: <201111071939.54282.daniel.is.fisc...@googlemail.com> Content-Type: Text/Plain; charset="iso-8859-1" On Monday 07 November 2011, 19:16:51, Allen S. Rout wrote: > Google seems to barf on '<+>'. I've found a haskell "list of > operators", and it's not mentioned. > > Could some kind soul point me at documentation for this thing? Try hoogle: http://www.haskell.org/hoogle/?hoogle=%3C%2B%3E (a few hits, searches only a restricted number of packages) or hayoo: http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=%3C%2B%3E (none found for this one :-( ) Or look at the ghc docs for stuff in the basic libraries: http://haskell.org/ghc/docs/7.0-latest/html/libraries/doc-index-60.html You may be looking for a different <+>, though. Unfortunately, afaik, there's no global hackage index of names. ------------------------------ Message: 7 Date: Mon, 7 Nov 2011 14:47:40 -0500 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] Search for docs on operator '<+>'. To: beginners@haskell.org Message-ID: <20111107194740.ga8...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Mon, Nov 07, 2011 at 01:16:51PM -0500, Allen S. Rout wrote: > > > Google seems to barf on '<+>'. I've found a haskell "list of > operators", and it's not mentioned. > > Could some kind soul point me at documentation for this thing? > > - Allen S. Rout In theory there could be many different definitions of <+> in many different packages. Off the top of my head I do not know of a "standard" meaning for it. Why are you looking for it? Did you see it used somewhere in particular? -Brent ------------------------------ Message: 8 Date: Tue, 8 Nov 2011 00:59:47 +0000 From: Peter Hall <peter.h...@memorphic.com> Subject: [Haskell-beginners] Couple of problems with leksah To: beginners@haskell.org Message-ID: <CAA6hAk4w2TnPtX=dv2DvrupPH0URi=5kgoszuxco_f56fcr...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I didn't get any response on the Leksah forum, so I hope it's ok to ask here. First problem, I keep seeing this in the error log: > Setup: You need to re-run the 'configure' command. The version of Cabal being > used has changed (was Cabal-1.10.2.0, now Cabal-1.10.1.0). Additionally the > compiler is different (was ghc-6.12, now ghc-7.0) which is probably the cause > of the problem. When I run configure, it just prints: > Resolving dependencies... > Configuring pokercalc-0.0.1... But it doesn't fix anything. The other problem is when I try to update cabal: > cabal install leksah Resolving dependencies... cabal: cannot configure haddock-2.9.4. It requires ghc >=7.2 && <7.4 There is no available version of ghc that satisfies >=7.2 && <7.4 I'm using Haskell Platform 2011.2.0.1 for Mac OS X 10.6 Any ideas? Peter ------------------------------ Message: 9 Date: Tue, 8 Nov 2011 09:03:12 +0800 From: Jared Wigmore <jared.wigm...@gmail.com> Subject: Re: [Haskell-beginners] Search for docs on operator '<+>'. To: Brent Yorgey <byor...@seas.upenn.edu> Cc: beginners@haskell.org Message-ID: <CACt4PuqC93TP8DKVRVL5u8p3YsOhEEbYOT7MbqjCYt=gii2...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi, It's part of the "Arrows" system, see: http://www.haskell.org/arrows/ and http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Arrow.html On Tue, Nov 8, 2011 at 3:47 AM, Brent Yorgey <byor...@seas.upenn.edu> wrote: > On Mon, Nov 07, 2011 at 01:16:51PM -0500, Allen S. Rout wrote: >> >> >> Google seems to barf on '<+>'. ? I've found a haskell "list of >> operators", and it's not mentioned. >> >> Could some kind soul point me at documentation for this thing? >> >> - Allen S. Rout > > In theory there could be many different definitions of <+> in many > different packages. ?Off the top of my head I do not know of a > "standard" meaning for it. ?Why are you looking for it? ?Did you see > it used somewhere in particular? > > -Brent > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > -- Jared Wigmore <jared.wigm...@gmail.com> ------------------------------ Message: 10 Date: Tue, 8 Nov 2011 02:18:34 +0100 From: Daniel Fischer <daniel.is.fisc...@googlemail.com> Subject: Re: [Haskell-beginners] Couple of problems with leksah To: beginners@haskell.org, peter.h...@memorphic.com Message-ID: <201111080218.34270.daniel.is.fisc...@googlemail.com> Content-Type: Text/Plain; charset="iso-8859-1" On Tuesday 08 November 2011, 01:59:47, Peter Hall wrote: > I didn't get any response on the Leksah forum, so I hope it's ok to ask > here. Sure. Anything Haskell-related is okay to ask here. > > First problem, I keep seeing this in the error log: > > Setup: You need to re-run the 'configure' command. The version of > > Cabal being used has changed (was Cabal-1.10.2.0, now > > Cabal-1.10.1.0). Additionally the compiler is different (was > > ghc-6.12, now ghc-7.0) which is probably the cause of the problem. > > When I run configure, it just prints: > > Resolving dependencies... > > Configuring pokercalc-0.0.1... > > But it doesn't fix anything. Sorry, no idea for that one. > > The other problem is when I try to update cabal: > > cabal install leksah > > Resolving dependencies... > cabal: cannot configure haddock-2.9.4. It requires ghc >=7.2 && <7.4 > There is no available version of ghc that satisfies >=7.2 && <7.4 haddock-2.9.4 is exclusively for ghc-7.2, with ghc-7.0, you need haddock-2.9.2, try $ cabal install leksah --constraint="haddock < 2.9.4" > > I'm using Haskell Platform 2011.2.0.1 for Mac OS X 10.6 > Any ideas? > > Peter ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 41, Issue 9 ****************************************