-
10.4.3. Access a Haskell library package in the nixpkgs repo (without a .cabal file)
+
10.4.3. Access a Haskell library package in the nixpkgs repo (without using a .cabal file)
Occasionally you might want to run a short Haskell program that depends on a Haskell library,
but you don’t want to bother writing a cabal file.
@@ -4904,12 +4904,12 @@ and line 17 uses the custom GHC as a build input for this flake.
3
4
5
-
6 import Text.Pandoc.Filters.Columns
+6 | import Data.List.Extra
main :: IO ()
main = do
- putStrLn "Prove we have access to the pandoc-columns package"
- print $ defaultColSpec
+ print $ lower "ABCDE"
+ print $ upper "XYZ"
|
@@ -4920,21 +4920,13 @@ and line 17 uses the custom GHC as a build input for this flake.
$ runghc Main.hs # Fails; dependency not available
-Main.hs:1:1: error: [GHC-87110]
- Could not find module ‘Text.Pandoc.Filters.Columns’.
- Use :set -v to see a list of the files searched for.
- |
-1 | import Text.Pandoc.Filters.Columns
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+<no location info>: error: [GHC-49196] Can't find Main.hs
+*** Exception: ExitFailure 1
$ nix develop
$ runghc Main.hs # Works in development environemnt
-Main.hs:1:1: error: [GHC-87110]
- Could not find module ‘Text.Pandoc.Filters.Columns’.
- Use :set -v to see a list of the files searched for.
- |
-1 | import Text.Pandoc.Filters.Columns
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+<no location info>: error: [GHC-49196] Can't find Main.hs
+*** Exception: ExitFailure 1
@@ -5644,7 +5636,7 @@ Hello from your flake!