Skip to content

Language

konsumlamm edited this page Apr 10, 2026 · 2 revisions

The language is an extended subset of Haskell 2010.

Differences:

  • Kind variables need an explicit forall.
  • Extensions are always enabled, with the only exception being CPP.
  • Data type contexts are not supported.
  • main in the top module given to mhs serves at the program entry point.
  • Many things that should be an error (but which are mostly harmless) are not reported.
  • Text file I/O always uses UTF8, as does the source code.
  • The BangPatterns extension is parsed, but only effective at the a top level let/where.
  • More differences that I don't remember right now.

Mutually recursive modules are allowed the same way as with GHC, using .hs-boot files.

Extensions

The following extensions are supported:

Standard library modules

This table provides an overview of which standard library modules are report compliant.

Module Report compliant Comment
Prelude yes1 missing catch (as in GHC)
Control.Monad yes1 fail not in Monad (as in GHC)
Data.Array yes part of array-mhs
Data.Bits yes
Data.Char no missing lexLitChar, readLitChar (see commit b7370759bfb726d997ac238123de5ff6d38c4aa5)
Data.Complex yes1 no datatype context, instance (RealFloat a) => Show a
Data.Int yes
Data.Ix yes
Data.List yes
Data.Maybe yes
Data.Ratio yes
Data.Word yes
Foreign yes
Foreign.C yes
Foreign.C.Error yes
Foreign.C.String no missing functions (in particular CWString related)
Foreign.C.Types no missing/wrong instances
Foreign.ForeignPtr no missing FinalizerEnvPtr, newForeignPtrEnv, addForeignPtrFinalizerEnv. finalizeForeignPtr, unsafeForeignPtrToPtr
Foreign.Marshal yes
Foreign.Marshal.Alloc yes
Foreign.Marshal.Array yes
Foreign.Marshal.Error yes1 void :: Functor f => f a -> f ()
Foreign.Marshal.Utils yes
Foreign.Ptr yes freeHaskellFunPtr does nothing
Foreign.StablePtr yes
Foreign.Storable yes
Numeric yes
System.Environment yes
System.Exit yes
System.IO no missing functions2, missing types3, missing IOMode instances
System.IO.Error yes1 renamed catch, try to catchIOError, tryIOError (as in GHC)

1. not quite, but close enough, see comment

2. hFileSize, hSetFileSize, hIsEOF, hGetPosn, hSetPosn, hSeek, hTell, hIsOpen, hIsClosed, hIsReadable, hIsWritable, hIsSeekable, hSetEcho, hGetEcho, hShow, hWaitForInput, hReady, hPrint

3. HandlePosn, SeekMode

Clone this wiki locally