Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to install ghc on arch linux?

3 Answer(s) Available
Answer # 1 #

Machine code can be run on Linux. There is nothing special required to run a compiled software like xmonad. On the other side, building AUR packages or developing software requires a build tool to be installed.

To install the latest version of Haskell, you need the following packages.

The Arch ghc package and all haskell-* packages in the community only provide dynamically linked libraries. Dynamic linking is the default when it comes to linking, so one must set up GHC, Cabal and Stack for it.

Dynamic linking results in faster builds and smaller disk and RAM usage, and will free you from cross-GHC mixing errors.

It's disadvantage is that all tools you install from source will break on every update of ghc, ghc-libs or haskell-* packages. The usual message error will be displayed when you load shared libraries: libhs...so: cannot open shared object file. To fix this, just rebuild and relink the broken tool to newer libraries.

static linking is easier to maintain and does not force you to rebuild tools from source after every update of their dependencies.

static linking is often the preferred option for local development outside of the package system. If you prefer static linking, you can find more information on the internet.

The -dynamic flag must be passed to GHC in order to link successfully. You can try it with the file.

Run it with:

To download the latest list of packages from Hackage, run the following command.

Uncomment and modify the options in /.cabal/config.

You can use the stack setup command to create a global configuration. Stack will download its own version of GHC to an isolated location upon first invocation. To force Stack to use system GHC installation, run a stack setup with system-ghc andsolver flags.

You need to specify a resolver that is compatible with your GHC system.

Stack will happily ignore the system-ghc flag and download its own copy. The ghc --version command can be used to determine the version of the system.

Pick a nightly snapshot or Long Term Support (LTS) from Stackage website. The snapshot should be used for the --resolver flag on the command line.

Stacking usually lags behind new releases. It is possible that no Stackage snapshot has yet been released. If you want to wait until support for newer GHC releases lands on Stackage, you might want to choose a snapshot for some earlier minor version of GHC or temporarily downgrade your Haskell installation.

Add the following snippets to /.stack/config.yaml:

Hackage and Stackage have source packages for most of the Haskell libraries.

A number of popular Haskell packages are available from official Arch repositories. Additional packages can be installed from AUR.

At some point, you may want to install Haskell packages directly from Hackage or someone else's packages from source, even though it is recommended to use pacman to install Ghc, libraries and tools.

You will need either Stack or Cabal to do that.

The advantages and disadvantages of different package management styles are summarized in a table.

The original build system for Haskell is called Cabal.

You can install most of the libraries and tools on Hackage.

The $PATH environment variable is needed to run user-wide executables.

The Hackage package and all of its dependencies can be installed in a single step.

You can build and install a Haskell package. The following command can be run from the package directory.

The.cabal file should have a list of the package's dependencies and version constraints. During the package installation, Cabal tries to find a set of dependencies. dependency resolution is a process.

There are many reasons why Stack exists. Sometimes dependency resolution fails but most of the time it works well.

You will need to figure out the cause of the problem and give the other person some hints about how to resolve it. Sometimes it's necessary to say "allow-newer" to allow Cabal to ignore the upper bounds of the dependency versions of the package.

It gets hairier for less-well maintained packages; for another example, see this thread about installing Idris (another programming language, written in Haskell), where one had to use both --allow-newer and --constraint='haskeline < 0.8.0.0' command-line flags to get a compile successfully.

There is no easy way to do it. There are external tools that support this function.

Remove /.cabal and /.ghc from the Haskell package system and start over. When GHC is upgraded, this is necessary.

It is possible to use ghc-package unregister package or ghc-package hide package to make Ghc forget about an installed package. There are no files removed by these.

Stack is a tool to manage Haskell packages. It has a slightly different philosophy and goals. It uses a library under the hood and integrates with Hackage, but also maintains its own repository of packages on Stackage with the promise that snapshots arecurated and include packages which work well together.

Stack installs compiled executables to /.local/bin. You can add this directory to the $PATH environment variable in your shell configuration file.

Run the following instructions to build and install a Stackage package.

The following command can be used to build and install a Haskell package from source.

The same resolver should be used for both the stack setup command and the resolver you specify.

The "uninstall" operation is not supported by Stack.

Remove the /.stack directory and start from scratch if you want to install the whole Haskell package system. When GHC is upgraded, this is necessary.

Haskell haskell-language-server is a language server protocol. It provides features like code completion, "goto definition", documentation on hover, linting, and refactoring for any editor that integrates with the LSP.

If you are using Haskell packages that are linked, you should install haskell-language-server.

