R Type Provider


IConvertFromR<'TOutType>

Namespace: RProvider

This interface can be used for providing new convertors that can convert R values to .NET types. The converter is used whenever the users calls the se.GetValue<'TOutType>() on a SymbolicExpression value returned from R provider.

Instance members

Instance memberDescription
Convert(arg1)
Signature: SymbolicExpression -> Option<'TOutType>
Modifiers: abstract

The method is called when the user calls GetValue<'TOutType>() on a SymbolicExpression value returned from the R provider.

Example

To use this interface, you need to write a plugin (YourPlugin.Plugin.dll) that exports an implementation of this interface using MEF. The method Convert of the interface can return None when the conversion is not possible.

1: 
2: 
3: 
4: 
5: 
[<Export(typeof<IConvertFromR<MyType>>)>]
type ConvertMyThingFromR() =
  interface IConvertFromR<MyThing> with 
  member x.Convert(symExpr) = 
    Some(new MyThing()) // TODO: Convert 'symExpr' from R.
val typeof<'T> : System.Type

Full name: Microsoft.FSharp.Core.Operators.typeof
Multiple items
type ConvertMyThingFromR =
  interface obj
  new : unit -> ConvertMyThingFromR
  override Convert : symExpr:'a -> 'b option

Full name: docs.ConvertMyThingFromR

--------------------
new : unit -> ConvertMyThingFromR
val x : ConvertMyThingFromR
override ConvertMyThingFromR.Convert : symExpr:'a -> 'b option

Full name: docs.ConvertMyThingFromR.Convert
val symExpr : 'a
union case Option.Some: Value: 'T -> Option<'T>
Fork me on GitHub