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
foreign import jvm "java.lang.Math.cos" cos :: Double -> Double
In fact, all primitive operations, types and so on are defined this way in the Frege Prelude.
Better yet, if you know it to be pure, you can give it an appropriate type and just use it in pure code, like:
which should be roughly equivalent to: 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.