module Distribution.Types.SourceRepo.Lens
  ( T.SourceRepo
  , module Distribution.Types.SourceRepo.Lens
  ) where

import Distribution.Compat.Lens
import Distribution.Compat.Prelude
import Prelude ()

import Distribution.Types.SourceRepo (RepoKind, RepoType, SourceRepo)
import qualified Distribution.Types.SourceRepo as T

repoKind :: Lens' SourceRepo RepoKind
repoKind :: Lens' SourceRepo RepoKind
repoKind RepoKind -> f RepoKind
f SourceRepo
s = (RepoKind -> SourceRepo) -> f RepoKind -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\RepoKind
x -> SourceRepo
s{T.repoKind = x}) (RepoKind -> f RepoKind
f (SourceRepo -> RepoKind
T.repoKind SourceRepo
s))
{-# INLINE repoKind #-}

repoType :: Lens' SourceRepo (Maybe RepoType)
repoType :: Lens' SourceRepo (Maybe RepoType)
repoType Maybe RepoType -> f (Maybe RepoType)
f SourceRepo
s = (Maybe RepoType -> SourceRepo)
-> f (Maybe RepoType) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe RepoType
x -> SourceRepo
s{T.repoType = x}) (Maybe RepoType -> f (Maybe RepoType)
f (SourceRepo -> Maybe RepoType
T.repoType SourceRepo
s))
{-# INLINE repoType #-}

repoLocation :: Lens' SourceRepo (Maybe String)
repoLocation :: Lens' SourceRepo (Maybe String)
repoLocation Maybe String -> f (Maybe String)
f SourceRepo
s = (Maybe String -> SourceRepo) -> f (Maybe String) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe String
x -> SourceRepo
s{T.repoLocation = x}) (Maybe String -> f (Maybe String)
f (SourceRepo -> Maybe String
T.repoLocation SourceRepo
s))
{-# INLINE repoLocation #-}

repoModule :: Lens' SourceRepo (Maybe String)
repoModule :: Lens' SourceRepo (Maybe String)
repoModule Maybe String -> f (Maybe String)
f SourceRepo
s = (Maybe String -> SourceRepo) -> f (Maybe String) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe String
x -> SourceRepo
s{T.repoModule = x}) (Maybe String -> f (Maybe String)
f (SourceRepo -> Maybe String
T.repoModule SourceRepo
s))
{-# INLINE repoModule #-}

repoBranch :: Lens' SourceRepo (Maybe String)
repoBranch :: Lens' SourceRepo (Maybe String)
repoBranch Maybe String -> f (Maybe String)
f SourceRepo
s = (Maybe String -> SourceRepo) -> f (Maybe String) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe String
x -> SourceRepo
s{T.repoBranch = x}) (Maybe String -> f (Maybe String)
f (SourceRepo -> Maybe String
T.repoBranch SourceRepo
s))
{-# INLINE repoBranch #-}

repoTag :: Lens' SourceRepo (Maybe String)
repoTag :: Lens' SourceRepo (Maybe String)
repoTag Maybe String -> f (Maybe String)
f SourceRepo
s = (Maybe String -> SourceRepo) -> f (Maybe String) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe String
x -> SourceRepo
s{T.repoTag = x}) (Maybe String -> f (Maybe String)
f (SourceRepo -> Maybe String
T.repoTag SourceRepo
s))
{-# INLINE repoTag #-}

repoSubdir :: Lens' SourceRepo (Maybe FilePath)
repoSubdir :: Lens' SourceRepo (Maybe String)
repoSubdir Maybe String -> f (Maybe String)
f SourceRepo
s = (Maybe String -> SourceRepo) -> f (Maybe String) -> f SourceRepo
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Maybe String
x -> SourceRepo
s{T.repoSubdir = x}) (Maybe String -> f (Maybe String)
f (SourceRepo -> Maybe String
T.repoSubdir SourceRepo
s))
{-# INLINE repoSubdir #-}