Better yet, if you know it to be pure, you can give it an appropriate type and just use it in pure code, like:
pure native cos java.lang.Math.cos :: Double -> Double
which should be roughly equivalent to: foreign import jvm "java.lang.Math.cos" cos :: Double -> Double
except that no Haskell compiler that I know implements the "jvm" calling convention, for obvious reasons.In fact, all primitive operations, types and so on are defined this way in the Frege Prelude.
But it is also not as relevant as one might think.
Consider how many Haskell programs actually use mutable C data, or export functions that take a foreign ptr to some mutable stuff.
Why should this be generally different in Frege? Useful Java APIs will be wrapped and sanitized through Frege libraries, and that is it then.
You can go directly to Java, just like you can directly go to C in Haskell, but it turns out one rarely actually does this.
This might be the reason that haskell has not enjoyed nearly the adoption of Scala and Clojure.
The different syntax should not be a big issue, as Haskell code that uses FFI targeting C is per se not portable.