mirror of
https://github.com/anoma/juvix.git
synced 2025-01-07 16:22:14 +03:00
97030f8cb4
- ⚠️ Depends on #2644 The `effectful` library does not support the `Embed` effect out of the box. However, it offers `IOE`, which is equivalent to `Embed IO` from polysemy. In preparation to a possible migration to `effectful`, this pr hides the general `Embed` effect from the prelude and it exports a specialized `EmbedIO` in its place.
22 lines
807 B
Haskell
22 lines
807 B
Haskell
module Commands.Extra.Package where
|
|
|
|
import Juvix.Compiler.Pipeline.Package.Base
|
|
import Juvix.Compiler.Pipeline.Package.Loader
|
|
import Juvix.Extra.Paths
|
|
import Juvix.Prelude
|
|
|
|
renderPackage :: Package -> Text
|
|
renderPackage = renderPackageVersion currentPackageVersion
|
|
|
|
writePackageFile' :: (Member EmbedIO r) => PackageVersion -> Path Abs Dir -> Package -> Sem r ()
|
|
writePackageFile' v root pkg =
|
|
writeFileEnsureLn
|
|
(root <//> packageFilePath)
|
|
(renderPackageVersion v pkg)
|
|
|
|
writePackageFile :: (Member EmbedIO r) => Path Abs Dir -> Package -> Sem r ()
|
|
writePackageFile = writePackageFile' currentPackageVersion
|
|
|
|
writeBasicPackage :: (Member EmbedIO r) => Path Abs Dir -> Sem r ()
|
|
writeBasicPackage root = writePackageFile' PackageBasic root (emptyPackage DefaultBuildDir (root <//> packageFilePath))
|