<div dir="ltr">Any clues in the documentation as to where I can find out how to do this? I've looked (and failed) to figure out how to call "maybe(T)" from C, basically I have the result of calling a C function that reutns NULL or a window pointer:<div><br></div><div>   SDL_WIndow *w = SDL_CreateWindow(...);</div><div><br></div><div>and I want the pred to return maybe(sdl_window) where so in my main code I can switch on the result blah blah</div><div><br></div><div>sdl_creatwindow(..., MW, ..., !IO),</div><div>(</div><div>    MW = yes(Wnd),</div><div>    % start my app</div><div>;</div><div>    MW = no,</div><div>    % fail path</div><div>),</div><div><br></div><div><br></div><div>:- type sdl_window.<br>:- pragma foreign_type("C", sdl_window, "SDL_Window *", [can_pass_as_mercury_type]).<br></div><div><br></div><div>It's just knowing what the "way" is?!?!</div><div><br></div><div>Thanks,</div><div>Sean.</div><div><br></div></div>