inline-r-0.9.1: Seamlessly call R from Haskell and vice versa. No FFI required.

Safe HaskellNone
LanguageHaskell2010

H.Prelude

Contents

Description

| Copyright: (C) 2013 Amgen, Inc.

DEPRECATED: use Language.R instead.

Synopsis

Documentation

class (Applicative m, MonadIO m, MonadCatch m, MonadMask m, PrimMonad m) => MonadR m where Source #

The class of R interaction monads. For safety, in compiled code we normally use the R monad. For convenience, in a GHCi session, we normally use the IO monad directly (by means of a MonadR instance for IO, imported only in GHCi).

Minimal complete definition

getExecContext, unsafeRunWithExecContext

Associated Types

data ExecContext m :: * Source #

A reification of an R execution context, i.e. a "session".

Methods

io :: IO a -> m a Source #

Lift an IO action.

acquire :: s ~ V => SEXP s a -> m (SEXP (Region m) a) Source #

Acquire ownership in the current region of the given object. This means that the liveness of the object is guaranteed so long as the current region remains active (the R garbage collector will not attempt to free it).

acquire :: (MonadIO m, Region m ~ G) => SEXP s a -> m (SEXP (Region m) a) Source #

Acquire ownership in the current region of the given object. This means that the liveness of the object is guaranteed so long as the current region remains active (the R garbage collector will not attempt to free it).

getExecContext :: m (ExecContext m) Source #

Get the current execution context.

unsafeRunWithExecContext :: m a -> ExecContext m -> IO a Source #

Provides no static guarantees that resources do not extrude the scope of their region. Acquired resources are not freed automatically upon exit. For internal use only.

Instances

MonadR (R s) Source # 

Associated Types

data ExecContext (R s :: * -> *) :: * Source #

Methods

io :: IO a -> R s a Source #

acquire :: (* ~ s) V => SEXP s a -> R s (SEXP (Region (R s)) a) Source #

getExecContext :: R s (ExecContext (R s)) Source #

unsafeRunWithExecContext :: R s a -> ExecContext (R s) -> IO a Source #

type Region m = PrimState m Source #

Language.R functions

module Language.R

Globals