Global variables in Haskell
Kaydedildi:
| Yayımlandı: | Journal of Functional Programming vol. 14, no. 5 (Sep 2004), p. 489-502 |
|---|---|
| Yazar: | |
| Baskı/Yayın Bilgisi: |
Cambridge University Press
|
| Konular: | |
| Online Erişim: | Citation/Abstract Full Text - PDF |
| Etiketler: |
Etiket eklenmemiş, İlk siz ekleyin!
|
| Özet: | Haskell today provides good support not only for a functional programming style, but also for an imperative one. Elements of imperative programming are needed in applications such as web servers, or to provide efficient implementations of well-known algorithms, such as many graph algorithms. However, one element of imperative programming, the global variable, is surprisingly hard to emulate in Haskell. We discuss several existing methods, none of which is really satisfactory, and finally propose a new approach based on implicit parameters. This approach is simple, safe, and efficient, although it does reveal weaknesses in Haskell's present type system. [PUBLICATION ABSTRACT] |
|---|---|
| ISSN: | 0956-7968 1469-7653 |
| Kaynak: | Advanced Technologies & Aerospace Database |