%!PS-Adobe-2.0 %%Creator: dvips 5.514 Copyright 1986, 1993 Radical Eye Software %%Title: io-popl.dvi %%CreationDate: Thu Jun 10 21:58:03 1993 %%Pages: 15 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSCommandLine: /usr/local/tex/bin/sun4/dvips io-popl.dvi %DVIPSSource: TeX output 1993.06.10:2155 %%BeginProcSet: tex.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /@rigin{isls{[ 0 -1 1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{Resolution hsize -72 div mul 0 TR}if Resolution VResolution vsize -72 div 1 add mul TR matrix currentmatrix dup dup 4 get round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 -.1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 -.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail} B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{ 3 M}B /k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{ 3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (/tmp_mnt/users/fp/simonpj/docs/papers/io-popl/io-popl.dvi) @start /Fa 47 122 df<183C7C340404080810106080060C799C0C>39 D<0008001000200040008001800300030006000E000C001C001800180038003000300070 007000600060006000E000E000E000E000E000C000C000C000E000E00060006000600060 0030003000100008000C0004000D2A7B9E10>I<0100008000C000400060002000300030 003000180018001800180018001800180018001800180038003800380030003000700070 0060006000E000C000C0018001800300030006000400080018003000600080000D2A809E 10>I<387878380808101020204080050C7D830C>44 D<7FF0FFE00C027F890E>I<001800 3003F00C7000700070007000E000E000E000E000E000E001C001C001C001C001C001C003 800380038003800380038007000780FFF80D1C7C9B15>49 D<0301C003FF8007FE0007F8 0004000004000004000004000008000008000008F8000B0C000C0E000807001007000007 00000780000780000780700F00F00F00F00F00F00E00801E00801C0040380040300030E0 000F8000121D7D9B15>53 D<007C000183000201800601800C00C00C00C00C00C01C0180 1C01801F03000F86000FCC0007F00003F80003FC000C7E00183F00301F00600700600700 C00300C00300C00300C00200C006006004006008003830000FC000121D7D9B15>56 D<0000200000003000000070000000F0000000F0000001F0000001F80000027800000278 0000047800000478000008780000083C0000103C0000103C0000203C0000203C0000403E 0000401E0000FFFE0000801E0001001E0001001F0002000F0002000F0004000F000C000F 001E000F80FF807FF01C1D7F9C1F>65 D<07FFFE0000F8078000F001C000F001E000F000 E000F000F000F000F001E000E001E001E001E001C001E003C001E0078001E01E0003FFFC 0003C00F0003C0078003C003C003C003C003C003C0078003C0078003C0078003C0078003 C00780078007800F000F001E000F003C00FFFFE0001C1C7F9B1D>I<0007F010001C0C30 0070026000C001E0038000E0070000E00E0000600E0000601C0000403C00004038000040 780000007800000078000000F0000000F0000000F0000000F0000000F0000000F0000080 F0000100700001007000010038000200380004001C0004000C001800060020000380C000 007F00001C1E7C9C1E>I<0FFFFC0000F8078000F001C000F000E000F0007000F0007000 F0007801E0003801E0003801E0003801E0003801E0003C01E0003803C0003803C0007803 C0007803C0007803C0007003C000F0078000E0078000E0078001C0078003800780078007 800E000F001C000F007000FFFFC0001E1C7E9B20>I<07FFFFE000F801E000F000E000F0 004000F0004000F0004000F0004001E0004001E0204001E0200001E0200001E0600001E0 E00003FFC00003C0C00003C0400003C0400003C0400003C0408007800080078000800780 01000780010007800300078006000F000E000F003E00FFFFFC001B1C7E9B1C>I<07FFFF C000F803C000F001C000F0008000F0008000F0008000F0008001E0008001E0208001E020 0001E0200001E0600001E0E00003FFC00003C0C00003C0400003C0400003C0400003C040 000780000007800000078000000780000007800000078000000F0000000F800000FFF800 001A1C7E9B1B>I<0007F010001C0C300070026000C001E0038000E0070000E00E000060 0E0000601C0000403C00004038000040780000007800000078000000F0000000F0000000 F0000000F000FFF0F0000F80F0000780F0000F0070000F0070000F0038000F0038000F00 1C001F000C001E000600660003818200007E00001C1E7C9C21>I<07FF00F800F000F000 F000F000F001E001E001E001E001E001E003C003C003C003C003C003C007800780078007 80078007800F000F80FFF0101C7F9B0F>73 D<007FF80007C00007800007800007800007 80000780000F00000F00000F00000F00000F00000F00001E00001E00001E00001E00001E 00001E00003C00003C00703C00F83C00F83C00F07800E0700080E00061C0001F0000151D 7E9B15>I<07FFC000F80000F00000F00000F00000F00000F00001E00001E00001E00001 E00001E00001E00003C00003C00003C00003C00003C00003C00407800407800407800407 80080780080780180F00380F00F0FFFFF0161C7E9B1A>76 D<07F80007FC00F8000FC000 BC000F8000BC00178000BC00178000BC00278000BC002780011E004F00011E004F00011E 008F00011E008F00011E010F00010F010F00020F021E00020F021E00020F041E00020F04 1E000207881E000207901E000407903C000407A03C000407A03C000407C03C000403C03C 000403803C000C038078001E03007C00FF8307FF80261C7E9B26>I<07F800FF8000F800 3C0000BC00180000BC001000009E001000009F001000008F001000010F80200001078020 000107C020000103C020000103E020000101E020000200F040000200F040000200784000 020078400002003C400002003C400004001E800004001F800004000F800004000F800004 0007800004000780000C000300001E00010000FF80010000211C7F9B1F>I<0007F00000 381C0000E00E0001C0030003800380070001C00E0001C01E0001E01C0000E03C0000E038 0000E0780000F0780000F0780000F0F00001E0F00001E0F00001E0F00001E0F00003C0F0 0003C0F00003C0700007807000070078000F0038001E003C001C001C0038000E00E00003 83800000FE00001C1E7C9C20>I<07FFFC0000F80F0000F0038000F003C000F001C000F0 01C000F001C001E003C001E003C001E003C001E0038001E0070001E00E0003C03C0003FF E00003C0000003C0000003C0000003C00000078000000780000007800000078000000780 0000078000000F0000000F800000FFF000001A1C7E9B1C>I<003F0400C0CC0180380300 380600180E00180E00180E00181E00101E00001F00000F80000FF80007FF0003FF8001FF C0003FE00003E00001E00000E00000E04000E04000E04000E04000C06001C0E00180F003 00CC0E0083F800161E7E9C17>83 D<1FFFFFF03C07C0F030078030200780206007802040 07802040078020400F0020800F0020000F0000000F0000000F0000000F0000001E000000 1E0000001E0000001E0000001E0000001E0000003C0000003C0000003C0000003C000000 3C0000003C000000780000007C00001FFFE0001C1C7C9B1E>I87 D<07F0001C18001E0C001C0E00180E00000E00000E0001FE000F0E001C1C00301C00701C 00E01C40E01C40E03C40E05C80709D803F0E0012127D9115>97 D<00FE000307000E0780 1C0700380600380000700000700000700000E00000E00000E00000600000700200700400 3008001C300007C00011127E9112>99 D<0001F800007800007000007000007000007000 00700000700000E00000E00000E000F8E00386E00601E00C01C01801C03801C07001C070 01C07001C0E00380E00380E00380600380700380300780300F001C378007C7E0151D7E9C 17>I<01F8070C0C0618073803300370037FFF7000E000E000E00060006002700430081C 3007C010127E9112>I<000F800039C00061C000E3C001C18001C00001C00001C0000380 000380000380003FF8000380000380000700000700000700000700000700000700000E00 000E00000E00000E00000E00000E00001C00001E0000FFC000121D7F9C0D>I<00003800 7CCC01871C0303080703800E03800E03800E03800E03800E0700060600070C0009F00008 00001800001800001FFE000FFF800FFFC03001C06000C06000E0C000C0C000C060018020 0300180E0007F000161C809215>I<07E00001E00001C00001C00001C00001C00001C000 01C000038000038000038000038F8003B0C003C0E00780E00780E00700E00700E00700E0 0700E00E01C00E01C00E01C00E01C00E01C00E01C01C03801E03C0FF9FF0141D7F9C17> I<00C001C001C0018000000000000000000000000000001F800780038007000700070007 00070007000E000E000E000E000E000E001C001E00FF800A1D7F9C0C>I<07E00001E000 01C00001C00001C00001C00001C00001C0000380000380000380000381FC0380E00380C0 07010007020007080007100007300007F8000F38000E3C000E1C000E1E000E0E000E0F00 1C07001C0F80FF9FE0161D7F9C16>107 D<07E001E001C001C001C001C001C001C00380 038003800380038003800700070007000700070007000E000E000E000E000E000E001C00 1E00FF800B1D7F9C0C>I<1F8FC0FC00079061060003E076070007807807000780780700 07007007000700700700070070070007007007000E00E00E000E00E00E000E00E00E000E 00E00E000E00E00E000E00E00E001C01C01C001E01E01E00FF8FF8FF8021127F9124>I< 1F8F8007B0C003C0E00780E00780E00700E00700E00700E00700E00E01C00E01C00E01C0 0E01C00E01C00E01C01C03801E03C0FF9FF014127F9117>I<00FC000307000E01801C01 C03800C03000C07000E07000E07000E0E001C0E001C0E001C0600180600380700700380E 001C180007E00013127E9115>I<0FC7C003D87001E03803C01803801C03800C03800E03 800E03800E07001C07001C07001C0700380700300700600F00C00EC3800E3E000E00000E 00000E00001C00001C00001C00001C0000FF8000171A809117>I<00F8200384600602E0 0C01C01801C03801C07001C07001C07001C0E00380E00380E00380600380700380300780 380F001C370007C700000700000700000700000E00000E00000E00000E00007FC0131A7E 9116>I<1F9C07EE03CF078E078C07000700070007000E000E000E000E000E000E001C00 1E00FFC010127F9110>I<03F20C0E18061004300438043E001FE00FF007F8003C401C40 0C400C6018E010D0608FC00F127F9110>I<020002000200060006000C001C003C00FFE0 1C001C00380038003800380038003800700070407040704070407080708031001E000B1A 7C9910>IIII<0FF07E03C03803C03001 C02001C02001C04001C08000E08000E10000E10000E20000F200007400007C0000780000 7000003000002000002000004000004000708000F10000F30000E60000780000171A8091 16>121 D E /Fb 1 59 df<60F0F06004047C830C>58 D E /Fc 2 111 df<0020004000C003C00CC0018001800180018003000300030003000600060006 0006000C00FFC00B137C9212>49 D<30F05B184C189C1898181818181830303032303230 64606460380F0D7D8C13>110 D E /Fd 42 122 df<003FE3F801F03F1C03C03E3E07C0 7C3E0F807C3E0F807C1C0F807C000F807C000F807C000F807C000F807C00FFFFFFC0FFFF FFC00F807C000F807C000F807C000F807C000F807C000F807C000F807C000F807C000F80 7C000F807C000F807C000F807C000F807C000F807C007FE1FF807FE1FF801F1D809C1C> 11 D45 D<78FCFCFCFC7806067D850D>I<0001800003 80000380000700000700000700000E00000E00001C00001C00001C000038000038000038 0000700000700000E00000E00000E00001C00001C00001C0000380000380000380000700 000700000E00000E00000E00001C00001C00001C00003800003800007000007000007000 00E00000E00000C0000011297D9E18>I<00600001E0000FE000FFE000F3E00003E00003 E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003 E00003E00003E00003E00003E00003E00003E0007FFF807FFF80111B7D9A18>49 D<07F8001FFE00383F80780FC0FC07C0FC07E0FC03E0FC03E07803E00007E00007C00007 C0000F80001F00001E0000380000700000E0000180600300600600600800E01FFFC03FFF C07FFFC0FFFFC0FFFFC0131B7E9A18>I<07F8001FFE003C1F003C0F807C07C07E07C07C 07C03807C0000F80000F80001E00003C0003F800001E00000F800007C00007C00007E030 07E07807E0FC07E0FC07E0FC07C0780F80781F001FFE0007F800131B7E9A18>I<000180 000380000780000F80001F80003F80006F8000CF80008F80018F80030F80060F800C0F80 180F80300F80600F80C00F80FFFFF8FFFFF8000F80000F80000F80000F80000F80000F80 00FFF800FFF8151B7F9A18>I<3801803FFF003FFE003FFC003FF8003FC0003000003000 0030000030000031F800361E00380F803007800007C00007E00007E00007E07807E0F807 E0F807E0F807C0F007C0600F80381F001FFE0007F000131B7E9A18>I<007E0003FF0007 81800F03C01E07C03C07C07C0380780000780000F80000F8F800FB0E00FA0780FC0380FC 03C0F803E0F803E0F803E0F803E07803E07803E07803C03C03C03C07801E0F0007FE0003 F800131B7E9A18>I<6000007FFFE07FFFE07FFFC07FFF807FFF80E00300C00600C00C00 C0180000300000300000600000E00000E00001E00001C00003C00003C00003C00003C000 07C00007C00007C00007C00007C00007C000038000131C7D9B18>I<0FF0303C601EF01F F81FF81F701F003E003C007000E001C00180018003000300030003000300000000000000 000007800FC00FC00FC00FC00780101D7D9C17>63 D<00038000000380000007C0000007 C0000007C000000FE000000FE000001FF000001BF000003BF8000031F8000031F8000060 FC000060FC0000E0FE0000C07E0000C07E0001803F0001FFFF0003FFFF8003001F800700 1FC006000FC006000FC00C0007E00C0007E0FF803FFEFF803FFE1F1C7E9B24>65 D<001FE02000FFF8E003F80FE007C003E00F8001E01F0000E03E0000E03E0000607E0000 607C000060FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC0000 007C0000607E0000603E0000603E0000C01F0000C00F80018007C0030003F80E0000FFFC 00001FE0001B1C7D9B22>67 DII73 D76 DI<003FE00001F07C0003C01E000F800F801F0007C01E00 03C03E0003E07E0003F07C0001F07C0001F0FC0001F8FC0001F8FC0001F8FC0001F8FC00 01F8FC0001F8FC0001F8FC0001F87C0001F07E0003F07E0003F03E0003E03F0007E01F00 07C00F800F8003C01E0001F07C00003FE0001D1C7D9B24>79 D87 D<0FF8001C1E003E0F803E07803E07 C01C07C00007C0007FC007E7C01F07C03C07C07C07C0F807C0F807C0F807C0780BC03E13 F80FE1F815127F9117>97 DI<03FC 000E0E001C1F003C1F00781F00780E00F80000F80000F80000F80000F80000F800007800 007801803C01801C03000E0E0003F80011127E9115>I<000FF0000FF00001F00001F000 01F00001F00001F00001F00001F00001F00001F001F9F00F07F01C03F03C01F07801F078 01F0F801F0F801F0F801F0F801F0F801F0F801F07801F07801F03C01F01C03F00F0FFE03 F9FE171D7E9C1B>I<03FC000F07001C03803C01C07801C07801E0F801E0F801E0FFFFE0 F80000F80000F800007800007800603C00601E00C00F038001FC0013127F9116>I<007F 0001E38003C7C00787C00F87C00F83800F80000F80000F80000F80000F8000FFF800FFF8 000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80 000F80000F80007FF0007FF000121D809C0F>I<03F0F00E1F383C0F3838073078078078 07807807807807803807003C0F001E1C0033F0003000003000003000003FFF003FFFC01F FFE01FFFF07801F8F00078F00078F000787000707800F01E03C007FF00151B7F9118>I< FF0000FF00001F00001F00001F00001F00001F00001F00001F00001F00001F00001F0FC0 1F31E01F40F01F80F81F80F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F8 1F00F81F00F81F00F8FFE7FFFFE7FF181D7F9C1B>I<1E003F003F003F003F001E000000 000000000000000000007F007F001F001F001F001F001F001F001F001F001F001F001F00 1F001F001F00FFC0FFC00A1E7F9D0E>I108 D II<01FC000F07801C01C03C 01E07800F07800F0F800F8F800F8F800F8F800F8F800F8F800F87800F07800F03C01E01E 03C00F078001FC0015127F9118>II114 D<1FD830786018E018E018F000FF807FE07F F01FF807FC007CC01CC01CE01CE018F830CFC00E127E9113>I<03000300030003000700 07000F000F003FFCFFFC1F001F001F001F001F001F001F001F001F001F0C1F0C1F0C1F0C 0F08079803F00E1A7F9913>IIII121 D E /Fe 72 126 df<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0 F0600000000060F0F0600419779816>33 DI<0387000387000387000387000387000387007FFFC0FFFFE0FF FFE0070E00070E00070E000E1C000E1C000E1C000E1C00FFFFE0FFFFE07FFFC01C38001C 38001C38001C38001C38001C380013197F9816>I<00C00001C00001C00001C00007F000 1FFC003FFE007DCF0071C780E1C380E1C780E1C780F1C30079C0003FC0001FF00007FC00 01FE0001CF0001C70061C380F1C380F1C380E1C38071C70079DF003FFE001FF80007E000 01C00001C00000C00011207E9C16>I<30787C3C1C1C1C1C3878F0E040060D789816>39 D<00E001E0038007000E001C001C0038003800700070007000E000E000E000E000E000E0 00E000E000E000700070007000380038001C001C000E000700038001E000E00B217A9C16 >II<00E00000E00000E00000E00000E00000E00000E00000E000FFFFE0FFFFE0FFFFE0 00E00000E00000E00000E00000E00000E00000E00000E00013137F9516>43 D<387C7E7E3E0E1E1C78F060070B798416>II<70F8 F8F8700505788416>I<0300070007000F001F00FF00FF00E70007000700070007000700 070007000700070007000700070007000700FFF8FFF8FFF80D197B9816>49 D<07E0001FF8003FFC00783E00E00700F00780F003806003800003800003800007000007 00000E00001C0000380000700000E00001C0000380000F00001E03803803807FFF80FFFF 807FFF8011197E9816>I<07E0001FF8003FFC00781E0078070030070000070000070000 0E00003E0007FC0007F00007FC00001E00000700000300000380000380600380F00380E0 0700781E003FFC001FF80007E00011197E9816>I<70F8F8F870000000000000000070F8 F8F8700512789116>58 D<387C7C7C38000000000000000038787C7C3C1C1C3870F04006 18799116>I<7FFFC0FFFFE0FFFFE0000000000000000000000000000000FFFFE0FFFFE0 7FFFC0130B7F9116>61 DI<00E00001F00001F00001B00001B00003B80003B80003B800031800 071C00071C00071C00071C00071C000E0E000E0E000FFE000FFE001FFF001C07001C0700 1C07007E0FC0FF1FE07E0FC013197F9816>65 D<7FF800FFFE007FFF001C07001C07801C 03801C03801C03801C03801C07001FFF001FFE001FFE001C1F001C03801C03C01C01C01C 01C01C01C01C01C01C03C01C07807FFF80FFFF007FFC0012197F9816>I<01F18007FB80 0FFF801F0F803C0780380380700380700380F00000E00000E00000E00000E00000E00000 E00000E00000F000007003807003803803803C07001F0F000FFE0007FC0001F00011197E 9816>I<7FF800FFFE007FFF001C0F001C07801C03C01C01C01C01C01C01E01C00E01C00 E01C00E01C00E01C00E01C00E01C00E01C00E01C01C01C01C01C03C01C07801C0F807FFF 00FFFE007FF8001319809816>I<7FFFC0FFFFC07FFFC01C01C01C01C01C01C01C01C01C 00001C00001C1C001C1C001FFC001FFC001FFC001C1C001C1C001C00001C00E01C00E01C 00E01C00E01C00E07FFFE0FFFFE07FFFE013197F9816>I<7FFFE0FFFFE07FFFE01C00E0 1C00E01C00E01C00E01C00001C00001C1C001C1C001FFC001FFC001FFC001C1C001C1C00 1C00001C00001C00001C00001C00001C00007F8000FFC0007F800013197F9816>I<01F1 8007FB800FFF801F0F803C0780380380700380700380F00000E00000E00000E00000E000 00E01FC0E01FE0E01FC0F003807003807007803807803C07801E0F800FFF8007FB8001F3 8013197F9816>I<7FFCFFFE7FFC03800380038003800380038003800380038003800380 038003800380038003800380038003807FFCFFFE7FFC0F197D9816>73 D<01FF0003FF8001FF00001C00001C00001C00001C00001C00001C00001C00001C00001C 00001C00001C00001C00001C00001C00001C00001C00601C00F01C00F038007FF8007FF0 001FC00011197E9816>I<7F0FE0FF8FF07F0FE01C07801C0F001C0E001C1C001C3C001C 78001CF0001CE0001DF0001FF0001FF8001F38001E1C001C1C001C0E001C0E001C07001C 07001C03807F07E0FF8FF07F07E01419809816>I77 D<7E07F0FF0FF87F07F01D81C01D81C01D81C01DC1C01CC1C01CE1C01CE1C01C61C01C71 C01C71C01C71C01C31C01C39C01C39C01C19C01C1DC01C0DC01C0DC01C0DC07F07C0FF87 C07F03C01519809816>I<1FFC003FFE007FFF00780F00F00780E00380E00380E00380E0 0380E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380F00780F0 0780780F007FFF003FFE001FFC0011197E9816>I<7FF800FFFE007FFF001C0F801C0380 1C03C01C01C01C01C01C01C01C03C01C03801C0F801FFF001FFE001FF8001C00001C0000 1C00001C00001C00001C00001C00007F0000FF80007F000012197F9816>I<7FF000FFFC 007FFE001C0F001C07801C03801C03801C03801C03801C07801C0F001FFE001FFC001FFE 001C0E001C07001C07001C07001C07001C07101C07381C07387F03F0FF83F07F01E01519 809816>82 D<07E3001FFF003FFF00781F00F00700E00700E00700E00000F00000780000 3F80001FF00007FC0000FE00000F00000700000380000380600380E00380E00700F80F00 FFFE00FFFC00C7F00011197E9816>I<7FFFE0FFFFE0FFFFE0E0E0E0E0E0E0E0E0E0E0E0 E000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0 0000E00000E00000E00007FC000FFE0007FC0013197F9816>I<7F07F0FF8FF87F07F01C 01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C 01C01C01C01C01C01C01C00E03800E038007070007FF0003FE0000F8001519809816>I< FE0FE0FE0FE0FE0FE03803803C07801C07001C07001C07001E0F000E0E000E0E000E0E00 0E0E00071C00071C00071C00071C0003180003B80003B80003B80001B00001F00001F000 00E00013197F9816>I<7E03F0FF07F87E03F03800E03800E03800E03800E01C01C01C01 C01C01C01C71C01CF9C01CF9C01CD9C01CD9C00CD9800CD9800CD9800DDD800D8D800D8D 800D8D80078F00078F000707001519809816>I91 DII95 D<081C3C7870E0E0E0E0F0F87830060D789B16>I<1FE0003FF0007FF800783C00300E00 000E00000E0003FE001FFE003E0E00700E00E00E00E00E00E00E00783E007FFFE03FE7E0 0F83E013127E9116>II<03F80FFC1FFE3C1E780C7000E000E000 E000E000E000F000700778073E0E1FFC0FF803F010127D9116>I<003F00003F00003F00 00070000070000070000070003C7000FF7001FFF003C1F00780F00700700E00700E00700 E00700E00700E00700E00700700F00780F003C1F001FFFE00FF7E007C7E013197F9816> I<03F0000FFC001FFE003C0F00780700700380E00380FFFF80FFFF80FFFF80E00000E000 007003807803803E07801FFF0007FE0001F80011127E9116>I<001E00007F0001FF8001 C7800383000380000380007FFF00FFFF00FFFF0003800003800003800003800003800003 80000380000380000380000380000380000380007FFC00FFFE007FFC0011197F9816>I< 03E3C007F7E00FFFE01C1CC0380E00380E00380E00380E00380E001C1C000FF8001FF000 1BE0003800001800001FFC001FFF003FFF807003C0E000E0E000E0E000E0E000E07001C0 7C07C03FFF800FFE0003F800131C7F9116>II<03000780078003 000000000000000000FF80FF80FF80038003800380038003800380038003800380038003 800380FFFCFFFEFFFC0F1A7C9916>I<003000780078003000000000000000000FF81FF8 0FF800380038003800380038003800380038003800380038003800380038003800380038 003800386070F0F0FFE07FC03F800D237E9916>I<7E0000FE00007E00000E00000E0000 0E00000E00000E7FE00E7FE00E7FE00E0F000E1E000E3C000E78000EF0000FF0000FF800 0FBC000F1E000E0E000E07000E07807F87F0FFCFF07F87F01419809816>I<7FC000FFC0 007FC00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0 0001C00001C00001C00001C00001C00001C00001C00001C0007FFF00FFFF807FFF001119 7E9816>III<03E0000FF8001FFC003C1E00780F007007 00E00380E00380E00380E00380E00380F00780700700780F003C1E001FFC000FF80003E0 0011127E9116>II<03E3800FF3801FFB803E0F80 780780700780E00380E00380E00380E00380E00380E003807007807807803C1F801FFB80 0FF38003E380000380000380000380000380000380000380001FF0003FF8001FF0151B7F 9116>I<7F0FC0FF3FE07F7FE007F04007C0000780000780000700000700000700000700 000700000700000700000700007FFC00FFFC007FFC0013127F9116>I<0FEC3FFC7FFCF0 3CE01CE01C70007F801FF007F8003C600EE00EF00EF81EFFFCFFF8C7E00F127D9116>I< 0300000700000700000700000700007FFF00FFFF00FFFF00070000070000070000070000 07000007000007000007010007038007038007038007870003FE0001FC0000F80011177F 9616>II<7F1FC0FF9FE07F 1FC01C07001C07000E0E000E0E000E0E00071C00071C00071C00071C0003B80003B80003 B80001F00001F00000E00013127F9116>II<7F1FC07F3FC07F1FC00F1E00073C0003B80003F00001F00000E00001E0 0001F00003B800073C00071C000E0E007F1FC0FF3FE07F1FC013127F9116>I<7F1FC0FF 9FE07F1FC01C07000E07000E0E000E0E00070E00071C00071C00039C00039C0003980001 B80001B80000F00000F00000F00000E00000E00000E00001C00079C0007BC0007F80007F 00003C0000131B7F9116>I<3FFFC07FFFC07FFFC0700780700F00701E00003C00007800 01F00003E0000780000F00001E01C03C01C07801C0FFFFC0FFFFC0FFFFC012127F9116> I<001F80007F8000FF8001E00001C00001C00001C00001C00001C00001C00001C00001C0 0001C00003C0007F8000FF0000FF00007F800003C00001C00001C00001C00001C00001C0 0001C00001C00001C00001C00001E00000FF80007F80001F8011207E9C16>II<7C 0000FF0000FF800003C00001C00001C00001C00001C00001C00001C00001C00001C00001 C00001E00000FF00007F80007F8000FF0001E00001C00001C00001C00001C00001C00001 C00001C00001C00001C00003C000FF8000FF00007C000011207E9C16>I E /Ff 3 64 df<03C00FF01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80F F003C010107E9115>15 D<0000600000600000C00000C000018000018000018000030000 0300000600000600000C00000C0000180000180000180000300000300000600000600000 C00000C0000180000180000300000300000300000600000600000C00000C000018000018 0000300000300000300000600000600000C0000040000013287A9D00>54 D<00040000000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C00 00000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C00 00000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C0000FFFFFF E0FFFFFFE01B1C7D9B21>63 D E /Fg 40 123 df<0001F03C00071C47000C1CC7000C19 C6001C0180001C0380001803800038038000380380003807000038070003FFFFF0007007 00007007000070070000700E0000700E0000E00E0000E00E0000E00E0000E01C0000E01C 0001C01C0001C01C0001C01C0001C0380001C03800038038000380380003803000030070 000300700007006000C630E000E638C000CC318000781E00002025819C19>11 D<0000FE000003018000060180000C0380001C0180001C00000018000000380000003800 00003800000038000003FFFE0000700E0000700E0000700E0000701C0000701C0000E01C 0000E01C0000E0380000E0380000E0380001C0380001C0720001C0720001C0720001C072 00038034000380180003800000030000000300000007000000C6000000E6000000CC0000 00780000001925819C17>I<0000FE0FF0000307380C000607700C000E06601C001C00E0 0C001C00C000001C01C000001C01C000003801C000003801C000003803800003FFFFFFF0 00380380700070038070007003807000700700E000700700E000700700E000E00700E000 E00701C000E00701C000E00E01C000E00E01C001C00E038801C00E038801C00E038801C0 1C039001C01C019001801C00E003801C0000038038000003003800000300300000C73030 0000E638600000CC30C00000781F0000002625819C25>14 D<0003000600080018003000 6000C000C0018003000300060006000C000C001C00180018003800300030007000700060 00600060006000E000E000E000E000E00060006000600060006000200030001000080008 00102A7B9E11>40 D<001000100008000C00040006000600060006000600070007000700 0700070006000600060006000E000E000C000C001C001800180038003000300060006000 C000C001800300030006000C00180010006000C000102A809E11>I<1838783808081010 20404080050C7D830D>44 DI<3078F06005047C830D>I<00 000200000600000600000C00000C0000180000300000300000600000600000C00000C000 0180000180000300000600000600000C00000C0000180000180000300000300000600000 C00000C0000180000180000300000300000600000C00000C000018000018000030000030 0000600000600000C0000080000017297F9E15>I<030007800780030000000000000000 000000000000000000000000001800380078003800080008001000100020004000400080 00091A7D910D>59 D<01FFC3FF80003C0078000038007000003800700000380070000038 007000007000E000007000E000007000E000007000E00000E001C00000E001C00000E001 C00000FFFFC00001C003800001C003800001C003800001C0038000038007000003800700 000380070000038007000007000E000007000E000007000E000007000E00000F001E0000 FFE1FFC000211C7E9B1F>72 D<03FF0078007000700070007000E000E000E000E001C001 C001C001C0038003800380038007000700070007000E000E000E000E001E00FFC0101C7D 9B10>I<01FE0001FE003E0001E0002E0003C0002E0005C0002E0005C0002E0009C0004E 000B80004E001380004E0023800047002380008700470000870047000087008700008701 07000107010E000107020E000107040E000107040E000207081C000203881C000203901C 000203A01C000403A038000403C038000403C038000C038038001C03007800FF8307FF00 271C7E9B25>77 D<0007F000001C1C0000700E0000E0070001C003800380038007000380 0E0003C01E0003C01C0003C03C0003C03C0003C0780003C0780003C0780003C0F0000780 F0000780F0000780F0000F00F0000F00F0000E00F0001E00F0003C007000380070007000 7800E0003801C0001C0380000E0E000003F800001A1E7A9C20>79 D<1FFFFFC01C0701C0300E00C0200E0080600E0080400E0080401C0080801C0080801C00 80001C000000380000003800000038000000380000007000000070000000700000007000 0000E0000000E0000000E0000000E0000001C0000001C0000001C0000001C0000003C000 007FFE00001A1C799B1E>84 D<01E307170C0F180F380E300E700E700EE01CE01CE01CE0 1CE039E039E0396079319A1E0C10127C9115>97 D<3F00070007000E000E000E000E001C 001C001C001C0039E03A183C0C380C700C700E700E700EE01CE01CE01CE018E038E030E0 6060C031801E000F1D7C9C13>I<00F803040E041C0E181C300070007000E000E000E000 E000E000E0046008601030600F800F127C9113>I<0007E00000E00000E00001C00001C0 0001C00001C000038000038000038000038001E7000717000C0F00180F00380E00300E00 700E00700E00E01C00E01C00E01C00E01C00E03900E03900E03900607900319A001E0C00 131D7C9C15>I<00F807040C0418023804300470087FF0E000E000E000E000E000600460 08301030600F800F127C9113>I<0003C0000670000C70001C60001C00001C0000380000 380000380000380000380003FF8000700000700000700000700000700000E00000E00000 E00000E00000E00001C00001C00001C00001C00001C00003800003800003800003000003 0000070000C60000E60000CC00007800001425819C0D>I<0078C001C5C00303C00603C0 0E03800C03801C03801C0380380700380700380700380700380E00380E00380E00181E00 0C7C00079C00001C00001C00003800003800C03000E07000C1C0007F0000121A7E9113> I<0FC00001C00001C0000380000380000380000380000700000700000700000700000E3E 000EC3000F03800E03801E03801C03801C03801C0380380700380700380700380E00700E 40700E40701C40701C80E00C80600700121D7E9C15>I<01800380010000000000000000 000000000000001C002600470047008E008E000E001C001C001C00380038007100710071 00720072003C00091C7C9B0D>I<0FC00001C00001C00003800003800003800003800007 00000700000700000700000E07800E08800E11C00E21C01C41801C80001D00001E00003F C00038E000387000387000707100707100707100707200E03200601C00121D7E9C13> 107 D<1F800380038007000700070007000E000E000E000E001C001C001C001C00380038 00380038007000700070007000E200E200E200E40064003800091D7D9C0B>I<1C1E0780 266318C04683A0E04703C0E08E0380E08E0380E00E0380E00E0380E01C0701C01C0701C0 1C0701C01C070380380E0388380E0388380E0708380E0710701C0320300C01C01D127C91 22>I<383E004CC3004D03804E03809E03809C03801C03801C0380380700380700380700 380E00700E40700E40701C40701C80E00C8060070012127C9117>I<00F800030C000E06 001C0300180300300300700380700380E00700E00700E00700E00E00E00E00E01C006018 0060300030E0000F800011127C9115>I<03878004C86004D03004E03009C03009C03801 C03801C0380380700380700380700380600700E00700C00701800783000E86000E78000E 00000E00001C00001C00001C00001C0000380000FF0000151A809115>I<01E107130C0F 180F380E300E700E700EE01CE01CE01CE01CE038E038E038607831F01E700070007000E0 00E000E000E001C00FF8101A7C9113>I<1C3C2642468747078E068E000E000E001C001C 001C001C0038003800380038007000300010127C9112>I<01F006080C080C1C18181C00 1F001FC00FF007F0007800386030E030C030806060C01F000E127D9111>I<0300070007 0007000E000E000E000E00FFE01C001C001C0038003800380038007000700070007000E0 80E080E100E100660038000B1A7C990E>I<1C01802E03804E03804E03808E07008E0700 1C07001C0700380E00380E00380E00380E00301C80301C80301C80383C80184D000F8600 11127C9116>I<1C062E0E4E064E068E028E021C021C0238043804380438083008300830 10382018400F800F127C9113>I<1E01832703874703874703838707018707010E07010E 07011C0E021C0E021C0E021C0E04180C04181C04181C081C1E080C263007C3C018127C91 1C>I<0387800CC8400870E01070E020E0C020E00000E00000E00001C00001C00001C000 01C000038100638100E38200C5820085840078780013127E9113>I<1C01802E03804E03 804E03808E07008E07001C07001C0700380E00380E00380E00380E00301C00301C00301C 00383C001878000FB800003800003000007000E06000E0C0008180004300003C0000111A 7C9114>I<01C107E10FF6081C10080010002000400080010002000400080410042C0C73 F841F080E010127E9111>I E /Fh 84 125 df<007E1F0001C1B1800303E3C00703C3C0 0E03C1800E01C0000E01C0000E01C0000E01C0000E01C0000E01C000FFFFFC000E01C000 0E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C000 0E01C0000E01C0000E01C0000E01C0000E01C0000E01C0007F87FC001A1D809C18>11 D<007E0001C1800301800703C00E03C00E01800E00000E00000E00000E00000E0000FFFF C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01 C00E01C00E01C00E01C00E01C07F87F8151D809C17>I<007FC001C1C00303C00703C00E 01C00E01C00E01C00E01C00E01C00E01C00E01C0FFFFC00E01C00E01C00E01C00E01C00E 01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C07F CFF8151D809C17>I<003F07E00001C09C18000380F018000701F03C000E01E03C000E00 E018000E00E000000E00E000000E00E000000E00E000000E00E00000FFFFFFFC000E00E0 1C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C 000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C00 0E00E01C007FC7FCFF80211D809C23>I<60F0F0F0F0F0F0F06060606060606060606060 6060000000000060F0F060041E7C9D0C>33 D<6060F0F0F8F86868080808080808101010 102020404080800D0C7F9C15>I<00E000000310000006080000060800000E0800000E08 00000E0800000E0800000E1000000E1000000E2000000740000007403FE007800F800780 0600038004000780040009C0080011C0100030E0100020F0200060702000E0384000E03C 8000E01C8000E00F0020E0070020700780403009C0401830E1800FC03F001B1F7E9D20> 38 D<60F0F8680808081010204080050C7C9C0C>I<00800100020006000C000C00180018 003000300030006000600060006000E000E000E000E000E000E000E000E000E000E000E0 00E0006000600060006000300030003000180018000C000C000600020001000080092A7C 9E10>I<8000400020003000180018000C000C0006000600060003000300030003000380 038003800380038003800380038003800380038003800300030003000300060006000600 0C000C00180018003000200040008000092A7E9E10>I<00060000000600000006000000 060000000600000006000000060000000600000006000000060000000600000006000000 060000FFFFFFE0FFFFFFE000060000000600000006000000060000000600000006000000 0600000006000000060000000600000006000000060000000600001B1C7E9720>43 D<60F0F0701010101020204080040C7C830C>II<60F0F0600404 7C830C>I<00010003000600060006000C000C000C001800180018003000300030006000 6000C000C000C0018001800180030003000300060006000C000C000C0018001800180030 0030003000600060006000C000C00010297E9E15>I<03C00C301818300C300C700E6006 6006E007E007E007E007E007E007E007E007E007E007E007E007E00760066006700E300C 300C18180C3007E0101D7E9B15>I<010007003F00C70007000700070007000700070007 000700070007000700070007000700070007000700070007000700070007000700FFF80D 1C7C9B15>I<07C01830201C400C400EF00FF80FF807F8077007000F000E000E001C001C 00380070006000C00180030006010C01180110023FFE7FFEFFFE101C7E9B15>I<07E018 30201C201C781E780E781E381E001C001C00180030006007C00030001C001C000E000F00 0F700FF80FF80FF80FF00E401C201C183007C0101D7E9B15>I<000C00000C00001C0000 3C00003C00005C0000DC00009C00011C00031C00021C00041C000C1C00081C00101C0030 1C00201C00401C00C01C00FFFFC0001C00001C00001C00001C00001C00001C00001C0001 FFC0121C7F9B15>I<300C3FF83FF03FC020002000200020002000200023E02C30301830 1C200E000E000F000F000F600FF00FF00FF00F800E401E401C2038187007C0101D7E9B15 >I<00F0030C04040C0E181E301E300C700070006000E3E0E430E818F00CF00EE006E007 E007E007E007E007600760077006300E300C18180C3003E0101D7E9B15>I<4000007FFF 807FFF007FFF0040020080040080040080080000100000100000200000600000400000C0 0000C00001C0000180000180000380000380000380000380000780000780000780000780 00078000078000030000111D7E9B15>I<03E00C301008200C200660066006700670067C 0C3E183FB01FE007F007F818FC307E601E600FC007C003C003C003C00360026004300C1C 1007E0101D7E9B15>I<03C00C301818300C700C600EE006E006E007E007E007E007E007 6007700F300F18170C2707C700060006000E300C780C78187018203010C00F80101D7E9B 15>I<60F0F0600000000000000000000060F0F06004127C910C>I<60F0F0600000000000 000000000060F0F0701010101020204080041A7C910C>I<7FFFFFC0FFFFFFE000000000 00000000000000000000000000000000000000000000000000000000FFFFFFE07FFFFFC0 1B0C7E8F20>61 D<0FE03038401CE00EF00EF00EF00E000C001C0030006000C000800180 0100010001000100010001000000000000000000000003000780078003000F1D7E9C14> 63 D<000600000006000000060000000F0000000F0000000F0000001780000017800000 37C0000023C0000023C0000043E0000041E0000041E0000080F0000080F0000080F00001 0078000100780001FFF80002003C0002003C0002003C0004001E0004001E000C001F000C 000F001E001F00FF00FFF01C1D7F9C1F>65 DI<001F808000E0 618001801980070007800E0003801C0003801C0001803800018078000080780000807000 0080F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00000007000 00807800008078000080380000801C0001001C0001000E000200070004000180080000E0 3000001FC000191E7E9C1E>IIII<001F808000E061800180 1980070007800E0003801C0003801C00018038000180780000807800008070000080F000 0000F0000000F0000000F0000000F0000000F0000000F000FFF0F0000F80700007807800 078078000780380007801C0007801C0007800E00078007000B800180118000E06080001F 80001C1E7E9C21>III<07FF80007C00003C00003C00003C00003C00003C00003C0000 3C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C0000 3C00703C00F83C00F83C00F8380070780040700030E0000F8000111D7F9B15>IIIII<003F800000E0E0000380380007001C000E000E001C0007003C000780380003 80780003C0780003C0700001C0F00001E0F00001E0F00001E0F00001E0F00001E0F00001 E0F00001E0F00001E0700001C0780003C0780003C0380003803C0007801C0007000E000E 0007001C000380380000E0E000003F80001B1E7E9C20>II82 D<07E0801C198030058030038060 0180E00180E00080E00080E00080F00000F800007C00007FC0003FF8001FFE0007FF0000 FF80000F800007C00003C00001C08001C08001C08001C0C00180C00180E00300D00200CC 0C0083F800121E7E9C17>I<7FFFFFC0700F01C0600F00C0400F0040400F0040C00F0020 800F0020800F0020800F0020000F0000000F0000000F0000000F0000000F0000000F0000 000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000 000F0000000F0000001F800003FFFC001B1C7F9B1E>IIII89 D91 D<08081010202040404040808080808080B0B0F8F87878 30300D0C7A9C15>II<0810204040808080B0F87830050C7D 9C0C>96 D<1FC000307000783800781C00301C00001C00001C0001FC000F1C00381C0070 1C00601C00E01C40E01C40E01C40603C40304E801F870012127E9115>II<03F80C0C181E301E700C6000E000E000E000E000 E000E00060007002300218040C1803E00F127F9112>I<001F8000038000038000038000 038000038000038000038000038000038000038003F3800E0B8018078030038070038060 0380E00380E00380E00380E00380E00380E003806003807003803003801807800E1B8003 E3F0141D7F9C17>I<07E00C301818300C700E6006E006FFFEE000E000E000E000600070 02300218040C1803E00F127F9112>I<00F8018C071E061E0E0C0E000E000E000E000E00 0E00FFE00E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E00 7FE00F1D809C0D>I<00038007C4C01C78C0383880301800701C00701C00701C00701C00 3018003838001C700027C0002000002000003000003FF8001FFF001FFF802003806001C0 C000C0C000C0C000C06001803003001C0E0007F800121C7F9215>II<18003C003C0018000000000000000000000000000000 FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C00FF80 091D7F9C0C>I<00C001E001E000C0000000000000000000000000000007E000E000E000 E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E060 E0F0C0F1C061803E000B25839C0D>IIIII<03F0000E1C00180600300300700380600180E001C0E001C0E001C0 E001C0E001C0E001C06001807003803003001806000E1C0003F00012127F9115>II<03E0800E1980180580380780700380700380E00380E00380E0 0380E00380E00380E003807003807003803807801807800E1B8003E38000038000038000 0380000380000380000380000380001FF0141A7F9116>II<1F90207040 30C010C010E010F8007F803FE00FF000F880388018C018C018E010D0608FC00D127F9110 >I<04000400040004000C000C001C003C00FFE01C001C001C001C001C001C001C001C00 1C001C101C101C101C101C100C100E2003C00C1A7F9910>IIIIII<7FFC70386038407040F040E041C003C0038007000F040E04 1C043C0C380870087038FFF80E127F9112>III E /Fi 38 122 df<0000180000380000380000700000700000E00000E00000 E00001C00001C0000380000380000380000700000700000700000E00000E00001C00001C 00001C0000380000380000700000700000700000E00000E00001C00001C00001C0000380 000380000700000700000700000E00000E00000E00001C00001C00003800003800003800 00700000700000E00000E00000C0000015317DA41C>47 D<00180000780001F800FFF800 FFF80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F800 01F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F800 01F80001F8007FFFE07FFFE013207C9F1C>49 D<03FC000FFF003C1FC07007E07C07F0FE 03F0FE03F8FE03F8FE01F87C01F83803F80003F80003F00003F00007E00007C0000F8000 1F00003E0000380000700000E01801C0180380180700180E00380FFFF01FFFF03FFFF07F FFF0FFFFF0FFFFF015207D9F1C>I<00FE0007FFC00F07E01E03F03F03F03F81F83F81F8 3F81F81F03F81F03F00003F00003E00007C0001F8001FE0001FF000007C00001F00001F8 0000FC0000FC3C00FE7E00FEFF00FEFF00FEFF00FEFF00FC7E01FC7801F81E07F00FFFC0 01FE0017207E9F1C>I<0000E00001E00003E00003E00007E0000FE0001FE0001FE00037 E00077E000E7E001C7E00187E00307E00707E00E07E00C07E01807E03807E07007E0E007 E0FFFFFFFFFFFF0007E00007E00007E00007E00007E00007E00007E000FFFF00FFFF1820 7E9F1C>I<3000203E01E03FFFC03FFF803FFF003FFE003FF80033C00030000030000030 000030000031FC0037FF003E0FC03807E03003E00003F00003F00003F80003F83803F87C 03F8FE03F8FE03F8FC03F0FC03F07007E03007C03C1F800FFF0003F80015207D9F1C>I< 001F8000FFE003E07007C0F00F01F81F01F83E01F83E01F87E00F07C00007C0000FC0800 FC7FC0FCFFE0FD80F0FF00F8FE007CFE007CFC007EFC007EFC007EFC007E7C007E7C007E 7C007E3C007C3E007C1E00F80F00F00783E003FFC000FF0017207E9F1C>I<6000007800 007FFFFE7FFFFE7FFFFC7FFFF87FFFF87FFFF0E00060E000C0C00180C00300C003000006 00000C00001C0000180000380000780000780000F00000F00000F00001F00001F00001F0 0003F00003F00003F00003F00003F00003F00003F00001E00017227DA11C>I<00FE0003 FFC00703E00E00F01C00F01C00783C00783E00783F00783F80783FE0F01FF9E01FFFC00F FF8007FFC003FFE007FFF01E7FF83C1FFC7807FC7801FEF000FEF0003EF0001EF0001EF0 001EF8001C7800383C00381F00F00FFFC001FF0017207E9F1C>I<000070000000007000 000000F800000000F800000000F800000001FC00000001FC00000003FE00000003FE0000 0003FE000000067F000000067F0000000C7F8000000C3F8000000C3F800000181FC00000 181FC00000301FE00000300FE00000700FF000006007F000006007F00000C007F80000FF FFF80001FFFFFC00018001FC00018001FC00030001FE00030000FE00070000FF00060000 7F000600007F00FFE007FFF8FFE007FFF825227EA12A>65 D<0003FE0080001FFF818000 FF01E38001F8003F8003E0001F8007C0000F800F800007801F800007803F000003803F00 0003807F000001807E000001807E00000180FE00000000FE00000000FE00000000FE0000 0000FE00000000FE00000000FE00000000FE000000007E000000007E000001807F000001 803F000001803F000003801F800003000F8000030007C000060003F0000C0001F8003800 00FF00F000001FFFC0000003FE000021227DA128>67 D69 D73 D<0007FC0000003FFF800000 FC07E00003F001F80007E000FC000FC0007E001F80003F001F80003F003F00001F803F00 001F807F00001FC07E00000FC07E00000FC0FE00000FE0FE00000FE0FE00000FE0FE0000 0FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE07E00000FC07F00001F C07F00001FC03F00001F803F80003F801F80003F000FC0007E0007E000FC0003F001F800 00FC07E000003FFF80000007FC000023227DA12A>79 D82 D<0FFC003FFF807E07C07E03E07E01E0 7E01F03C01F00001F00001F0003FF003FDF01FC1F03F01F07E01F0FC01F0FC01F0FC01F0 FC01F07E02F07E0CF81FF87F07E03F18167E951B>97 DI<00FF8007FFE00F83F01F 03F03E03F07E03F07C01E07C0000FC0000FC0000FC0000FC0000FC0000FC00007C00007E 00007E00003E00181F00300FC06007FFC000FF0015167E9519>I<0001FE000001FE0000 003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000 003E0000003E0001FC3E0007FFBE000F81FE001F007E003E003E007E003E007C003E00FC 003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC003E007C003E007C 003E003E007E001F00FE000F83BE0007FF3FC001FC3FC01A237EA21F>I<00FE0007FF80 0F87C01E01E03E01F07C00F07C00F8FC00F8FC00F8FFFFF8FFFFF8FC0000FC0000FC0000 7C00007C00007E00003E00181F00300FC07003FFC000FF0015167E951A>I<001FC0007F E000F1F001E3F003E3F007C3F007C1E007C00007C00007C00007C00007C00007C000FFFE 00FFFE0007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C0 0007C00007C00007C00007C00007C00007C00007C0003FFC003FFC00142380A211>I<01 FE0F0007FFBF800F87C7801F03E7801E01E0003E01F0003E01F0003E01F0003E01F0003E 01F0001E01E0001F03E0000F87C0000FFF800009FE000018000000180000001C0000001F FFE0000FFFF80007FFFE001FFFFF003C003F0078000F80F0000780F0000780F0000780F0 00078078000F003C001E001F007C000FFFF80001FFC00019217F951C>II<1C003E 007F007F007F003E001C000000000000000000000000000000FF00FF001F001F001F001F 001F001F001F001F001F001F001F001F001F001F001F001F001F001F00FFE0FFE00B247E A310>I107 DIII<00FE0007 FFC00F83E01E00F03E00F87C007C7C007C7C007CFC007EFC007EFC007EFC007EFC007EFC 007EFC007E7C007C7C007C3E00F81F01F00F83E007FFC000FE0017167E951C>II114 D<0FF3003FFF00781F00 600700E00300E00300F00300FC00007FE0007FF8003FFE000FFF0001FF00000F80C00780 C00380E00380E00380F00700FC0E00EFFC00C7F00011167E9516>I<0180000180000180 000180000380000380000780000780000F80003F8000FFFF00FFFF000F80000F80000F80 000F80000F80000F80000F80000F80000F80000F80000F80000F81800F81800F81800F81 800F81800F830007C30003FE0000F80011207F9F16>IIIIII E /Fj 41 122 df<0000800001000002 0000040000080000100000300000600000C00000C0000180000300000300000600000600 000E00000C00001C00001800001800003800003000003000007000007000006000006000 00E00000E00000E00000C00000C00000C00000C00000C00000C00000C00000C00000C000 00C00000C00000C00000C000004000006000006000002000003000001000000800001132 78A414>40 D<000800000400000600000200000300000300000100000180000180000180 000180000180000180000180000180000180000180000180000180000180000380000380 000380000300000300000700000700000600000600000E00000C00000C00001C00001800 00380000300000300000600000600000C000018000018000030000060000040000080000 100000200000400000800000113280A414>I<0E1E1E1E1E02020404080810204080070F 7D840F>44 DI<70F8F8F0E005057A840F>I<000100030003 0006001E002E03CE001C001C001C001C0038003800380038007000700070007000E000E0 00E000E001C001C001C001C003800380038003800780FFFC10217AA019>49 D<000FC000307000C01801001C02001C04000C04401C08201C08201C08201C08403808C0 380700700000600001C000070000FC000007000003800003800001C00001C00001C00003 C06003C0F003C0F00380E00780800700800E00801C0040380020F0001F800016227BA019 >51 D<0000180000380000380000700000700000700000E00000E00000E00000C00001C0 000180000380000300000300000600000600000C00000C000018000010000031800061C0 0043800083800183800303800207000407000807003FC700403E00800FF0000E00000E00 001C00001C00001C00001C00003800003800003800003000152B7EA019>I<02780204FC 0407FC040FFC080F0C181E04701803A03000602000406000C04000808001800003800003 00000700000600000E00000E00001C00001C00003C0000380000780000780000F00000F0 0000F00001E00001E00001E00003E00003C00003C000018000172279A019>55 D<000FC000306000401000801801000803000C03000C07001807001807001007803007C0 6007E0C003F10001FE0000FC0000FE00033F00061F800C0FC01803C03001C06001C06000 C0C000C0C000C0C00080C00180C00100C00200C006006008003030000FC00016227BA019 >I<000FC000386000603000E03001C0380380380780380700380F00380F00380F00381E 00781E00781E00781E00F81E00F01C00F00E01F00E02F00605E00309E001F1E00003C000 03C0000380000700000700600E00F00C00F01800E0300080600041C0003F000015227BA0 19>I<0000030000000300000007000000070000000F0000000F0000001F0000002F0000 002F0000004F8000004F8000008780000087800001078000020780000207800004078000 0407800008078000180780001007800020078000200780007FFFC0004003C0008003C001 8003C0010003C0020003C0020003C0040003C0040003C00C0003C03C0007E0FF003FFC1E 237DA224>65 D<00007F00800003808100000E00630000380027000070001F0000E0000E 0001C0000E000380000E000700000E000F000004000E000004001E000004003C00000400 3C00000800780000000078000000007800000000F000000000F000000000F000000000F0 00000000F000000000E000000000E000002000E000002000E000004000E000004000F000 00800070000080007000010000380002000018000400001C0008000006003000000381C0 000000FE000000212479A223>67 D<0007FFC000003C0000003C0000003C000000780000 00780000007800000078000000F0000000F0000000F0000000F0000001E0000001E00000 01E0000001E0000003C0000003C0000003C0000003C00000078000000780000007800000 078000000F0000000F0000380F0000780F0000F81E0000F81E0000F03C00004038000040 70000021E000001F8000001A237CA11A>74 D<00FFFC00000F8000000F0000000F000000 1E0000001E0000001E0000001E0000003C0000003C0000003C0000003C00000078000000 780000007800000078000000F0000000F0000000F0000000F0000001E0000001E0000001 E0002001E0002003C0004003C0004003C0008003C0008007800180078001000780030007 800F000F803E00FFFFFE001B227DA11F>76 D<00FF800007FC000F80000F80000F800017 80000F80001780001780002F000013C0002F000013C0004F000013C0008F000023C0009E 000023C0011E000023C0011E000023C0021E000043C0043C000043C0043C000043C0083C 000041E0083C000081E01078000081E02078000081E02078000081E04078000101E040F0 000101E080F0000101E100F0000101E100F0000200F201E0000200F201E0000200F401E0 000200F801E0000400F803C0000400F003C0000400F003C0000C00E003C0001E00C007C0 00FF80C07FF8002E227DA12C>I<0000FE0000078380000C00E0003800700070003800E0 003801C0001C0380001C0700001C0F00001E1E00001E1C00001E3C00001E3C00001E7800 001E7800001E7800001EF000003CF000003CF000003CF0000078F0000078E0000078E000 00F0E00000F0E00001E0E00001C0F00003C0F00007807000070078000E0038001C001C00 38000E00E0000703800001FC00001F2479A225>79 D<00FFFFE0000F0038000F001E000F 000E001E0007001E0007001E0007001E0007003C000F003C000F003C000F003C001E0078 001E0078003C00780078007800E000F003C000FFFE0000F0000000F0000001E0000001E0 000001E0000001E0000003C0000003C0000003C0000003C0000007800000078000000780 0000078000000F800000FFF0000020227DA121>I<0001F020000E0C40001802C0003001 C0006001C000E0018000C0018001C0018001C0018003C0010003C0010003C0000003C000 0003E0000001F8000001FF000000FFE000007FF000001FF8000003FC0000007C0000003C 0000001E0000001E0000001E0020001C0020001C0020001C002000180060003800600030 00700060007000C000C8018000C607000081FC00001B247DA21B>83 D<1FFFFFF81E03C0381803C0183003C01820078018200780184007801040078010400F00 10800F0010800F0010000F0000001E0000001E0000001E0000001E0000003C0000003C00 00003C0000003C00000078000000780000007800000078000000F0000000F0000000F000 0000F0000001E0000001E0000001E0000001E0000003E00000FFFF00001D2277A123>I< 00F8C00185C00705C00E03800E03801C03803C0380380700780700780700780700F00E00 F00E00F00E00F00E10F01C20701C20703C20305C40308C400F078014157B9419>97 D<03C01F8003800380038007000700070007000E000E000E000E001C001CF81D0C1E0E3C 0638073807380F700F700F700F700FE01EE01EE01EE03CE038E038607060E031C01F0010 237BA216>I<007E0001C1000301800703800E07801C07803C0000380000780000780000 780000F00000F00000F00000F00000F00100700100700200300C001830000FC00011157B 9416>I<00003C0003F80000380000380000380000700000700000700000700000E00000 E00000E00000E00001C000F9C00185C00705C00E03800E03801C03803C03803807007807 00780700780700F00E00F00E00F00E00F00E10F01C20701C20703C20305C40308C400F07 8016237BA219>I<00F803840E021C023C0238027804F018FFE0F000F000E000E000E000 E000E002E0026004701830600F800F157A9416>I<00003E0000470000CF00018F000186 000380000380000380000700000700000700000700000700000E0000FFF0000E00000E00 000E00001C00001C00001C00001C00001C00003800003800003800003800003800007000 00700000700000700000700000E00000E00000E00000E00000C00001C00001C000718000 F18000F300006200003C0000182D82A20F>I<001F180030B800E0B801C07001C0700380 700780700700E00F00E00F00E00F00E01E01C01E01C01E01C01E01C01E03800E03800E07 80060B8006170001E700000700000700000E00000E00000E00701C00F01800F0300060E0 003F8000151F7E9416>I<00F0000FE00000E00000E00000E00001C00001C00001C00001 C000038000038000038000038000070000071F0007218007C0C00F00E00F00E00E00E00E 00E01C01C01C01C01C01C01C01C0380380380380380380380704700708700E08700E1070 0610E006206003C016237DA219>I<00C001E001C001C000000000000000000000000000 0000001E002300430043008700870087000E000E001C001C001C00380038003840708070 807080710032001C000B217BA00F>I<01E00FC001C001C001C003800380038003800700 0700070007000E000E000E000E001C001C001C001C003800380038003800700070007000 7100E200E200E200E200640038000B237CA20C>108 D<1C0F80F8002610C10C00476066 060087807807008780780700870070070087007007000E00E00E000E00E00E000E00E00E 000E00E00E001C01C01C001C01C01C001C01C01C001C01C0382038038038403803807040 3803807080380380308070070031003003001E0023157B9428>I<380F804C30C04E4060 8E80708F00708E00708E00701C00E01C00E01C00E01C00E03801C03801C03801C0380384 700388700308700708700310E003106001E016157B941B>I<007E0001C3000381800701 C00E01C01C01E03C01E03801E07801E07801E07801E0F003C0F003C0F00380F007807007 00700E00700C0030180018700007C00013157B9419>I<01C1F002621804741C08780C08 700E08700E08701E00E01E00E01E00E01E00E01E01C03C01C03C01C03C01C07803807003 807003C0E003C1C0072380071E000700000700000E00000E00000E00000E00001C00001C 00001C0000FFC000171F7F9419>I<1C1F002620804741C08783C08703C0870180870000 0E00000E00000E00000E00001C00001C00001C00001C0000380000380000380000380000 70000030000012157B9415>114 D<00FC000183000200800401800C03800C03000C0000 0F00000FF00007FC0003FE00003E00000F00000700700700F00600F00600E00400400800 2030001FC00011157D9414>I<00C001C001C001C001C003800380038003800700FFF807 0007000E000E000E000E001C001C001C001C003800380038003810702070207040708031 001E000D1F7C9E10>I<1E00602300E04380E04381C08381C08701C08701C00703800E03 800E03800E03801C07001C07001C07001C07081C0E10180E101C0E101C1E200C262007C3 C015157B941A>I<1C01802603C04707C04703C08701C08E00C08E00C00E00801C00801C 00801C00803801003801003801003802003802003804003808001808000C300007C00012 157B9416>I<1E0060E02300E0F04380E1F04381C0F08381C0708701C0308701C0300703 80200E0380200E0380200E0380201C0700401C0700401C0700401C0700801C0700801C07 01001C0F01000C0B02000613840003E0F8001C157B9420>I<1E00302300704380704380 E08380E08700E08700E00701C00E01C00E01C00E01C01C03801C03801C03801C03801C07 001C07001C07001C0F000C3E0003CE00000E00000E00001C00601C00F03800F03000E060 0080C0004380003E0000141F7B9418>121 D E /Fk 24 126 df<183E7E7F3F1F070E0E 1CFCF860080D77851A>44 D<3078FCFC7830060676851A>46 D<003E0001FF8003FFC007 C1E00F00E01E0F703C3FF0387FF07070F870E07870E078E1C038E1C038E1C038E1C038E1 C038E1C038E1C038E1C03870E07070E0707070E0387FE03C3FC01E0F000F003807C0F803 FFF001FFE0003F00151E7E9D1A>64 D<7FFF00FFFF807FFF0001C00001C00001C00001C0 0001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0 0001C00001C00001C00001C00001C00001C00001C00001C0007FFF00FFFF807FFF00111E 7C9D1A>73 D<0FFE003FFF807FFFC07C07C07001C0F001E0E000E0E000E0E000E0E000E0 E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0 E000E0F001E0F001E07001C07C07C07FFFC03FFF800FFE00131E7D9D1A>79 D<1FF0003FFC007FFE00780F00300700000380000380007F8007FF801FFF803F83807803 80700380E00380E00380E00380700780780F803FFFFC1FFDFC07F0FC16157D941A>97 D<00FF8003FFC00FFFE01F01E03C00C0780000700000700000E00000E00000E00000E000 00E000007000007000007800703C00701F01F00FFFE003FFC000FE0014157D941A>99 D<000FC0001FC0000FC00001C00001C00001C00001C00001C00001C001F1C007FDC00FFF C01E0FC03C07C07803C07001C0E001C0E001C0E001C0E001C0E001C0E001C0E001C07003 C07003C03807C03E0FC01FFFF807FDFC01F1F8161E7E9D1A>I<01F80007FF000FFF801E 07C03C01C07800E07000E0E00070E00070FFFFF0FFFFF0FFFFF0E0000070000070000078 00703C00701F01F00FFFE003FF8000FE0014157D941A>I<01F87C07FFFE0FFFFE1E078C 1C03803801C03801C03801C03801C03801C01C03801E07801FFF001FFE0039F800380000 3800001C00001FFF801FFFE03FFFF878007C70001CE0000EE0000EE0000EE0000E70001C 78003C3E00F81FFFF007FFC001FF0017217F941A>103 D<00C00001E00001E00000C000 0000000000000000000000000000000000007FE0007FE0007FE00000E00000E00000E000 00E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000 7FFF80FFFFC07FFF80121F7C9E1A>105 D<000C001E001E000C00000000000000000000 000007FE0FFE07FE000E000E000E000E000E000E000E000E000E000E000E000E000E000E 000E000E000E000E000E000E000E000E000E001C601CF038FFF87FF01FC00F2A7E9E1A> II<7FE000FFE0007FE00000 E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000 E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0007F FFC0FFFFE07FFFC0131E7D9D1A>I<7CE0E000FFFBF8007FFFF8001F1F1C001E1E1C001E 1E1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C 1C1C001C1C1C001C1C1C001C1C1C007F1F1F00FFBFBF807F1F1F00191580941A>I<7E3E 00FEFF807FFFC00FC1C00F80E00F00E00E00E00E00E00E00E00E00E00E00E00E00E00E00 E00E00E00E00E00E00E00E00E00E00E07FC3FCFFE7FE7FC3FC17157F941A>I<01F00007 FC001FFF003E0F803C07807803C07001C0E000E0E000E0E000E0E000E0E000E0E000E0F0 01E07001C07803C03C07803E0F801FFF0007FC0001F00013157D941A>I<7E3E00FEFF80 7FFFE00FC1F00F80700F00380E00380E001C0E001C0E001C0E001C0E001C0E001C0E001C 0F00380F00780F80F00FC1E00FFFC00EFF800E3E000E00000E00000E00000E00000E0000 0E00000E00000E00007FC000FFE0007FC00016207F941A>I<7F81F8FF8FFC7F9FFE03FE 1E03F80C03E00003E00003C0000380000380000380000380000380000380000380000380 000380000380007FFF00FFFF007FFF0017157F941A>114 D<07FB801FFF807FFF807807 80E00380E00380E003807800007FC0001FFC0007FE00003F800007806001C0E001C0E001 C0F003C0FC0780FFFF00EFFE00E3F80012157C941A>I<7E07E0FE0FE07E07E00E00E00E 00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E 01E00F03E007FFFC03FFFE00FCFC17157F941A>117 D119 D<0007E0001FE0003FE000780000 F00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00001 E00003C000FF8000FF0000FF800003C00001E00000E00000E00000E00000E00000E00000 E00000E00000E00000E00000E00000E00000F000007800003FE0001FE00007E013277DA2 1A>123 D<7C0000FF0000FF800003C00001E00000E00000E00000E00000E00000E00000 E00000E00000E00000E00000E00000E00000F000007800003FE0001FE0003FE000780000 F00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00001 E00003C000FF8000FF00007C000013277DA21A>125 D E /Fl 37 122 df<70F8FCFC7404040404080810102040060F7C840E>44 D<008003800F80F38003 800380038003800380038003800380038003800380038003800380038003800380038003 800380038003800380038003800380038007C0FFFE0F217CA018>49 D<03F0000C1C001007002007804003C04003C08003E0F003E0F801E0F801E0F801E02003 E00003E00003C00003C0000780000700000E00001C0000180000300000600000C0000180 000100000200200400200800201800603000403FFFC07FFFC0FFFFC013217EA018>I<01 F000060C000C0600180700380380700380700380F001C0F001C0F001C0F001E0F001E0F0 01E0F001E0F001E07001E07003E03803E01805E00C05E00619E003E1E00001C00001C000 01C0000380000380300380780700780600700C002018001030000FC00013227EA018>57 D<70F8F8F870000000000000000000000070F8F8F87005157C940E>I<0007E010003818 3000E0063001C00170038000F0070000F00E0000701E0000701C0000303C0000303C0000 307C0000107800001078000010F8000000F8000000F8000000F8000000F8000000F80000 00F8000000F800000078000000780000107C0000103C0000103C0000101C0000201E0000 200E000040070000400380008001C0010000E0020000381C000007E0001C247DA223>67 DI< FFFFFFC00F8007C0078001C0078000C00780004007800040078000600780002007800020 0780002007802020078020000780200007802000078060000780E00007FFE0000780E000 078060000780200007802000078020000780200807800008078000080780001007800010 07800010078000300780003007800070078000E00F8003E0FFFFFFE01D227EA121>I<00 07F008003C0C1800E0021801C001B8038000F8070000780F0000381E0000381E0000183C 0000183C0000187C0000087800000878000008F8000000F8000000F8000000F8000000F8 000000F8000000F8000000F8001FFF780000F8780000787C0000783C0000783C0000781E 0000781E0000780F00007807000078038000B801C000B800E00318003C0C080007F00020 247DA226>71 D<03FFE0001F00000F00000F00000F00000F00000F00000F00000F00000F 00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F 00000F00000F00000F00000F00700F00F80F00F80F00F80E00F01E00401C002038001870 0007C00013237EA119>74 D76 D<000FE00000783C0000E00E0003C00780078003C00F00 01E00E0000E01E0000F03C0000783C0000787C00007C7C00007C7800003C7800003CF800 003EF800003EF800003EF800003EF800003EF800003EF800003EF800003EF800003E7800 003C7C00007C7C00007C3C0000783E0000F81E0000F00F0001E00F0001E0078003C003C0 078000E00E0000783C00000FE0001F247DA226>79 DI<03F0200C0C601802603001E07000E0 600060E00060E00060E00020E00020E00020F00000F000007800007F00003FF0001FFE00 0FFF0003FF80003FC00007E00001E00000F00000F0000070800070800070800070800070 C00060C00060E000C0F000C0C80180C6070081FC0014247DA21B>83 D85 D87 D<1FE000303800780C00780E0030070000070000070000070000FF0007C7 001E07003C0700780700700700F00708F00708F00708F00F087817083C23900FC1E01515 7E9418>97 D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E0000 0E00000E00000E00000E00000E1F000E61C00E80600F00300E00380E003C0E001C0E001E 0E001E0E001E0E001E0E001E0E001E0E001E0E001C0E003C0E00380F00700C80600C41C0 083F0017237FA21B>I<01FE000703000C07801C0780380300780000700000F00000F000 00F00000F00000F00000F00000F000007000007800403800401C00800C010007060001F8 0012157E9416>I<0000E0000FE00001E00000E00000E00000E00000E00000E00000E000 00E00000E00000E00000E00000E001F8E00704E00C02E01C01E03800E07800E07000E0F0 00E0F000E0F000E0F000E0F000E0F000E0F000E07000E07800E03800E01801E00C02E007 0CF001F0FE17237EA21B>I<01FC000707000C03801C01C03801C07801E07000E0F000E0 FFFFE0F00000F00000F00000F00000F000007000007800203800201C00400E0080070300 00FC0013157F9416>I<003E0000E30001C7800387800307800700000700000700000700 00070000070000070000070000070000FFF8000700000700000700000700000700000700 000700000700000700000700000700000700000700000700000700000700000700000700 000780007FF000112380A20F>I<00007003F1980E1E181C0E1838070038070078078078 07807807807807803807003807001C0E001E1C0033F0002000002000003000003800003F FE001FFFC00FFFE03000F0600030C00018C00018C00018C000186000306000303800E00E 038003FE0015217F9518>I<0E0000FE00001E00000E00000E00000E00000E00000E0000 0E00000E00000E00000E00000E00000E00000E1F800E60C00E80E00F00700F00700E0070 0E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E0070 0E00700E0070FFE7FF18237FA21B>I<1C003E003E003E001C0000000000000000000000 0000000000000E007E001E000E000E000E000E000E000E000E000E000E000E000E000E00 0E000E000E000E000E00FFC00A227FA10E>I<0E00FE001E000E000E000E000E000E000E 000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E 000E000E000E000E000E000E000E00FFE00B237FA20E>108 D<0E1FC07F00FE60E18380 1E807201C00F003C00E00F003C00E00E003800E00E003800E00E003800E00E003800E00E 003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E00 3800E00E003800E00E003800E00E003800E0FFE3FF8FFE27157F942A>I<0E1F80FE60C0 1E80E00F00700F00700E00700E00700E00700E00700E00700E00700E00700E00700E0070 0E00700E00700E00700E00700E00700E0070FFE7FF18157F941B>I<01FC000707000C01 801800C03800E0700070700070F00078F00078F00078F00078F00078F00078F000787000 707800F03800E01C01C00E038007070001FC0015157F9418>I<0E1F00FE61C00E80600F 00700E00380E003C0E003C0E001E0E001E0E001E0E001E0E001E0E001E0E001E0E003C0E 003C0E00380F00700E80E00E41C00E3F000E00000E00000E00000E00000E00000E00000E 00000E00000E0000FFE000171F7F941B>I<0E3CFE461E8F0F0F0F060F000E000E000E00 0E000E000E000E000E000E000E000E000E000E000F00FFF010157F9413>114 D<0F8830786018C018C008C008E008F0007F003FE00FF001F8003C801C800C800CC00CC0 08E018D0308FC00E157E9413>I<02000200020002000600060006000E001E003E00FFFC 0E000E000E000E000E000E000E000E000E000E000E000E040E040E040E040E040E040708 030801F00E1F7F9E13>I<0E0070FE07F01E00F00E00700E00700E00700E00700E00700E 00700E00700E00700E00700E00700E00700E00700E00700E00F00E00F006017003827800 FC7F18157F941B>III121 D E /Fm 16 119 df73 D<00FE00000303C0000C00E00010007000100038003C003C003E001C003E001E003E 001E0008001E0000001E0000001E0000001E00000FFE0000FC1E0003E01E000F801E001F 001E003E001E003C001E007C001E00F8001E04F8001E04F8001E04F8003E04F8003E0478 003E047C005E043E008F080F0307F003FC03E01E1F7D9E21>97 D<001FC00000F0300001 C00C00078002000F0002000E000F001E001F003C001F003C001F007C00040078000000F8 000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000078 0000007C0000003C0000003C0000801E0000800E0001000F0001000780020001C00C0000 F03000001FC000191F7E9E1D>99 D<003F800000E0E0000380380007003C000E001E001E 001E001C000F003C000F007C000F0078000F8078000780F8000780F8000780FFFFFF80F8 000000F8000000F8000000F8000000F8000000F8000000780000007C0000003C0000003C 0000801E0000800E0001000F0002000700020001C00C0000F03000001FC000191F7E9E1D >101 D<0007E0001C1000383800707C00E07C01E07C01C03803C00003C00003C00003C0 0003C00003C00003C00003C00003C00003C00003C00003C000FFFFC0FFFFC003C00003C0 0003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C0 0003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C0 0007E0007FFF007FFF0016327FB114>I<000000F0007F030801C1C41C0380E81C070070 080F0078001E003C001E003C003E003E003E003E003E003E003E003E003E003E003E003E 001E003C001E003C000F007800070070000780E00009C1C000087F000018000000180000 001800000018000000180000001C0000000E0000000FFFF80007FFFF0003FFFF800E000F C0180001E0300000F070000070E0000038E0000038E0000038E0000038E0000038700000 7070000070380000E01C0001C00700070001C01C00003FE0001E2F7E9F21>I<0F001F80 1F801F801F800F000000000000000000000000000000000000000000000007807F807F80 0F8007800780078007800780078007800780078007800780078007800780078007800780 07800780078007800780078007800FC0FFF8FFF80D307EAF12>105 D<0780FF80FF800F80078007800780078007800780078007800780078007800780078007 800780078007800780078007800780078007800780078007800780078007800780078007 80078007800780078007800780078007800780078007800FC0FFFCFFFC0E327EB112> 108 D<0780FE001FC000FF83078060F000FF8C03C18078000F9001E2003C0007A001E400 3C0007A000F4001E0007C000F8001E0007C000F8001E00078000F0001E00078000F0001E 00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00 078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E0007 8000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E000780 00F0001E00078000F0001E00078000F0001E000FC001F8003F00FFFC1FFF83FFF0FFFC1F FF83FFF0341F7E9E38>I<0780FE0000FF83078000FF8C03C0000F9001E00007A001E000 07A000F00007C000F00007C000F000078000F000078000F000078000F000078000F00007 8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 00F000078000F000078000F000078000F000078000F000078000F000078000F000078000 F000078000F0000FC001F800FFFC1FFF80FFFC1FFF80211F7E9E25>I<001FC00000F078 0001C01C00070007000F0007801E0003C01C0001C03C0001E03C0001E0780000F0780000 F0780000F0F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000 F8780000F07C0001F03C0001E03C0001E01E0003C01E0003C00F00078007800F0001C01C 0000F07800001FC0001D1F7E9E21>I<0781FC0000FF86078000FF8801C0000F9000E000 07A000700007C00078000780003C000780003E000780001E000780001F000780001F0007 80000F000780000F800780000F800780000F800780000F800780000F800780000F800780 000F800780000F000780001F000780001F000780001E000780003E000780003C0007C000 780007A000700007A000E000079803C00007860F00000781F80000078000000007800000 000780000000078000000007800000000780000000078000000007800000000780000000 078000000007800000000FC0000000FFFC000000FFFC000000212D7E9E25>I<0783E0FF 8418FF887C0F907C07A07C07A03807C00007C00007C00007800007800007800007800007 800007800007800007800007800007800007800007800007800007800007800007800007 80000780000780000FC000FFFE00FFFE00161F7E9E19>114 D<00400000400000400000 400000400000C00000C00000C00001C00001C00003C00007C0000FC0001FFFE0FFFFE003 C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003 C00003C00003C00003C00003C01003C01003C01003C01003C01003C01003C01003C01001 C02001E02000E0400078C0001F00142C7FAB19>116 D<078000F000FF801FF000FF801F F0000F8001F000078000F000078000F000078000F000078000F000078000F000078000F0 00078000F000078000F000078000F000078000F000078000F000078000F000078000F000 078000F000078000F000078000F000078000F000078000F000078000F000078001F00007 8001F000078001F000038002F00003C004F00001C008F800007030FF80001FC0FF80211F 7E9E25>II E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: A4 %%EndSetup %%Page: 1 1 1 0 bop 418 328 a Fm(Imp)r(erativ)n(e)22 b(functional)f(programming)447 448 y Fl(Simon)15 b(L)i(P)o(eyton)f(Jones)191 b(Philip)15 b(W)l(adler)388 548 y(Dept)h(of)h(Computing)e(Science,)g(Univ)o(ersit)o (y)e(of)k(Glasgo)o(w)414 606 y(Email:)j Fk({simonpj,)o(wa)o(dle)o(r}@)o (dcs)o(.g)o(lag)o(sow)o(.ac)o(.u)o(k)787 688 y Fl(Octob)q(er)c(1992)700 770 y Fj(This)h(p)n(ap)n(er)f(app)n(e)n(ars)g(in)-56 819 y(A)o(CM)h(Symp)n(osium)g(on)h(Principles)g(Of)g(Pr)n(o)n(gr)n (amming)e(L)n(anguages)i(\(POPL\),)f(Charleston,)h(Jan)f(1993,)15 869 y(pp71-84.)22 b(This)17 b(c)n(opy)g(c)n(orr)n(e)n(cts)f(a)h(few)i (minor)e(typ)n(o)n(gr)n(aphic)n(al)e(err)n(ors)h(in)i(the)g(publishe)n (d)g(version.)-120 990 y Fi(Abstract)-120 1080 y Fh(W)m(e)c(presen)o(t) h(a)f(new)g(mo)q(del,)e(based)j(on)f(monads,)e(for)h(p)q(erform-)-120 1130 y(ing)k(input/output)h(in)g(a)g(non-strict,)h(purely)f(functional) f(lan-)-120 1179 y(guage.)i(It)c(is)f(comp)q(osable,)f(extensible,)i (e\016cien)o(t,)g(requires)g(no)-120 1229 y(extensions)i(to)e(the)i(t)o (yp)q(e)f(system,)g(and)f(extends)i(smo)q(othly)d(to)-120 1279 y(incorp)q(orate)20 b(mixed-language)c(w)o(orking)i(and)h (in-place)f(arra)o(y)-120 1329 y(up)q(dates.)-120 1470 y Fi(1)56 b(In)n(tro)r(duction)-120 1560 y Fh(Input/output)17 b(has)f(alw)o(a)o(ys)f(app)q(eared)i(to)g(b)q(e)f(one)h(of)f(the)h (less)-120 1610 y(satisfactory)g(features)h(of)f(purely)g(functional)f (languages:)24 b(\014t-)-120 1659 y(ting)14 b(action)g(in)o(to)g(the)i (functional)d(paradigm)g(feels)i(lik)o(e)f(\014tting)-120 1709 y(a)f(square)h(blo)q(c)o(k)e(in)o(to)h(a)f(round)i(hole.)j (Closely)c(related)g(di\016cul-)-120 1759 y(ties)g(are)g(asso)q(ciated) h(with)e(p)q(erforming)f(in-place)h(up)q(date)i(op)q(er-)-120 1809 y(ations)d(on)g(arra)o(ys,)h(and)f(calling)f(arbitrary)h(pro)q (cedures)j(written)-120 1859 y(in)f(some)g(other)i(\(p)q(ossibly)f (side-e\013ecting\))h(language.)-120 1938 y(Some)e(mostly-functional)f (languages,)h(suc)o(h)i(as)f(Lisp)g(or)h(SML,)-120 1988 y(deal)e(successfully)i(with)e(input/output)h(b)o(y)f(using)h(side)g (e\013ects.)-120 2038 y(W)m(e)j(fo)q(cus)g(on)g(purely-functional)g (solutions,)g(whic)o(h)g(rule)g(out)-120 2087 y(side)f(e\013ects,)i (for)d(t)o(w)o(o)g(reasons.)25 b(Firstly)m(,)15 b(the)h(absence)i(of)d (side)-120 2137 y(e\013ects)21 b(p)q(ermits)d(unrestricted)j(use)e(of)g (equational)e(reasoning)-120 2187 y(and)c(program)e(transformation.)k (Secondly)m(,)d(w)o(e)h(are)g(in)o(terested)-120 2237 y(in)h Fg(non-strict)k Fh(languages,)c(in)g(whic)o(h)g(the)h(order)h (of)e(ev)n(aluation)-120 2287 y(\(and)j(hence)i(the)f(order)g(of)f(an)o (y)g(side)h(e\013ects\))i(is)d(delib)q(erately)-120 2336 y(unsp)q(eci\014ed;)d(laziness)f(and)f(side)h(e\013ect)g(are)g (fundamen)o(tally)d(in-)-120 2386 y(imical.)-120 2466 y(There)i(is)f(no)g(shortage)g(of)g(prop)q(osals)g(for)f(input/output)h (in)g(lazy)-120 2515 y(functional)i(languages,)g(some)g(of)g(whic)o(h)h (w)o(e)h(surv)o(ey)f(later,)g(but)-120 2565 y(no)k(one)h(solution)e (has)h(b)q(ecome)g(accepted)j(as)d(the)h(consensus.)-120 2615 y(This)h(pap)q(er)i(outlines)e(a)g(new)h(approac)o(h)f(based)h(on) g(monads)-120 2665 y(\(Moggi)8 b([1989];)h(W)m(adler)f([1992];)h(W)m (adler)g([1990]\),)f(with)h(a)g(n)o(um-)-120 2715 y(b)q(er)15 b(of)e(notew)o(orth)o(y)h(features.)-78 2835 y Ff(\017)20 b Fg(It)f(is)f(c)n(omp)n(osable.)32 b Fh(Large)18 b(programs)f(whic)o (h)h(engage)h(in)1034 990 y(I/O)c(are)g(constructed)i(b)o(y)e(gluing)f (together)i(smaller)d(pro-)1034 1040 y(grams)c(that)i(do)g(so)g (\(Section)g(2\).)17 b(Com)o(bined)9 b(with)i(higher-)1034 1089 y(order)25 b(functions)g(and)f(lazy)g(ev)n(aluation,)h(this)g(giv) o(es)f(a)1034 1139 y(highly)16 b(expressiv)o(e)i(medium)c(in)j(whic)o (h)g(to)f(express)j(I/O-)1034 1189 y(p)q(erforming)14 b(computations)h(\(Section)i(2.2\))e(|)g(quite)h(the)1034 1239 y(rev)o(erse)k(of)e(the)h(sen)o(timen)o(t)f(with)g(whic)o(h)h(w)o (e)f(b)q(egan)h(this)1034 1289 y(section.)1034 1352 y(W)m(e)10 b(compare)f(the)i(monadic)d(approac)o(h)i(to)g(I/O)g(with)g(other)1034 1402 y(standard)22 b(approac)o(hes:)35 b(dialogues)21 b(and)h(con)o(tin)o(uations)1034 1452 y(\(Section)12 b(3\),)f(and)h(e\013ect)h(systems)f(and)f(linear)h(t)o(yp)q(es)g (\(Sec-)1034 1502 y(tion)h(7\).)992 1579 y Ff(\017)21 b Fg(It)11 b(is)g(e)n(asily)g(extensible)p Fh(.)17 b(The)10 b(k)o(ey)g(to)g(our)g(implemen)o(tation)1034 1629 y(is)f(to)g(extend)i (Hask)o(ell)e(with)g(a)g(single)g(form)f(that)i(allo)o(ws)e(one)1034 1679 y(to)j(call)g(an)h(an)o(y)f(pro)q(cedure)j(written)e(in)f(the)i (programmi)o(ng)1034 1729 y(language)18 b(C)h(\(Kernighan)h(&)f(Ritc)o (hie)g([1978]\),)f(without)1034 1778 y(losing)e(referen)o(tial)h (transparency)h(\(Section)f(2.3\).)26 b(Using)1034 1828 y(it)14 b(programmers)f(can)i(readily)f(extend)i(the)f(p)q(o)o(w)o(er)g (of)f(the)1034 1878 y(I/O)h(system,)g(b)o(y)g(writing)f(Hask)o(ell)h (functions)h(whic)o(h)f(call)1034 1928 y(op)q(erating)f(system)f(pro)q (cedures.)992 2005 y Ff(\017)21 b Fg(It)f(is)h(e\016cient.)38 b Fh(Our)21 b(Hask)o(ell)e(compiler)h(has)g(C)g(as)h(its)1034 2055 y(target)13 b(co)q(de.)18 b(Giv)o(en)12 b(a)g(Hask)o(ell)g (program)e(p)q(erforming)h(an)1034 2105 y(I/O)j(lo)q(op,)f(the)h (compiler)f(can)h(pro)q(duce)h(C)f(co)q(de)h(whic)o(h)f(is)1034 2155 y(v)o(ery)h(similar)d(to)j(that)g(whic)o(h)f(one)h(w)o(ould)f (write)h(b)o(y)g(hand)1034 2204 y(\(Section)f(4\).)992 2282 y Ff(\017)21 b Fg(Its)j(e\016ciency)h(is)g(achieve)n(d)g(by)h (applying)f(simple)f(pr)n(o-)1034 2332 y(gr)n(am)17 b(tr)n (ansformations)p Fh(.)28 b(W)m(e)17 b(use)h(un)o(b)q(o)o(xed)f(data)g (t)o(yp)q(es)1034 2382 y(\(P)o(eyton)e(Jones)h(&)f(Launc)o(h)o(bury)g ([1991]\))e(to)i(exp)q(ose)g(rep-)1034 2431 y(resen)o(tation)21 b(and)g(order-of-ev)n(aluation)e(detail)i(to)f(co)q(de-)1034 2481 y(impro)o(ving)8 b(transformations,)h(rather)i(than)f(relying)g (on)h Fg(ad)1034 2531 y(ho)n(c)h Fh(optimisations)c(in)h(the)i(co)q(de) f(generator)h(\(Section)f(4.1\).)992 2608 y Ff(\017)21 b Fg(It)16 b(extends)i(uniformly)e(to)h(pr)n(ovide)f(interle)n(ave)n(d) g(I/O)h(and)1034 2658 y(r)n(efer)n(enc)n(e)d(typ)n(es)g Fh(\(Section)g(5\).)992 2736 y Ff(\017)21 b Fg(It)e(extends)i (uniformly)e(to)h(supp)n(ort)f(incr)n(emental)h(arr)n(ays)1034 2785 y(with)e(in-plac)n(e)g(up)n(date)h Fh(\(Section)f(6\).)31 b(Our)18 b(implemen)o(ta-)1034 2835 y(tion)11 b(is)h(e\016cien)o(t)g (enough)g(that)g(w)o(e)g(can)h(de\014ne)g(monolithic)920 2960 y(1)p eop %%Page: 2 2 2 1 bop -37 195 a Fh(Hask)o(ell)14 b(arra)o(y)g(op)q(erations)h(in)f (terms)g(of)g(incremen)o(tal)f(ar-)-37 245 y(ra)o(ys.)22 b(Hudak)15 b(ha)o(v)o(e)g(prop)q(osed)h(a)f(similar)e(metho)q(d)i (based)-37 295 y(on)g(con)o(tin)o(uations.)20 b(Our)15 b(metho)q(d)f(is)g(more)g(general)h(than)-37 345 y(his)k(in)g(the)i (follo)o(wing)16 b(sense:)31 b(monads)18 b(can)i(implemen)o(t)-37 394 y(con)o(tin)o(uations,)13 b(but)h(not)g(the)g(con)o(v)o(erse.)-78 477 y Ff(\017)20 b Fg(It)13 b(is)g(b)n(ase)n(d)g(\(only\))h(on)g(the)f (Hind)r(ley-Milner)f(typ)n(e)i(system)p Fh(.)-37 527 y(Some)d(other)i(prop)q(osals)f(require)h(linear)e(t)o(yp)q(es)i(or)f (existen-)-37 577 y(tial)h(t)o(yp)q(es;)h(ours)g(do)q(es)h(not.)-120 689 y(W)m(e)k(ha)o(v)o(e)h(implem)o(en)o(ted)e(all)g(that)i(w)o(e)g (describ)q(e)h(in)e(the)h(con-)-120 739 y(text)15 b(of)e(a)g(compiler)g (for)g(Hask)o(ell)h(\(Hudak)g(et)g(al.)f([1992]\),)f(with)-120 789 y(the)21 b(exception)g(of)f(the)h(extension)g(to)g(arra)o(ys)f(and) h(reference)-120 838 y(t)o(yp)q(es.)26 b(The)17 b(en)o(tire)g(I/O)g (system)f(pro)o(vided)g(b)o(y)g(our)h(compiler)-120 888 y(is)f(written)h(in)f(Hask)o(ell,)g(using)g(the)h(non-standard)f (extensions)-120 938 y(w)o(e)j(describ)q(e)i(b)q(elo)o(w.)32 b(The)20 b(language's)e(standard)h Fe(Dialogue)-120 988 y Fh(in)o(terface)c(for)e(I/O)i(is)f(supp)q(orted)h(b)o(y)f(pro)o (viding)f(a)h(function)f(to)-120 1038 y(con)o(v)o(ert)18 b(a)g Fe(Dialogue)e Fh(in)o(to)h(our)g Fe(IO)g Fh(monad.)28 b(The)18 b(system)f(is)-120 1087 y(freely)d(a)o(v)n(ailable)e(b)o(y)h (FTP)m(.)-120 1167 y(W)m(e)i(do)g(not)g(claim)e(an)o(y)h(fundamen)o (tal)f(expressiv)o(eness)18 b(or)d(e\016-)-120 1217 y(ciency)g(whic)o (h)g(is)f(not)g(obtainable)g(through)g(existing)h(systems,)-120 1266 y(except)i(where)f(arra)o(ys)g(are)f(concerned.)25 b(Nev)o(ertheless)18 b(w)o(e)d(feel)-120 1316 y(that)h(the)h(en)o(tire) g(system)f(w)o(orks)g(particularly)g(smo)q(othly)e(as)i(a)-120 1366 y(whole,)d(from)g(the)h(standp)q(oin)o(t)g(of)g(b)q(oth)g (programmer)d(and)j(im-)-120 1416 y(plemen)o(tor.)-120 1548 y Fi(2)56 b(Ov)n(erview)-120 1636 y Fh(W)m(e)14 b(need)h(a)f(w)o(a)o(y)f(to)i(reconcile)g Fg(b)n(eing)j Fh(with)c Fg(doing)p Fh(:)19 b(an)14 b(expres-)-120 1686 y(sion)j(in)h(a)f(functional)g(language)f Fg(denotes)22 b Fh(a)c(v)n(alue,)f(while)g(an)-120 1736 y(I/O)h(command)d(should)j Fg(p)n(erform)j Fh(an)d(action.)30 b(W)m(e)18 b(in)o(tegrate)-120 1786 y(these)g(w)o(orlds)f(b)o(y)f(pro)o(viding)g(a)g(t)o(yp)q(e)i Fe(IO)j(a)c Fh(denoting)f(actions)-120 1836 y(that,)d Fg(when)i(p)n(erforme)n(d)p Fh(,)d(ma)o(y)f(do)i(some)g(I/O)g(and)g (then)h(return)-120 1885 y(a)19 b(v)n(alue)f(of)g(t)o(yp)q(e)i Fe(a)p Fh(.)33 b(The)19 b(follo)o(wing)e(pro)o(vide)h(simple)g(Unix-) -120 1935 y(\015a)o(v)o(oured)c(I/O)g(op)q(erations.)-120 2022 y Fe(getcIO)42 b(::)22 b(IO)f(Char)-120 2072 y(putcIO)42 b(::)22 b(Char)f(->)g(IO)g(\(\))-120 2158 y Fh(Here)13 b Fe(getcIO)e Fh(is)h(an)g(action)g(whic)o(h,)f(when)i(p)q(erformed,)f (reads)g(a)-120 2208 y(c)o(haracter)g(from)e(the)h(standard)h(input,)f (and)f(returns)j(that)e(c)o(har-)-120 2258 y(acter;)i(and)f Fe(putcIO)21 b(a)11 b Fh(is)h(an)g(action)g(whic)o(h,)f(when)i(p)q (erformed,)-120 2308 y(writes)18 b(the)g(c)o(haracter)g Fe(a)f Fh(to)g(the)h(standard)g(output.)28 b(Actions)-120 2357 y(whic)o(h)11 b(ha)o(v)o(e)h(nothing)f(in)o(teresting)h(to)f (return,)i(suc)o(h)f(as)g Fe(putcIO)o Fh(,)-120 2407 y(return)i(the)f(empt)o(y)f(tuple)g Fe(\(\))p Fh(,)g(whose)h(t)o(yp)q (e)h(is)e(also)g(written)h Fe(\(\))p Fh(.)-120 2487 y(Notice)k(the)f (distinction)g(b)q(et)o(w)o(een)i(an)e(action)g(and)g(its)g(p)q(erfor-) -120 2536 y(mance.)28 b(Think)17 b(of)g(an)g(action)g(as)h(a)f (\\script",)h(whic)o(h)f(is)g(p)q(er-)-120 2586 y(formed)11 b(b)o(y)h(executing)i(it.)j(Actions)c(themselv)o(es)f(are)h (\014rst-class)-120 2636 y(citizens.)25 b(Ho)o(w,)16 b(then,)h(are)f(actions)g(p)q(erformed?)24 b(In)16 b(our)g(sys-)-120 2686 y(tem,)d(the)i(v)n(alue)f(of)f(the)i(en)o(tire)g(program)e(is)h(a) g(single)g(\(p)q(erhaps)-120 2736 y(large\))e(action,)f(called)g Fe(mainIO)o Fh(,)h(and)f(the)i(program)d(is)h(executed)-120 2785 y(b)o(y)k(p)q(erforming)f(this)h(action.)22 b(F)m(or)15 b(example,)f(the)i(follo)o(wing)c(is)-120 2835 y(a)i(legal)e(Hask)o (ell)i(program.)951 195 y Fe(mainIO)20 b(::)i(IO)f(\(\))951 245 y(mainIO)f(=)i(putcIO)e('!')951 331 y Fh(This)e(is)f(the)i(p)q(oin) o(t)e(at)h(whic)o(h)g(b)q(eing)g(is)f(con)o(v)o(erted)j(to)d(doing:)951 381 y(when)12 b(executed,)i(the)e Fe(putcIO)f Fh(action)h(will)e(b)q(e) j(p)q(erformed,)e(and)951 431 y(write)j(an)g(exclamation)d(mark)i(to)g (the)i(standard)f(output.)951 563 y Fd(2.1)47 b(Comp)q(osing)15 b(I/O)g(op)q(erations)951 646 y Fh(The)h(functions)f(de\014ned)i(ab)q (o)o(v)o(e)e(allo)o(w)f(one)h(to)h(de\014ne)g(a)f(single)951 695 y(action,)f(but)i(ho)o(w)e(can)i(actions)f(b)q(e)h(com)o(bined?)k (F)m(or)15 b(example,)951 745 y(ho)o(w)k(can)g(w)o(e)h(write)f(a)g (program)f(to)h(prin)o(t)g(t)o(w)o(o)g(exclamation)951 795 y(marks?)e(T)m(o)c(do)g(so,)h(w)o(e)g(in)o(tro)q(duce)h(t)o(w)o(o)e (\\glue")g(com)o(binators:)951 882 y Fe(doneIO)20 b(::)i(IO)f(\(\))951 931 y(seqIO)42 b(::)22 b(IO)f(a)h(->)f(IO)g(b)h(->)f(IO)h(b)951 1018 y Fh(The)12 b(comp)q(ound)e(action)h Fe(m)21 b(`seqIO`)g(n)11 b Fh(is)g(p)q(erformed,)g(b)o(y)g(\014rst)951 1068 y(p)q(erforming)h Fe(m)i Fh(and)g(then)g(p)q(erforming)f Fe(n)o Fh(,)h(returning)g (whatev)o(er)951 1117 y Fe(n)i Fh(returns)j(as)d(the)i(result)f(of)f (the)i(comp)q(ound)d(action.)27 b(\(Bac)o(k-)951 1167 y(quotes)18 b(are)g(Hask)o(ell's)f(syn)o(tax)h(for)f(an)h(in\014x)f(op) q(erator.\))31 b(The)951 1217 y(action)18 b Fe(doneIO)e Fh(do)q(es)j(no)f(I/O)h(and)f(returns)h(the)g(unit)f(v)n(alue,)951 1267 y Fe(\(\))o Fh(.)i(T)m(o)13 b(illustrate,)h(here)h(is)f(an)h (action)e Fe(putsIO)o Fh(,)h(whic)o(h)g(puts)h(a)951 1317 y(string)f(to)f(the)i(standard)f(output:)951 1403 y Fe(putsIO)20 b(::)i([Char])e(->)i(IO)f(\(\))951 1453 y(putsIO)f([])109 b(=)21 b(doneIO)951 1503 y(putsIO)f(\(a:as\))h(=)g (putcIO)g(a)43 b(`seqIO`)1299 1553 y(putsIO)21 b(as)951 1639 y Fh(W)m(e)12 b(can)g(no)o(w)g(use)h Fe(putsIO)e Fh(to)h(de\014ne)h(a)f(program)f(whic)o(h)h(prin)o(ts)951 1689 y(\\)p Fe(hello)n Fh(")i(t)o(wice:)951 1775 y Fe(mainIO)20 b(=)i(hello)f(`seqIO`)f(hello)1103 1825 y(where)1147 1875 y(hello)h(=)g(putsIO)g("hello")951 1962 y Fh(This)10 b(example)f(illustrates)h(the)h(distinction)f(b)q(et)o(w)o(een)h(an)f (action)951 2011 y(and)g(its)h(p)q(erformance:)16 b Fe(hello)9 b Fh(is)i(an)f(action)g(whic)o(h)h(happ)q(ens)g(to)951 2061 y(b)q(e)k(p)q(erformed)f(t)o(wice.)20 b(The)14 b(program)f(is)h (precisely)i(equiv)n(alen)o(t)951 2111 y(to)c(one)h(in)f(whic)o(h)h Fe(putsIO)20 b("hello")11 b Fh(is)i(substituted)h(for)e(either)951 2161 y(or)j(b)q(oth)g(of)g(the)g(o)q(ccurrences)j(of)d Fe(hello)o Fh(.)22 b(In)15 b(short,)g(programs)951 2211 y(remain)d(referen)o(tially)i(transparen)o(t.)951 2290 y(In)19 b(general,)i(an)e(action)g(ma)o(y)f(also)h(return)i(a)e(v)n (alue.)34 b(Again,)951 2340 y(there)15 b(are)f(t)o(w)o(o)g(com)o (binators.)i(The)f(\014rst)f(is)g(again)f(trivial:)951 2426 y Fe(unitIO)20 b(::)i(a)f(->)h(IO)f(a)951 2513 y Fh(If)14 b Fe(x)g Fh(is)g(of)g(t)o(yp)q(e)h Fe(a)p Fh(,)f(then)h Fe(unitIO)20 b(x)15 b Fh(denotes)g(the)g(action)f(that,)951 2563 y(when)f(p)q(erformed,)f(do)q(es)i(nothing)e(sa)o(v)o(e)g(return)i Fe(x)p Fh(.)k(The)13 b(second)951 2612 y(com)o(bines)g(t)o(w)o(o)g (actions:)951 2699 y Fe(bindIO)20 b(::)i(IO)f(a)h(->)f(\(a)g(->)h(IO)f (b\))h(->)f(IO)g(b)951 2785 y Fh(If)d Fe(m)j(::)h(IO)f(a)d Fh(and)g Fe(k)k(::)f(a)h(->)f(IO)g(b)e Fh(then)f Fe(m)k(`bindIO`)e(k) 951 2835 y Fh(denotes)15 b(the)f(action)f(that,)h(when)g(p)q(erformed,) f(b)q(eha)o(v)o(es)h(as)g(fol-)920 2960 y(2)p eop %%Page: 3 3 3 2 bop -120 195 a Fh(lo)o(ws:)26 b(\014rst)19 b(p)q(erform)e(action)h Fe(m)p Fh(,)g(yielding)f(a)h(v)n(alue)f Fe(x)h Fh(of)g(t)o(yp)q(e)-120 245 y Fe(a)p Fh(,)c(then)h(p)q(erform)f(action)g Fe(k)22 b(x)p Fh(,)14 b(yielding)f(a)i(v)n(alue)f Fe(y)g Fh(of)g(t)o(yp)q(e)h Fe(b)p Fh(,)-120 295 y(and)g(then)h(return)h(v)n(alue)e Fe(y)p Fh(.)22 b(T)m(o)15 b(illustrate,)g(here)i(is)e(an)h(action)-120 345 y(that)h(ec)o(ho)q(es)i(the)e(standard)h(input)f(to)f(the)i (standard)f(output.)-120 394 y(\(In)11 b(Hask)o(ell,)f Fe(\\x)22 b(->)f(e)11 b Fh(stands)g(for)g(a)f(lam)o(b)q(da)f (abstraction;)j(the)-120 444 y(b)q(o)q(dy)i(of)f(the)i(abstraction)f (extends)h(as)f(far)g(as)g(p)q(ossible.\))-120 531 y Fe(echo)21 b(::)g(IO)h(\(\))-120 580 y(echo)f(=)h(getcIO)e(`bindIO`)g (\\a)i(->)33 630 y(if)f(\(a)g(==)h(eof\))f(then)142 680 y(doneIO)33 730 y(else)142 780 y(putcIO)f(a)i(`seqIO`)142 830 y(echo)-120 916 y Fh(The)15 b(com)o(binators)e Fe(bindIO)h Fh(and)g Fe(unitIO)f Fh(are)i(generalisations)-120 966 y(of)g Fe(seqIO)f Fh(and)h Fe(doneIO)o Fh(.)22 b(Here)16 b(are)g(de\014nitions)f(for)g(the)h(latter)-120 1016 y(in)d(terms)h(of)f(the)i(former:)-120 1102 y Fe(doneIO)151 b(=)44 b(unitIO)20 b(\(\))-120 1152 y(m)i(`seqIO`)e(n)43 b(=)h(m)21 b(`bindIO`)f(\\a)i(->)f(n)-120 1238 y Fh(The)k(com)o (binators)f(ha)o(v)o(e)g(a)h(useful)g(algebra:)39 b Fe(doneIO)23 b Fh(and)-120 1288 y Fe(seqIO)c Fh(form)g(a)g Fg(monoid)p Fh(,)j(while)e Fe(bindIO)f Fh(and)h Fe(unitIO)f Fh(form)-120 1338 y(a)14 b Fg(monad)g Fh(\(Moggi)f([1989];)f(W)m(adler)h([1992];)e (W)m(adler)i([1990]\).)-120 1474 y Fd(2.2)48 b(Imp)q(erativ)o(e)14 b(programming)-120 1557 y Fh(It)d(will)f(not)h(ha)o(v)o(e)g(escap)q(ed) i(the)f(reader's)g(notice)f(that)g(programs)-120 1607 y(written)h(in)f(the)i(monadic)d(st)o(yle)h(lo)q(ok)g(rather)i(similar) c(to)i(imp)q(er-)-120 1657 y(ativ)o(e)20 b(programs.)35 b(F)m(or)20 b(example,)f(the)i Fe(echo)e Fh(program)g(in)g(C)-120 1707 y(migh)o(t)12 b(lo)q(ok)h(something)f(lik)o(e)h(this:)-120 1793 y Fe(echo\(\))21 b({)-120 1843 y(loop:)g(a)g(=)h(getchar\(a\);)11 1893 y(if)f(\(a)h(==)f(eof\))163 1942 y(return;)11 1992 y(else)g({)g(putchar\(a\);)163 2042 y(goto)g(loop;)g(})-120 2092 y(})-120 2178 y Fh(\(Indeed,)c(as)f(w)o(e)g(discuss)h(later,)f (our)g(compiler)f(translates)i(the)-120 2228 y Fe(echo)j Fh(function)h(in)o(to)f(essen)o(tially)h(this)g(C)f(co)q(de.\))40 b(Do)q(es)22 b(the)-120 2278 y(monadic)16 b(st)o(yle)i(force)g(one,)g (in)g(e\013ect,)h(to)f(write)g(a)f(functional)-120 2328 y(facsimile)g(of)h(an)h(imp)q(erativ)o(e)f(program,)g(thereb)o(y)j (losing)d(an)o(y)-120 2378 y(adv)n(an)o(tages)e(of)f(writing)h(in)g(a)g (functional)f(language?)24 b(W)m(e)16 b(b)q(e-)-120 2427 y(liev)o(e)e(not.)-120 2507 y(Firstly)m(,)g(the)i(st)o(yle)f(in)g(whic) o(h)g(one)h(writes)f(the)h(functional)e(pro-)-120 2557 y(gram's)f(in)o(ternal)i(computation)e(is)i(una\013ected.)22 b(F)m(or)15 b(instance,)-120 2606 y(the)d(argumen)o(t)e(to)i Fe(putsIO)e Fh(can)h(b)q(e)h(computed)f(using)g(the)h(usual)-120 2656 y(list-pro)q(cessing)20 b(op)q(erations)f(pro)o(vided)g(b)o(y)f(a) h(functional)f(lan-)-120 2706 y(guage)c(\(list)f(comprehensions,)h (map,)e(app)q(end,)i(and)f(the)i(lik)o(e\).)-120 2785 y(Secondly)m(,)k(the)f(p)q(o)o(w)o(er)h(of)e(higher-order)i(functions)g (and)f(non-)-120 2835 y(strict)f(seman)o(tics)f(can)h(b)q(e)g(used)h (to)e(mak)o(e)f(I/O)i(programmi)o(ng)951 195 y(easier,)c(b)o(y)f (de\014ning)g(new)g(action-manipulating)d(com)o(binators.)951 245 y(F)m(or)17 b(example,)g(the)i(de\014nition)e(of)g Fe(putsIO)g Fh(giv)o(en)g(ab)q(o)o(v)o(e)h(uses)951 295 y(explicit)h(recursion.)36 b(Here)21 b(is)e(an)g(alternativ)o(e)g(w)o (a)o(y)g(to)h(write)951 345 y Fe(putsIO)12 b Fh(whic)o(h)i(do)q(es)h (not)f(do)f(so:)951 431 y Fe(putsIO)20 b(as)i(=)f(seqsIO)g(\(map)g (putcIO)f(as\))951 518 y Fh(The)12 b Fe(map)e Fh(applies)h Fe(putcIO)f Fh(to)i(eac)o(h)g(c)o(haracter)g(in)f(the)h(list)f Fe(as)g Fh(to)951 567 y(pro)q(duce)17 b(a)f(list)g(of)f(actions.)25 b(The)16 b(com)o(binator)f Fe(seqsIO)g Fh(tak)o(es)951 617 y(a)g(list)g(of)f(actions)i(and)f(p)q(erforms)g(them)f(in)h (sequence;)j(that)e(is,)951 667 y(it)d(encapsulates)j(the)f(recursion.) 20 b(It)14 b(is)g(easy)g(to)g(de\014ne)h Fe(seqsIO)951 717 y Fh(th)o(us:)951 803 y Fe(seqsIO)20 b(::)i([IO)f(a])g(->)h(IO)f (\(\))951 853 y(seqsIO)f([])109 b(=)21 b(doneIO)951 903 y(seqsIO)f(\(a:as\))h(=)g(a)h(`seqIO`)e(seqsIO)h(as)951 989 y Fh(or)30 b(ev)o(en,)k(using)c(the)g(standard)h(list-pro)q (cessing)f(function)951 1039 y Fe(foldr)o Fh(,)13 b(th)o(us:)951 1126 y Fe(seqsIO)20 b(=)i(foldr)f(seqIO)f(doneIO)951 1212 y Fh(T)m(o)12 b(tak)o(e)i(another)g(example,)d(here)k(is)e(a)g (function)g(whic)o(h)g(writes)951 1262 y(a)g(giv)o(en)h(n)o(um)o(b)q (er)f(of)g(spaces)i(to)f(the)h(standard)f(output:)951 1348 y Fe(spaceIO)20 b(::)h(Int)h(->)f(IO)g(\(\))951 1398 y(spaceIO)f(n)994 1448 y(=)i(seqsIO)e(\(take)h(n)h(\(repeat)e (\(putcIO)h(')g('\)\)\))951 1535 y Fh(The)32 b(functions)g Fe(take)f Fh(and)h Fe(repeat)f Fh(are)h(standard)h(list-)951 1584 y(pro)q(cessing)15 b(functions)f(\(with)g(nothing)g(to)g(do)g (with)f(I/O\))i(from)951 1634 y(Hask)o(ell's)e(standard)h(prelude.)19 b(The)c(function)e Fe(repeat)g Fh(tak)o(es)h(a)951 1684 y(v)n(alue)g(and)h(returns)i(an)e(in\014nite)g(list)f(eac)o(h)i(of)e (whose)i(elemen)o(ts)951 1734 y(is)h(the)h(giv)o(en)f(v)n(alue.)29 b(The)18 b(function)f Fe(take)g Fh(tak)o(es)h(a)f(pre\014x)i(of)951 1784 y(giv)o(en)13 b(length)h(from)e(a)i(list.)951 1863 y(These)23 b(necessarily)h(small)c(examples)h(could)h(easily)g(b)q(e)h (pro-)951 1913 y(grammed)13 b(with)i(explicit)h(recursion)g(without)g (signi\014can)o(t)f(loss)951 1963 y(of)g(clarit)o(y)g(\(or)h(ev)o(en)g (a)g(gain!\).)22 b(The)16 b(p)q(oin)o(t)g(w)o(e)g(are)g(making)d(is)951 2012 y(that)e(it)g(is)g(easy)h(for)f(the)h(programmer)d(to)i(de\014ne)i (new)e(\\glue")g(to)951 2062 y(com)o(bine)i(actions)h(in)g(just)g(the)h (w)o(a)o(y)e(whic)o(h)h(is)g(suitable)h(for)e(the)951 2112 y(program)d(b)q(eing)j(written.)18 b(It's)12 b(a)g(bit)g(lik)o(e)f (b)q(eing)i(able)f(to)g(de\014ne)951 2162 y(y)o(our)h(o)o(wn)h(con)o (trol)g(structures)i(in)d(an)h(imp)q(erativ)o(e)f(language.)951 2281 y Fd(2.3)47 b(Calling)14 b(C)j(directly)951 2361 y Fh(Since)g(the)g(\\primitiv)o(e")d(functions)j Fe(putcIO)o Fh(,)g Fe(getcIO)n Fh(,)g(and)g(so)951 2411 y(on)e(m)o(ust)g (ultimately)e(b)q(e)j(implemen)o(ted)d(b)o(y)i(a)h(call)e(to)i(the)g (un-)951 2461 y(derlying)j(op)q(erating)h(system,)g(it)g(is)g(natural)f (to)h(pro)o(vide)f(the)951 2510 y(abilit)o(y)12 b(to)h(call)g Fg(any)h Fh(op)q(erating)f(system)h(function)f(directly)m(.)18 b(T)m(o)951 2560 y(ac)o(hiev)o(e)h(this,)h(w)o(e)f(pro)o(vide)g(a)g (new)h(form)d(of)h(expression,)j(the)951 2610 y Fe(ccall)o Fh(,)13 b(whose)i(general)f(form)e(is:)1271 2698 y Fe(ccall)h Fg(pr)n(o)n(c)j(e)1504 2704 y Fc(1)1548 2698 y Fb(:)7 b(:)g(:)19 b Fg(e)1636 2704 y Fc(n)951 2785 y Fh(Here,)c Fg(pr)n(o)n(c)h Fh(is)e(the)g(name)f(of)h(a)g(C)g(pro)q(cedure,)h(and)f Fg(e)1807 2791 y Fc(1)1831 2785 y Fh(,)f Fb(:)7 b(:)g(:)e Fh(,)14 b Fg(e)1956 2791 y Fc(n)951 2835 y Fh(are)k(the)h(parameters)f (to)g(b)q(e)g(passed)h(to)f(it.)30 b(This)18 b(expression)920 2960 y(3)p eop %%Page: 4 4 4 3 bop -120 195 a Fh(is)15 b(an)g(action,)f(with)h(t)o(yp)q(e)g Fe(IO)22 b(Int)o Fh(;)15 b(when)h(p)q(erformed,)e(it)h(calls)-120 245 y(the)f(named)f(pro)q(cedure,)i(and)f(deliv)o(ers)g(its)g(result)h (as)e(the)i(v)n(alue)-120 295 y(of)i(the)i(action.)30 b(Here,)20 b(for)e(example,)f(are)h(the)h(de\014nitions)f(of)-120 345 y Fe(getcIO)13 b Fh(and)g Fe(putcIO)o Fh(:)-120 431 y Fe(putcIO)21 b(a)g(=)h(ccall)e(putchar)h(a)-120 481 y(getcIO)64 b(=)22 b(ccall)e(getchar)-120 567 y Fh(These)e Fe(ccall)o Fh(s)g(directly)f(in)o(v)o(ok)o(e)g(the)g(system-pro)o (vided)g(func-)-120 617 y(tions;)12 b(no)g(further)h(run)o(time)e(supp) q(ort)h(is)g(necessary)m(.)19 b(Using)12 b(this)-120 667 y(single)19 b(primitiv)o(e)f(allo)o(ws)g(us)i(to)f(implemen)o(t)e (our)j(en)o(tire)g(I/O)-120 717 y(system)14 b(in)f(Hask)o(ell.)-120 796 y(W)m(e)i(de\014ne)h Fe(ccall)f Fh(to)g(b)q(e)h(a)f(language)g Fg(c)n(onstruct)g Fh(rather)h(than)-120 846 y(simply)c(a)h(function)h (b)q(ecause:)-78 964 y Ff(\017)20 b Fh(The)12 b(\014rst)h(\\argumen)o (t")d(m)o(ust)h(b)q(e)h(the)h(literal)e(name)f(of)i(the)-37 1014 y(C)j(pro)q(cedures)j(to)d(b)q(e)h(called,)e(and)h(not)h(\(sa)o (y\))f(an)g(expres-)-37 1064 y(sion)d(whic)o(h)g(ev)n(aluates)g(to)g(a) g(string)h(whic)o(h)f(is)g(the)h(name)e(of)-37 1114 y(the)h(function.) 17 b(T)o(yp)q(e)12 b(information)d(alone)i(cannot)h(express)-37 1163 y(this.)-78 1258 y Ff(\017)20 b Fh(Di\013eren)o(t)15 b(C)f(pro)q(cedures)i(tak)o(e)e(di\013eren)o(t)h(n)o(um)o(b)q(ers)f(of) f(ar-)-37 1307 y(gumen)o(ts,)21 b(and)f(some)g(tak)o(e)h(a)f(v)n (ariable)g(n)o(um)o(b)q(er)f(of)h(ar-)-37 1357 y(gumen)o(ts.)30 b(\(It)18 b(w)o(ould)g(b)q(e)h(p)q(ossible)f(to)g(c)o(hec)o(k)h(the)g (t)o(yp)q(e-)-37 1407 y(correctness)e(of)d(the)h(C)f(call)g(b)o(y)g (reading)g(the)h(signature)g(of)-37 1457 y(the)g(C)e(pro)q(cedure,)j (but)e(w)o(e)g(do)g(not)f(at)h(presen)o(t)i(do)d(so.\))-78 1551 y Ff(\017)20 b Fh(Di\013eren)o(t)g(C)f(pro)q(cedures)i(tak)o(e)e (argumen)o(ts)g(of)f(di\013eren)o(t)-37 1601 y(t)o(yp)q(es)j(and)g (sizes.)39 b(\(A)o(t)20 b(presen)o(t,)k(w)o(e)c(only)g(p)q(ermit)g(the) -37 1651 y(argumen)o(ts)e(to)g(b)q(e)h(of)e(base)i(t)o(yp)q(es,)h(suc)o (h)f(as)f Fe(Char)o Fh(,)h Fe(Int)p Fh(,)-37 1701 y Fe(Float)o Fh(,)13 b Fe(Double)f Fh(and)h(so)g(on,)g(though)g(w)o(e)g(are)h(w)o (orking)e(on)-37 1750 y(extensions)19 b(whic)o(h)f(allo)o(w)e (structured)k(argumen)o(ts)d(to)h(b)q(e)-37 1800 y(built.\))-120 1918 y(T)m(reating)d Fe(ccall)g Fh(as)g(a)g(construct)j(allo)o(ws)c (these)j(v)n(ariations)d(to)-120 1968 y(b)q(e)h(accomo)q(dated)e (without)g(di\016cult)o(y)m(.)-120 2107 y Fi(3)56 b(Comparison)18 b(with)h(other)f(I/O)g(st)n(yles)-120 2196 y Fh(In)13 b(this)g(section)g(w)o(e)g(brie\015y)g(compare)g(our)f(approac)o(h)h (with)g(t)o(w)o(o)-120 2246 y(other)i(p)q(opular)e(ones,)h(dialogues)f (and)h(con)o(tin)o(uations.)-120 2369 y Fd(3.1)48 b(Dialogues)-120 2450 y Fh(The)10 b(I/O)g(system)g(sp)q(eci\014ed)i(for)d(the)i(Hask)o (ell)e(language)g(\(Hudak)-120 2500 y(et)i(al.)e([1992]\))f(is)i(based) h(on)f Fg(dialo)n(gues)p Fh(,)h(also)f(called)g Fg(lazy)h(str)n(e)n (ams)-120 2549 y Fh(\(Dw)o(elly)k([1989];)g(O'Donnell)f([1985];)h (Thompson)g([1989]\).)22 b(In)-120 2599 y(Hask)o(ell,)16 b(the)h(v)n(alue)e(of)h(the)g(program)f(has)h(t)o(yp)q(e)h Fe(Dialogue)n Fh(,)f(a)-120 2649 y(synon)o(ym)10 b(for)i(a)f(function)h (b)q(et)o(w)o(een)h(a)f(list)f(of)g(I/O)h(resp)q(onses)i(to)-120 2699 y(a)g(list)f(of)g(I/O)h(requests:)-120 2785 y Fe(type)21 b(Dialogue)f(=)i([Response])d(->)j([Request])-120 2835 y(main)f(::)g(Dialogue)951 195 y(Request)d Fh(and)h Fe(Response)f Fh(are)i(algebraic)f(data)h(t)o(yp)q(es)g(whic)o(h)951 245 y(em)o(b)q(o)q(dy)12 b(all)g(the)h(p)q(ossible)h(I/O)f(op)q (erations)g(and)g(their)g(results,)951 295 y(resp)q(ectiv)o(ely:)951 381 y Fe(data)21 b(Request)f(=)i(Putc)f(Char)g(|)g(Getc)951 431 y(data)g(Response)f(=)h(OK)h(|)f(OKCh)g(Char)951 518 y Fh(\(F)m(or)c(the)i(purp)q(oses)g(of)e(exp)q(osition)h(w)o(e)g (ha)o(v)o(e)g(grossly)g(simpli-)951 567 y(\014ed)h(these)h(data)f(t)o (yp)q(es)h(compared)e(with)h(those)g(in)g(standard)951 617 y(Hask)o(ell.\))27 b(A)17 b(system)f(\\wrapp)q(er)i(program")d(rep) q(eatedly)j(gets)951 667 y(the)j(next)g(request)h(from)d(the)i(list)f (of)g(requests)j(returned)f(b)o(y)951 717 y Fe(main)o Fh(,)g(in)o(terprets)g(and)e(p)q(erforms)h(it,)g(and)g(attac)o(hes)g (the)g(re-)951 767 y(sp)q(onse)e(to)e(the)h(end)g(of)f(the)i(resp)q (onse)g(list)e(to)h(whic)o(h)f Fe(main)g Fh(is)951 816 y(applied.)951 896 y(Here,)h(for)e(example,)g(is)g(the)i Fe(echo)e Fh(program)f(written)i(using)f(a)951 946 y Fe(Dialogue)n Fh(.)29 b(\(In)18 b(Hask)o(ell)f Fe(xs!!n)g Fh(extracts)i(the)f Fe(n)p Fh('th)f(elemen)o(t)951 995 y(from)12 b(the)i(list)g Fe(xs)o Fh(.\))951 1082 y Fe(echo)21 b(::)g(Dialogue)951 1132 y(echo)g(resps)f(=)i(Getc)f(:)1234 1181 y(if)g(\(a)h(==)f(eof\))1234 1231 y(then)g([])1234 1281 y(else)g(Putc)g(a)h(:)1343 1331 y(echo)f(\(drop)g(2)g(resps\))1190 1381 y(where)1234 1431 y(OKCh)g(a)h(=)f(resps!!1)951 1517 y Fh(The)d(di\016culties)f(with)h(this)g(programmi)o(ng)d(st)o (yle)j(are)g(all)e(to)q(o)951 1567 y(ob)o(vious,)g(and)h(ha)o(v)o(e)g (b)q(een)h(w)o(ell)f(rehearsed)i(elsewhere)g(\(P)o(erry)951 1617 y([1991]\):)992 1723 y Ff(\017)i Fh(It)f(is)f(easy)h(to)g(extract) h(the)f(wrong)g(elemen)o(t)f(of)g(the)h(re-)1034 1773 y(sp)q(onses,)15 b(a)e Fg(synchr)n(onisation)i(err)n(or)p Fh(.)i(This)d(ma)o(y)d(sho)o(w)j(up)1034 1822 y(in)d(a)h(v)n(ariet)o(y) g(of)f(w)o(a)o(ys.)17 b(If)12 b(the)h(\\)p Fe(2)o Fh(")f(in)g(the)h(ab) q(o)o(v)o(e)f(program)1034 1872 y(w)o(as)17 b(erroneously)i(written)f (as)g(\\)p Fe(1)p Fh(")f(the)i(program)d(w)o(ould)1034 1922 y(fail)c(with)h(a)g(pattern-mathing)g(error)h(in)f Fe(getCharIO)n Fh(;)h(if)e(it)1034 1972 y(w)o(ere)j(written)f(\\)p Fe(3)p Fh(")f(it)h(w)o(ould)f(deadlo)q(c)o(k.)992 2052 y Ff(\017)21 b Fh(The)11 b Fe(Response)e Fh(data)h(t)o(yp)q(e)h(has)g (to)f(con)o(tain)g(a)g(constructor)1034 2101 y(for)17 b(ev)o(ery)i(p)q(ossible)g(resp)q(onse)h(to)d(ev)o(ery)i(request.)32 b(Ev)o(en)1034 2151 y(though)9 b Fe(Putc)f Fh(ma)o(y)g(only)h(ev)o(er)h (return)g(a)f(resp)q(onse)j Fe(OKChar)n Fh(,)1034 2201 y(the)k(pattern-matc)o(hing)e(p)q(erformed)h(b)o(y)g Fe(get)f Fh(has)i(to)f(tak)o(e)1034 2251 y(accoun)o(t)f(of)f(all)g (these)i(other)g(resp)q(onses.)992 2331 y Ff(\017)21 b Fh(Ev)o(en)h(more)e(seriously)m(,)j(the)f(st)o(yle)g(is)f(not)h(comp) q(osable:)1034 2380 y(there)g(is)f(no)f(direct)i(w)o(a)o(y)e(to)h(tak)o (e)f(t)o(w)o(o)h(v)n(alues)f(of)g(t)o(yp)q(e)1034 2430 y Fe(Dialogue)12 b Fh(and)j(com)o(bine)e(them)g(to)h(mak)o(e)f(a)h (larger)h(v)n(alue)1034 2480 y(of)e(t)o(yp)q(e)h Fe(Dialogue)f Fh(\(try)h(it!\).)951 2586 y(Dialogues)9 b(and)i(the)g Fe(IO)g Fh(monad)e(ha)o(v)o(e)h(equal)h(expressiv)o(e)h(p)q(o)o(w)o (er,)951 2636 y(as)17 b(Figure)h(1)g(demonstrates,)g(b)o(y)g(using)f Fe(Dialogues)f Fh(to)h(em)o(u-)951 2686 y(late)e(the)h Fe(IO)f Fh(monad,)e(and)i(vice)h(v)o(ersa.)23 b(The)15 b(function)h Fe(dToIO)n Fh(,)951 2736 y(whic)o(h)i(em)o(ulates)g Fe(Dialogue)o Fh(s)h(in)f(terms)g(of)g Fe(IO)h Fh(is)f(rather)i(cu-)951 2785 y(rious,)j(b)q(ecause)h(it)d(in)o(v)o(olv)o(es)g(applying)g(the)h (single)g(dialogue)951 2835 y Fe(d)i Fh(to)h(b)q(oth)g(b)q(ottom)f(\()p Ff(?)p Fh(\))g(and)h(\(later\))g(to)g(the)g(\\real")f(list)920 2960 y(4)p eop %%Page: 5 5 5 4 bop -120 155 1020 2 v -120 1774 2 1620 v 241 169 311 2 v 241 229 2 60 v 256 207 a Fe(Dialogue)12 b Fh(to)i Fe(IO)p 551 229 V 241 231 311 2 v -92 271 a(dToIO)21 b(::)g(Dialogue)f(->)i(IO)f(\(\))-92 321 y(dToIO)g(d)-70 370 y(=)g(case)g(\(d)h(bottom\))e(of)-5 420 y([])109 b(->)21 b(doneIO)-5 470 y(\(q:qs\))g(->)g(doReq)g(q)109 b(`bindIO`)42 b(\\r)21 b(->)213 520 y(dToIO)g(\(\\rs)g(->)g(tail)g(\(d) h(\(r:rs\)\)\))-92 620 y(bottom)f(::)g(a)-92 669 y(bottom)g(=)g(error)g ("Should)f(never)h(be)g(evaluated")-92 769 y(doReq)g(::)g(Request)f(->) i(IO)f(Response)-92 819 y(doReq)g(\(GetChar)f(f\))-70 869 y(=)h(getCharIO)f(f)i(`bindIO`)e(\(\\c)h(->)-27 918 y(unitIO)g(\(OKChar)f(c\)\))-92 968 y(doReq)h(\(PutChar)f(f)h(c\))-70 1018 y(=)g(putCharIO)f(f)i(c)f(`seqIO`)g(unitIO)f(OK)p 241 1103 V 241 1163 2 60 v 256 1141 a(IO)13 b Fh(to)h Fe(Dialogue)p 551 1163 V 241 1165 311 2 v -92 1205 a(type)21 b(IO)g(a)h(=)43 b([Response])126 1254 y(->)21 b(\(a,)g([Request],)f ([Response]\))-92 1354 y(ioToD)h(::)g(IO)g(\(\))h(->)f(Dialogue)-92 1404 y(ioToD)g(action)f(=)i(\\rs)f(->)g(case)g(\(action)g(rs\))g(of)475 1454 y(\(_,)g(qs,)g(_\))g(->)h(qs)-92 1553 y(unitIO)f(v)g(=)h(\\rs)f (->)g(\(v,)g([],)h(rs\))-92 1603 y(bindIO)f(op)g(fop)-70 1653 y(=)g(\\rs)h(->)f(let)g(\(v1,)g(qs1,)g(rs1\))g(=)h(op)f(rs)213 1703 y(\(v2,)g(qs2,)g(rs2\))g(=)h(fop)f(v1)g(rs1)126 1753 y(in)43 b(\(v2,)21 b(qs1++qs2,)f(rs2\))p 898 1774 2 1620 v -120 1776 1020 2 v -39 1850 a Fh(Figure)14 b(1:)j(Con)o(v)o (erting)d(b)q(et)o(w)o(een)h Fe(Dialogue)d Fh(and)i Fe(IO)-120 1994 y Fh(of)j(resp)q(onses)j(\(Hudak)e(&)f(Sundaresh)i([1989];)e(P)o (eyton)h(Jones)-120 2044 y([1988]\).)28 b(This)18 b(causes)h(b)q(oth)f (duplicated)g(w)o(ork)g(and)g(a)f(space)-120 2093 y(leak,)c(but)g(no)g (more)g(e\016cien)o(t)h(purely-functional)e(em)o(ulation)f(is)-120 2143 y(kno)o(wn.)17 b(The)d(rev)o(erse)i(function,)c Fe(ioToD)h Fh(do)q(es)h(not)f(su\013er)i(from)-120 2193 y(these)j(problems,)e(and)h(this)g(asymmetry)e(is)h(the)i(main)d (reason)-120 2243 y(that)f Fe(Dialogue)o Fh(s)g(are)h(sp)q(eci\014ed)g (as)g(primitiv)o(e)d(in)h(Hask)o(ell.)19 b(W)m(e)-120 2293 y(return)c(to)f(this)g(this)g(matter)f(in)g(Section)i(5.3.)-120 2418 y Fd(3.2)48 b(Con)o(tin)o(uati)o(on)o(s)-120 2500 y Fh(The)11 b(con)o(tin)o(uation-st)o(yle)g(I/O)g(mo)q(del)e(\(Gordon)i ([1989];)e(Hudak)-120 2549 y(&)17 b(Sundaresh)h([1989];)e(Karlsson)h ([1982];)f(P)o(erry)i([1991]\))d(pro-)-120 2599 y(vides)e(primitiv)o(e) e(I/O)j(op)q(erations)f(whic)o(h)g(tak)o(e)g(as)h(one)f(of)g(their)-120 2649 y(argumen)o(ts)e(a)g(con)o(tin)o(uation)f(whic)o(h)i(sa)o(ys)f (what)g(to)h(do)f(after)h(the)-120 2699 y(I/O)i(op)q(eration)g(is)f(p)q (erformed:)-120 2785 y Fe(main)21 b(::)g(Result)-120 2835 y(putcC)g(::)g(Char)g(->)g(Result)g(->)g(Result)951 195 y(getcC)g(::)g(\(Char)g(->)g(Result\))f(->)i(Result)951 245 y(doneC)f(::)g(Result)951 331 y Fh(Using)13 b(these)i(primitiv)o (es,)d(the)i Fe(echo)e Fh(program)g(can)i(b)q(e)g(written)951 381 y(as)g(follo)o(ws:)951 468 y Fe(echo)21 b(::)g(Result)g(->)g (Result)951 518 y(echo)g(c)g(=)h(getcC)42 b(\(\\a)22 b(->)1147 567 y(if)f(\(a)h(==)f(eof\))g(then)1147 617 y(then)g(c)1147 667 y(else)g(putcC)g(a)g(\(echo)g(c\)\))951 753 y Fh(Since)12 b(w)o(e)g(migh)o(t)e(w)o(an)o(t)i(to)f(do)h(some)f (more)g(I/O)h(after)g(the)h(ec)o(ho-)951 803 y(ing)g(is)g(completed,)g (w)o(e)h(m)o(ust)f(pro)o(vide)g Fe(echo)g Fh(with)g(a)h(con)o(tin)o (ua-)951 853 y(tion,)d Fe(c)p Fh(,)g(to)g(express)j(what)d(to)h(do)f (when)h Fe(echo)f Fh(is)g(\014nished.)18 b(This)951 903 y(\\extra)i(argumen)o(t")f(is)g(required)i(for)f(ev)o(ery)h(I/O-p)q (erforming)951 953 y(function)16 b(if)h(it)f(is)h(to)g(b)q(e)h(comp)q (osable,)e(a)h(p)q(erv)n(asiv)o(e)g(and)g(tire-)951 1003 y(some)c(feature.)951 1082 y(The)g(ab)q(o)o(v)o(e)g(presen)o(tation)h (of)f(con)o(tin)o(uation-st)o(yle)f(I/O)h(is)g(a)g(lit-)951 1132 y(tle)h(di\013eren)o(t)h(from)e(those)i(cited)g(ab)q(o)o(v)o(e.)k (In)14 b(all)f(those)i(descrip-)951 1181 y(tions,)e Fe(Result)g Fh(is)h(an)g(algebraic)f(data)h(t)o(yp)q(e,)g(with)g(a)g(construc-)951 1231 y(tor)e(for)f(eac)o(h)i(primitiv)o(e)d(I/O)h(op)q(eration.)18 b(As)12 b(with)g Fe(Dialogue)n Fh(s,)951 1281 y(execution)i(is)g(driv)o (en)f(b)o(y)h(a)f(\\wrapp)q(er")h(program,)d(whic)o(h)j(ev)n(al-)951 1331 y(uates)f Fe(main)p Fh(,)f(p)q(erforms)h(the)g(op)q(eration)g (indicated)g(b)o(y)f(the)i(con-)951 1381 y(structor,)e(and)d(applies)h (the)h(con)o(tin)o(uation)e(inside)h(the)h(construc-)951 1431 y(tor)19 b(to)h(the)g(result.)35 b(This)20 b(approac)o(h)f(has)h (the)g(disadv)n(an)o(tage)951 1480 y(that)g(it)f(requires)i(existen)o (tial)e(t)o(yp)q(es)i(if)e(p)q(olymorphic)f(op)q(era-)951 1530 y(tions,)12 b(suc)o(h)i(as)f(those)h(w)o(e)g(in)o(tro)q(duce)f (later)h(in)e(Section)i(5.3,)e(are)951 1580 y(to)h(b)q(e)i(supp)q (orted.)951 1659 y(An)f(ob)o(vious)g(impro)o(v)o(emen)o(t,)e(whic)o(h)i (w)o(e)h(ha)o(v)o(e)g(not)f(seen)i(previ-)951 1709 y(ously)h (suggested,)j(is)e(to)g(implemen)o(t)d(the)k(primitiv)o(e)c(con)o(tin)o (u-)951 1759 y(ation)i(op)q(erations)h(\(suc)o(h)h(as)g Fe(putcC)o Fh(,)f Fe(getcC)f Fh(and)h Fe(doneC)o Fh(\))h(di-)951 1809 y(rectly)m(,)j(making)c(the)j Fe(Result)e Fh(t)o(yp)q(e)i(an)g (abstract)g(data)f(t)o(yp)q(e)951 1859 y(with)e(no)h(op)q(erations)g (de\014ned)h(on)f(it)f(other)i(than)f(the)g(primi-)951 1908 y(tiv)o(es)14 b(themselv)o(es.)k(This)c(solv)o(es)g(the)g (problem.)951 1988 y(Con)o(tin)o(uations)e(are)i(easily)f(em)o(ulated)g (b)o(y)g(the)i Fe(IO)e Fh(monad,)e(and)951 2038 y(vice)16 b(v)o(ersa,)h(as)f(Figure)h(2)f(sho)o(ws.)25 b(The)17 b(comparison)e(b)q(et)o(w)o(een)951 2087 y(the)22 b(monadic)e(and)i (con)o(tin)o(uation)f(approac)o(h)h(is)g(further)h(ex-)951 2137 y(plored)14 b(in)f(Section)h(6.)951 2269 y Fi(4)56 b(Implem)o(en)n(ting)16 b(monadic)h(I/O)951 2357 y Fh(So)e(far)h(w)o(e) g(ha)o(v)o(e)g(sho)o(wn)g(that)g(an)g(en)o(tire)g(I/O)g(system)g(can)g (b)q(e)951 2407 y(expressed)f(in)d(terms)h(of)f Fe(ccall)o Fh(,)g Fe(bindIO)o Fh(,)g(and)h Fe(unitIO)o Fh(,)f(and)h(of)951 2457 y(course)k(the)f Fe(IO)g Fh(t)o(yp)q(e)g(itself.)24 b(Ho)o(w)15 b(are)h(these)i(com)o(binators)c(to)951 2507 y(b)q(e)j(implemen)o(ted?)23 b(One)17 b(p)q(ossibilit)o(y)e(is)i(to)f (build)f(them)h(in)g(as)951 2557 y(primitiv)o(es,)c(but)i(it)g(turns)g (out)g(to)g(b)q(e)h(b)q(oth)f(simpler)f(and)h(more)951 2606 y(e\016cien)o(t)g(to)g(implemen)o(t)d(all)i(except)i Fe(ccall)e Fh(in)g(Hask)o(ell.)951 2686 y(The)f(idea)f(is)h(that)g(an)f (action)h(of)f(t)o(yp)q(e)h Fe(IO)21 b(a)12 b Fh(is)f(implemen)o(ted)f (as)951 2736 y(a)15 b Fg(function)p Fh(,)h(whic)o(h)f(tak)o(es)h(as)f (its)g(input)h(a)f(v)n(alue)f(represen)o(ting)951 2785 y(the)h(en)o(tire)h(curren)o(t)g(state)f(of)f(the)i(w)o(orld,)e(and)g (returns)i(a)f(pair,)951 2835 y(consisting)h(of)f(\(a)h(v)n(alue)f (represen)o(ting\))j(the)e(new)g(state)h(of)e(the)920 2960 y(5)p eop %%Page: 6 6 6 5 bop -120 155 1020 2 v -120 1421 2 1267 v 202 169 391 2 v 202 223 2 54 v 216 210 a Fh(Con)o(tin)o(uations)13 b(to)g Fe(IO)p 590 223 V 202 225 391 2 v -92 267 a(type)21 b(Result)f(=)i(IO)f(\(\))-92 367 y(cToIO)g(::)g(Result)g(->)g(IO)g (\(\))-92 417 y(cToIO)g(r)g(=)h(r)-92 516 y(putCharC)e(::)h(File)g(->)h (Char)f(->)g(Result)g(->)g(Result)-92 566 y(putCharC)f(f)i(c)f(k)h(=)f (putCharIO)f(f)i(c)g(`seqIO`)e(k)-92 666 y(getCharC)g(::)h(File)g(->)h (Char)104 715 y(->)f(\(Char)g(->)h(Result\))e(->)h(Result)-92 765 y(getCharC)f(f)i(k)f(=)h(getCharIO)e(f)h(`thenIO`)g(k)p 206 854 383 2 v 206 907 2 54 v 220 894 a Fh(IO)14 b(to)g(con)o(tin)o (uations)p 586 907 V 206 909 383 2 v -92 951 a Fe(type)21 b(IO)g(a)h(=)f(\(a)h(->)f(Result\))g(->)g(Result)-92 1051 y(ioToC)g(::)g(IO)g(\(\))h(->)f(Result)-92 1101 y(ioToC)g(action)f(=)i(action)e(\(\\)i(\(\))f(->)h(nopC\))-92 1201 y(unitIO)f(v)130 b(=)22 b(\\k)f(->)g(k)h(v)-92 1250 y(bindIO)f(op)g(fop)g(=)h(\\k)f(->)g(op)h(\(\\a)f(->)g(fop)h(a)f(k\)) -92 1350 y(putCharIO)f(f)h(c)h(=)g(\\k)f(->)g(putCharC)g(f)g(c)h(\(k)f (\(\)\))-92 1400 y(getCharIO)f(f)65 b(=)22 b(\\k)f(->)g(getCharC)g(f)g (\(\\c)g(->)h(k)f(c\))p 898 1421 2 1267 v -120 1423 1020 2 v -73 1498 a Fh(Figure)14 b(2:)j(Con)o(v)o(erting)d(b)q(et)o(w)o(een) h(con)o(tin)o(uations)e(and)h Fe(IO)-120 1650 y Fh(w)o(orld,)f(and)h (the)g(result)h(of)e(t)o(yp)q(e)h Fe(a)p Fh(:)-120 1736 y Fe(type)21 b(IO)g(a)87 b(=)22 b(World)f(->)g(IORes)g(a)-120 1786 y(data)g(IORes)g(a)g(=)h(MkIORes)e(a)i(World)-120 1872 y Fh(The)14 b Fe(type)e Fh(declaration)h(in)o(tro)q(duces)h(a)f(t) o(yp)q(e)h(synom)o(ym)c(for)j Fe(IO)p Fh(,)-120 1922 y(and)i(the)h(auxiliary)e(algebraic)h(datat)o(yp)q(e)h Fe(IORes)e Fh(simply)f(pairs)-120 1972 y(the)k(result)h(with)e(the)h (new)g(w)o(orld.)26 b(Recall)16 b(that)h(the)g(v)n(alue)f(of)-120 2022 y(the)h(en)o(tire)f(program)e(is)i(of)f(t)o(yp)q(e)i Fe(IO)k(\(\))p Fh(.)j(The)16 b(t)o(yp)q(e)h Fe(World)d Fh(is)-120 2072 y(abstract,)k(with)e(only)g(one)h(op)q(eration)g (de\014ned)h(on)e(it,)h(namely)-120 2121 y Fe(ccall)o Fh(.)j(Conceptually)m(,)14 b(the)h(program)e(is)h(executed)j(b)o(y)d (apply-)-120 2171 y(ing)j Fe(main)h Fh(to)g(a)f(v)n(alue)h(of)f(t)o(yp) q(e)i Fe(World)e Fh(represen)o(ting)j(curren)o(t)-120 2221 y(state)e(of)f(the)g(w)o(orld,)g(extracting)h(the)f(resulting)h Fe(World)e Fh(v)n(alue)-120 2271 y(from)11 b(the)j Fe(MkIORes)d Fh(constructor,)k(and)d(applying)g(an)o(y)g(c)o(hanges)-120 2321 y(em)o(b)q(o)q(died)h(therein)i(to)e(the)i(real)f(w)o(orld.)-120 2400 y(If)e(implemen)o(ted)f(literally)m(,)f(suc)o(h)k(a)e(system)h(w)o (ould)e(b)q(e)j(un)o(w)o(ork-)-120 2450 y(ably)g(exp)q(ensiv)o(e.)22 b(The)16 b(k)o(ey)e(to)h(making)e(it)h(c)o(heap)i(is)e Fg(to)i(ensur)n(e)-120 2500 y(that)h(the)h(world)e(state)h(is)g(use)n (d)h(in)f(a)h(single-thr)n(e)n(ade)n(d)f(way,)g(so)-120 2549 y(that)c(I/O)f(op)n(er)n(ations)h(c)n(an)g(b)n(e)g(applie)n(d)g (imme)n(diately)f(to)g(the)h(r)n(e)n(al)-120 2599 y(world)p Fh(.)26 b(One)18 b(w)o(a)o(y)e(to)h(ensure)h(this)f(w)o(ould)f(b)q(e)i (to)f(do)f(a)h(global)-120 2649 y(analysis)c(of)g(the)i(program.)h(A)e (m)o(uc)o(h)f(simpler)f(w)o(a)o(y)h(is)h(to)g(mak)o(e)-120 2699 y Fe(IO)c Fh(in)o(to)g(an)g(abstract)h(data)f(t)o(yp)q(e)h(whic)o (h)g(encapsulates)g(the)h(data)-120 2749 y(t)o(yp)q(es)21 b Fe(IO)e Fh(and)h Fe(IORes)o Fh(,)g(and)g(the)g(com)o(binators)f Fe(bindIO)f Fh(and)-120 2799 y Fe(unitIO)o Fh(.)g(Here)d(are)f (suitable)g(de\014nitions)g(for)f(the)i(latter:)951 195 y Fe(unitIO)20 b(a)i(w)65 b(=)22 b(MkIORes)e(a)i(w)951 245 y(bindIO)e(m)i(k)f(w)h(=)g(case)f(\(m)g(w\))g(of)1321 295 y(MkIORes)g(a)g(w')h(->)f(k)h(a)f(w')951 381 y Fh(Notice)14 b(that)g Fe(bindIO)e Fh(and)i Fe(unitIO)f Fh(carefully)g(a)o(v)o(oid)g (duplicat-)951 431 y(ing)20 b(the)h(w)o(orld.)37 b(Pro)o(vided)21 b(that)g(the)g(primitiv)o(e)d Fe(ccall)i Fh(ac-)951 481 y(tions)15 b(are)h(com)o(bined)e(only)g(with)h(these)i(com)o(binators,) d Fg(we)h(c)n(an)951 531 y(guar)n(ante)n(e)i(that)g(the)g Fe(ccall)o Fg(s)g(wil)r(l)e(b)n(e)i(linke)n(d)g(in)g(a)g(single,)g (lin-)951 580 y(e)n(ar)c(chain)p Fh(,)h(connected)g(b)o(y)f(data)g(dep) q(endencies)i(in)e(whic)o(h)f(eac)o(h)951 630 y Fe(ccall)d Fh(consumes)i(the)g(w)o(orld)e(state)j(pro)q(duced)f(b)o(y)g(the)g (previous)951 680 y(one.)28 b(In)17 b(turn)h(this)f(means)f(that)h(the) h Fe(ccall)e Fh(op)q(erations)i(can)951 730 y(up)q(date)c(the)h(real)f (w)o(orld)f(\\in)g(place".)951 872 y Fd(4.1)47 b(Implemen)o(tin)o(g)13 b Fe(ccall)951 956 y Fh(So)19 b(m)o(uc)o(h)g(for)g(the)h(com)o (binators.)34 b(All)19 b(that)g(remains)g(is)g(the)951 1006 y(implemen)o(tati)o(on)12 b(of)i Fe(ccall)o Fh(.)21 b(The)15 b(only)f(complication)e(here)k(is)951 1056 y(that)h(w)o(e)g(m) o(ust)g(arrange)g(to)g(ev)n(aluate)g(the)h(argumen)o(ts)e(to)h(the)951 1106 y Fe(ccall)c Fh(b)q(efore)h(passing)g(them)f(to)h(C.)951 1185 y(This)h(is)f(v)o(ery)i(similar)c(to)j(the)h(argumen)o(t)d(ev)n (aluation)h(required)951 1235 y(for)f(built-in)f(functions)h(suc)o(h)h (as)f(addition,)f(for)h(whic)o(h)g(w)o(e)g(ha)o(v)o(e)951 1284 y(earlier)21 b(dev)o(elop)q(ed)g(the)h(idea)e(of)h Fg(unb)n(oxe)n(d)h(data)g(typ)n(es)f Fh(\(P)o(ey-)951 1334 y(ton)11 b(Jones)i(&)f(Launc)o(h)o(bury)g([1991]\).)j(These)e (allo)o(w)d(represen)o(ta-)951 1384 y(tion)g(and)i(order-of-ev)n (aluation)d(information)g(to)i(b)q(e)h(exp)q(osed)g(to)951 1434 y(co)q(de-impro)o(ving)k(transformations.)28 b(F)m(or)18 b(example,)f(consider)951 1484 y(the)d(expression)i Fe(x+x)d Fh(where)i Fe(x)f Fh(is)g(of)f(t)o(yp)q(e)i Fe(Int)o Fh(.)j(The)d(impro)o(v)o(e-)951 1534 y(men)o(t)c(w)o(e)i(w)o(an)o(t)f (to)g(express)i(is)e(that)g Fe(x)g Fh(need)i(only)d(b)q(e)i(ev)n (aluated)951 1583 y(once.)951 1663 y(The)j(k)o(ey)g(idea)f(is)h(to)f (de\014ne)i(the)f(t)o(yp)q(e)g Fe(Int)f Fh(\(whic)o(h)h(is)g(usually) 951 1713 y(primitiv)o(e\))11 b(as)i(a)f(structured)j(algebraic)e(data)f (t)o(yp)q(e)i(with)f(a)f(sin-)951 1762 y(gle)h(constructor,)i Fe(MkInt)o Fh(,)f(lik)o(e)f(this:)951 1849 y Fe(data)21 b(Int)g(=)g(MkInt)g(Int#)951 1935 y Fh(A)12 b(v)n(alue)f(of)g(t)o(yp)q (e)h Fe(Int)f Fh(is)h(represen)o(ted)j(b)o(y)c(a)h(p)q(oin)o(ter)g(to)f (a)h(heap-)951 1985 y(allo)q(cated)e(ob)r(ject,)h(whic)o(h)g(ma)o(y)d (either)k(b)q(e)f(an)f(unev)n(aluated)g(sus-)951 2035 y(p)q(ension,)16 b(or)h(a)e Fe(MkInt)h Fh(constructor)h(con)o(taining)e (the)i(mac)o(hine)951 2085 y(bit-pattern)i(for)g(the)h(in)o(teger.)34 b(This)19 b(bit-pattern)h(is)f(of)f(t)o(yp)q(e)951 2135 y Fe(Int#)o Fh(.)951 2214 y(No)o(w)g(that)i Fe(Int)e Fh(is)h(giv)o(en)f(structure,)k(w)o(e)e(can)f(mak)o(e)e(explicit)951 2264 y(the)i(ev)n(aluation)f(p)q(erformed)g(b)o(y)h Fe(+)p Fh(,)g(b)o(y)g(giving)e(the)j(follo)o(wing)951 2314 y(de\014nition,)h (whic)o(h)f(expresses)j Fe(+)d Fh(in)g(terms)g(of)f(the)i(primitiv)o(e) 951 2363 y(mac)o(hine)12 b(op)q(eration)i Fe(+#)p Fh(:)951 2450 y Fe(a)21 b(+)h(b)g(=)f(case)g(a)h(of)1147 2500 y(MkInt)f(a#)g(->)1169 2549 y(case)g(b)g(of)1190 2599 y(MkInt)g(b#)h(->)1212 2649 y(MkInt)f(\(a#)g(+#)h(b#\))951 2736 y Fh(Inlining)c(this)h(de\014nition)g(of)f Fe(+)h Fh(in)g(the)h(expression)h Fe(x+x)o Fh(,)f(and)951 2785 y(p)q(erforming)15 b(simple,)g(routine)i(simpli\014cations,)d(giv)o(es) i(the)h(fol-)951 2835 y(lo)o(wing,)12 b(in)h(whic)o(h)h Fe(x)f Fh(is)h(ev)n(aluated)g(only)f(once:)920 2960 y(6)p eop %%Page: 7 7 7 6 bop -120 195 a Fe(case)21 b(x)h(of)-76 245 y(MkInt)e(x#)i(->)f (MkInt)g(\(x#)g(+#)g(x#\))-120 331 y Fh(\(Un)o(b)q(o)o(xed)k(t)o(yp)q (es)g(and)g Fe(ccall)e Fh(are)i(not)g(part)g(of)f(standard)-120 381 y(Hask)o(ell.)17 b(They)12 b(are)g(mainly)d(used)k(in)o(ternally)e (in)g(our)h(compiler,)-120 431 y(though)j(w)o(e)h(do)f(also)g(mak)o(e)f (them)h(a)o(v)n(ailable)e(to)i(programmers)-120 481 y(as)f(a)g (non-standard)g(extension.\))-120 560 y(W)m(e)e(apply)g(exactly)h(the)g (same)f(ideas)h(to)g Fe(ccall)o Fh(.)k(In)c(particular,)-120 610 y(instead)j(of)f(implemen)o(ting)d Fe(ccall)j Fh(directly)m(,)g(w)o (e)h(unfold)e(ev)o(ery)-120 660 y(use)20 b(of)e Fe(ccall)f Fh(to)i(mak)o(e)e(the)j(argumen)o(t)d(ev)n(aluation)h(explicit)-120 710 y(b)q(efore)h(using)e(the)i(truly)f(primitiv)o(e)e(op)q(eration)i Fe(ccall#)n Fh(.)31 b(F)m(or)-120 759 y(example,)16 b(the)h(uses)h(of)e Fe(ccall)g Fh(in)g(the)i(de\014nitions)e(of)g Fe(putcIO)-120 809 y Fh(and)d Fe(getcIO)f Fh(giv)o(en)g(ab)q(o)o(v)o(e)h(\(Section)h (2.3\),)e(are)h(unfolded)g(th)o(us:)-120 896 y Fe(putcIO)21 b(a)g(=)h(\\w)f(->)-76 946 y(case)g(a)g(of)-55 995 y(MkChar)g(a#)g(->) -33 1045 y(case)g(\(ccall#)f(putchar)h(a#)g(w\))h(of)-11 1095 y(MkIORes#)e(n#)h(w')h(->)f(MkIORes)g(\(\))g(w')-120 1195 y(getcIO)g(=)g(\\w)h(->)-76 1244 y(case)f(\(ccall#)f(getchar)g (w\))i(of)-33 1294 y(MkIORes#)e(n#)i(w')f(->)11 1344 y(MkIORes)f(\(MkChar)g(n#\))i(w')-120 1431 y Fh(Lik)o(e)16 b Fe(Int)p Fh(,)g(the)h(t)o(yp)q(e)g Fe(Char)f Fh(is)h(implem)o(en)o (ted)e(as)h(an)h(algebraic)-120 1480 y(data)d(t)o(yp)q(e)g(th)o(us:) -120 1567 y Fe(data)21 b(Char)g(=)h(MkChar)e(Int#)-120 1653 y Fh(The)f(outer)h Fe(case)e Fh(expression)i(of)e Fe(putcIO)o Fh(,)i(therefore,)h(ev)n(alu-)-120 1703 y(ates)e Fe(a)e Fh(and)h(extracts)i(the)e(bit-pattern)g Fe(a#)p Fh(,)h(whic)o(h)e(is)h(passed)-120 1753 y(to)e Fe(ccall#)o Fh(.)24 b(The)16 b(inner)g Fe(case)f Fh(expression)i(ev)n(aluates)g (the)f(ex-)-120 1803 y(pression)g Fe(\(ccall#)k(putchar)h(a#)g(w\))p Fh(,)15 b(whic)o(h)g(returns)h(a)f(pair,)-120 1853 y(constructed)k(b)o (y)e Fe(MkIORes#)n Fh(,)g(consisting)g(of)f(the)h(v)n(alue)f Fe(n#)h Fh(re-)-120 1902 y(turned)h(b)o(y)f(the)g(C)g(pro)q(cedure)i Fe(putchar)d Fh(\(whic)o(h)h(is)g(ignored\),)-120 1952 y(and)d(a)f(new)i(w)o(orld)e Fe(w')g Fh(\(whic)o(h)h(is)g(returned\).) -120 2032 y(In)g(the)h(case)h(of)e Fe(getcIO)n Fh(,)g(the)h(\(primitiv) o(e,)d(un)o(b)q(o)o(xed\))j(v)n(alue)f Fe(n#)-120 2081 y Fh(returned)20 b(b)o(y)f Fe(getchar)e Fh(is)i(not)f(ignored)h(as)g (it)f(is)h(in)f Fe(putcIO)o Fh(;)-120 2131 y(rather)k(it)e(is)h(wrapp)q (ed)g(in)f(a)h Fe(MkChar)e Fh(constructor,)24 b(and)d(re-)-120 2181 y(turned)15 b(as)f(part)g(of)f(the)i(result.)-120 2260 y(The)d(di\013erences)h(b)q(et)o(w)o(een)g Fe(ccall)d Fh(and)h Fe(ccall#)f Fh(are)i(as)f(follo)o(ws.)-120 2310 y(Firstly)m(,)k Fe(ccall#)f Fh(tak)o(es)j(only)d(un)o(b)q(o)o(xed)i (argumen)o(ts,)f(ready)h(to)-120 2360 y(call)d(C)h(directly)m(.)-120 2439 y(Secondly)m(,)g(it)f(returns)j(a)e(pair)g(built)f(with)h Fe(MkIORes#)n Fh(,)g(con)o(tain-)-120 2489 y(ing)e(an)g(un)o(b)q(o)o (xed)h(in)o(teger)g(result)h(direct)f(from)e(the)i(C)g(call.)k(The)-120 2539 y Fe(IORes#)c Fh(t)o(yp)q(e)h(is)g(v)o(ery)g(similar)d(to)j Fe(IORes)o Fh(:)-120 2625 y Fe(data)21 b(IORes#)g(=)g(MkIORes#)f(Int#)h (World)-120 2712 y Fh(\()p Fe(IORes)13 b Fh(and)h Fe(IORes#)f Fh(are)i(distinct)f(t)o(yp)q(es,)h(b)q(ecause)h(while)d(our)-120 2762 y(extended)18 b(t)o(yp)q(e)f(system)f(recognises)i(un)o(b)q(o)o (xed)f(t)o(yp)q(es,)g(it)f(do)q(es)-120 2812 y(not)10 b(p)q(ermit)f(p)q(olymorphic)g(t)o(yp)q(e)h(constructors,)j(suc)o(h)e (as)f Fe(IORes)o Fh(,)951 195 y(to)j(b)q(e)i(instan)o(tiated)f(at)f(an) h(un)o(b)q(o)o(xed)g(t)o(yp)q(e,)g(suc)o(h)h(as)f Fe(Int#)o Fh(.\))951 274 y(Thirdly)m(,)h(the)j Fe(ccall#)d Fh(primitiv)o(e)f(is)j (recognised)h(b)o(y)e(the)h(co)q(de)951 324 y(generator)h(and)f (expanded)h(to)f(an)g(actual)g(call)g(to)g(C.)f(Sp)q(eci\014-)951 374 y(cally)m(,)c(the)i(expression:)951 461 y Fe(case)21 b(\(ccall#)f(proc)h(a#)g(b#)h(c#)f(w\))h(of)994 510 y(MkIORes#)e(n#)i (w')f(->)h(...)951 597 y Fh(generates)15 b(the)g(C)f(statemen)o(t)951 683 y Fe(n#)21 b(=)h(proc\(a#,b#,c#\);)951 733 y(...)951 820 y Fg(This)c(simple)g(tr)n(anslation)g(is)g(al)r(l)g(that)h(the)f(c) n(o)n(de)h(gener)n(ator)f(is)951 869 y(r)n(e)n(quir)n(e)n(d)11 b(to)h(do)p Fh(.)18 b(The)11 b(rest)h(is)f(done)g(b)o(y)g(generic)h (program)e(trans-)951 919 y(formations;)f(that)h(is,)g(transformations) f(whic)o(h)h(are)g(not)g(sp)q(eci\014c)951 969 y(to)i(I/O)g(or)h(ev)o (en)g(to)f(un)o(b)q(o)o(xing)g(\(P)o(eyton)h(Jones)g(&)g(Launc)o(h)o (bury)951 1019 y([1991]\).)951 1172 y Fd(4.2)47 b(Where)16 b(has)f(the)g(w)o(orld)f(gone?)951 1258 y Fh(But)21 b(what)f(has)h(b)q (ecome)f(of)g(the)h(w)o(orld)e(v)n(alues)i(in)f(the)h(\014nal)951 1308 y(C)c(co)q(de?)30 b(The)18 b(w)o(orld)f(v)n(alue)g(manipulated)f (b)o(y)h(the)i(program)951 1358 y Fg(r)n(epr)n(esents)9 b Fh(the)h(curren)o(t)h(state)f(of)f(the)h(real)f(w)o(orld,)g(but)h (since)g(the)951 1408 y(real)g(w)o(orld)g(is)g(up)q(dated)h(\\in)f (place")g(the)h(w)o(orld)f(v)n(alue)g(carries)h(no)951 1457 y(useful)f(information.)k(Hence)d(w)o(e)g(simply)d(arrange)i(that) g(no)g(co)q(de)951 1507 y(is)16 b(ev)o(er)h(generated)g(to)f(mo)o(v)o (e)f(v)n(alues)g(of)h(t)o(yp)q(e)g Fe(World)o Fh(.)25 b(This)16 b(is)951 1557 y(easy)g(to)g(do,)g(as)h(t)o(yp)q(e)f (information)e(is)i(preserv)o(ed)i(throughout)951 1607 y(the)i(compiler.)35 b(In)20 b(particular,)h(the)f(w)o(orld)g(is)g(nev) o(er)g(loaded)951 1657 y(in)o(to)12 b(a)i(register,)g(stored)g(in)f(a)g (data)h(structure,)h(or)e(passed)i(to)e(C)951 1707 y(pro)q(cedure)j (calls.)951 1786 y(Is)10 b(it)g(p)q(ossible,)h(then,)g(to)f(disp)q (ense)i(with)e(the)h(w)o(orld)e(in)h(the)h(func-)951 1836 y(tional)j(part)h(of)f(the)i(implemen)o(tation)c(as)j(w)o(ell?)21 b(F)m(or)15 b(example,)951 1885 y(can)k(w)o(e)g(de\014ne)g(the)h Fe(IORes)d Fh(t)o(yp)q(e)i(and)g Fe(bindIO)e Fh(com)o(binators)951 1935 y(lik)o(e)c(this?)951 2022 y Fe(data)21 b(IORes)f(a)i(=)g(MkIORes) e(a)951 2072 y(bindIO)g(m)i(k)f(w)h(=)g(case)f(\(m)g(w\))g(of)1321 2121 y(MkIORes)g(a)g(->)h(k)f(a)h(w)951 2208 y Fh(No,)12 b(w)o(e)h(cannot!)18 b(T)m(o)12 b(see)i(this,)e(supp)q(ose)i(that)f Fe(bindIO)f Fh(w)o(as)g(ap-)951 2258 y(plied)e(to)h(a)f(function)h Fe(k)g Fh(whic)o(h)f(discarded)i(its)f(argumen)o(t.)16 b(Then,)951 2308 y(if)d Fe(bindIO)g Fh(w)o(as)h(unfolded,)f(and)h(the)g (expression)i Fe(\(k)21 b(r)g(w\))14 b Fh(w)o(as)951 2357 y(simpli\014ed,)f Fg(ther)n(e)i(would)g(b)n(e)h(no)h(r)n(emaining) e(data)h(dep)n(endency)951 2407 y(to)f(for)n(c)n(e)f(the)i(c)n(al)r(l)e (of)h Fe(k)g Fg(to)h(o)n(c)n(cur)f(after)f(that)h(of)g Fe(m)p Fh(.)k(A)14 b(compiler)951 2457 y(w)o(ould)d(b)q(e)i(free)h(to)e (call)g(them)f(in)h(either)i(order,)f(whic)o(h)f(destro)o(ys)951 2507 y(the)i(I/O)g(sequencing.)951 2586 y(T)m(o)19 b(reiterate,)j(the)f (w)o(orld)e(is)h(there)h(to)f(form)e(a)i(linear)f(c)o(hain)951 2636 y(of)g(data)h(dep)q(endencies)j(b)q(et)o(w)o(een)e(successiv)o(e)i Fe(ccall)o Fh(s.)37 b(It)20 b(is)951 2686 y(quite)g(safe)h(to)f(exp)q (ose)i(the)f(represen)o(tation)h(of)d(the)i Fe(IO)f Fh(t)o(yp)q(e)951 2736 y(to)15 b(co)q(de-impro)o(ving)e(transformations,)g(b)q(ecause)k (the)f(c)o(hain)f(of)951 2785 y(data)9 b(dep)q(endencies)j(will)c(prev) o(en)o(t)j(an)o(y)e(transformations)f(whic)o(h)951 2835 y(reorder)16 b(the)g Fe(ccall)o Fh(s.)21 b(Once)16 b(the)g(co)q(de)g (generator)f(is)g(reac)o(hed,)920 2960 y(7)p eop %%Page: 8 8 8 7 bop -120 195 a Fh(though,)13 b(the)h(w)o(ork)e(of)h(the)h(w)o(orld) f(v)n(alues)f(is)i(done,)f(so)g(it)g(is)g(safe)-120 245 y(to)h(generate)h(no)f(co)q(de)g(for)g(them.)-120 444 y Fd(4.3)48 b Fe(echo)15 b Fd(revisited)-120 537 y Fh(The)e(implem)o (en)o(tation)c(w)o(e)k(ha)o(v)o(e)f(outlined)g(is)g(certainly)g (simple,)-120 587 y(but)j(is)f(it)g(e\016cien)o(t?)20 b(P)o(erhaps)15 b(surprisingly)m(,)e(the)i(answ)o(er)g(is)f(an)-120 637 y(emphatic)k(y)o(es.)36 b(The)20 b(reason)g(for)f(this)h(is)f(that) g(b)q(ecause)j(the)-120 687 y(com)o(binators)13 b(are)h(written)h(in)e (Hask)o(ell,)h Fg(the)h(c)n(ompiler)f(c)n(an)i(un-)-120 737 y(fold)c(them)h(at)f(al)r(l)g(their)g(c)n(al)r(l)g(sites)p Fh(;)f(that)h(is,)f(p)q(erform)f(pro)q(cedure)-120 786 y(inlining.)-120 866 y(V)m(ery)g(little)f(sp)q(ecial-purp)q(ose)i(co)q (de)f(is)g(required)g(in)f(the)i(compiler)-120 916 y(to)k(ac)o(hiev)o (e)g(this)g(e\013ect)h(|)f(essen)o(tially)f(all)g(that)h(is)g(required) g(is)-120 965 y(that)j(the)h(Hask)o(ell)f(de\014nitions)g(of)f Fe(bindIO)o Fh(,)i Fe(unitIO)o Fh(,)f Fe(putcIO)-120 1015 y Fh(and)f(so)g(on,)g(b)q(e)h(unfolded)f(b)o(y)g(the)g(compiler.) 27 b(In)17 b(con)o(trast,)h(if)-120 1065 y Fe(bindIO)12 b Fh(w)o(ere)j(primitiv)o(e,)c(then)j(ev)o(ery)g(call)f(to)g Fe(bindIO)g Fh(will)f(re-)-120 1115 y(quire)j(the)h(construction)g(of)f (t)o(w)o(o)f(heap-allo)q(cated)h(closures)i(for)-120 1165 y(its)d(t)o(w)o(o)g(argumen)o(ts.)k(Ev)o(en)d(if)e Fe(bindIO)g Fh(itself)h(to)q(ok)g(no)g(time)e(at)-120 1214 y(all,)g(this)i(w)o(ould)f(b)q(e)i(a)e(hea)o(vy)h(cost.)-120 1294 y(T)m(o)19 b(illustrate)g(the)h(e\013ectiv)o(eness)j(of)c(the)h (approac)o(h)g(w)o(e)f(ha)o(v)o(e)-120 1344 y(outlined,)11 b(w)o(e)g(return)i(to)e(the)g Fe(echo)g Fh(program)e(of)i(Section)g (2.1.)17 b(If)-120 1393 y(w)o(e)12 b(tak)o(e)f(the)h(co)q(de)h(there,)g (unfold)d(the)i(calls)g(of)f Fe(seqIO)n Fh(,)h Fe(doneIO)o Fh(,)-120 1443 y Fe(eof)o Fh(,)i Fe(putcIO)e Fh(and)i Fe(getcIO)o Fh(,)f(and)h(do)f(some)g(simpli\014cation,)e(w)o(e)-120 1493 y(get)j(the)h(follo)o(wing:)-120 1579 y Fe(echo)21 b(=)h(\\w)f(->)-98 1629 y(case)g(\(ccall#)f(getchar)g(w\))i(of)-76 1679 y(MkIORes#)e(a#)h(w1)g(->)-55 1729 y(case)g(\(a#)h(==#)f(eof#\))f (of)-33 1779 y(T#)i(->)f(MkIORes)f(\(\))i(w1)-33 1829 y(F#)g(->)f(case)g(\(ccall#)f(putchar)h(a#)g(w1\))g(of)98 1878 y(MkIORes#)f(n#)h(w2)h(->)f(echo)g(w2)-120 1965 y Fh(When)e(this)g(is)f(compiled)g(using)g(the)h(simple)f(co)q (de-generator)-120 2015 y(describ)q(ed,)d(the)g(follo)o(wing)c(C)j(is)g (pro)q(duced:)-120 2101 y Fe(echo\(\))21 b({)-76 2151 y(int)g(a;)-76 2201 y(a)g(=)h(getchar\(\);)-76 2251 y(if)f(\(a)g(==)h (eof\))f({)54 2300 y(retVal)g(=)g(unitTuple;)54 2350 y(RETURN;)-76 2400 y(})g(else)g({)54 2450 y(putchar\(a\);)54 2500 y(JUMP\()g(echo)g(\);)-120 2549 y(})h(})-120 2636 y Fh(\()p Fe(JUMP)11 b Fh(and)g Fe(RETURN)f Fh(are)i(artefacts)g(of)f (our)g(use)h(of)f(C)g(as)h(a)f(target)-120 2686 y(\\mac)o(hine)e(co)q (de")i(\(P)o(eyton)f(Jones)i([1992]\).)j(They)10 b(expand)h(only)-120 2736 y(to)18 b(a)f(mac)o(hine)f(instruction)i(or)g(t)o(w)o(o.\))29 b(This)18 b(is)f(v)o(ery)h(close)g(to)-120 2785 y(the)h(C)f(one)g(w)o (ould)f(write)h(b)o(y)g(hand!)30 b(W)m(e)18 b(kno)o(w)f(of)h(no)g (other)-120 2835 y(implemen)o(tatio)o(n)11 b(of)j(I/O)f(with)h(b)q (etter)i(e\016ciency)m(.)951 195 y Fd(4.4)47 b(A)16 b(con)o(tin)o(uati) o(on-p)o(assi)o(ng)d(implemen)n(tat)o(ion)951 280 y Fh(Lik)o(e)d(most)f (abstract)i(data)f(t)o(yp)q(es,)h(there)h(is)e(more)f(than)h(one)h(w)o (a)o(y)951 329 y(to)e(implemen)o(t)e Fe(IO)p Fh(.)16 b(In)10 b(particular,)g(it)f(is)g(p)q(ossible)h(to)g(implemen)o(t)951 379 y(the)17 b Fe(IO)g Fh(abstract)h(t)o(yp)q(e)f(using)g(a)g(con)o (tin)o(uation-passing)e(st)o(yle.)951 429 y(The)h(t)o(yp)q(e)h Fe(IO)22 b(a)15 b Fh(is)i(represen)o(ted)i(b)o(y)d(a)g(function)f(whic) o(h)i(tak)o(es)951 479 y(a)c(con)o(tin)o(uation)f(exp)q(ecting)i(a)f(v) n(alue)f(of)h(t)o(yp)q(e)h Fe(a)p Fh(,)e(and)h(returns)i(a)951 529 y(v)n(alue)e(of)g(the)i(opaque)f(t)o(yp)q(e)g Fe(Result)o Fh(.)951 615 y Fe(type)21 b(IO)g(a)h(=)f(\(a)h(->)f(Result\))f(->)i (Result)951 702 y Fh(It)14 b(is)f(easy)i(to)f(implem)o(en)o(t)e Fe(bindIO)g Fh(and)i Fe(unitIO)o Fh(:)951 788 y Fe(bindIO)20 b(m)i(k)f(cont)g(=)h(m)g(\(\\a)f(->)g(k)h(a)f(cont\))951 838 y(unitIO)f(r)i(cont)f(=)g(cont)g(r)951 925 y Fh(What)10 b(is)h(there)i(to)e(c)o(ho)q(ose)g(b)q(et)o(w)o(een)i(these)f(this)f (represen)o(tation)951 974 y(of)17 b(the)i Fe(IO)f Fh(t)o(yp)q(e)h(and) f(the)h(one)f(w)o(e)g(describ)q(ed)i(initially)c(\(Sec-)951 1024 y(tion)g(4\)?)26 b(The)17 b(ma)r(jor)d(tradeo\013)k(seems)e(to)h (b)q(e)g(this:)23 b(with)16 b(the)951 1074 y(con)o(tin)o (uation-passing)d(represen)o(tation,)i(ev)o(ery)g(use)g(of)e Fe(bindIO)951 1124 y Fh(\(ev)o(en)i(if)f(unfolded\))h(requires)h(the)f (construction)h(of)e(one)h(heap-)951 1174 y(allo)q(cated)h(con)o(tin)o (uation.)25 b(In)16 b(con)o(trast,)h(the)g(implemen)o(tation)951 1223 y(w)o(e)e(describ)q(ed)h(earlier)f(k)o(eeps)h(the)f(con)o(tin)o (uation)f(implicitly)d(on)951 1273 y(the)j(stac)o(k,)g(whic)o(h)g(is)g (sligh)o(tly)e(c)o(heap)q(er)j(in)f(our)g(system.)951 1353 y(There)24 b(is)g(a)f(cost)h(to)g(pa)o(y)f(for)g(the)h(earlier)g (represen)o(tation,)951 1402 y(namely)9 b(that)i(a)g(hea)o(vily)f (left-sk)o(ew)o(ed)h(comp)q(osition)e(of)i Fe(bindIO)o Fh(s)951 1452 y(can)19 b(cause)i(the)f(stac)o(k)g(to)f(gro)o(w)g (rather)h(large.)34 b(In)20 b(con)o(trast,)951 1502 y(the)12 b(con)o(tin)o(uation-passing)e(implemen)o(tation)e(ma)o(y)i(use)i(a)g (lot)f(of)951 1552 y(heap)16 b(for)g(suc)o(h)h(a)f(comp)q(osition,)e (but)j(its)f(stac)o(k)g(usage)h(is)f(con-)951 1602 y(stan)o(t.)951 1681 y(The)e(main)d(p)q(oin)o(t)i(is)h(that)g(the)g(implemen)o(tor)d (is)i(free)i(to)e(c)o(ho)q(ose)951 1731 y(the)h(represen)o(tation)h (for)e Fe(IO)g Fh(based)h(only)f(on)h(considerations)g(of)951 1781 y(e\016ciency)g(and)g(resource)i(usage;)d(the)h(c)o(hoice)h(mak)o (es)d(no)i(di\013er-)951 1830 y(ence)h(to)f(the)g(in)o(terface)h(seen)g (b)o(y)f(the)g(programmer.)951 2006 y Fi(5)56 b(Extensions)17 b(to)i(the)f Fk(IO)g Fi(monad)951 2103 y Fd(5.1)47 b(Dela)o(y)o(ed)14 b(I/O)951 2188 y Fh(So)20 b(far)f(all)g(I/O)h(op)q(erations)g(ha)o(v)o (e)g(b)q(een)h(strictly)g(sequenced)951 2237 y(along)16 b(a)i(single)f(\\trunk".)30 b(Sometimes,)16 b(though,)i(suc)o(h)g (strict)951 2287 y(sequencing)j(is)g(un)o(w)o(an)o(ted.)38 b(F)m(or)20 b(example,)g(almost)f(all)g(lazy)951 2337 y(functional-language)25 b(I/O)j(systems)g(pro)o(vide)f(a)h Fe(readFile)951 2387 y Fh(primitiv)o(e,)17 b(whic)o(h)i(returns)h(the)g (en)o(tire)f(con)o(ten)o(ts)h(of)f(a)f(sp)q(eci-)951 2437 y(\014ed)e(\014le)f(as)h(a)f(list)g(of)g(c)o(haracters.)25 b(It)16 b(is)f(often)h(vital)e(that)i(this)951 2487 y(primitiv)o(e)e (should)j(ha)o(v)o(e)g(lazy)f(seman)o(tics;)h(that)g(is,)g(the)g (\014le)g(is)951 2536 y(op)q(ened,)e(but)h(only)e(actually)g(read)h (when)h(the)f(resulting)h(list)e(is)951 2586 y(ev)n(aluated.)19 b(The)c(relativ)o(e)f(ordering)h(of)e(other)i(I/O)g(op)q(erations)951 2636 y(and)k(the)g(reading)g(of)g(the)h(\014le)f(is)g(imma)o(terial)d (\(pro)o(vided)j(the)951 2686 y(\014le)13 b(is)g(not)h(sim)o (ultaneously)d(written\).)18 b(This)c(lazy)f(read)g(is)h(usu-)951 2736 y(ally)d(implemen)o(ted)f(b)o(y)j(some)e Fg(ad)k(ho)n(c)e Fh(\\magic")d(in)i(the)h(run)o(time)951 2785 y(system,)j(but)g(within)g (the)h(monadic)d(framew)o(ork)h(it)g(is)h(easy)h(to)951 2835 y(generalise)d(the)h(idea.)920 2960 y(8)p eop %%Page: 9 9 9 8 bop -120 195 a Fh(What)14 b(is)g(required)h(is)f(a)g(new)g(com)o (binator)e(for)i(the)h Fe(IO)e Fh(monad,)-120 245 y Fe(delayIO)o Fh(,)20 b(whic)o(h)g(forks)g(o\013)g(a)f(new)h(branc)o(h)h(from)d(the)i (main)-120 295 y(\\trunk":)-120 381 y Fe(delayIO)g(::)i(IO)f(a)h(->)f (IO)g(a)-120 468 y Fh(When)26 b(p)q(erformed,)i Fe(\(delayIO)20 b(action\))k Fh(immediately)f(re-)-120 518 y(turns)18 b(a)g(susp)q(ension)g(whic)o(h)g Fg(when)g(it)g(is)g(subse)n(quently)h (for)n(c)n(e)n(d)-120 567 y Fh(will)d(p)q(erform)h(the)h(I/O)f(sp)q (eci\014ed)i(b)o(y)e Fe(action)o Fh(.)29 b(The)17 b(relativ)o(e)-120 617 y(in)o(terlea)o(ving)11 b(of)f(the)i(I/O)g(op)q(erations)g(on)f (the)h(\\trunk")f(and)h(the)-120 667 y(\\branc)o(h")j(is)h(therefore)g (dep)q(enden)o(t)h(on)f(the)g(ev)n(aluation)d(order)-120 717 y(of)g(the)i(program.)-120 796 y(The)d Fe(delayIO)e Fh(com)o(binator)g(is)i(dangerous)g(\(alb)q(eit)g(useful\),)g(b)q(e-) -120 846 y(cause)19 b(the)f(correctness)j(of)c(the)h(program)e(no)o(w)h (requires)i(that)-120 896 y(arbitrary)e(in)o(terlea)o(ving)g(of)g(I/O)g (op)q(erations)h(on)f(the)h(\\trunk")-120 946 y(and)i(\\branc)o(h")g (cannot)h(a\013ect)g(the)g(result.)37 b Fg(This)21 b(c)n(ondition)-120 995 y(c)n(annot)d(b)n(e)g(guar)n(ante)n(e)n(d)g(by)g(the)g(c)n (ompiler;)f(it)h(is)f(a)h(pr)n(o)n(of)f(obli-)-120 1045 y(gation)h(for)g(the)g(pr)n(o)n(gr)n(ammer)p Fh(.)26 b(In)17 b(practice,)i(w)o(e)e(exp)q(ect)i(that)-120 1095 y Fe(delayIO)12 b Fh(will)h(b)q(e)h(used)h(mainly)c(b)o(y)j(system)g (programmers.)-120 1174 y(With)f(the)i(aid)f(of)f Fe(delayIO)g Fh(\(and)h(a)f(few)i(new)f(primitiv)o(es)e(suc)o(h)-120 1224 y(as)i Fe(fOpenIO)o Fh(\),)f(it)h(is)f(easy)i(to)e(write)i(a)e (lazy)h Fe(readFile)n Fh(:)-120 1311 y Fe(readFile)20 b(::)i([Char])e(->)h(IO)h([Char])-120 1360 y(readFile)e(s)i(=)f (fOpenIO)g(s)g(`bindIO`)f(\\f)i(->)163 1410 y(delayIO)f(\(lazyRd)f(f\)) -120 1510 y(lazyRd)h(::)g(File)g(->)g(IO)h([Char])-120 1560 y(lazyRd)f(f)-98 1610 y(=)g(readChar)g(f)g(`bindIO`)f(\\a)i(->)-55 1659 y(if)g(\(a)f(==)h(eof\))e(then)-11 1709 y(fCloseIO)g(f)i(`seqIO`) -11 1759 y(unitIO)f([])-55 1809 y(else)-11 1859 y(delayIO)f(\(lazyRd)h (f\))g(`bindIO`)f(\\as)h(->)-11 1908 y(unitIO)g(\(a:as\))-120 1995 y Fh(The)c Fe(delayIO)f Fh(com)o(binator)f(pro)o(vides)i(essen)o (tially)f(the)i(p)q(o)o(w)o(er)-120 2045 y(of)13 b(Gordon's)g Fe(suspend)g Fh(op)q(erator)h(\(Gordon)g([1989]\).)-120 2124 y Fg(Implementation)p Fh(.)35 b(A)20 b(nice)g(feature)g(of)f(the)h (implem)o(en)o(tation)-120 2174 y(tec)o(hnique)f(outlined)e(in)h (Section)g(4)f(is)h(that)g Fe(delayIO)e Fh(is)i(v)o(ery)-120 2224 y(easy)c(to)g(de\014ne:)-120 2310 y Fe(delayIO)20 b(m)i(=)g(\\w)f(->)g(let)g(res)h(=)f(case)g(\(m)h(w\))f(of)534 2360 y(MkIORes)f(r)i(w')f(->)g(r)272 2410 y(in)272 2460 y(MkIORes)g(res)g(w)-120 2546 y Fh(In)11 b(con)o(trast)i(to)e Fe(bindIO)o Fh(,)g(notice)h(ho)o(w)f Fe(delayIO)f Fh(duplicates)i(the) -120 2596 y(w)o(orld)j Fe(w)p Fh(,)h(and)g(then)h(discards)f(the)h (\014nal)e(w)o(orld)g Fe(w')h Fh(of)f(the)i(de-)-120 2646 y(la)o(y)o(ed)e(branc)o(h;)i(it)f(is)g(this)g(whic)o(h)g(allo)o (ws)e(the)j(unsync)o(hronised)-120 2696 y(in)o(terlea)o(ving)10 b(of)g(I/O)h(op)q(erations)g(on)g(the)g(\\branc)o(h")g(with)f(those) -120 2745 y(on)k(the)g(\\trunk".)951 195 y Fd(5.2)47 b(Async)o(hronous)14 b(I/O)951 276 y Fh(An)19 b(ev)o(en)h(more)f (dangerous)h(but)f(still)g(useful)g(com)o(binator)f(is)951 326 y Fe(performIO)n Fh(,)13 b(whose)i(t)o(yp)q(e)f(is)g(as)g(follo)o (ws:)951 413 y Fe(performIO)20 b(::)h(IO)g(a)h(->)f(a)951 499 y Fh(It)9 b(allo)o(ws)f(p)q(oten)o(tially)h(side-e\013ecting)h(op)q (erations)g(to)f(tak)o(e)h(place)951 549 y(whic)o(h)15 b(are)h(not)g(attac)o(hed)g(to)f(the)h(main)e(\\trunk")h(at)h(all!)22 b(The)951 599 y(pro)q(of)14 b(obligation)e(here)k(is)e(that)h(an)o(y)f (suc)o(h)h(side)g(e\013ects)i(do)d(not)951 649 y(a\013ect)g(the)g(b)q (eha)o(viour)f(of)g(the)g(rest)i(of)e(the)g(program.)k(An)c(ob)o(vi-) 951 699 y(ous)h(application)e(is)i(when)h(one)f(wishes)h(to)e(call)g(a) h(C)g(pro)q(cedure)951 748 y(whic)o(h)d(really)g(is)h(a)f(pure)i (function;)f(pro)q(cedures)i(from)9 b(a)j(n)o(umer-)951 798 y(ical)h(analysis)g(library)g(are)h(one)h(example.)951 877 y Fg(Implementation)p Fh(.)j(The)c(implemen)o(tation)d(is)i(quite)h (simple:)951 964 y Fe(performIO)20 b(m)h(=)h(case)f(\(m)g(newWorld\))f (of)1299 1014 y(MkIORes)h(r)g(w')h(->)f(r)951 1100 y Fh(Here,)14 b Fe(newWorld)e Fh(is)h(a)g(v)n(alue)g(of)f(t)o(yp)q(e)i Fe(World)f Fh(conjured)h(up)f(out)951 1150 y(of)19 b(thin)g(air,)h(and) f(discarded)h(when)g(the)g(action)f Fe(m)g Fh(has)h(b)q(een)951 1200 y(p)q(erformed.)951 1326 y Fd(5.3)47 b(Assignmen)o(t)13 b(and)i(reference)f(v)m(ariables)951 1408 y Fh(Earlier,)19 b(in)f(Section)h(3.1,)f(w)o(e)h(discussed)h(the)f(apparen)o(tly)g(in-) 951 1457 y(soluble)i(ine\016ciency)h(of)e Fe(dToIO)o Fh(,)j(the)f(function)f(whic)o(h)g(em)o(u-)951 1507 y(lates)16 b Fe(Dialogue)n Fh(s)g(using)g(the)g Fe(IO)g Fh(monad.)22 b(W)m(e)15 b(can)h(solv)o(e)g(this)951 1557 y(problem)i(b)o(y)h(pro)o (viding)f(an)h(extra)h(general-purp)q(ose)h(mec)o(ha-)951 1607 y(nism,)e(that)g(of)g Fg(assignable)h(r)n(efer)n(enc)n(e)f(typ)n (es)g Fh(and)h(op)q(erations)951 1657 y(o)o(v)o(er)14 b(them)f(\(Ireland)h([1989]\):)951 1743 y Fe(newVar)86 b(::)21 b(a)h(->)f(IO)g(\(Ref)g(a\))951 1793 y(assignVar)f(::)h(Ref)g (a)h(->)f(a)h(->)f(IO)h(\(\))951 1843 y(deRefVar)42 b(::)21 b(Ref)g(a)h(->)f(IO)h(a)951 1929 y Fh(The)d(call)e Fe(newVar)k(x)d Fh(allo)q(cates)g(a)g(fresh)h(v)n(ariable)e(con)o(taining)951 1979 y(the)h(v)n(alue)g Fe(x)p Fh(;)h(the)g(call)e Fe(assignVar)j(v)i (x)c Fh(assigns)g(v)n(alue)f Fe(x)h Fh(to)951 2029 y(v)n(ariable)c Fe(v)p Fh(;)i(and)g(the)g(call)f Fe(deRefVar)20 b(v)15 b Fh(fetc)o(hes)i(the)f(v)n(alue)f(in)951 2079 y(v)n(ariable)9 b Fe(v)p Fh(.)17 b(By)10 b(making)e(these)k(side-e\013ecting)f(op)q (erations)g(part)951 2129 y(of)i(the)h Fe(IO)f Fh(monad,)e(w)o(e)j(mak) o(e)e(sure)i(that)g(their)g(order)g(of)f(ev)n(alu-)951 2178 y(ation,)f(and)i(hence)h(seman)o(tics,)e(is)h(readily)f (explicable.)951 2258 y(With)18 b(the)i(aid)e(of)g(these)j(primitiv)o (es)c(it)i(is)g(p)q(ossible)g(to)g(write)951 2308 y(an)d(e\016cen)o(t)h (em)o(ulation)d(of)h Fe(Dialogues)g Fh(using)g Fe(IO)h Fh(\(Figure)h(3\).)951 2357 y(The)c(idea)g(is)f(to)h(mimi)o(c)d(a)j (system)g(whic)o(h)f(directly)h(implemen)o(ts)951 2407 y Fe(Dialogues)n Fh(,)i(whic)o(h)g(follo)o(ws)f(the)i(pro)q(cessing)g (of)f(eac)o(h)g(request)951 2457 y(with)g(a)h(destructiv)o(e)i(up)q (date)e(to)g(add)g(a)f(new)i(resp)q(onse)h(to)d(the)951 2507 y(end)g(of)g(the)g(list)g(of)f(resp)q(onses.)24 b(Notice)16 b(the)f(uses)h(of)f Fe(delayIO)n Fh(,)951 2557 y(whic)o(h)20 b(re\015ects)i(the)e(fact)g(that)g(there)h(is)f(no)g (guaran)o(tee)g(that)951 2606 y Fe(dialogue)11 b Fh(will)g(not)i(ev)n (aluate)f(a)g(resp)q(onse)j(b)q(efore)e(it)g(has)f(emit-)951 2656 y(ted)k(a)g(request.)25 b(If)15 b(this)h(o)q(ccurs,)h(the)f (un-assigned)g(v)n(ariable)f(is)951 2706 y(ev)n(aluated,)e(whic)o(h)h (elicits)g(a)f(suitable)h(error)h(message.)951 2785 y(References)j(in)e (languages)f(suc)o(h)i(as)f(ML)g(require)h(a)f(w)o(eak)o(ened)951 2835 y(form)g(of)h(p)q(olymorphism)d(in)k(order)g(to)g(main)o(tain)d(t) o(yp)q(e)j(safet)o(y)920 2960 y(9)p eop %%Page: 10 10 10 9 bop -120 155 1020 2 v -120 866 2 711 v -92 197 a Fe(dToIO)21 b(::)g(Dialogue)f(->)i(IO)f(\(\))-92 246 y(dToIO)g(dialogue)-70 296 y(=)g(newVar)g(\(error)f("Synch"\))h (`bindIO`)f(\\rsV)h(->)-27 346 y(delayIO)g(\(deRefVar)f(rsV\))h (`bindIO`)f(\\rs)h(->)-27 396 y(run)h(\(dialogue)d(rs\))j(rsV)-92 495 y(run)f(::)h([Request])d(->)j(Ref)f([Response])f(->)h(IO)g(\(\))-92 545 y(run)g([])196 b(v)21 b(=)h(doneIO)-92 595 y(run)f(\(req:reqs\))f (v)-70 645 y(=)h(doReq)g(req)305 b(`bindIO`)20 b(\\r)h(->)-27 695 y(newVar)g(\(error)f("Synch"\))h(`bindIO`)f(\\rsV)h(->)-27 744 y(delayIO)g(\(deRefVar)f(rsV\))h(`bindIO`)f(\\rs)h(->)-27 794 y(assignVar)f(v)i(\(r:rs\))108 b(`seqIO`)-27 844 y(run)22 b(reqs)e(rsV)p 898 866 V -120 868 1020 2 v -69 942 a Fh(Figure)14 b(3:)k(E\016cien)o(t)c(con)o(v)o(ersion)g(from)e Fe(Dialogue)g Fh(to)i Fe(IO)-120 1094 y Fh(\(T)m(ofte)i([1990]\).)25 b(F)m(or)16 b(instance,)i(in)f(ML)f(a)h(fresh)g(reference)i(to)-120 1144 y(an)h(empt)o(y)f(list)g(has)h(t)o(yp)q(e)h Fe('_a)g(list)g(ref)o Fh(,)g(where)g(the)g(t)o(yp)q(e)-120 1193 y(v)n(ariable)e Fe('_a)g Fh(is)h Fg(we)n(ak)p Fh(,)h(and)f(so)g(ma)o(y)e(b)q(e)j (instan)o(tiated)f(only)-120 1243 y(once.)g(In)14 b(con)o(trast,)g (here)i(a)e(fresh)h(reference)h(to)f(an)e(empt)o(y)h(list)-120 1293 y(has)g(t)o(yp)q(e)h Fe(IO)21 b(\(Ref)g(a\))p Fh(,)13 b(and)h(the)h(t)o(yp)q(e)f(v)n(ariable)f Fe(a)h Fh(is)g(normal.)-120 1343 y(But)f(no)f(lac)o(k)g(of)g(safet)o(y)h(arises,)g(b)q(ecause)h(an) f(expression)g(of)f(this)-120 1393 y(t)o(yp)q(e)k(allo)q(cates)g(a)f (new)i(reference)h(eac)o(h)e(time)f(it)g(is)h(ev)n(aluated.)-120 1442 y(The)10 b(only)f(w)o(a)o(y)g(to)g(c)o(hange)h(a)g(v)n(alue)f(of)g (t)o(yp)q(e)h Fe(IO)21 b(\(Ref)g(a\))9 b Fh(to)h(one)-120 1492 y(of)i(t)o(yp)q(e)h Fe(Ref)21 b(a)12 b Fh(is)g(via)f Fe(bindIO)o Fh(,)h(but)h(no)o(w)f(the)h(v)n(ariable)e(of)h(t)o(yp)q(e) -120 1542 y Fe(Ref)21 b(a)16 b Fh(is)g(not)g(let-b)q(ound,)g(and)g(so)g (can)g(only)g(b)q(e)g(instan)o(tiated)-120 1592 y(once)e(an)o(yw)o(a)o (y)m(.)i(Hence)f(the)f(extra)g(complication)d(of)h(w)o(eak)i(t)o(yp)q (e)-120 1642 y(v)n(ariables,)j(required)h(in)f(languages)g(with)g(side) g(e\013ects,)j(seems)-120 1691 y(unnecessary)14 b(here.)k(\(W)m(e're)11 b(indebted)i(to)e(Martin)g(Odersky)i(for)-120 1741 y(this)h(observ)n (ation.\))-120 1893 y Fi(6)56 b(Arra)n(ys)-120 1985 y Fh(The)20 b(approac)o(h)f(w)o(e)g(tak)o(e)h(to)f(I/O)g(smo)q(othly)f (extends)i(to)f(ar-)-120 2035 y(ra)o(ys)c(with)g(in-place)f(up)q(date.) 22 b(Hudak)14 b(has)h(recen)o(tly)h(prop)q(osed)-120 2085 y(a)h(similar)e(metho)q(d)i(based)h(on)f(con)o(tin)o(uations.)28 b(F)m(or)18 b(I/O,)f(the)-120 2135 y(monad)i(and)h(con)o(tin)o(uation)f (approac)o(hes)i(are)g(in)o(terde\014nable.)-120 2184 y(F)m(or)13 b(arra)o(ys,)g(it)g(turns)h(out)g(that)f(monads)f(can)i (implem)o(en)o(t)d(con-)-120 2234 y(tin)o(uations,)i(but)h(not)g(the)g (con)o(v)o(erse.)-120 2314 y(Let)g Fe(Arr)g Fh(b)q(e)g(the)h(t)o(yp)q (e)g(of)e(arra)o(ys)h(taking)f(indexes)i(of)e(t)o(yp)q(e)i Fe(Ind)-120 2363 y Fh(and)h(yielding)f(v)n(alues)g(of)h(t)o(yp)q(e)g Fe(Val)p Fh(.)24 b(There)17 b(are)g(three)g(op)q(era-)-120 2413 y(tions)d(on)f(this)h(t)o(yp)q(e.)-120 2500 y Fe(new)87 b(::)21 b(Val)g(->)g(Arr)-120 2549 y(lookup)g(::)g(Ind)g(->)g(Arr)h(->) f(Val)-120 2599 y(update)g(::)g(Ind)g(->)g(Val)h(->)f(Arr)g(->)h(Arr) -120 2686 y Fh(The)14 b(call)f Fe(new)22 b(v)13 b Fh(returns)i(an)f (arra)o(y)g(with)f(all)g(en)o(tries)i(set)f(to)g Fg(v)t Fh(;)-120 2736 y(the)k(call)e Fe(lookup)k(i)i(x)16 b Fh(returns)j(the)e(v)n(alue)g(at)f(index)h Fe(i)g Fh(in)f(ar-)-120 2785 y(ra)o(y)d Fe(x)o Fh(;)g(and)g(the)g(call)f Fe(update)21 b(i)g(v)h(x)12 b Fh(returns)j(an)d(arra)o(y)h(where)-120 2835 y(index)j Fe(i)g Fh(has)g(v)n(alue)f Fe(v)h Fh(and)g(the)g (remainder)g(is)g(iden)o(tical)f(to)h Fe(x)p Fh(.)951 195 y(The)10 b(b)q(eha)o(viour)f(of)h(these)h(op)q(erations)f(is)f(sp)q (eci\014ed)i(b)o(y)f(the)g(usual)951 245 y(la)o(ws.)951 331 y Fe(lookup)20 b(i)i(\(new)f(v\))43 b(=)g(v)951 381 y(lookup)20 b(i)i(\(update)e(i)i(v)f(x\))h(=)f(v)951 431 y(lookup)f(i)i(\(update)e(j)i(v)f(x\))h(=)f(lookup)g(i)h(x)951 518 y Fh(where)14 b Fe(i)d Ff(6)p Fh(=)h Fe(j)h Fh(in)f(the)i(last)e (equation.)18 b(In)12 b(practice,)i(these)g(op)q(er-)951 567 y(ations)c(w)o(ould)g(b)q(e)h(more)f(complex;)g(one)h(needs)h(a)e (w)o(a)o(y)g(to)g(sp)q(ecify)951 617 y(the)k(arra)o(y)g(b)q(ounds,)g (for)g(instance.)20 b(But)14 b(the)h(ab)q(o)o(v)o(e)f(su\016ces)h(to) 951 667 y(explicate)f(the)g(main)e(p)q(oin)o(ts.)951 746 y(The)17 b(e\016cien)o(t)h(w)o(a)o(y)f(to)g(implemen)o(t)d(the)k (up)q(date)g(op)q(eration)f(is)951 796 y(to)11 b(o)o(v)o(erwrite)h(the) g(sp)q(eci\014ed)h(en)o(try)f(of)f(the)h(arra)o(y)m(,)f(but)h(in)f(a)g (pure)951 846 y(functional)i(language)g(this)g(is)h(only)f(safe)h(if)f (there)i(are)g(no)e(other)951 896 y(p)q(oin)o(ters)k(to)f(the)g(arra)o (y)g(extan)o(t)h(when)f(the)h(up)q(date)g(op)q(eration)951 946 y(is)e(p)q(erformed.)22 b(An)16 b(arra)o(y)f(satisfying)f(this)i (prop)q(ert)o(y)g(is)f(called)951 995 y Fg(single)f(thr)n(e)n(ade)n(d)p Fh(,)g(follo)o(wing)d(Sc)o(hmidt)i(\(Sc)o(hmidt)f([1985]\).)951 1075 y(As)17 b(an)f(example,)g(consider)i(the)f(follo)o(wing)d (problem.)25 b(An)17 b Fg(o)n(c-)951 1125 y(curr)n(enc)n(e)22 b Fh(is)e(either)g(a)g Fg(de\014nition)j Fh(pairing)c(an)g(index)h (with)f(a)951 1174 y(v)n(alue,)13 b(or)g(a)h Fg(use)g Fh(of)f(an)h(index.)951 1261 y Fe(data)43 b(Occ)f(=)i(Def)21 b(Ind)g(Val)g(|)h(Use)f(Ind)951 1347 y Fh(F)m(or)15 b(illustration)f (tak)o(e)i Fe(Ind)21 b(=)h(Int)14 b Fh(and)i Fe(Val)21 b(=)15 b(Char)p Fh(.)23 b(Giv)o(en)951 1397 y(a)12 b(list)g Fe(os)g Fh(of)g(o)q(ccurrences,)j(the)e(call)f Fe(uses)20 b(os)12 b Fh(returns)i(for)e(eac)o(h)951 1447 y(use)j(the)f(most)f (recen)o(tly)i(de\014ned)g(v)n(alue)e(\(or)i Fe('-')e Fh(if)g(there)i(is)f(no)951 1497 y(previous)g(de\014nition\).)k(If)951 1583 y Fe(os)j(=)h([Def)f(1)g('a',)g(Def)g(2)h('b',)f(Use)g(1,)1082 1633 y(Def)g(1)g('c',)g(Use)g(2,)h(Use)f(1])951 1720 y Fh(then)951 1806 y Fe(uses)g(os)g(=)h(['a',)e('b',)h('c'].)951 1893 y Fh(Here)15 b(is)f(the)g(co)q(de.)951 1979 y Fe(uses)108 b(::)21 b([Occ])g(->)g([Val])951 2029 y(uses)g(os)43 b(=)g(loop)21 b(os)h(\(new)f('-'\))951 2128 y(loop)g(::)g([Occ])g(->)g (Arr)g(->)h([Val])951 2178 y(loop)f([])283 b(x)21 b(=)44 b([])951 2228 y(loop)21 b(\(Def)g(i)g(v)h(:)f(os\))h(x)f(=)h(loop)f(os) g(\(update)f(i)i(v)g(x\))951 2278 y(loop)f(\(Use)g(i)g(:)h(os\))65 b(x)21 b(=)h(lookup)e(i)i(x)g(:)f(loop)g(os)g(x)951 2364 y Fh(The)d(up)q(date)g(in)e(this)i(program)d(can)j(b)q(e)g(p)q (erformed)f(b)o(y)g(o)o(v)o(er-)951 2414 y(writing,)12 b(but)i(some)e(care)j(is)e(required)h(with)g(the)g(order)g(of)f(ev)n (al-)951 2464 y(uation.)k(In)c(the)g(last)g(line,)f(the)h(lo)q(okup)f (m)o(ust)g(o)q(ccur)i Fg(b)n(efor)n(e)h Fh(the)951 2514 y(recursiv)o(e)c(call)e(whic)o(h)h(ma)o(y)e(up)q(date)i(the)h(arra)o(y) m(.)16 b(Some)8 b(w)o(ork)i(has)951 2564 y(b)q(een)h(done)f(on)f (analysing)g(when)h(up)q(date)h(can)f(b)q(e)g(p)q(erformed)g(in-)951 2613 y(place,)i(but)g(it)g(is)g(rather)h(tric)o(ky)f(\(Bloss)h([1989];) d(Hudak)i([1986]\).)909 2960 y(10)p eop %%Page: 11 11 11 10 bop -120 195 a Fd(6.1)48 b(Monadic)15 b(arra)o(ys)-120 278 y Fh(W)m(e)c(b)q(eliev)o(e)h(that)f(single)g(threading)h(is)f(to)q (o)g(imp)q(ortan)o(t)f(to)h(lea)o(v)o(e)-120 328 y(to)h(the)h(v)n (agaries)e(of)h(an)g(analyser.)17 b(Instead,)c(w)o(e)g(use)g(monads)d (to)-120 377 y Fg(guar)n(ante)n(e)16 b Fh(single)d(threading,)f(in)h(m) o(uc)o(h)e(the)i(same)f(w)o(a)o(y)g(as)h(w)o(as)-120 427 y(done)e(with)f(I/O.)g(Analogous)g(to)g(the)h(t)o(yp)q(e)g Fe(IO)22 b(a)10 b Fh(\(the)h(monad)e(of)-120 477 y(I/O)h(actions\),)h (w)o(e)f(pro)o(vide)g(an)h(abstract)g(t)o(yp)q(e)f Fe(A)22 b(a)10 b Fh(\(the)h(monad)-120 527 y(of)i(arra)o(y)h(transformers\).) -120 613 y Fe(newA)86 b(::)22 b(Val)f(->)g(A)h(a)f(->)h(a)-120 663 y(lookupA)e(::)i(Ind)f(->)g(A)h(Val)-120 713 y(updateA)e(::)i(Ind)f (->)g(Val)g(->)h(A)f(\(\))-120 763 y(unitA)64 b(::)22 b(a)f(->)h(A)f(a)-120 813 y(bindA)64 b(::)22 b(A)f(a)h(->)f(\(a)h(->)f (A)h(b\))f(->)g(A)h(b)-120 899 y Fh(F)m(or)10 b(purp)q(oses)j(of)d(sp)q (eci\014cation,)i(w)o(e)f(can)g(de\014ne)h(these)g(in)e(terms)-120 949 y(of)j(the)i(pro)q(ceeding)g(op)q(erations)f(as)g(follo)o(ws.)-120 1035 y Fe(type)43 b(A)21 b(a)66 b(=)21 b(Arr)g(->)h(\(a,)f(Arr\))-120 1135 y(newA)g(v)h(m)87 b(=)21 b(fst)g(\(m)h(\(new)f(v\)\))-120 1185 y(lookupA)f(i)66 b(=)21 b(\\x)g(->)h(\(lookup)e(i)i(x,)f(x\))-120 1235 y(updateA)f(i)i(v)g(=)f(\\x)g(->)h(\(\(\),)f(update)f(i)i(v)g(x\)) -120 1284 y(unitA)f(a)109 b(=)21 b(\\x)g(->)h(\(a,x\))-120 1334 y(m)g(`bindA`)e(k)i(=)f(\\x)g(->)h(let)f(\(a,y\))g(=)g(m)h(x)43 b(in)h(k)21 b(a)h(y)-120 1421 y Fh(A)17 b(little)f(though)o(t)h(sho)o (ws)g(that)h(these)g(op)q(erations)f(are)h(indeed)-120 1471 y(single)13 b(threaded.)19 b(The)13 b(only)g(op)q(eration)g(that)g (could)g(duplicate)-120 1520 y(the)19 b(arra)o(y)f(is)h Fe(lookupA)n Fh(,)h(but)e(this)h(ma)o(y)e(b)q(e)i(implemen)o(ted)d(as) -120 1570 y(follo)o(ws:)28 b(\014rst)20 b(fetc)o(h)g(the)g(en)o(try)g (at)f(the)h(giv)o(en)f(index)h(in)f(the)-120 1620 y(arra)o(y)m(,)f(and) g(then)h(return)g(the)g(pair)f(consisting)g(of)g(this)g(v)n(alue)-120 1670 y(and)g(the)h(p)q(oin)o(ter)f(to)g(the)g(arra)o(y)m(.)30 b(T)m(o)17 b(enforce)j(the)e(necessary)-120 1720 y(sequencing,)d(w)o(e) f(augmen)o(t)e(the)j(ab)q(o)o(v)o(e)e(sp)q(eci\014cation)i(with)f(the) -120 1769 y(requiremen)o(t)h(that)h Fe(lookupA)d Fh(and)i Fe(updateA)f Fh(are)i(strict)g(in)f(the)-120 1819 y(index)e(and)g(arra) o(y)g(argumen)o(ts)f(\(but)h(need)h(not)f(b)q(e)h(strict)g(in)f(the) -120 1869 y(v)n(alue\).)-120 1948 y(The)f(ab)q(o)o(v)o(e)f(is)g(giv)o (en)f(for)h(purp)q(oses)i(of)d(sp)q(eci\014cation)i(only)f({)g(the)-120 1998 y(actual)j(implem)o(en)o(tation)d(is)j(along)e(the)j(lines)f(of)f (Section)h(4.)-120 2078 y(F)m(or)19 b(con)o(v)o(enience,)k(de\014ne)d Fe(seqA)f Fh(in)h(terms)f(of)g Fe(bindA)g Fh(in)h(the)-120 2127 y(usual)14 b(w)o(a)o(y)m(.)-120 2214 y Fe(m)22 b(`seqA`)e(n)44 b(=)f(m)21 b(`bindA`)g(\\a)g(->)h(n)-120 2300 y Fh(Here)17 b(is)e(the)h(`de\014nition-use')f(problem,)f(reco)q(ded)j(in)e(monadic) -120 2350 y(st)o(yle.)-120 2437 y Fe(uses)108 b(::)22 b([Occ])e(->)i([Val])-120 2487 y(uses)f(os)43 b(=)h(newA)20 b('-')i(\(loopA)e(os\))-120 2586 y(loopA)h(::)g([Occ])g(->)g(A)h([Val]) -120 2636 y(loopA)f([])283 b(=)21 b(unitA)g([])-120 2686 y(loopA)g(\(Def)g(i)g(v)h(:)f(os\))h(=)f(updateA)g(i)g(v)44 b(`seqA`)381 2736 y(loopA)21 b(os)-120 2785 y(loopA)g(\(Use)g(i)g(:)h (os\))65 b(=)21 b(lookupA)g(i)g(`bindA`)g(\\v)43 b(->)381 2835 y(loopA)21 b(os)43 b(`bindA`)21 b(\\vs)g(->)1452 195 y(unitA)g(\(v:vs\))951 282 y Fh(This)d(is)g(somewhat)g(lengthier)g (than)h(the)g(previous)g(example,)951 331 y(but)f(it)f(is)g(guaran)o (teed)h(safe)g(to)g(implem)o(en)o(t)d(up)q(date)k(b)o(y)e(o)o(v)o(er-) 951 381 y(writing.)951 532 y Fd(6.2)47 b(Con)o(tin)o(uatio)o(n)13 b(arra)o(ys)951 617 y Fh(An)k(alternativ)o(e)g(metho)q(d)g(of)g(guaran) o(teeing)g(single)g(threading)951 667 y(for)e(arra)o(ys)g(has)h(b)q (een)g(prop)q(osed)g(b)o(y)g(Hudak)f([1992].)20 b(Lik)o(e)15 b(the)951 717 y(previous)j(w)o(ork)f(of)g(Sw)o(arup,)h(Reddy)f(&)h (Ireland)g([1991],)e(it)h(is)951 767 y(based)f(on)g(con)o(tin)o (uations,)e(but)i(unlik)o(e)f(that)h(w)o(ork)f(it)h(requires)951 817 y(no)d(c)o(hange)i(to)e(the)i(t)o(yp)q(e)f(system.)951 896 y(As)k(with)f(the)h(arra)o(y)g(monad,)e(one)i(de\014nes)h(an)e (abstract)h(t)o(yp)q(e)951 946 y(supp)q(orting)d(v)n(arious)f(op)q (erations.)21 b(The)16 b(t)o(yp)q(e)f(is)g Fe(C)21 b(z)p Fh(,)15 b(and)f(the)951 995 y(op)q(erations)g(are)g(as)g(follo)o(ws.) 951 1082 y Fe(newC)86 b(::)21 b(Val)h(->)f(C)h(z)f(->)h(z)951 1132 y(lookupC)e(::)h(Ind)h(->)f(\(Val)g(->)g(C)h(z\))f(->)h(C)f(z)951 1182 y(updateC)f(::)h(Ind)h(->)f(Val)g(->)h(C)f(z)h(->)f(C)h(z)951 1231 y(unitC)64 b(::)21 b(z)h(->)f(C)h(z)951 1318 y Fh(Here)11 b(a)e(con)o(tin)o(uation,)g(of)f(t)o(yp)q(e)i Fe(C)22 b(z)p Fh(,)10 b(represen)o(ts)i(the)e(remaining)951 1368 y(series)k(of)f(actions)g(to)g(b)q(e)h(p)q(erformed)f(on)g(the)g(arra)o (y)m(,)g(ev)o(en)o(tually)951 1418 y(returning)h(\(via)f Fe(unitC)o Fh(\))h(a)g(v)n(alue)f(of)g(t)o(yp)q(e)i Fe(z)p Fh(.)951 1497 y(F)m(or)10 b(purp)q(oses)j(of)d(sp)q(eci\014cation,)i(w) o(e)f(can)g(de\014ne)h(these)g(in)e(terms)951 1547 y(of)j(the)i(arra)o (y)e(op)q(erations)h(as)g(follo)o(ws.)951 1633 y Fe(type)43 b(C)21 b(z)43 b(=)h(Arr)21 b(->)g(z)951 1733 y(newC)g(v)g(c)131 b(=)21 b(c)h(\(new)f(v\))951 1783 y(lookupC)f(i)i(d)65 b(=)21 b(\\x)h(->)f(d)h(\(lookup)e(i)i(x\))f(x)951 1832 y(updateC)f(i)i(v)f(c)h(=)f(\\x)h(->)f(c)h(\(update)e(i)i(v)f(x\))951 1882 y(unitC)g(z)152 b(=)21 b(\\x)h(->)f(z)951 1969 y Fh(Again,)e(these)i(op)q(erations)f(are)f(single)g(threaded)i(if)d Fe(lookupC)951 2019 y Fh(and)12 b Fe(updateC)e Fh(are)j(strict)f(in)g (the)h(index)f(and)f(arra)o(y)h(argumen)o(ts.)951 2098 y(F)m(or)h(con)o(v)o(enience,)i(de\014ne)951 2184 y Fe(m)21 b($)h(c)43 b(=)h(m)21 b(c)951 2271 y Fh(This)c(lets)i(us)f(omit)d(some) i(paren)o(theses,)k(since)d Fe(m)k(\(\\x)f(->)g(n\))951 2321 y Fh(b)q(ecomes)14 b Fe(m)21 b($)h(\\x)f(->)h(n)p Fh(.)951 2400 y(Here)14 b(is)f(the)h(`de\014nition-use')f(problem,)e (reco)q(ded)k(in)e(con)o(tin)o(ua-)951 2450 y(tion)g(st)o(yle.)951 2536 y Fe(uses)108 b(::)21 b([Occ])g(->)g([Val])951 2586 y(uses)g(os)43 b(=)g(newC)21 b('-')g(\(loopC)g(os)g(unitC\))951 2686 y(loopC)g(::)g([Occ])g(->)g(\([Val])g(->)g(C)h(z\))f(->)g(C)h(z) 951 2736 y(loopC)f([])282 b(c)22 b(=)g(c)f([])951 2785 y(loopC)g(\(Def)f(i)i(v)g(:)f(os\))g(c)h(=)g(updateC)e(i)i(v)43 b($)1496 2835 y(loopC)20 b(os)i(c)909 2960 y Fh(11)p eop %%Page: 12 12 12 11 bop -120 195 a Fe(loopC)21 b(\(Use)g(i)g(:)h(os\))f(c)65 b(=)22 b(lookupC)e(i)i($)f(\\v)44 b(->)425 245 y(loopC)21 b(os)43 b($)21 b(\\vs)h(->)425 295 y(c)f(\(v:vs\))-120 381 y Fh(This)d(is)g(remark)n(ably)f(similar)f(to)i(the)h(monadic)d(st) o(yle,)j(where)-120 431 y Fe($)h Fh(tak)o(es)g(the)h(place)f(of)g Fe(bindA)f Fh(and)h Fe(seqA)o Fh(,)h(and)f(the)h(curren)o(t)-120 481 y(con)o(tin)o(uation)15 b Fe(c)h Fh(tak)o(es)g(the)h(place)f(of)g Fe(unitA)o Fh(.)24 b(\(If)16 b Fe(c)g Fh(pla)o(ys)g(the)-120 531 y(role)d(of)g Fe(unitA)o Fh(,)g(wh)o(y)g(do)g(w)o(e)g(need)h Fe(unitC)o Fh(?)k(Because)d(it)e(acts)h(as)-120 580 y(the)g(`top)g(lev) o(el')f(con)o(tin)o(uation.\))-120 660 y(Ho)o(w)o(ev)o(er,)j(there)g (are)g(t)o(w)o(o)f(things)g(to)g(note)h(ab)q(out)f(the)h(con)o(tin-) -120 710 y(uation)i(st)o(yle.)31 b(First,)20 b(the)f(t)o(yp)q(es)g(are) g(rather)g(more)e(complex)-120 759 y({)h(compare)f(the)i(t)o(yp)q(es)g (of)e Fe(loopA)g Fh(and)h Fe(loopC)o Fh(.)31 b(Second,)20 b(the)-120 809 y(monadic)14 b(st)o(yle)h(abstracts)i(a)o(w)o(a)o(y)d (from)g(the)i(notion)f(of)g(con)o(tin-)-120 859 y(uation)h({)g(so)h (there)h(are)g(no)e(o)q(ccurrences)k(of)c Fe(c)h Fh(cluttering)g(the) -120 909 y(de\014n)o(tion)d(of)f Fe(loopA)o Fh(.)-120 1062 y Fd(6.3)48 b(Monads)15 b(vs.)h(con)o(tin)o(uati)o(on)o(s)-120 1148 y Fh(W)m(e)9 b(can)h(formally)d(compare)i(the)h(p)q(o)o(w)o(er)g (of)f(the)h(t)o(w)o(o)f(approac)o(hes)-120 1198 y(b)o(y)16 b(attempting)f(to)g(implemen)o(t)f(eac)o(h)i(in)g(terms)g(of)f(the)i (other.)-120 1248 y(Despite)24 b(their)f(similarities,)f(the)i(t)o(w)o (o)e(approac)o(hes)i(are)f(not)-120 1298 y(equiv)n(alen)o(t.)32 b(Monads)18 b(are)h(p)q(o)o(w)o(erful)g(enough)f(to)h(implemen)o(t)-120 1347 y(con)o(tin)o(uations,)13 b(but)h(not)g(\(quite\))g(vice)g(v)o (ersa.)-120 1427 y(T)m(o)i(implemen)o(t)f(con)o(tin)o(uations)h(in)h (terms)g(of)f(monads)g(is)h(sim-)-120 1477 y(plicit)o(y)c(itself.)-120 1563 y Fe(type)43 b(C)21 b(z)44 b(=)f(A)22 b(z)-120 1663 y(newC)f(v)h(c)130 b(=)43 b(newA)21 b(v)h(c)-120 1713 y(lookupC)e(i)i(d)65 b(=)43 b(lookupA)21 b(i)g(`bindA`)g(d)-120 1762 y(updateC)f(i)i(v)g(c)f(=)43 b(updateA)21 b(i)g(v)h(`seqA`)f(c) -120 1812 y(unitC)195 b(=)43 b(unitA)-120 1899 y Fh(It)14 b(is)h(an)f(easy)h(exercise)h(in)e(equational)f(reasoning)i(to)f(to)g (pro)o(v)o(e)-120 1948 y(that)f(this)h(implemen)o(tatio)o(n)d(is)i (correct)i(in)e(terms)h(of)e(the)i(sp)q(eci-)-120 1998 y(\014cations)g(in)f(Sections)i(6.1)e(and)h(6.2.)-120 2078 y(The)h(rev)o(erse)i(implem)o(en)o(tation)12 b(is)i(not)h(p)q (ossible.)20 b(The)15 b(trouble)-120 2127 y(is)h(the)h(anno)o(ying)f (extra)g(t)o(yp)q(e)h(v)n(ariable,)f Fe(z)p Fh(,)g(app)q(earing)h(in)f (the)-120 2177 y(t)o(yp)q(es)e(of)e Fe(lookupC)g Fh(and)h Fe(updateC)n Fh(.)18 b(This)13 b(forces)h(the)f(in)o(tro)q(duc-)-120 2227 y(tion)d(of)h(a)f(spurious)i(t)o(yp)q(e)f(v)n(ariable)f(in)o(to)g (an)o(y)g(attempt)g(to)h(de\014ne)-120 2277 y(monads)h(in)g(terms)h(of) g(con)o(tin)o(uations.)k(Instead)d(of)f(a)g(t)o(yp)q(e)g Fe(A)22 b(a)p Fh(,)-120 2327 y(the)16 b(b)q(est)h(one)f(can)g(do)g(is)f (to)h(de\014ne)h(a)e(t)o(yp)q(e)h Fe(B)22 b(a)f(z)p Fh(.)j(Here)17 b(are)-120 2376 y(the)d(t)o(yp)q(es)h(of)f(the)g(new)g(op)q(erations.) -120 2463 y Fe(newB)86 b(::)22 b(Val)f(->)g(B)h(a)f(a)h(->)f(a)-120 2513 y(lookupB)f(::)i(Ind)f(->)g(B)h(Val)f(z)-120 2563 y(updateB)f(::)i(Ind)f(->)g(Val)g(->)h(B)f(\(\))h(z)-120 2612 y(unitB)64 b(::)22 b(a)f(->)h(B)f(a)h(z)-120 2662 y(bindB)64 b(::)22 b(B)f(a)h(z)f(->)h(\(a)f(->)h(B)f(b)h(z\))f(->)h(B)f (b)h(z)-120 2749 y Fh(And)16 b(here)h(are)f(the)g(implemen)o(tations)d (in)i(terms)h(of)f(con)o(tin)o(ua-)-120 2799 y(tions.)951 195 y Fe(type)43 b(B)21 b(a)h(z)43 b(=)g(\(a)22 b(->)f(C)h(z\))f(->)h (C)f(z)951 295 y(newB)g(v)g(m)109 b(=)43 b(newC)21 b(v)h(\(m)f(unitC\)) 951 345 y(lookupB)f(i)87 b(=)43 b(\\d)22 b(->)f(lookupC)g(i)g(d)951 394 y(updateB)f(i)i(v)43 b(=)g(\\d)22 b(->)f(updateC)g(i)g(v)h(\(d)f (\(\)\))951 444 y(unitB)g(a)130 b(=)43 b(\\d)22 b(->)f(d)h(a)951 494 y(m)f(`bindB`)g(k)43 b(=)g(\\d)22 b(->)f(m)h(\(\\a)f(->)g(k)h(a)g (d\))951 580 y Fh(Again,)10 b(it)g(is)h(easy)g(to)f(pro)o(v)o(e)h(this) g(implem)o(en)o(tation)d(satis\014es)j(the)951 630 y(giv)o(en)i(sp)q (eci\014cations.)951 710 y(So)20 b(monads)g(are)h(more)f(p)q(o)o(w)o (erful)g(than)h(con)o(tin)o(uations,)h(but)951 759 y(only)17 b(b)q(ecause)j(of)e(the)h(t)o(yp)q(es!)32 b(It)19 b(is)f(not)g(clear)h (whether)h(this)951 809 y(is)15 b(simply)f(an)i(artifact)f(of)h(the)g (Hindley-Milner)f(t)o(yp)q(e)i(system,)951 859 y(or)e(whether)h(the)f (t)o(yp)q(es)h(are)f(rev)o(ealing)g(a)f(di\013erence)j(of)e(funda-)951 909 y(men)o(tal)9 b(imp)q(ortance.)16 b(\(Our)c(o)o(wn)f(in)o(tuition)f (is)h(the)h(latter)f({)g(but)951 959 y(it's)i(only)g(an)h(in)o (tuition.\))951 1085 y Fd(6.4)47 b(Conclusion)951 1166 y Fh(The)18 b(I/O)g(approac)o(h)f(outlined)h(earlier)g(manipulates)e(a) h Fg(glob)n(al)951 1216 y Fh(state,)h(namely)e(the)h(en)o(tire)h(state) g(of)f(the)h(mac)o(hine)e(accessible)951 1266 y(via)f(a)i(C)f(program.) 25 b(What)16 b(has)g(b)q(een)i(sho)o(wn)f(in)f(this)g(section)951 1316 y(is)g(that)g(this)g(approac)o(h)g(extends)i(smo)q(othly)c(to)i (manipulating)951 1365 y Fg(lo)n(c)n(al)i Fh(state,)e(suc)o(h)f(as)g(a) g(single)f(arra)o(y)m(.)20 b(F)m(urther,)15 b(although)f(the)951 1415 y(monad)f(and)j(con)o(tin)o(uation)e(approac)o(hes)j(are)e(in)o (tercon)o(v)o(ertible)951 1465 y(for)k(I/O,)g(they)h(are)f(not)h(for)f (arra)o(ys:)29 b(monads)18 b(are)h(p)q(o)o(w)o(erful)951 1515 y(enough)14 b(to)f(de\014ne)i(con)o(tin)o(uations,)e(but)h(not)g (the)h(rev)o(erse.)951 1594 y(F)m(or)10 b(actual)h(use)h(with)f(Hask)o (ell,)f(w)o(e)i(require)g(a)e(sligh)o(tly)g(more)g(so-)951 1644 y(phisticated)i(set)i(of)d(op)q(erations.)18 b(The)12 b(t)o(yp)q(e)h Fe(A)f Fh(m)o(ust)f(tak)o(e)h(extra)951 1694 y(parameters)k(corresp)q(onding)i(to)e(the)h(index)f(and)h(v)n (alue)f(t)o(yp)q(es,)951 1744 y(the)e(op)q(eration)f Fe(newA)f Fh(should)i(tak)o(e)f(the)h(arra)o(y)f(b)q(ounds,)h(and)f(so) 951 1793 y(on.)34 b(By)20 b(using)f(a)g(v)n(arian)o(t)f(of)h Fe(newA)f Fh(that)i(creates)h(an)e(unini-)951 1843 y(tialised)13 b(arra)o(y)m(,)f(and)i(returns)h(the)f(arra)o(y)g(after)f(all)g(up)q (dates)i(are)951 1893 y(\014nished,)22 b(it)e(is)g(p)q(ossible)g(to)g (implemen)o(t)e(Hask)o(ell)i(primitiv)o(es)951 1943 y(for)14 b(creating)g(arra)o(ys)g(in)g(terms)g(of)g(the)g(simpler)f(monad)g(op)q (era-)951 1993 y(tions.)k(Th)o(us)d(the)g(same)e(strategy)i(that)f(w)o (orks)g(for)g(implemen)o(t-)951 2042 y(ing)e(I/O)g(should)g(w)o(ork)h (for)f(implem)o(en)o(ting)e(arra)o(ys:)17 b(use)12 b(a)f(small)951 2092 y(set)18 b(of)e(primitiv)o(es)f(based)j(on)f(monads,)f(and)h(dep)q (end)h(on)f(pro-)951 2142 y(gram)12 b(transformation)g(to)i(mak)o(e)e (this)i(adequately)g(e\016cien)o(t.)951 2221 y(One)h(question)g(that)f (remains)g(is)g(ho)o(w)g(w)o(ell)g(this)g(approac)o(h)h(ex-)951 2271 y(tends)f(to)f(situations)g(where)h(one)g(wishes)g(to)f (manipulate)e(more)951 2321 y(than)18 b(one)g(state)h(at)e(a)h(time,)f (as)h(when)h(com)o(bining)c(I/O)j(with)951 2371 y(arra)o(y)c(op)q (erations,)h(or)g(op)q(erating)g(on)g(t)o(w)o(o)f(arra)o(ys.)22 b(In)14 b(this)h(re-)951 2421 y(sp)q(ect)h(e\013ect)h(systems)e(or)g (linear)f(t)o(yp)q(es)i(ma)o(y)d(b)q(e)j(sup)q(erior;)g(see)951 2470 y(b)q(elo)o(w.)951 2614 y Fi(7)56 b(Related)17 b(w)n(ork)951 2704 y Fd(7.1)47 b(E\013ect)16 b(systems)951 2785 y Fh(Gi\013ord)i(and) h(Lucassen)h(in)o(tro)q(duced)g(`e\013ect)g(systems')f(whic)o(h)951 2835 y(use)e(t)o(yp)q(es)h(to)e(record)i(the)f(side-e\013ects)i(p)q (erformed)d(b)o(y)h(a)f(pro-)909 2960 y(12)p eop %%Page: 13 13 13 12 bop -120 195 a Fh(gram,)12 b(and)j(to)f(determine)g(whic)o(h)h (comp)q(onen)o(ts)f(of)g(a)g(program)-120 245 y(can)k(run)h(in)f (parallel)f(without)h(in)o(terference)i(\(Gi\013ord)e(&)g(Lu-)-120 295 y(cassen)j([1986]\).)32 b(The)20 b(original)d(notion)i(of)f (e\013ect)j(w)o(as)f(fairly)-120 345 y(crude,)14 b(there)h(b)q(eing)f (only)f(four)g(p)q(ossible)h(e\013ects:)19 b(pure)c(\(no)e(ef-)-120 394 y(fect\),)g(allo)q(cate)f(\(ma)o(y)f(allo)q(cate)h(storage\),)h (function)f(\(ma)o(y)f(read)-120 444 y(storage\),)g(pro)q(cedure)g (\(ma)o(y)d(write)i(storage\).)18 b(New)10 b(systems)g(are)-120 494 y(more)15 b(re\014ned,)h(allo)o(wing)e(e\013ects)j(to)f(b)q(e)g (expressed)i(separately)-120 544 y(for)c(di\013eren)o(t)g(regions)g(of) g(store)h(\(Jouv)o(elot)e(&)h(Gi\013ord)g([1991]\).)-120 623 y(A)23 b(theoretical)h(precursor)h(of)e(the)h(e\013ects)h(w)o(ork)e (is)g(that)h(of)-120 673 y(Reynolds,)16 b(whic)o(h)h(also)f(used)h(t)o (yp)q(es)g(to)g(record)h(where)f(e\013ects)-120 723 y(could)12 b(o)q(ccur)h(and)f(where)h(parallelism)c(w)o(as)j(allo)o(w)o(ed)e (\(Reynolds)-120 773 y([1981];)h(Reynolds)j([1989]\).)-120 852 y(Our)k(w)o(ork)g(is)g(similar)d(to)j(the)g(ab)q(o)o(v)o(e)g(in)f (its)h(commitm)o(en)o(t)d(to)-120 902 y(use)i(t)o(yp)q(es)g(to)g (indicate)f(e\013ects.)28 b(But)17 b(e\013ect)h(systems)e(are)h(de-) -120 952 y(signed)g(for)g(impure,)g(strict)h(functional)e(languaes,)h (where)i(the)-120 1001 y(order)c(of)f(sequencing)i(is)f Fg(implicit)p Fh(.)k(Our)c(w)o(ork)g(is)f(designed)i(for)-120 1051 y(pure,)i(lazy)f(functional)f(languages,)h(and)g(the)h(purp)q(ose) g(of)f(the)-120 1101 y(`)p Fe(bind)o Fh(')e(op)q(eration)h(is)f(to)h (mak)o(e)e(sequencing)j Fg(explicit)j Fh(where)d(it)-120 1151 y(is)d(required.)-120 1230 y(With)25 b(e\013ect)h(systems,)i(one)d (ma)o(y)f(use)i(the)f(usual)g(la)o(ws)g(of)-120 1280 y(equational)19 b(reasoning)i(on)f(an)o(y)g(program)f(segmen)o(t)h (without)-120 1330 y(a)e(`write')h(side)g(e\013ect.)34 b(Our)19 b(w)o(ork)g(di\013ers)g(in)g(that)f(the)i(la)o(ws)-120 1380 y(of)13 b(equational)h(reasoning)g(apply)f Fg(even)j(wher)n(e)e (side)h(e\013e)n(cts)h(ar)n(e)-120 1429 y(al)r(lowe)n(d)p Fh(.)h(This)12 b(is)f(essen)o(tial,)i(b)q(ecause)g(the)g(optimisation)c (phase)-120 1479 y(of)k(our)h(compiler)f(is)g(based)i(on)f(equational)e (reasoning.)-120 1559 y(On)23 b(the)h(other)f(hand,)h(e\013ect)h (systems)e(mak)o(e)e(it)i(v)o(ery)g(easy)-120 1608 y(to)c(com)o(bine)e (programs)h(with)g(di\013eren)o(t)i(e\013ects.)35 b(In)19 b(our)g(ap-)-120 1658 y(proac)o(h,)13 b(eac)o(h)g(di\013eren)o(t)g (e\013ect)i(w)o(ould)d(corresp)q(ond)i(to)e(a)h(di\013er-)-120 1708 y(en)o(t)18 b(monad)d(t)o(yp)q(e)j(\(one)f(for)g(IO,)g(one)g(for)g (eac)o(h)h(arra)o(y)e(manip-)-120 1758 y(ulated,)i(and)f(so)h(on\),)g (and)f(it)g(is)h(not)f(so)h(clear)g(ho)o(w)f(one)h(go)q(es)-120 1808 y(ab)q(out)c(com)o(bining)d(e\013ects.)-120 1971 y Fd(7.2)48 b(Linear)14 b(t)o(yp)q(es)-120 2058 y Fh(The)i(implem)o(en) o(tation)c(of)j(the)h Fe(IO)f Fh(monad)e(giv)o(en)i(in)g(Section)g(4) -120 2108 y(is)d(safe)h(b)q(ecause)h(\(and)f(only)e(b)q(ecause\))k(the) e(co)q(de)g(that)f(manipu-)-120 2158 y(lates)i(the)h(w)o(orld)f(nev)o (er)h(duplicates)f(or)g(destro)o(ys)h(it.)k(W)m(e)14 b(guar-)-120 2208 y(an)o(tee)f(safet)o(y)g(b)o(y)f(making)e(the)j Fe(IO)f Fh(t)o(yp)q(e)h(abstract,)g(so)g(that)f(user)-120 2258 y(has)i(no)g(direct)g(access)i(to)e(the)g(w)o(orld.)-120 2337 y(An)k(alternativ)o(e)f(is)h(to)f(allo)o(w)f(the)i(user)h(access)h (to)d(the)h(w)o(orld,)-120 2387 y(but)j(in)o(tro)q(duce)h(a)f(t)o(yp)q (e)h(system)f(that)g(guaran)o(tees)h(that)g(the)-120 2437 y(w)o(orld)12 b(can)g(nev)o(er)h(b)q(e)g(duplicated)f(or)g(destro) o(y)o(ed.)19 b(A)12 b(n)o(um)o(b)q(er)g(of)-120 2487 y(t)o(yp)q(e)i(systems)g(ha)o(v)o(e)g(b)q(een)h(prop)q(osed)f(along)f (suc)o(h)h(lines.)k(Some)-120 2536 y(ha)o(v)o(e)c(b)q(een)i(based)f(on) f(Girard's)f(linear)h(logic)g(\(Girard)f([1987]\),)-120 2586 y(and)k(this)g(remains)f(an)g(area)h(of)f(activ)o(e)h(exploration) f(\(Abram-)-120 2636 y(sky)11 b([1990];)f(Guzman)g(&)h(Hudak)h([1990];) d(W)m(adler)i([1990]\).)k(An-)-120 2686 y(other)e(is)e(the)i(t)o(yp)q (e)f(system)g(prop)q(osed)h(b)o(y)e(the)i(Nijmegen)d(Clean)-120 2736 y(group,)i(whic)o(h)h(is)g(more)f(ad-ho)q(c)g(but)h(has)g(b)q(een) h(tested)h(in)d(prac-)-120 2785 y(tical)h(applications)g(similar)e(to)j (our)g(o)o(wn)f(\(Ac)o(h)o(ten,)i(Groningen)-120 2835 y(&)f(Plasmeijer)f([1992]\).)951 195 y(F)m(or)h(example,)f(here)j(is)f (the)g Fe(echo)f Fh(program)f(again,)g(written)i(in)951 245 y(the)f(st)o(yle)g(suggested)i(b)o(y)d(the)i(Clean)e(I/O)h(system:) 951 331 y Fe(echo)21 b(::)g(File)g(->)g(File)g(->)h(World)f(->)g(World) 951 381 y(echo)g(fi)g(fo)g(w)h(=)g(if)f(a)h(==)f(eof)1278 431 y(then)g(w1)1278 481 y(else)g(echo)g(\(putChar)f(fo)h(a)h(w1\))1234 531 y(where)1278 580 y(\(w1,a\))e(=)i(getChar)e(fi)i(w)951 667 y Fh(Compared)d(to)h(the)g(monad)f(approac)o(h,)i(this)f(su\013ers) i(from)c(a)951 717 y(n)o(um)o(b)q(er)c(of)f(dra)o(wbac)o(ks:)20 b(programs)13 b(b)q(ecome)h(more)g(cluttered;)951 767 y(the)19 b(linear)f(t)o(yp)q(e)i(system)e(has)h(to)f(b)q(e)i(explained) e(to)h(the)g(pro-)951 816 y(grammer)f(and)j(implem)o(en)o(ted)e(in)h (the)i(compiler;)g(and)e(co)q(de-)951 866 y(impro)o(ving)9 b(transformations)i(need)j(to)e(b)q(e)h(re-examined)e(to)i(en-)951 916 y(sure)j(they)h(preserv)o(e)g(linearit)o(y)m(.)22 b(The)16 b(latter)f(problem)g(ma)o(y)e(b)q(e)951 966 y(imp)q(ortan)o(t;)f(W)m(ak)o(eling)g(found)i(that)g(some)f(standard)i (transfor-)951 1016 y(mations)10 b(could)i(not)g(b)q(e)h(p)q(erformed)e (in)h(the)h(presence)h(of)e(linear-)951 1065 y(it)o(y)h(\(W)m(ak)o (eling)f([1990]\).)951 1145 y(The)k(big)f(adv)n(an)o(tage)g(of)g(a)h (linear)f(t)o(yp)q(e)i(system)f(is)f(that)h(it)g(en-)951 1195 y(ables)f(us)h(to)e(write)i(programs)e(whic)o(h)h(manipulate)e (more)h(than)951 1244 y(one)f(piece)h(of)e(up)q(datable)h(state)h(at)f (a)f(time.)17 b(The)c(monadic)e(and)951 1294 y(con)o(tin)o (uation-passing)j(presen)o(tations)i(of)e(arra)o(ys)i(giv)o(en)e(ab)q (o)o(v)o(e)951 1344 y(pass)f(the)h(arra)o(y)e(around)h(implicitly)m(,)c (and)k(hence)h(can)f(only)g(eas-)951 1394 y(ily)i(handle)i(one)f(at)h (a)f(time.)25 b(This)16 b(is)g(an)h(imp)q(ortan)o(t)e(area)h(for)951 1444 y(future)e(w)o(ork.)951 1523 y(On)d(the)h(practical)g(side,)g(the) g(Clean)f(w)o(ork)g(is)g(impressiv)o(e.)17 b(They)951 1573 y(ha)o(v)o(e)h(written)h(a)f(library)g(of)f(high-lev)o(el)h (routines)h(to)f(call)f(the)951 1623 y(Macin)o(tosh)g(windo)o(w)g (system,)h(and)f(demonstrated)h(that)g(it)f(is)951 1672 y(p)q(ossible)c(to)h(build)e(pure)j(functional)d(programs)g(with)h (sophisti-)951 1722 y(cated)f(user)g(in)o(terfaces.)18 b(The)11 b(same)f(approac)o(h)h(should)g(w)o(ork)f(for)951 1772 y(monads,)15 b(and)i(another)g(area)f(for)g(future)i(w)o(ork)e(is) g(to)h(con\014rm)951 1822 y(that)d(this)g(is)f(the)i(case.)951 1984 y Fi(8)56 b(Conclusions)19 b(and)g(further)f(w)n(ork)951 2079 y Fh(W)m(e)g(ha)o(v)o(e)f(b)q(een)j(pleasan)o(tly)d(surprised)j(b) o(y)e(b)q(oth)g(the)h(expres-)951 2129 y(siv)o(eness)g(and)e(the)h (e\016ciency)h(of)e(the)h(approac)o(h)f(w)o(e)h(ha)o(v)o(e)g(de-)951 2178 y(scrib)q(ed.)h(F)m(or)12 b(example,)g(w)o(e)h(ha)o(v)o(e)g(found) g(that)g(while)f(it)h(is)g(p)q(os-)951 2228 y(sible)j(to)h(write)g (comp)q(osable)e(I/O)i(programs)e(in)i(other)g(st)o(yles,)951 2278 y(it)c(is)h(almost)d(imp)q(ossible)h Fg(not)i Fh(to)g(do)f(so)h (in)f(using)h(the)g(monadic)951 2328 y(approac)o(h.)951 2407 y(Plen)o(t)o(y)i(remains)g(to)g(b)q(e)h(done.)27 b(W)m(e)16 b(are)h(w)o(orking)e(on)h(our)h(im-)951 2457 y(plemen)o(tation)12 b(of)h(arra)o(ys;)h(this)g(in)f(turn)h(feeds)h(in) o(to)e(the)i(abilit)o(y)951 2507 y(to)f(pass)h(structured)h(v)n(alues)e (in)g Fe(ccall)o Fh(s;)h(w)o(e)f(ha)o(v)o(e)g(not)g(y)o(et)h(im-)951 2557 y(plemen)o(ted)e(assignable)h(reference)i(t)o(yp)q(es.)951 2636 y(More)g(imp)q(ortan)o(tly)m(,)d(the)j(mo)q(del)e(w)o(e)i(ha)o(v)o (e)f(desrib)q(ed)i(concerns)951 2686 y(only)11 b(the)h(I/O)g Fg(infr)n(astructur)n(e)p Fh(.)j(Muc)o(h)e(more)d(w)o(ork)i(needs)h(to) e(b)q(e)951 2736 y(done)k(to)g(design)g(libraries)f(of)g(functions,)h (built)f(on)h(top)g(of)f(this)951 2785 y(infrastructure,)21 b(whic)o(h)d(presen)o(t)j(a)d(higher-lev)o(el)h(in)o(terface)g(to)951 2835 y(the)11 b(programmer)e(\(Ac)o(h)o(ten,)j(Groningen)e(&)i (Plasmeijer)d([1992];)909 2960 y(13)p eop %%Page: 14 14 14 13 bop -120 195 a Fh(Hammond,)10 b(W)m(adler)j(&)i(Brady)f ([1991]\).)-120 327 y Fi(Ac)n(kno)n(wledgemen)n(ts)-120 416 y Fh(This)f(w)o(ork)g(to)q(ok)g(place)h(in)f(the)h(con)o(text)g(of) e(the)i(team)f(building)-120 466 y(the)j(Glasgo)o(w)f(Hask)o(ell)g (compiler:)20 b(Cordy)c(Hall,)f(Kevin)h(Ham-)-120 515 y(mond)f(and)i(Will)d(P)o(artain.)26 b(Da)o(vid)16 b(W)m(att,)g(Jo)q(e) h(Morris,)g(John)-120 565 y(Launc)o(h)o(bury)11 b(also)g(made)f(v)o (ery)h(helpful)g(suggestions)g(ab)q(out)g(our)-120 615 y(presen)o(tation.)19 b(W)m(e)13 b(gratefully)g(ac)o(kno)o(wledge)h (their)g(help.)-120 747 y Fi(References)-120 915 y Fh(S)26 b(Abramsky)6 b([1990],)23 b(\\Computational)f(in)o(terpretations)27 b(of)29 965 y(linear)19 b(logic,")f(DOC)h(90/20,)f(Dept)i(of)f (Computing,)29 1015 y(Imp)q(erial)13 b(College.)-120 1106 y(PM)30 b(Ac)o(h)o(ten,)f(JHG)h(v)n(an)e(Groningen)h(&)h(MJ)f (Plasmeijer)29 1156 y([1992],)16 b(\\High-lev)o(el)i(sp)q (eci\014cation)h(of)f(I/O)g(in)g(func-)29 1206 y(tional)11 b(languages,")g(in)h Fa(Pro)q(c)g(Glasgo)o(w)f(W)m(orkshop)g(on)29 1256 y(F)m(unctional)i(Programming)s Fh(,)d(Launc)o(h)o(bury)k Fg(et)g(al)p Fh(,)f(ed.,)29 1306 y(Springer)i(V)m(erlag.)-120 1397 y(A)10 b(Bloss)d([Sept)j(1989],)e(\\Up)q(date)i(analysis)f(and)h (the)g(e\016cien)o(t)g(im-)29 1447 y(plemen)o(tation)j(of)g(functional) h(aggregates,")f(in)h Fa(F)m(unc-)29 1497 y(tional)22 b(Programmi)o(ng)d(Languages)k(and)f(Computer)29 1547 y(Arc)o(hitecture,)16 b(London)p Fh(,)d(A)o(CM.)-120 1639 y(A)24 b(Dw)o(elly)6 b([Sept)24 b(1989],)e(\\Dialogue)g(com)o (binators)h(and)g(dy-)29 1688 y(namic)18 b(user)i(in)o(terfaces,")g(in) f Fa(F)m(unctional)f(Program-)29 1738 y(ming)27 b(Languages)h(and)g (Computer)f(Arc)o(hitecture,)29 1788 y(London)p Fh(,)13 b(A)o(CM.)-120 1880 y(DK)d(Gi\013ord)g(&)g(JM)g(Lucassen)f([Aug)g (1986],)g(\\In)o(tegrating)g(func-)29 1930 y(tional)21 b(and)h(imp)q(erativ)o(e)e(programming,)o(")f(in)i Fa(A)o(CM)29 1979 y(Conference)28 b(on)e(Lisp)f(and)h(F)m(unctional)f(Program-)29 2029 y(ming,)12 b(MIT)s Fh(,)h(A)o(CM,)h(28{38.)-120 2121 y(J-Y)f(Girard)6 b([1987],)11 b(\\Linear)h(Logic,")g Fa(Theoretical)h(Computer)29 2171 y(Science)e Fh(50,)i(1{102.)-120 2263 y(A)j(Gordon)6 b([F)m(eb)16 b(1989],)e(\\PFL+:)i(a)g(k)o(ernel)g (sc)o(heme)g(for)g(func-)29 2312 y(tional)f(I/O,")f(TR)h(160,)f (Computer)h(Lab,)f(Univ)o(ersit)o(y)29 2362 y(of)g(Cam)o(bridge.)-120 2454 y(JC)21 b(Guzman)f(&)h(P)g(Hudak)7 b([1990],)19 b(\\Single-threaded)i(p)q(oly-)29 2504 y(morphic)d(lam)o(b)q(da)e (calculus,")i(in)h Fa(Pro)q(c)g(5th)g(Ann)o(ual)29 2554 y(IEEE)12 b(Symp)q(osium)c(on)j(Logic)g(in)g(Computer)f(Science)r Fh(.)-120 2646 y(K)g(Hammond,)c(PL)j(W)m(adler)g(&)h(D)f(Brady)e ([1991],)g(\\Imp)q(erate:)i(b)q(e)29 2695 y(imp)q(erativ)o(e,")18 b(Departmen)o(t)h(of)g(Computer)g(Science,)29 2745 y(Univ)14 b(of)f(Glasgo)o(w.)951 195 y(P)20 b(Hudak)7 b([July)20 b(1992],)e(\\Con)o(tin)o(uation-based)h(m)o(utable)f(ab-)1100 245 y(stract)f(datat)o(yp)q(es,)e(or)h(ho)o(w)f(to)g(ha)o(v)o(e)h(y)o (our)f(state)h(and)1100 295 y(m)o(unge)k(it)g(to)q(o,")g(Y)m (ALEU/DCS/RR-914,)e(Depart-)1100 345 y(men)o(t)13 b(of)g(Computer)h (Science,)g(Y)m(ale)g(Univ)o(ersit)o(y)m(.)951 436 y(P)c(Hudak,)f(SL)h (P)o(eyton)g(Jones,)g(PL)g(W)m(adler,)f(Arvind,)g(B)h(Boutel,)1100 486 y(J)j(F)m(airbairn,)e(J)i(F)m(asel,)f(M)h(Guzman,)e(K)i(Hammo)o (nd,)d(J)1100 536 y(Hughes,)16 b(T)g(Johnsson,)g(R)f(Kieburtz,)h(RS)f (Nikhil,)f(W)1100 586 y(P)o(artain)d(&)h(J)g(P)o(eterson)d([Ma)o(y)h (1992],)g(\\Rep)q(ort)i(on)f(the)1100 636 y(functional)19 b(programming)d(language)j(Hask)o(ell,)g(V)m(er-)1100 685 y(sion)14 b(1.2,")e Fa(SIGPLAN)i(Notices)9 b Fh(27.)951 777 y(P)23 b(Hudak)f(&)h(RS)f(Sundaresh)8 b([Marc)o(h)22 b(1989],)f(\\On)i(the)g(ex-)1100 827 y(pressiv)o(eness)g(of)d (purely-functional)f(I/O)i(systems,")1100 877 y(Y)m(ALEU/DCS/RR-665,)34 b(Departmen)o(t)j(of)f(Com-)1100 927 y(puter)15 b(Science,)g(Y)m(ale)e (Univ)o(ersit)o(y)m(.)951 1018 y(P)o(aul)i(Hudak)7 b([Aug)16 b(1986],)e(\\A)j(seman)o(tic)e(mo)q(del)g(of)g(reference)1100 1068 y(coun)o(ting)j(and)f(its)h(abstraction,")g Fa(Pro)q(c)h(A)o(CM)e (Con-)1100 1118 y(ference)f(on)d(Lisp)h(and)g(F)m(unctional)f (Programming)s Fh(.)951 1210 y(E)25 b(Ireland)7 b([Marc)o(h)25 b(1989],)e(\\W)m(riting)g(in)o(teractiv)o(e)i(and)g(\014le-)1100 1260 y(pro)q(cessing)31 b(functional)e(programs,")e(MSc)k(thesis,)1100 1309 y(Victoria)14 b(Univ)o(ersit)o(y)f(of)h(W)m(ellington.)951 1401 y(P)c(Jouv)o(elot)g(&)h(D)f(Gi\013ord)c([Jan)k(1991],)f (\\Algebraic)h(reconstruc-)1100 1451 y(tion)j(of)f(t)o(yp)q(es)i(and)f (e\013ects,")i(in)d Fa(18'th)h(A)o(CM)g(Symp)q(o-)1100 1501 y(sium)19 b(on)h(Principles)h(of)e(Programming)e(Languages)1100 1551 y(\(POPL\),)e(Orlando)r Fh(,)e(A)o(CM.)951 1643 y(Ken)o(t)21 b(Karlsson)7 b([1982],)18 b(\\Nebula)i(-)h(a)f(functional) f(op)q(erating)1100 1692 y(system,")13 b(Chalmers)g(Inst,)h(Goteb)q (org.)951 1784 y(BW)c(Kernighan)g(&)g(DM)f(Ritc)o(hie)e([1978],)g Fa(The)k(C)f(programmi)o(ng)1100 1834 y(language)p Fh(,)j(Pren)o(tice)i (Hall.)951 1926 y(E)22 b(Moggi)6 b([June)22 b(1989],)e(\\Computational) e(lam)o(b)q(da)i(calculus)1100 1976 y(and)11 b(monads,")d(in)i Fa(Logic)g(in)g(Computer)g(Science,)i(Cal-)1100 2025 y(ifornia)p Fh(,)g(IEEE.)951 2117 y(JT)20 b(O'Donnell)6 b([1985],)18 b(\\Dialogues:)g(a)i(basis)h(for)e(construct-)1100 2167 y(ing)f(programmi)o(ng)d(en)o(vironmen)o(ts,")i(in)h Fa(Pro)q(c)h(A)o(CM)1100 2217 y(Symp)q(osium)10 b(on)j(Language)f (Issues)j(in)d(Programming)1100 2267 y(En)o(vironmen)o(ts,)h(Seattle)r Fh(,)h(A)o(CM,)f(19{27.)951 2358 y(N)19 b(P)o(erry)8 b([1991],)18 b(\\The)h(implemen)o(tation)d(of)j(practical)h(func-)1100 2408 y(tional)12 b(programming)e(languages,")i(PhD)h(thesis,)h(Im-)1100 2458 y(p)q(erial)g(College,)f(London.)951 2550 y(SL)20 b(P)o(eyton)i(Jones)8 b([Apr)20 b(1992],)f(\\Implemen)o(ting)f(lazy)i (func-)1100 2600 y(tional)e(languages)g(on)h(sto)q(c)o(k)h(hardw)o (are:)e(the)i(Spine-)1100 2649 y(less)g(T)m(agless)f(G-mac)o(hine,")e Fa(Journal)i(of)g(F)m(unctional)1100 2699 y(Programming)7 b Fh(2,)13 b(127{202.)909 2960 y(14)p eop %%Page: 15 15 15 14 bop -120 195 a Fh(SL)13 b(P)o(eyton)g(Jones)8 b([Oct)13 b(1988],)e(\\Con)o(v)o(erting)h(streams)h(to)f(con-)29 245 y(tin)o(uations)22 b(and)f(vice)i(v)o(ersa,")e(Electronic)i(mail)c (on)29 295 y(Hask)o(ell)14 b(mailing)c(list.)-120 387 y(SL)k(P)o(eyton)g(Jones)h(&)f(J)g(Launc)o(h)o(bury)7 b([Sept)14 b(1991],)e(\\Un)o(b)q(o)o(xed)29 436 y(v)n(alues)j(as)h (\014rst)f(class)h(citizens,")f(in)g Fa(F)m(unctional)f(Pro-)29 486 y(gramming)20 b(Languages)j(and)g(Computer)f(Arc)o(hitec-)29 536 y(ture,)d(Boston)p Fh(,)g(Hughes,)g(ed.,)f(LNCS)h(523,)e(Springer) 29 586 y(V)m(erlag.)-120 678 y(J)12 b(Reynolds)7 b([1981],)j(\\The)i (essence)i(of)e(Algol,")e(in)i Fa(Algorithmic)29 727 y(Languages)r Fh(,)17 b(de)h(Bakk)o(er)g(&)g(v)n(an)f(Vliet,)g(eds.,)h (North)29 777 y(Holland,)13 b(345{372.)-120 869 y(J)f(Reynolds)7 b([1989],)i(\\Syn)o(tactic)j(con)o(trol)g(of)f(in)o(terference,)j(part) 29 919 y(I)q(I,")19 b(in)h Fa(In)o(ternational)f(Collo)q(quium)d(on)j (Automata,)29 969 y(Languages,)14 b(and)f(Programming)t Fh(.)-120 1060 y(D)o(A)d(Sc)o(hmidt)c([Apr)k(1985],)e(\\Detecting)j (global)d(v)n(ariables)i(in)g(de-)29 1110 y(notational)j(sp)q (eci\014cations,")h Fa(TOPLAS)c Fh(7,)j(299{310.)-120 1202 y(V)k(Sw)o(arup,)f(US)h(Reddy)f(&)h(E)g(Ireland)7 b([Sept)17 b(1991],)d(\\Assign-)29 1252 y(men)o(ts)k(for)h(applicativ)o (e)e(languages,")g(in)h Fa(F)m(unctional)29 1302 y(Programming)f (Languages)j(and)g(Computer)f(Arc)o(hi-)29 1351 y(tecture,)12 b(Boston)p Fh(,)d(Hughes,)h(ed.,)g(LNCS)f(523,)g(Springer)29 1401 y(V)m(erlag,)k(192{214.)-120 1493 y(SJ)f(Thompson)6 b([1989],)j(\\In)o(teractiv)o(e)j(functional)f(programs)f(-)h(a)29 1543 y(metho)q(d)k(and)g(a)g(formal)e(seman)o(tics,")i(in)f Fa(Declarativ)o(e)29 1593 y(Programming)t Fh(,)c(D)o(A)j(T)m(urner,)h (ed.,)g(Addison)g(W)m(esley.)-120 1684 y(M)f(T)m(ofte)6 b([No)o(v)12 b(1990],)e(\\T)o(yp)q(e)j(inference)h(for)e(p)q (olymorphic)f(ref-)29 1734 y(erences,")16 b Fa(Information)11 b(and)j(Computation)5 b Fh(89.)-120 1826 y(PL)15 b(W)m(adler)6 b([1990],)12 b(\\Linear)i(t)o(yp)q(es)h(can)g(c)o(hange)g(the)g(w)o (orld!,")29 1876 y(in)f Fa(Programming)d(concepts)k(and)f(metho)q(ds)r Fh(,)f(M)h(Bro)o(y)29 1926 y(&)h(C)e(Jones,)i(eds.,)f(North)g(Holland.) -120 2018 y(PL)21 b(W)m(adler)6 b([Jan)21 b(1992],)e(\\The)i(essence)i (of)d(functional)g(pro-)29 2067 y(gramming,)o(")14 b(in)j Fa(Pro)q(c)h(Principles)g(of)f(Programmi)o(ng)29 2117 y(Languages)r Fh(,)c(A)o(CM.)-120 2209 y(PL)25 b(W)m(adler)6 b([June)25 b(1990],)e(\\Comprehending)g(monads,")g(in)29 2259 y Fa(Pro)q(c)e(A)o(CM)f(Conference)h(on)e(Lisp)h(and)f(F)m (unctional)29 2309 y(Programming,)10 b(Nice)r Fh(,)15 b(A)o(CM.)-120 2400 y(D)21 b(W)m(ak)o(eling)5 b([No)o(v)21 b(1990],)f(\\Linearit)o(y)h(and)h(laziness,")f(PhD)29 2450 y(thesis,)12 b(Departmen)o(t)e(of)h(Computer)f(Science,)i(Univ)o (er-)29 2500 y(sit)o(y)i(of)f(Y)m(ork.)909 2960 y(15)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF