Q:

What is the purpose of the LANGUAGE keyword in Haskell?

I saw a Haskell source code, and at the beginning of the source file, it included several things like:
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}

I know that comments in Haskell stat with {- and end with -}, but this is clearly something else. What's the purpose of this? It seems pretty similar like include statements or macros in C.

A:

The purpose is to enable language extensions. It's a compiler pragma. The GHC compiler supports a lot of language extensions. The GHC manual provides explanation of each extension and examples.

