--
You received this message because you are subscribed to the Google Groups "haskellr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskellr+unsubscribe@googlegroups.com.
To post to this group, send email to hask...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/haskellr/bfed050d-85dd-40be-8032-7f5d65f090fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{-# OPTIONS_GHC -fno-ghci-sandbox #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE ScopedTypeVariables #-}
import H.Prelude.Interactive as H.Prelude
Language.R.Instance.initialize Language.R.Instance.defaultConfig
--
You received this message because you are subscribed to the Google Groups "haskellr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskellr+unsubscribe@googlegroups.com.
To post to this group, send email to hask...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/haskellr/f4df08e2-c597-4360-9690-531e158565a7%40googlegroups.com.
:set -XQuasiQuotes
import qualified Foreign.R as R
import Foreign.R (SEXP, SEXPTYPE)
import Language.R.Instance as R
import Language.R.QQ
import H.Prelude (fromSomeSEXP)
z <- R.withEmbeddedR R.defaultConfig $ R.unsafeRunRegion [r|1+1|]
fromSomeSEXP z :: Double
Call that function early on from your main function.
My goal was to try to do a web app which calls R, and it works: http://stla.github.io/stlapblog/posts/RunRInYesod.htmlVery cool.
--
You received this message because you are subscribed to the Google Groups "haskellr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskellr+unsubscribe@googlegroups.com.
To post to this group, send email to hask...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/haskellr/896d144b-a991-41d3-b9c2-731656f67a5b%40googlegroups.com.
fromSomeSEXP x :: Double
> fromSomeSEXP y :: Int
<interactive>:35:1:
No instance for (Literal Int form0)
arising from a use of ‘fromSomeSEXP’
In the expression: fromSomeSEXP y :: Int
In an equation for ‘it’: it = fromSomeSEXP y :: Int
> fromSomeSEXP y :: Int
<interactive>:35:1:
No instance for (Literal Int form0)
arising from a use of ‘fromSomeSEXP’
In the expression: fromSomeSEXP y :: Int
In an equation for ‘it’: it = fromSomeSEXP y :: Int
> import Data.Int (Int32)
> fromSomeSEXP y :: Int32
2
fromSomeSEXP x :: DoubleHow to do when the result is an integer ? I can't get it:
> fromSomeSEXP x :: Int
<interactive>:35:1:
No instance for (Literal Int form0)
arising from a use of ‘fromSomeSEXP’
In the expression: fromSomeSEXP y :: Int
In an equation for ‘it’: it = fromSomeSEXP y :: Int
> fromSomeSEXP x :: Int
<interactive>:35:1:
No instance for (Literal Int form0)
arising from a use of ‘fromSomeSEXP’
In the expression: fromSomeSEXP y :: Int
In an equation for ‘it’: it = fromSomeSEXP y :: Int
--
You received this message because you are subscribed to the Google Groups "haskellr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskellr+unsubscribe@googlegroups.com.
To post to this group, send email to hask...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/haskellr/cefea562-64c8-4e06-8081-3d195200bac0%40googlegroups.com.