22
votes

Can the GHC-specific libraries be called the standard library? Or do only those in the Haskell 2010 report count?

Many of the GHC libraries can be implemented by the functions in the Haskell report, possibly combined with C bindings. But the others are reliant on GHC-specific extensions, since the current Haskell language as defined in the language report doesn't support it.

For example, can Data.Array.IO be implemented in pure standard Haskell?

Is it really okay to think that GHC is Haskell?

1
Specifically about Data.Array.IO, the answer is explicitly "no". The array docs say that "In addition to providing the Data.Array module as specified in the Haskell 2010 Language Report, this package also defines the classes IArray of immutable arrays and MArray of arrays mutable within appropriate monads, as well as some instances of these classes" (emphasis mine); meanwhile, Data.Array.IO is marked as "non-portable (uses Data.Array.MArray)".duplode
As far as I know, GHC is the only current general purpose Haskell implementation. That said, you might want to check what libraries are available with GHCJS and Haste, and perhaps to branch out a bit to Haskell relatives like Purescript and Frege.dfeuer
Unfortunately the Haskell community doesn't have a real consensus about what's the "standard" library. The report libraries are too limited for many uses, the GHC libraries are mainly defined by what GHC itself needs, the Haskell Platform was an attempt to define one but many don't like to depend on it, and Stackage and especially Hackage are too huge.Ørjan Johansen
@ØrjanJohansen Probably you should post your comment as an answer.Sibi

1 Answers

13
votes

Unfortunately the Haskell community doesn't have a real consensus about what's the "standard" library.