[Haskell-cafe] separate input calculation output

Robert Vollmert rvollmert-lists at gmx.net
Tue Mar 25 08:39:00 EDT 2008


On Mar 25, 2008, at 13:03, Thomas Engel wrote:
>
>> type Input = (Float, Float, ...)
>> type Output = (Float, Float, ...)
>>
>> inputvalues :: IO Input     -- add a "return (ve,de,...)" to the end
>> compute :: Input -> Output
>
> How can I combine several function (calculations) in this function?

compute (ve,de,dewalze,dewand,...) = ( nvr ve de,
                                        pzugmin ve femin,
                                        pzugmax ve femax be,
                                        ... )

> Can you give me an example how do to it with named fields?

See e.g. http://www.haskell.org/tutorial/moretypes.html#sect6.2 .  
However, I'm not so sure anymore they'd be of much help here.

Cheers
Robert



More information about the Haskell-Cafe mailing list