[Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Sep 22 15:15:31 EDT 2006


Hello Brian,

Friday, September 22, 2006, 9:03:01 PM, you wrote:

>     withBSTR8 :: [Char] -> (BSTR8 -> IO a) -> IO a
>     withBSTR8 s f =
>         bracket
>             (createBSTR8 s)
>             (\bstr -> free (bstr `plusPtr` (-4)))
>             (\bstr -> f bstr)

this may be shortened to

>     withBSTR8 s =
>         bracket
>             (createBSTR8 s)
>             (\bstr -> free (bstr `plusPtr` (-4)))

my lib contains a tons of such brackets

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list