Handling Errors

Gustavo Villavicencio gustavov at ucse.edu.ar
Thu Apr 24 10:26:18 EDT 2003

Hi all,

Suppose the next fragment

main = newCString s1 >>= \p1 ->
       newCString s2 >>= \p2 ->
       let p3 = hstrL p2 p1
       in peekCString p3 >>= \s ->
          print s

where hstrL is a C function. The question is,
if newCString fails to get allocation to s1 or s2,
how must i handle this error?.
Thanks for any help.

More information about the FFI mailing list