Hi,
My teacher asked us to do some exercises using haskell, one of these exercises asks us to implement a simple calculator, like this:
The first input is an Integer N, which tells how many operands will be used, the following N inputs are the operands and the operators themselves, like this:
3
2 *
2 *
2
Output: 8
I'm starting right now with functional programming, I've studied a little about haskell and learned about lists, high order functions, etc. I don't have experience yet with I/O on haskell, I was thinking about reading the input and putting it on a Char list, like [ '2', '', '2', '', '2' ], after that I could worry about the computation. Any suggestions on how can I write some function to read the next N lines and putting the results on a list?