stack-1.5.0: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Internal

Description

Internal types to the library.

Synopsis

Documentation

data Env config #

Monadic environment.

Constructors

Env 

Instances

HasEnvConfig config => HasEnvConfig (Env config) # 

Methods

envConfigL :: Lens' (Env config) EnvConfig #

HasBuildConfig config => HasBuildConfig (Env config) # 

Methods

buildConfigL :: Lens' (Env config) BuildConfig #

HasConfig config => HasConfig (Env config) # 

Methods

configL :: Lens' (Env config) Config #

HasGHCVariant config => HasGHCVariant (Env config) # 

Methods

ghcVariantL :: Lens' (Env config) GHCVariant #

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

Methods

logOptionsL :: Lens' (Env config) LogOptions #

HasSticky (Env config) # 

Methods

stickyL :: Lens' (Env config) Sticky #

HasReExec (Env config) # 

Methods

reExecL :: Lens' (Env config) Bool #

HasTerminal (Env config) # 

Methods

terminalL :: Lens' (Env config) Bool #

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 #

Minimal complete definition

terminalL

Methods

terminalL :: Lens' env Bool #

Instances

HasTerminal (Env config) # 

Methods

terminalL :: Lens' (Env config) Bool #

class HasReExec env where #

Minimal complete definition

reExecL

Methods

reExecL :: Lens' env Bool #

Instances

HasReExec (Env config) # 

Methods

reExecL :: Lens' (Env config) Bool #

newtype Sticky #

Constructors

Sticky 

Fields

class HasSticky env where #

Minimal complete definition

stickyL

Methods

stickyL :: Lens' env Sticky #

Instances

HasSticky (Env config) # 

Methods

stickyL :: Lens' (Env config) Sticky #

class HasLogOptions env where #

Minimal complete definition

logOptionsL

Instances

HasLogOptions (Env config) # 

Methods

logOptionsL :: Lens' (Env config) LogOptions #

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
  ...