{-# language DeriveFunctor, DeriveFoldable, DeriveTraversable, DeriveGeneric #-}
{-# language InstanceSigs, ScopedTypeVariables, TypeApplications #-}
module Language.Python.Syntax.AugAssign where
import Control.Lens.Lens (Lens', lens)
import Data.Generics.Product.Typed (typed)
import GHC.Generics
import Language.Python.Syntax.Ann
import Language.Python.Syntax.Whitespace
data AugAssign a
= MkAugAssign
{ _augAssignAnn :: Ann a
, _augAssignType :: AugAssignOp
, _augAssignWhitespace :: [Whitespace]
}
deriving (Eq, Show, Functor, Foldable, Traversable, Generic)
instance HasAnn AugAssign where
annot :: forall a. Lens' (AugAssign a) (Ann a)
annot = typed @(Ann a)
instance HasTrailingWhitespace (AugAssign a) where
trailingWhitespace =
lens _augAssignWhitespace (\a b -> a { _augAssignWhitespace = b })
data AugAssignOp
= PlusEq
| MinusEq
| StarEq
| AtEq
| SlashEq
| PercentEq
| AmpersandEq
| PipeEq
| CaretEq
| ShiftLeftEq
| ShiftRightEq
| DoubleStarEq
| DoubleSlashEq
deriving (Eq, Show)