Re: [Haskell-cafe] Binary code

2006-11-27 Thread Valentin Gjorgjioski
On 28.11.2006 01:20 J. Garrett Morris wrote: Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Second: div, mod, reverse, and the unfoldr function from Data.List will do what you want. /g On 11/25/06, escafia

[Haskell-cafe] Collection of objects?

2006-11-17 Thread Valentin Gjorgjioski
Is some kind of collection of object with different types in Haskell exist? Except the tuples, which have fixed length. I find this * Tuples heterogeneous, lists homogeneous. * Tuples have a fixed length, or at least their length is encoded in their type. That is, two tuples with

Re: [Haskell-cafe] working with lists of couples

2006-11-17 Thread Valentin Gjorgjioski
On 17.11.2006 19:29 Clara Zamolo wrote: Hello, i'd like to write a function that given a list like [1,2,3,4...] returns a list of couple where the first element is the corresponding element of the string, and the second is the sum of the previous elements. An example: input: [1,2,3,4] output:

Re: [Haskell-cafe] working with lists of couples

2006-11-17 Thread Valentin Gjorgjioski
On 17.11.2006 19:51 Valentin Gjorgjioski wrote: So, this algorithm should work fine for you buildCouples :: [Int]-Int-[(Int,Int)] buildCouples (x:[]) s = [(x,s)] buildCouples (x:xs) s = [(x,s)] ++ (buildCouples xs (x+s)). Please ignore the . at the end, it is a typo :( Sorry again

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Valentin Gjorgjioski
On 17.11.2006 19:08 Donn Cave wrote: On Fri, 17 Nov 2006, Valentin Gjorgjioski wrote: ... But I need something which is heterogeneous and non-fixed length. I'm used do Java, and this switch to functional languages is very strange to me. So, to be clear, I need something like

Re: [Haskell-cafe] Haskell Debugging

2006-11-15 Thread Valentin Gjorgjioski
On 15.11.2006 17:38 Ross Paterson wrote: On Mon, Nov 13, 2006 at 04:32:34PM +0100, Valentin Gjorgjioski wrote: import Hugs.Observe ex8 :: [Float] ex8 = (observe after reverse ) reverse [10.0,7.0,3.0,0.0,4.0] gives me ex8 [4.0,0.0,3.0,7.0,10.0] Observations

Re: [Haskell-cafe] Haskell Debugging

2006-11-14 Thread Valentin Gjorgjioski
On 14.11.2006 23:17 Cale Gibbard wrote: On 13/11/06, Valentin Gjorgjioski [EMAIL PROTECTED] wrote: Following example import Hugs.Observe ex8 :: [Float] ex8 = (observe after reverse ) reverse [10.0,7.0,3.0,0.0,4.0] gives me ex8 [4.0,0.0,3.0,7.0,10.0] Observations after reverse

Re: [Haskell-cafe] Haskell Debugging

2006-11-13 Thread Valentin Gjorgjioski
On 13.11.2006 16:48 Pepe Iborra wrote: Hi Valentin Please, take a look at the Haskell Wiki page for debugging. http://haskell.org/haskellwiki/Debugging You will find that thanks to Neil Mitchell there is a Windows version of Hat available. Perhaps you can add your experiences with it if it