Home > Net >  Haskell fmt library not found
Haskell fmt library not found

Time:02-21

When I import the Haskell Fmt module, I get the information "Could not find module 'Fmt'. It is not a module in the current program, or in any known package".

GHCi, version 9.2.1: https://www.haskell.org/ghc/  :? for help
ghci> :set -XOverloadedStrings
ghci> import Fmt

<no location info>: error:
Could not find module `Fmt'
It is not a module in the current program, or in any known package.
ghci>

CodePudding user response:

Nowadays one uses cabal repl rather than ghci:

cabal repl --build-depends fmt
...
Prelude> :set -XOverloadedStrings 
Prelude> import Fmt
Prelude Fmt> let (a, b, n) = ("foo", "bar", 25)
Prelude Fmt> ("Here are some words: " |a| ", " |b| "\nAlso a number: " |n| "") :: String
"Here are some words: foo, bar\nAlso a number: 25"
  • Related