Do I have to compile every packages again if I upgrade ghc ?
It is a pleasure to make use of the utilities (greencard, HOpenGL, etc).
But what
When I try to use CVS repository and stand-alone binary distribution
together (because I wanted to see hdirect is like and v 0.16 does not work
with ghc-5
On Wed, 13 Nov 2002, William Lee Irwin III wrote:
>> main = mapM_ (\h -> mapM_ putChar =<< hGetContents h) =<< mapM (flip openFile $
>ReadMode) =<< getArgs
On Wed, Nov 13, 2002 at 07:46:41AM -0800, Hal Daume III wrote:
> main = interact id
There is a semantic difference here, as the version I
> > I'm passing that 'record' around as an implicit value. The record as
> > STRefs that I use to collect info, but it also has some pure fields with
> > 'read-only' info. Something like,
> > data E s = E{
> > refi :: STRef s Int,
> > refc :: STRef s Char,
> > m:: Int
>
> G'day all.
>
> > If I use an STRef to a record, will a new record be created each time I
> > want to update a single field?
> Basically, yes.
Ok.
> > Right now I'm using a record of STRefs, like:
> > data E s = E{
> > refi :: STRef s Int,
> > refc :: STRef s Char
> > }
> >
>
> > If I use an STRef to a record, will a new record be created
> > each time I want
> > to update a single field? Or can I expect GHC to optimize it
> > and have the field of the record updated in place?
>
> You'll get a new record for each update. This might not be so bad
> though, depending on
I'm not sure why someone hasn't suggested
main = interact id
which I think would accomplis everything you want, and probably be a heck
of a lot faster, as (apparently) putChar and getChar are quire
inefficient.
--
Hal Daume III
"Computer science is no more about computers| [EMAIL PROTECT
module GT where
import Monad
import Monoid
import MonadState
import MonadWriter
import MonadRWS
-- Just a quick exercise in using monads.
-- Thought it'd be nice to share with the class.
data GOp
= PushVal Integer
| Push Integer
| Pop Integer
| Slide Integer
On Wed, Nov 13, 2002 at 03:29:53PM +0900, Ahn Ki-yung wrote:
> If you are steaming with compicated codes, then how about taking a break.
> Let's play with a simple cat.
> \begin{code}
> main = mapM (>>=putChar) getCharS where getCharS = getChar:getCharS
> \end{code}
Why not this?
main = mapM_ (\h
--- Simon Peyton-Jones <[EMAIL PROTECTED]> wrote:
> | So here is what I envision: I write the main
> | application in Python. I write a (hopefully) small
> | Haskell module that:
> | a) Calls back to the main Python app for reading
> the
> | text to be parsed, preferably using laziness.
> | b) Par
> main = mapM (>>=putChar) getCharS where getCharS = getChar:getCharS
>
> How would you suggest to neatly insert the error handling code into ?
\begin{code}
-- some suggestions for a little zoo of cats
module Main where
import IO
import Monad
main0 = interact id
main1 = getContents >>= putStr
m
> If I use an STRef to a record, will a new record be created
> each time I want
> to update a single field? Or can I expect GHC to optimize it
> and have the field of the record updated in place?
You'll get a new record for each update. This might not be so bad
though, depending on the numbe
Simon Peyton-Jones writes:
> If Python uses C's calling convention, it might be easy; just use
> 'foreign import' and 'foreign export' (see the FFI spec at
> haskell.org).
I remember reading that the main program, that wants to call Haskell
code, would have to be compiled with a special Haskel
| So here is what I envision: I write the main
| application in Python. I write a (hopefully) small
| Haskell module that:
| a) Calls back to the main Python app for reading the
| text to be parsed, preferably using laziness.
| b) Parses the text, and maybe processes a bit.
| c) Returns the parsed
13 matches
Mail list logo