Here is a list of differences between Helium (with overloading turned on) and Haskell 98.
- labeled fields in data types (a.k.a. records)
newtype
declarations- Strictness annotations
(,)
and(,,)
etc. to construct a tuple (type), i.e. you cannot write(,) 3 4
[]
as type constructor, i.e. you cannot writex :: [] Int
- literate programming
- n+k patterns
- The layout rule is somewhat simpler. more details
- If your main function is not of type
IO
, then the value is printed with ashow
function. The show functions can print anything, e.g. functions are printed as<function>
. Therefore, there is a difference between mainexpression and main
show expression. In the latter case, the expression must be in theShow
class. - The following character sequences are supported in characters and strings: \, \n, \a, \b, \f, \r, \t, \v, ", '. Other escape sequences, e.g., \030 are not supported.
- Numeric literals are not overloaded (even when using the
--overloading
flag). Thus,3
is of typeInt
and3.0
of typeFloat
. A consequence is that you can never write2 + 2.3
, although in overloaded mode you may write both2 + 3
and2.0 + 3.0
. - Type variables are always of kind star (*).
- A more restrictive syntax exists for operator sections. For instance,
(+2*3)
is not allowed, this should be written as(+(2*3))
. - A slightly more restrictive syntax exists for left-hand sides of function definitions. For example, in Helium the parentheses in the following definitions are necessary whereas in Haskell they are not:
(x:xs) ++ ys ` ... (x:xs) ` ...
Helium rejects a definition if operator precedence is necessary to understand the left-hand side. See the end of Section 4.4 of the Haskell 98 Report to see why we have done this.
- Fixity declarations are only allowed at top-level.
Integer
is simply a type synonym forInt
. This makes programs with the explicit typeInteger
compile but, of course, this does not make them have arbitrary precision.- Tuples with more than ten elements are not supported.