<div dir="ltr">I wrote a graph-like data type, with some functions for adding statements and relationships between statements. (It's different from a graph in that there's no edge/vertex distinction; there are only statements, but a statement might refer to other statements.)<br><br>Currently I'm using them in GHCI. Because it does not allow one to change a variable, I keep having to do things like this:<br>  let g0 = emptyDocument<br>  let s1 = newStatement ...<br>  let g1 = addStatement s1 g0<br>  let s2 = newStatement ...<br>  let g2 = addStatement s2 g1<br>  ...<br>If I wrote a standalone application, I could use mutable variables, so I would not have to define a new object every time I want to modify an existing one. However I like being able to type in arbitrary code into GHCI.<br><br>Can one have both of those at once? That is, could I either (1) use MVars from within GHCI, or (2) write a standalone app that lets the user evaluate arbitrary Haskell?<br></div>