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 foreign SYSTEM "Foreign.sgml">
8 <!ENTITY glaexts SYSTEM "GlaExts.sgml">
9 <!ENTITY ioexts SYSTEM "IOExts.sgml">
10 <!ENTITY int SYSTEM "Int.sgml">
11 <!ENTITY ndset SYSTEM "NDSet.sgml">
12 <!ENTITY numexts SYSTEM "NumExts.sgml">
13 <!ENTITY pretty SYSTEM "Pretty.sgml">
14 <!ENTITY st SYSTEM "ST.sgml">
15 <!ENTITY weak SYSTEM "Weak.sgml">
16 <!ENTITY word SYSTEM "Word.sgml">
20 o Add indexing support (to linuxdoc)
21 o Fix citations in html
26 <title>The Hugs-GHC Extension Libraries
27 <author>The Hugs/GHC Team
30 Hugs and GHC provide a common set of libraries to aid portability.
31 This document specifies the interfaces to these libraries and documents
37 <sect> <idx/Naming conventions/
38 <label id="sec:Naming conventions">
41 The set of interfaces specified in this document try to adhere to the
42 following naming conventions:
46 Actions that create a new values have the prefix <tt/new/ followed by
47 the name of the type of object they're creating, e.g., <tt/newIORef/,
50 Operations that read a value from a mutable object are prefixed with
51 <tt/read/, and operations that update the contents have the prefix
52 <tt/write/, e.g., <tt/readChan/, <tt/readIOArray/.
57 This differs from the convention used to name the operations for
58 reading and writing to a file <tt/Handle/, where <tt/get/ and <tt/put/
61 Operations provided by various concurrency abstractions, e.g., <tt/MVar/,
62 <tt/CVar/ , also deviate from this naming scheme. This is perhaps
63 defensible, since the read and write operations have additional
64 behaviour, e.g., <tt/takeMVar/ tries to read the current value
65 of an <tt/MVar/, locking it if it succeeds.
68 Conversions operators have the form <tt/AToB/ where <tt/A/ and <tt/B/
69 are the types we're converting between.
71 Operations that lazily read values from a mutable object/handle, have
72 the form <tt/getXContents/, e.g., <tt/Channel.getChanContents/ and
73 <tt/IO.hGetContents/. (OK, so the latter isn't called
74 <tt/getHandleContents/, but you hopefully get the picture.)
77 <!-- ========================= -->
94 <label id="sec:LazyST">
97 This library is identical to <tt/ST/ except that the <tt/ST/ monad
98 instance is <em/lazy/. The lazy ST monad tends to be more prone to
99 space leaks than the strict version, so most programmers will use the
100 former unless laziness is explicitly required. <tt/LazyST/ provides
101 two additional operations:
104 lazyToStrictST :: LazyST.ST s a -> ST.ST s a
105 strictToLazyST :: ST.ST s a -> LazyST.ST s a
108 These are used to convert between lazy and strict state threads. The
109 semantics with respect to laziness are as you would expect: the strict
110 state thread passed to <tt/strictToLazyST/ is not performed until the
111 result of the lazy state thread it returns is demanded.
116 <!-- ========================= -->
118 <biblio files="refs" style="abbrv">