<div dir="ltr">...but I can't see what I have done wrong!!!! I have this in my graphics window: the intenttion is to create an SDL window and render and then hand back the graphics state and yes or no, making the basic_window `det`.<div><br></div><div><font face="monospace">:- pred basic_window(<br>    string::in, int::in, int::in, int::in, int::in,<br>    gfx_state::in, {gfx_state, bool}::out,<br>    io::di, io::uo) is det.<br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">basic_window(Title, X, Y, W, H, GIn, {GOut, yes}, !IO) :-<br>    sdl_createwindow(Title, X, Y, W, H, [resizable], yes(Wnd), !IO),<br>    sdl_createrenderer(Wnd, -1, [accelerated], yes(_), !IO),<br>    GOut = GIn ^ gfx_wnd := maybe.yes(Wnd).<br><br>basic_window(Title, X, Y, W, H, GIn, {GIn, no}, !IO).</font><br></div><div><br></div><div>And calling it from my "execute" predicate int he game controller....</div><div><br></div><div><font face="monospace">:- pred execute(gfx_state::in, io::di, io::uo) is det.<br><br>execute(GfxState, !IO) :-<br>    (<br>        basic_window("blah", 0, 0, 400, 200, GfxState, {GfxState1, yes}, !IO)<br>    -><br>        random.init(0, RS),<br>        sdl_getticks(TNow, !IO),<br>        starfield.init(100, Starfield, RS, RS0),<br><br>        AppState  = app_state(<br>            TNow,<br>            GfxState1,<br>            Starfield<br>        ),<br>        game_loop(AppState, RS0, !IO)<br>    ;<br>        format("basic window failed\n", [], !IO)<br>    ),<br>    format("*\n* All over\n*\n", [], !IO).<br></font></div><div><br></div><div>But on building it I get this and I cannot figure out my error!</div><div><br></div><div><b>ddgame.m:042: In clause for `execute(in, di, uo)':<br>ddgame.m:042:   in argument 8 of call to predicate `gfx.basic_window'/9:<br>ddgame.m:042:   mode error: variable `STATE_VARIABLE_IO_0' has instantiatedness<br>ddgame.m:042:   `mostly_unique',<br>ddgame.m:042:   expected instantiatedness was `unique'.<br></b></div><div><br></div><div>I can't figure out what "mostly" is doing there...how did the compiler get to that place ?</div><div>TIA</div><div>Sean</div><div><br></div><div><br></div></div>