úÎ1$.^"      !QPull together several methods of reducing priority and easy access to resources:  ", and the rlimit bindings,  If called with False,  will not use POSIX rlimits. #$%&Set all the available rlimits. = These values have been determined through trial-and-error '()*+,-./012LReturn false if any of the listed modules cannot be found in the whitelist. JModules which we should load by default. These are of course whitelisted. K Specifically, we want the Prelude because otherwise things are horribly K crippled; we want SimpleReflect so we can do neat things (for said neat  things, see   Mhttp://twan.home.fmf.nl/blog/haskell/simple-reflection-of-expressions.details); ? and we want ShowQ and ShowFun to neuter IO stuff even more. Q The rest should be safe to import without clashes, according to the Lambdabot  sources. JBorrowed from Lambdabot, this is the whitelist of modules which should be 2 safe to import functions from, but which we don't want to import by  default. 4 FIXME: make these qualified imports. The GHC API & Hint currently do not  support qualified imports. N WARNING: You can import these with --module, certainly, but the onus is on E the user to make sure they fully disambiguate function names; ie: : mueval --module Data.Map -e "Prelude.map (+1) [1..100]" ESee the results of --help for information on what each option means.  346Just give us the end result options; this parsing for & us. Bonus points for handling UTF.       GThe actual calling of Hint functionality. The heart of this just calls  5;, but we do so much more - we disable Haskell extensions, ; hide all packages, make sure one cannot call unimported 6 functions, typecheck, set resource limits for this ( thread, and do some error handling. Wrapper around '; supplies a fresh GHC API session and V error-handling. The arguments are largely passed on, and the results lightly parsed. (Print the String (presumably the result O of interpreting something), but only print the first 1024 characters to avoid * flooding. Lambdabot has a similar limit. &Oh no, something has gone wrong. If it'#s a compilation error pretty print ) the first 1024 chars of it and throw an  ExitException 1 otherwise rethrow the exception in String form. 8Renders the input String including its exceptions using  exceptionMsg $max number of characters to include input  ( output, True if we found an exception )    KFork off a thread which will sleep and then kill off the specified thread. A basic blocking operation.  Using MVars, block on forkedMain' until it finishes. !Set a 5 on this thread, and then continue on with whatever.  ! ! !6       !"#$%&'()*+,-./0123456789:;<=>? mueval-0.8Mueval.ResourcesMueval.ContextMueval.ArgsParseMueval.InterpreterMueval.ParallellimitResources cleanModulesdefaultModulesqualifiedModulesOptions timeLimitmodules expressionloadFileuser printType extensionsnamedExtensions noImportsrLimitsinterpreterOpts getOptionsStreamEnd ExceptionCons interpreterinterpreterSessionmvloadsayIOprintInterpreterError exceptionMsgrendertoStreamwatchDogblock forkedMain forkedMain' unix-2.4.0.2System.Posix.ProcessnicetotalMemoryLimitSofttotalMemoryLimitHardstackSizeLimitSoftstackSizeLimitHardopenFilesLimitSoftopenFilesLimitHardfileSizeLimitSoftfileSizeLimitHarddataSizeLimitSoftdataSizeLimitHardcpuTimeLimitSoftcpuTimeLimitHardcoreSizeLimitSoftcoreSizeLimitHardzerolimitsdefaultOptionsoptions hint-0.3.2.3 Hint.Evaleval