Hi all, I'm just wondering -- for "primitive" C types (int, float, char, etc), why was the decision made in the FFI to have function declarations look like e.g. foreign import ccall "math.h sin" sin :: CDouble -> CDouble rather than foreign import ccall "math.h sin" sin :: !CDouble -> !CDouble I'm fairly sure any foreign imported functions must be strict in their arguments, and it would make things a bit clearer for Haskell programmer. Am I missing something (non-)obvious in my reasoning? -- % Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
Andre Pang <ozone@algorithm.com.au> writes:
I'm just wondering -- for "primitive" C types (int, float, char, etc), why was the decision made in the FFI to have function declarations look like e.g.
foreign import ccall "math.h sin" sin :: CDouble -> CDouble
rather than
foreign import ccall "math.h sin" sin :: !CDouble -> !CDouble
Haskell doesn't reflect strictness of functions in their types, no matter whether foreign or not. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/
On 16/03/2005, at 8:27 PM, Marcin 'Qrczak' Kowalczyk wrote:
I'm just wondering -- for "primitive" C types (int, float, char, etc), why was the decision made in the FFI to have function declarations look like e.g.
foreign import ccall "math.h sin" sin :: CDouble -> CDouble
rather than
foreign import ccall "math.h sin" sin :: !CDouble -> !CDouble
Haskell doesn't reflect strictness of functions in their types, no matter whether foreign or not.
*sigh* Silly me, that's a rather good point. I guess I was off in Clean-land for a few minutes ... thanks Marcin. -- % Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
participants (2)
-
Andre Pang -
Marcin 'Qrczak' Kowalczyk