Hi Everyone,
(NOTE: I'm a complete beginner with Frege...as in I just started working with it a few hours ago.)
I was wondering if it is possible to call Scala code from Frege. So, I gave it a try, but I am having some trouble. Interestingly, I can call Frege code from Scala, but not vice-versa.
For example, here is a Scala class.
package example
object Blah {
val wiffy = "42"
}
And here is a Frege module where I attempt to call "Blah.wiffy":
module example.Hello where
data Meow = native example.Blah where
pure native wiffy example.Blah.wiffy :: String
greeting = "Hello, " ++ Meow.wiffy
main args = do
println ("Hello, " ++ Meow.wiffy)
I get a compiler error "`example.Blah` is not a known java class". I suspected that this would happen due to Scala's name mangling (cf.
http://stackoverflow.com/questions/12284028/how-can-i-use-a-scala-singleton-object-in-java). However, if I try to use the mangled name "example.Blah$" to refer to the scala object, I get a parser error "unexpected '::' while trying to parse a method type with optional throws clause".
Is Scala's name mangling incompatible with Frege, or am I doing things wrong?
Thanks so much!
William Harvey