Go to the first, previous, next, last section, table of contents.

"HBC-ish" extensions implemented by GHC

`fromInt' method in class `Num':
It's there. Converts from an `Int' to the type.
`toInt' method in class `Integral':
Converts from type type to an `Int'.
Overlapping instance declarations:
In `instance <context> => Class (T x1 ... xn)', the `xi's can be types, rather than just type variables. Thus, you can have an instance `instance Foo [Char]', as well as the more general `instance Foo [a]'; the former will be used in preference to the latter, where applicable. As Lennart says, "This is a dubious feature and should not be used carelessly." See also: `SPECIALIZE instance' pragmas, in Section See section Faster: producing a program that runs quicker.
Signal-handling I/O request:
The Haskell-1.2 I/O request `SigAction n act' installs a signal handler for signal `n :: Int'. The number is the usual UNIX signal number. The action is of this type:
data SigAct
  = SAIgnore
  | SADefault
  | SACatch Dialogue
The corresponding continuation-style I/O function is the unsurprising:
sigAction :: Int -> SigAct -> FailCont -> SuccCont -> Dialogue
When a signal handler is installed with `SACatch', receipt of the signal causes the current top-level computation to be abandoned, and the specified dialogue to be executed instead. The abandoned computation may leave some partially evaluated expressions in a non-resumable state. If you believe that your top-level computation and your signal handling dialogue may share subexpressions, you should execute your program with the `-N' RTS option, to prevent black-holing. The `-N' option is not available with concurrent/parallel programs, so great care should be taken to avoid shared subexpressions between the top-level computation and any signal handlers when using threads.


Go to the first, previous, next, last section, table of contents.