|
|
|
|
|
by voxfrege
3961 days ago
|
|
> If you know such a function to be pure, you can use unsafePerformIO to tell the type system 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. |
|