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 getopt SYSTEM "GetOpt.sgml">
10 <!ENTITY ioexts SYSTEM "IOExts.sgml">
11 <!ENTITY int SYSTEM "Int.sgml">
12 <!ENTITY ndset SYSTEM "NDSet.sgml">
13 <!ENTITY numexts SYSTEM "NumExts.sgml">
14 <!ENTITY pretty SYSTEM "Pretty.sgml">
15 <!ENTITY st SYSTEM "ST.sgml">
16 <!ENTITY weak SYSTEM "Weak.sgml">
17 <!ENTITY word SYSTEM "Word.sgml">
21 o Add indexing support (to linuxdoc)
22 o Fix citations in html
27 <title>The Hugs-GHC Extension Libraries
28 <author>The Hugs/GHC Team
31 Hugs and GHC provide a common set of libraries to aid portability.
32 This document specifies the interfaces to these libraries and documents
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 <!-- ========================= -->
96 <label id="sec:LazyST">
99 This library is identical to <tt/ST/ except that the <tt/ST/ monad
100 instance is <em/lazy/. The lazy ST monad tends to be more prone to
101 space leaks than the strict version, so most programmers will use the
102 former unless laziness is explicitly required. <tt/LazyST/ provides
103 two additional operations:
106 lazyToStrictST :: LazyST.ST s a -> ST.ST s a
107 strictToLazyST :: ST.ST s a -> LazyST.ST s a
110 These are used to convert between lazy and strict state threads. The
111 semantics with respect to laziness are as you would expect: the strict
112 state thread passed to <tt/strictToLazyST/ is not performed until the
113 result of the lazy state thread it returns is demanded.
118 <!-- ========================= -->
120 <biblio files="refs" style="abbrv">