{- |
Module : Language.Scheme.Plugins.CPUTime
Copyright : Justin Ethier
Licence : MIT (see LICENSE in the distribution)
Maintainer : github.com/justinethier
Stability : experimental
Portability : portable
This module wraps System.CPUTime so that it can be used directly by Scheme code.
More importantly, it serves as an example of how to wrap existing Haskell code so
that it can be loaded and called by husk.
See 'examples/ffi/ffi-cputime.scm' in the husk source tree for an example of how to
call into this module from Scheme code.
-}moduleLanguage.Scheme.Plugins.CPUTime(get,precision)whereimportLanguage.Scheme.TypesimportSystem.CPUTimeimportControl.Monad.Error-- |Wrapper for CPUTime.getCPUTimeget::[LispVal]->IOThrowsErrorLispValget[]=dot<-liftIO$System.CPUTime.getCPUTimereturn$NumbertgetbadArgList=throwError$NumArgs0badArgList-- |Wrapper for CPUTime.cpuTimePrecisionprecision::[LispVal]->IOThrowsErrorLispValprecision[]=return$Number$System.CPUTime.cpuTimePrecisionprecisionbadArgList=throwError$NumArgs0badArgList