1 <!doctype linuxdoc system [
2 <!ENTITY addr SYSTEM "Addr.sgml">
3 <!ENTITY bits SYSTEM "Bits.sgml">
4 <!ENTITY concurrent SYSTEM "Concurrent.sgml">
5 <!ENTITY dynamic SYSTEM "Dynamic.sgml">
6 <!ENTITY exception SYSTEM "Exception.sgml">
7 <!ENTITY glaexts SYSTEM "GlaExts.sgml">
8 <!ENTITY ioexts SYSTEM "IOExts.sgml">
9 <!ENTITY int SYSTEM "Int.sgml">
10 <!ENTITY ndset SYSTEM "NDSet.sgml">
11 <!ENTITY numexts SYSTEM "NumExts.sgml">
12 <!ENTITY pretty SYSTEM "Pretty.sgml">
13 <!ENTITY st SYSTEM "ST.sgml">
14 <!ENTITY weak SYSTEM "Weak.sgml">
15 <!ENTITY word SYSTEM "Word.sgml">
19 o Add indexing support (to linuxdoc)
20 o Fix citations in html
25 <title>The Hugs-GHC Extension Libraries
26 <author>Alastair Reid <tt/reid-alastair@cs.yale.edu/
27 Simon Marlow <tt/simonm@dcs.gla.ac.uk/
28 <date>v0.8, 28 January 1998
30 Hugs and GHC provide a common set of libraries to aid portability.
31 This document specifies the interfaces to these libraries and documents
32 known differences. We hope that these modules will be adopted for inclusion
33 as Standard Haskell Libraries sometime soon.
38 <sect> <idx/Naming conventions/
39 <label id="sec:Naming conventions">
42 The set of interfaces specified in this document try to adhere to the
43 following naming conventions:
47 Actions that create a new values have the prefix <tt/new/ followed by
48 the name of the type of object they're creating, e.g., <tt/newIORef/,
51 Operations that read a value from a mutable object are prefixed with
52 <tt/read/, and operations that update the contents have the prefix
53 <tt/write/, e.g., <tt/readChan/, <tt/readIOArray/.
58 This differs from the convention used to name the operations for
59 reading and writing to a file <tt/Handle/, where <tt/get/ and <tt/put/
62 Operations provided by various concurrency abstractions, e.g., <tt/MVar/,
63 <tt/CVar/ , also deviate from this naming scheme. This is perhaps
64 defensible, since the read and write operations have additional
65 behaviour, e.g., <tt/takeMVar/ tries to read the current value
66 of an <tt/MVar/, locking it if it succeeds.
69 Conversions operators have the form <tt/AToB/ where <tt/A/ and <tt/B/
70 are the types we're converting between.
72 Operations that lazily read values from a mutable object/handle, have
73 the form <tt/getXContents/, e.g., <tt/Channel.getChanContents/ and
74 <tt/IO.hGetContents/. (OK, so the latter isn't called
75 <tt/getHandleContents/, but you hopefully get the picture.)
78 <!-- ========================= -->
87 <label id="sec:Foreign">
89 This module is provided by GHC but not by Hugs.
90 GreenCard for Hugs provides the <tt/ForeignObj/ type.
97 <label id="sec:LazyST">
100 This library is identical to <tt/ST/ except that the <tt/ST/ monad
101 instance is <em/lazy/. The lazy ST monad tends to be more prone to
102 space leaks than the strict version, so most programmers will use the
103 former unless laziness is explicitly required. <tt/LazyST/ provides
104 two additional operations:
107 lazyToStrictST :: LazyST.ST s a -> ST.ST s a
108 strictToLazyST :: ST.ST s a -> LazyST.ST s a
111 These are used to convert between lazy and strict state threads. The
112 semantics with respect to laziness are as you would expect: the strict
113 state thread passed to <tt/strictToLazyST/ is not performed until the
114 result of the lazy state thread it returns is demanded.
122 <!-- ========================= -->
124 <biblio files="refs" style="abbrv">