Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to use parameters in "IO(int, int)"
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
一千瓦的刀狼  
View profile  
 More options May 26 2008, 9:14 am
Newsgroups: comp.lang.haskell
From: 一千瓦的刀狼 <knifew...@gmail.com>
Date: Mon, 26 May 2008 06:14:47 -0700 (PDT)
Local: Mon, May 26 2008 9:14 am
Subject: Re: How to use parameters in "IO(int, int)"
On 5月25日, 下午6时04分, Dirk Thierbach <dthierb...@usenet.arcornews.de>
wrote:

> ?????? <knifew...@gmail.com> wrote:
> >  I have got such a function like "Object => o -> IO(int, int)" from
> > existing API, and actually I needed is the parameters of "IO(int,
> > int)". How can I get these 2 parameters? just use a sentence like "x
> > <- fst(IO(int, int))"? Is it works?

> No, that doesn't work: Read up on Monads. Tutorials have just been
> mentioned in a different thread.

> > Or somebody will have a good idea to help me?

> Try something like

> > foo o = do
> >   (x1,x2) <- yourFunction o
> >   -- now do something with x1 and x2, eg add them:
> >   return (x1+x2)

> But if you don't understand how to use the IO-Monad, you'll probably
> quickly get stuck again.

> - Dirk

Thank you very much! I will read the tutorial first

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.