lean4-htt/Lake/Config/Context.lean
2022-06-14 15:54:07 -04:00

28 lines
714 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2021 Mac Malone. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mac Malone
-/
import Lake.Config.Opaque
import Lake.Config.InstallPath
open System
namespace Lake
/-- A Lake configuration. -/
structure Context where
lean : LeanInstall
lake : LakeInstall
opaqueWs : OpaqueWorkspace
/-- A transformer to equip a monad with a `Lake.Context`. -/
abbrev LakeT := ReaderT Context
@[inline] def LakeT.run (ctx : Context) (self : LakeT m α) : m α :=
ReaderT.run self ctx
/-- A monad equipped with a `Lake.Context`. -/
abbrev LakeM := LakeT Id
@[inline] def LakeM.run (ctx : Context) (self : LakeM α) : α :=
ReaderT.run self ctx |>.run