concept GHC in category haskell

appears as: GHC, The GHC, GHC, GHC
Haskell in Depth

This is an excerpt from Manning's book Haskell in Depth.

With this instance, GHC is able to delegate pattern mathing failures to the fail method. Thus, we’ll get Nothing as expected.

type family Mutable v = mv | mv -> v
Get Programming with Haskell

This is an excerpt from Manning's book Get Programming with Haskell.

Haskell is a compiled language and the Glasgow Haskell Compiler is the reason Haskell is as powerful as it is. The job of the compiler is to transform human readable source code into machine readable binary. At the end compilation you are left with an executable binary file. This is very different than when you run Ruby for example, in which another program reads in your source code and interprets it on the fly (this is accomplished with an Interpreter). The main benefit of a compiler over an interpreter is that, since the compiler transforms code in advance, it can take much more time to perform analysis and optimization of the code you have written. Because of some other design features of Haskell, namely its powerful type system, there is an adage that "If it compiles it works". Though you will use GHC often, never take it for granted. It is an amazing piece of software in its own right.

  • Use GHC and GHCi
  • Haskell is a compiled language, and the Glasgow Haskell Compiler is the reason Haskell is as powerful as it is. The job of the compiler is to transform human-readable source code into machine-readable binary. At the end compilation, you’re left with an executable binary file. This is different from when you run Ruby, for example, in which another program reads in your source code and interprets it on the fly (this is accomplished with an interpreter). The main benefit of a compiler over an interpreter is that because the compiler transforms code in advance, it can perform analysis and optimization of the code you’ve written. Because of some other design features of Haskell, namely its powerful type system, there’s an adage that if it compiles, it works. Though you’ll use GHC often, never take it for granted. It’s an amazing piece of software in its own right.

    To invoke GHC, open a terminal and type in ghc:

    $ ghc

    In this text, whenever you come across a $ sign, it means you’re typing into a command prompt. Of course, with no file to compile, GHC will complain. To get started, you’ll make a simple file called hello.hs. In your text editor of choice, create a new file named hello.hs and enter the following code.

    In this lesson, our objective was to get you started with Haskell. You started by installing the Haskell Platform, which bundles together the tools you’ll be using through this book. These tools include GHC, Haskell’s compiler; GHCi, the interactive interpreter for Haskell; and stack, a build tool you’ll use later in the book. The rest of this lesson covered the basics of writing, refactoring, interacting with, and compiling Haskell programs. Let’s see if you got this.