{-# LANGUAGE ImpredicativeTypes, CPP #-}
-- | Functorial tasks, which have exactly one statically known dependency.
-- Docker is an example of a functorial build system: Docker containers are
-- organised in layers, where each layer makes changes to the previous one.
module Build.Task.Functor (dependency) where

#if __GLASGOW_HASKELL__ < 800
import Control.Applicative
#else
import Data.Functor.Const
#endif

import Build.Task

-- | Find the dependency of a functorial task.
dependency :: Task Functor k v -> k
dependency :: forall k v. Task Functor k v -> k
dependency Task Functor k v
task = Const k v -> k
forall {k} a (b :: k). Const a b -> a
getConst ((k -> Const k v) -> Const k v
Task Functor k v
task k -> Const k v
forall {k} a (b :: k). a -> Const a b
Const)