purescript-0.13.8: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Make.Cache

Synopsis

Documentation

newtype CacheInfo Source #

A CacheInfo contains all of the information we need to store about a particular module in the cache database.

Instances
Eq CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

Ord CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

Show CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

Semigroup CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

Monoid CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

ToJSON CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

FromJSON CacheInfo Source # 
Instance details

Defined in Language.PureScript.Make.Cache

checkChanged :: Monad m => CacheDb -> ModuleName -> FilePath -> Map FilePath (UTCTime, m ContentHash) -> m (CacheInfo, Bool) Source #

Given a module name, and a map containing the associated input files together with current metadata i.e. timestamps and hashes, check whether the input files have changed, based on comparing with the database stored in the monadic state.

The CacheInfo in the return value should be stored in the cache for future builds.

The Bool in the return value indicates whether it is safe to use existing build artifacts for this module, at least based on the timestamps and hashes of the module's input files.

If the timestamps are the same as those in the database, assume the file is unchanged, and return True without checking hashes.

If any of the timestamps differ from what is in the database, check the hashes of those files. In this case, update the database with any changed timestamps and hashes, and return True if and only if all of the hashes are unchanged.

removeModules :: Set ModuleName -> CacheDb -> CacheDb Source #

Remove any modules from the given set from the cache database; used when they failed to build.

normaliseForCache :: FilePath -> FilePath -> FilePath Source #

  1. Any path that is beneath our current working directory will be stored as a normalised relative path
  2. Any path that isn't will be stored as an absolute path