úÎa[ÅM      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL NoneThe  IOSpec f a is merely type synonym for IO a . Once you've C tested a module, you can use these definitions to avoid having to  change your type signatures. %Note that because this definition of  ignores its f  argument, each of ,  , etc., is simply an empty data  type. NoneThe (:< :) class The coproduct of functors A value of type   f a is either a pure value of type a  or some effect, determined by f . Crucially,   f is a  monad, provided f is a functor. The fold over   values.  MNOPQR       MNOPQRNoneThe 0 type class captures all the different types of ( operations that can be executed in the  monad. The 2 type contains all the primitive effects that are $ observable on the virtual machine. The 3 monad is essentially a state monad, modifying the A store. Besides returning pure values, various primitive effects A may occur, such as printing characters or failing with an error  message. !The !1 function allocate a fresh location on the heap. "The "- function removes the data stored at a given : location. This corresponds, for instance, to emptying an MVar. #The #+ function returns a previously unallocated . $The $. function kills the thread with the specified  . %The %- function returns the data stored at a given ! heap location, if there is any. &The & constant is the  of the main process. 'The ' and ( functions are the primitive  counterparts of S and T in the  monad. )The )+ function overwrites a given location with  new data. *The *0 function updates the process associated with a  given . +The +4 scheduler provides a simple round-robin scheduler. ,The ,& scheduler will never schedule forked ; threads, always scheduling the main thread. Only use this + scheduler if your code is not concurrent. -The -/ function is the heart of this library. Given B the scheduling algorithm you want to use, it will run a value of  type   f a/, returning the sequence of observable effects  together with the final store. .The . returns the final  after executing a  computation. Beware3: this function assumes that your computation will $ succeed, without any other visible . If your computation C reads a character from the teletype, for instance, it will return  an error. /The /, function returns the effects a computation > yields, but discards the final state of the virtual machine. & !"#$%&'()*+,-./UVWXYZ  !"#$%&'()*+,-./  !"#$%&(')*+,-/. !"#$%&'()*+,-./UVWXYZNone0An expression of type   0 a corresponds to an IO = computation that may print to or read from stdout and stdin  respectively. AThere is a minor caveat here. I assume that stdin and stdout are B not buffered. This is not the standard behaviour in many Haskell  compilers. 1The 13 function can be used to read a character from the  teletype. 2The 12 function can be used to print a character to the  teletype. 012345[\012345012345012345[\None 6A 6, is a shared, mutable variable used by STM. 8An expression of type IOSpec 8 a corresponds to an ]  computation that may use 9 and returns a value of type  a.  By itself, 80 is not terribly useful. You will probably want  to use IOSpec (ForkS :+: STMS). 9The 9! function atomically executes an 7 action. :The :0 function creates a new transactional variable. ;The ;& function reads the value stored in a  transactional variable. <The <+ function overwrites the value stored in a  transactional variable. =The =5 function abandons a transaction and retries at some  later time. >The >3 function checks if its boolean argument holds. If 8 the boolean is true, it returns (); otherwise it calls =. ?The ? function takes two 7 actions stm1 and stm2 and  performs stm1. If stm1 calls = it performs stm2. If stm1  succeeds, on the other hand, stm2 is not executed. 6789:;<=>?^_`a 6789:;<=>? 8976:;<=?>6789:;<=>?^_`aNone@<A mutable variable storing a value of type a. Note that the  types stored by an @ are assumed to be Typeable. AAn expression of type IOSpec IORefS a corresponds to an IO A computation that uses mutable references and returns a value of  type a. BThe B* function creates a new mutable variable. CThe C8 function reads the value stored in a mutable variable. DThe D+ function overwrites the value stored in a  mutable variable. EThe E4 function applies a function to the value stored in  and @. bThe  instance for the A monad. @ABCDEbc@ABCDEA@BCDE@ABCDEbcNoneFAn F is a shared, mutable variable. GAn expression of type IOSpec MVarS a corresponds to an IO ? computation that uses shared, mutable variables and returns a  value of type a.  By itself, G0 is not terribly useful. You will probably want  to use IOSpec (ForkS :+: MVarS). HThe H function creates a new F that is initially empty. IThe I) function removes the value stored in an  F . If the F" is empty, the thread is blocked. JThe J function fills an F with a new value. If the  F& is not empty, the thread is blocked. FGHIJdeFGHIJGFHIJFGHIJdeNoneKAn expression of type IOSpec ForkS a corresponds to an ]  computation that uses L and returns a value of  type a.  By itself, K0 is not terribly useful. You will probably want  to use IOSpec (ForkS :+: MVarS) or IOSpec (ForkS :+: STMS). LThe L" function forks off a new thread. KLfgKLKLKLfg NoneF  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLh      !"#$%&'()*+,-./0123456 789:;<= >?@ABCDE FGHIJKLMNOPQRSTUV7UV8WXYZ[\]^_`abcdefghijkl IOSpec-0.2Test.IOSpec.SurrogateTest.IOSpec.TypesTest.IOSpec.VirtualMachineTest.IOSpec.TeletypeTest.IOSpec.STMTest.IOSpec.IORefTest.IOSpec.MVarTest.IOSpec.Fork Test.IOSpec:+:TeletypeSTMSIORefSMVarSForkSIOSpec:<:InrInlImpurePure foldIOSpecinjectStepBlock ExecutablestepEffectFailPrintReadCharDoneVMStore SchedulerThreadIdLocData initialStoreallocemptyLoc freshThreadId finishThread lookupHeapmainTidreadChar printChar updateHeap updateSoup roundRobinsingleThreaded runIOSpec execIOSpec evalIOSpecgetCharputCharputStrputStrLngetLineTVarSTM atomicallynewTVarreadTVar writeTVarretrycheckorElseIORefnewIORef readIORef writeIORef modifyIORefMVar newEmptyMVartakeMVarputMVarforkIO $f:<:f:+: $f:<:f:+:0$f:<:ff $fFunctor:+: $fMonadIOSpec$fFunctorIOSpecbase System.IO$fExecutable:+: $fMonadEffect$fFunctorEffect$fShowScheduler$fArbitraryScheduler$fArbitraryThreadId$fExecutableTeletype$fFunctorTeletypeghc-prim GHC.TypesIO $fMonadSTM $fFunctorSTM$fExecutableSTMS $fFunctorSTMS$fExecutableIORefS$fFunctorIORefS$fExecutableMVarS$fFunctorMVarS$fExecutableForkS$fFunctorForkS