[Haskell-cafe] Haskell Debugging

Valentin Gjorgjioski valentin.gjorgjioski at ijs.si
Tue Nov 14 20:15:55 EST 2006


On 14.11.2006 23:17 Cale Gibbard wrote:
> On 13/11/06, Valentin Gjorgjioski <valentin.gjorgjioski at ijs.si> 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
>>    { \ ($-990871 : $-990888 : $-990905 : $-990922 : $-990939 : [])  ->
>> $-990939 : $-990922 : $-990905 : $-990888 : $-990871 : []
>>    }
>>
>
> First of all, I don't get this behaviour in Hugs 20050308 on Ubuntu.
>
> Main> ex8
> [4.0,0.0,3.0,7.0,10.0]
>
>>>>>>>> Observations <<<<<<
>
> after reverse
>  { \ (10.0 : 7.0 : 3.0 : 0.0 : 4.0 : [])  -> 4.0 : 0.0 : 3.0 : 7.0 : 
> 10.0 : []
>  }
Just one more thing

If I write

ex9 :: [Float]
ex9 = (observe "after reverse" )  reverse  [10.0,7.0,3.0,0.0,4.0]

it doesn't work. If I delete ex9 :: [Float] then it works fine. any 
suggestions?


More information about the Haskell-Cafe mailing list