stack-1.5.1: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Internal

Description

Internal types to the library.

Synopsis

Documentation

data Env config Source #

Monadic environment.

Constructors

Env 

Instances

HasEnvConfig config => HasEnvConfig (Env config) Source # 

Methods

envConfigL :: Lens' (Env config) EnvConfig Source #

HasBuildConfig config => HasBuildConfig (Env config) Source # 
HasConfig config => HasConfig (Env config) Source # 

Methods

configL :: Lens' (Env config) Config Source #

HasGHCVariant config => HasGHCVariant (Env config) Source # 

Methods

ghcVariantL :: Lens' (Env config) GHCVariant Source #

HasPlatform config => HasPlatform (Env config) Source # 
HasLogOptions (Env config) Source # 

Methods

logOptionsL :: Lens' (Env config) LogOptions Source #

HasSticky (Env config) Source # 

Methods

stickyL :: Lens' (Env config) Sticky Source #

HasReExec (Env config) Source # 

Methods

reExecL :: Lens' (Env config) Bool Source #

HasTerminal (Env config) Source # 

Methods

terminalL :: Lens' (Env config) Bool Source #

Monad m => MonadReader (Env config) (StackT config m) # 

Methods

ask :: StackT config m (Env config) #

local :: (Env config -> Env config) -> StackT config m a -> StackT config m a #

reader :: (Env config -> a) -> StackT config m a #

class HasTerminal env where Source #

Minimal complete definition

terminalL

Methods

terminalL :: Lens' env Bool Source #

Instances

HasTerminal (Env config) Source # 

Methods

terminalL :: Lens' (Env config) Bool Source #

class HasReExec env where Source #

Minimal complete definition

reExecL

Methods

reExecL :: Lens' env Bool Source #

Instances

HasReExec (Env config) Source # 

Methods

reExecL :: Lens' (Env config) Bool Source #

newtype Sticky Source #

Constructors

Sticky 

Fields

class HasSticky env where Source #

Minimal complete definition

stickyL

Methods

stickyL :: Lens' env Sticky Source #

Instances

HasSticky (Env config) Source # 

Methods

stickyL :: Lens' (Env config) Sticky Source #

class HasLogOptions env where Source #

Minimal complete definition

logOptionsL

Instances

view :: MonadReader s m => Getting a s a -> m a #

view is a synonym for (^.), generalised for MonadReader (we are able to use it instead of (^.) since functions are instances of the MonadReader class):

>>> view _1 (1, 2)
1

When you're using Reader for config and your config type has lenses generated for it, most of the time you'll be using view instead of asks:

doSomething :: (MonadReader Config m) => m Int
doSomething = do
  thingy        <- view setting1  -- same as “asks (^. setting1)”
  anotherThingy <- view setting2
  ...