Re: Q: Efficiency of Array Implementation

1999-02-19 Thread Jan Laitenberger


Dear Mr. Mechveliani,
 

 I thought efficient arrays are impossible in functional language.

I'm not sharing this thought...   

Here is a quote from the Haskell Library Report:

\begin{quote}
  ``Haskell provides indexable arrays, which may be thought of as functions
whose domains are isomorphic to contiguous subsets of the integers.
Functions restricted in this way can be implemented efficiently;
in particular, a programmer may reasonably expect rapid access to the
components.''
\end{quote}
   
 So we have to organise the data so that to avoid the access by index
  - as possible. 

Sure. If possible - ok.


Regards,

Jan

 ___
'---|--
|  __,   _  _  EMail: [EMAIL PROTECTED]
| /  |  / |/ | WWWeb: http://www.uni-passau.de/~laitenbe/
|/\_/|_/  |  |_/
   /| Laitenberger 
--(-|--
   \|



Q: Efficiency of Array Implementation

1999-02-18 Thread Jan Laitenberger


Hi,


I recently noticed in a test program, that updating a table of
fixed size (index and entries of type Int) was slower using an
Array instead of our AVL implementation.

Does anybody know which compiler option I must give on the
command line that the Array is translated to a C array?

I was using ghc-4.01 without special options.


Many thanks in advance,   

Jan

 ___
'---|--
|  __,   _  _  EMail: [EMAIL PROTECTED]
| /  |  / |/ | WWWeb: http://www.uni-passau.de/~laitenbe/
|/\_/|_/  |  |_/
   /| Laitenberger 
--(-|--
   \|




getChar without pressing return?

1999-01-30 Thread Jan Laitenberger


Hi,


Does anyone know how I can get a character without the
need of pressing the return key afterwards?

main = do c - getChar 
  putStr (c:"")

Hugs returns the control back to the program as soon as
a character was read - but ghc waits for a whole line
to be finished...


Thanks,  

Jan

 ___
'---|--
|  __,   _  _  EMail: [EMAIL PROTECTED]
| /  |  / |/ | WWWeb: http://www.uni-passau.de/~laitenbe/
|/\_/|_/  |  |_/
   /| Laitenberger 
--(-|--
   \|