File: ForeignImport.hs

package info (click to toggle)
haskell-doctest-parallel 0.3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 652 kB
  • sloc: haskell: 3,241; makefile: 6; ansic: 4
file content (10 lines) | stat: -rw-r--r-- 255 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
{-# LANGUAGE ForeignFunctionInterface #-}
module ForeignImport where
import Foreign.C

import Prelude hiding (sin)
 
-- pure function
foreign import ccall "sin" c_sin :: CDouble -> CDouble
sin :: Double -> Double
sin d = realToFrac (c_sin (realToFrac d))