How to use a DLL in a Haskell project?

You’ll need to use extra-lib-dirs and extra-libraries in the executable section of your .cabal file like so: name: MyApp version: 0.1.0.0 synopsis: homepage: author: simon.bourne category: build-type: Simple cabal-version: >=1.10 library exposed-modules: HelloWorld build-depends: base >= 4.7 && < 5 hs-source-dirs: src default-language: Haskell2010 executable MyApp main-is: Main.hs extra-lib-dirs: lib extra-libraries: helloWorld build-depends: base >= … Read more

How to install a package using stack?

stack install hakyll stack offers a curated set of packages that won’t blow your machine up. If you want to check what packages are available, or exactly what version is supported, or on what version of GHC you can get it, check out https://www.stackage.org/. For example, you can get hakyll 4.6.9.0 right now for both … Read more

How to print integer literals in binary or hex in haskell?

The Numeric module includes several functions for showing an Integral type at various bases, including showIntAtBase. Here are some examples of use: import Numeric (showHex, showIntAtBase) import Data.Char (intToDigit) putStrLn $ showHex 12 “” — prints “c” putStrLn $ showIntAtBase 2 intToDigit 12 “” — prints “1100”

Profiling builds with Stack

Profiling builds with Stack 1.0.0 and newer To build with profiling enabled: stack build –profile You may need to run stack clean first, but this should be fixed in Stack 1.5.0. To profile: stack exec –profile — <your program> +RTS <profiling options> where for <profiling options> you might want -p for time profiling or -h … Read more