replace :: forall a. a -> AVar a -> Effect Unit replace x v = tryTake v *> tryPut x v $> unit