{-# LANGUAGE OverloadedStrings #-} import Control.Lens test3s = [Left (1::Int), Left (2::Int),Right 3] test3_3 :: Maybe [Either Int Int] test3_3 = case preview (_head . _Left) test3s of Just _ -> Just (set (traversed . _Left) 200 test3s) Nothing -> Nothing main = print test3_3