Achim Schneider wrote:
things like


data State = State { winSize :: IORef Size
    , t         :: IORef Int
    , fps       :: IORef Float
    , showFPS   :: IORef Bool
    , showHelp  :: IORef Bool
    , grabMouse :: IORef Bool
    , mousePos  :: IORef (Maybe Position)
    , mouseDelta :: IORef Position
    , viewRot   :: IORef Vec3
    , angle'    :: IORef GLfloat
    , ballPos   :: IORef Vec2
    , ballVel   :: IORef Vec2
    }


Yuck!

I'm not sure whether this is a real example or not, but if it's real, get rid of all those IORefs. Make State a simple type, and use (IORef State) as needed for callbacks, and hide that fact in other code.

Jules
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to