mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-01-03 12:05:13 +08:00
temp
This commit is contained in:
parent
c7ec45dd0e
commit
1bc3cb16ec
2 changed files with 10 additions and 3 deletions
|
|
@ -4917,7 +4917,7 @@ In this example, we will access the <code>extra</code> package from the <code>ha
|
|||
</div>
|
||||
<div class="literalblock">
|
||||
<div class="content">
|
||||
<pre class="nowrap">$ runghc Main.hs # Won't work; package not available
|
||||
<pre class="nowrap">$ runghc Main.hs # Won't work; dependency not available
|
||||
|
||||
Main.hs:1:1: error: [GHC-87110]
|
||||
Could not find module ‘Data.List.Extra’.
|
||||
|
|
@ -4926,7 +4926,7 @@ Main.hs:1:1: error: [GHC-87110]
|
|||
1 | import Data.List.Extra
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
$ nix develop
|
||||
$ runghc Main.hs # Works now!
|
||||
$ runghc Main.hs # Works in development environemnt
|
||||
"abcde"
|
||||
"XYZ"</pre>
|
||||
</div>
|
||||
|
|
@ -5633,7 +5633,7 @@ Hello from your flake!</pre>
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-09-14 18:15:21 IST
|
||||
Last updated 2025-09-14 18:18:01 IST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,13 @@ Occasionally you might want to run a short Haskell program that depends on a Has
|
|||
but you don't want to bother writing a cabal file.
|
||||
In this example, we will access the `extra` package from the `haskellPackages` set in the nixpkgs repo.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
For non-trivial Haskell development projects,
|
||||
it's usually more convenient to use `haskell-flake` as described in <<#haskell-flake>>,
|
||||
together with the high-level workflow described in <<_development_workflows>>.
|
||||
====
|
||||
|
||||
[source,nix,linenums,highlight='11,16']
|
||||
.flake.nix
|
||||
....
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue