Ugh, sorry for pressing send too soon. You'll need 'W.' for the imports from StackSet: shiftMaster = W.modify' $ \c -> case c of W.Stack _ [] _ -> c -- already master. W.Stack t ls rs -> W.Stack t [] (reverse ls ++ rs) -- wmw