sectionSet :: SectionId -> SectionFlag -> Exp Bool -> Action ()
sectionSet sec flag set = do
    v <- var
    emit $ SectionGetFlags sec v
    v <- return (return $ Value $ val v :: Exp Int)
    iff set
        (emit1 (SectionSetFlags sec) $ setBit   v (fromEnum flag))
        (emit1 (SectionSetFlags sec) $ clearBit v (fromEnum flag))


-- don't want to accidentally dupe the message box, so make it in Action Exp
sectionSet :: SectionId -> SectionFlag -> Exp Bool -> Action ()
sectionSet sec flag set = do
    v <- var
    emit $ SectionGetFlags sec v
    v <- return (return $ Value $ val v :: Exp Int)
    iff set
        (emit1 (SectionSetFlags sec) $ setBit   v (fromEnum flag))
        (emit1 (SectionSetFlags sec) $ clearBit v (fromEnum flag))


-- don't want to accidentally dupe the message box, so make it in Action Exp
sectionSet sec flag set = do
    v <- var
    emit $ SectionGetFlags sec v
    v <- return (return $ Value $ val v :: Exp Int)
    iff set
        (emit1 (SectionSetFlags sec) $ setBit   v (fromEnum flag))
        (emit1 (SectionSetFlags sec) $ clearBit v (fromEnum flag))


-- don't want to accidentally dupe the message box, so make it in Action Exp