If you prefer static linking, install haskell-language-server-staticAUR. Each supported version of GHC has a statically linked package. The haskell-language-server can be installed by using the Haskell extension.

When you open your project, haskell-language-server will attempt to determine the build configuration. You might want to use a hie.yaml file in the project root directory if automatic detection fails.

ghcid is a tool for Haskell development that provides a simple and robust way to display compiler errors and warnings on every source code change. It can be installed using the ghcidAUR package.

You can search the Haskell libraries by function name or approximate type signature on the internet. It is possible to install via the package on the internet.

There is an online version of hoogle.

Hlint suggests ways to improve Haskell code. It can be found through hlint package.

stan is a Haskell static analyzer. It is in the early stages of being ready for public use.

Weeder is a program analysis application.

[6]
Edit
Query
Report
Snag Aranoa
Spotlight Operator
Answer # 2 #

It depends on your machine. AArch64/ARM64 is the architecture.

[5]
Edit
Query
Report
Igo Montaño
Experimental Psychologist
Answer # 3 #

First, log in to your Linux machine as a non root user. When installing the operating system, your user is likely to be named something other than travis.

You will have just finished installing Arch if you are following along with the article series. We were able to enable time sync.

We did it on the live image. Since we're installing the actual system, you'll probably have to re-enable it.

Check the setting.

Go ahead and enable NTP if the system clock shows no.

The package manager can be used to install all sorts of packages.

It's a good idea to update the packages on your system before installing a new one.

Everything you need to run xmonad is installed.

Fira Mono is a fonts installed by the command above. If you prefer, you can use another monospace fonts that I like, but you can also search for it.

A new file is called /.

Every time you start the X server, the commands you enter in this file will run. Every time you start the process for handling graphics displays.

is just a name for your directory.

A lot of the files you'll be working with will begin with a dot.

This tells Linux that the file should be hidden. Make sure you pay attention to the dots. It is important to get right when entering commands and editing files.

The file has a single line in it. This will make sure that xmonad starts when you start X server.

A new directory for configuration is needed.

This is a good example configuration file.

X server will start xmonad.

You won't see much unless you use a black screen.

This is what the default installation is.

You can open the terminal with the following commands.

You can open a second, third, and fourth terminal to see the tiling windows in action.

A single window has a full screen.

When you open a second window, it goes into the "stack" on the right side.

If you keep opening the windows, they will get pushed into the stack.

xmonad also has work spaces. These are similar to virtual desktops. You are on workspace 1.

You can switch to any of them by pressing Alt + 1, Alt + 2 and so on.

How would you use it? You may want a certain group of windows for editing code open on workspace 1 and then a fullscreen web browser on workspace 2. You can change workspace to workspace at any time with the key binding.

If you have more than one terminal open, close them all with Shift + c.

You can learn and use a lot of keyboard binding. You will be able to manage your windows. You will be able to open, close, and navigate around your windows with lightning speed once you learn these.

The most common keyboard binding I use on a daily basis is listed here.

The manual page has all the keyboard bindings.

I like to have gaps between my windows. It looks better to me. If you want gaps between your windows, you can use xmonad.

You can change your xmonad configuration file.

Next to the other import statements, add the following new line.

You can find the layout section by scrolling down.

The line that reads myLayout should be added above the other lines.

Everything is set to have a 5 pixel gap around it, but you can adjust to your liking.

We need to apply mySpacing to the layout. The current line should be changed.

To read.

Go ahead and save the file.

If you want to see the gaps in action, open a few windows and restart xmonad.

The black background is boring. A tool called feh can be used to set a custom image.

You have to install feh.

You can find a nice wallpaper online. Make a note of the URL once you've found it.

The person who took the photo is free to use it under the Unsplash License.

Make a directory of things to do.

You can download the picture. The appropriate values for your image should be replaced with sunset.jpg.

You can set it as a wallpaper.

You should be able to see your new wallpaper if you close the windows.

You should be able to see it through the gaps in your windows.

feh also creates an.fehbg file in your home directory which restores the wallpaper when you run it. You can tell xmonad to start running this program.

You can modify your xmonad configuration.

Line import run modules can be added in your imports section.

Find the call to main that looks similar.

Update it to this

You can exit and save it.

When you start xmonad, the wallpaper should appear.

If you quit xmonad and start it again, you can see if this is true.

The red border that appears around the active window is something that I don't like about the default configuration. I like a blue color that is subdued.

The xmonad configuration can be edited at /.xmonad/xmonad.hs again.

[3]
Edit
Query
Report
Romain prjb
CRUDE OIL TREATER