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: database question (Brent Yorgey) 2. Re: The cost of generality, or how expensive is realToFrac? (Daniel Fischer) ---------------------------------------------------------------------- Message: 1 Date: Sun, 19 Sep 2010 22:34:28 -0400 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] database question To: beginners@haskell.org Message-ID: <20100920023428.ga9...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Sun, Sep 19, 2010 at 07:53:54PM -0400, Brandon S Allbery KF8NH wrote: > Since IO must always be at the base(*) of any stack of monad transformers it > is used in, the MonadIO class provides a convenience function liftIO that > lifts its argument directly to the IO monad without having to step through > any intermediates. > > _______ > * we call it "lifting" but we also claim IO is at the base of the stack, and > I at least usually expect a base to be at the bottom. Nice and > confusing :) I think of liftIO as lifting its argument *from* the IO monad (at the bottom of the stack) into a monad higher up the stack. liftIO :: (MonadIO m) => IO a -> m a So I don't find it confusing/backwards at all. -Brent ------------------------------ Message: 2 Date: Mon, 20 Sep 2010 16:53:25 +0200 From: Daniel Fischer <daniel.is.fisc...@web.de> Subject: Re: [Haskell-beginners] The cost of generality, or how expensive is realToFrac? To: Greg <gregli...@me.com>, beginners@haskell.org Message-ID: <201009201653.26350.daniel.is.fisc...@web.de> Content-Type: text/plain; charset="utf-8" On Monday 20 September 2010 05:09:16 you wrote: > I'm building with the latest Haskell Platform. Â GHC 6.12.3 and OpenGL > 2.2.1.1 :sigh: So we can forget about rewrite rules, newtypes, unsafeCoerce and all that Jazz. In OpenGL-2.2.1.1, GLclampf (and GLfloat &c.) were not newtypes, they were type synonyms, type GLclampf = Float and so on. So it's clear that GHC rewrites realToFrac to double2Float# in the benchmark, since it's converting to Float (that also explains the absence of casts in your core). Then, if floatToFloat is faster than realToFrac in your programme (compiled with optimisations), that probably means GHC doesn't spot an opportunity to replace realToFrac with double2Float# because the types are still polymorphic. Perhaps some type annotations would help. ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 27, Issue 46 *****************************************