2 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
4 module GHC.Types (Char(..), Int(..), Float(..), Double(..), IO(..)) where
7 -- We need Inl etc behind the scenes for the type definitions
12 data [] a = [] | a : [a]
17 -- ^A fixed-precision integer type with at least the range @[-2^29 .. 2^29-1]@.
18 -- The exact range for a given implementation can be determined by using
19 -- 'Prelude.minBound' and 'Prelude.maxBound' from the 'Prelude.Bounded' class.
21 -- | Single-precision floating point numbers.
22 -- It is desirable that this type be at least equal in range and precision
23 -- to the IEEE single-precision type.
24 data Float = F# Float#
26 -- | Double-precision floating point numbers.
27 -- It is desirable that this type be at least equal in range and precision
28 -- to the IEEE double-precision type.
29 data Double = D# Double#
32 A value of type @'IO' a@ is a computation which, when performed,
33 does some I\/O before returning a value of type @a@.
35 There is really only one way to \"perform\" an I\/O action: bind it to
36 @Main.main@ in your program. When your program is run, the I\/O will
37 be performed. It isn't possible to perform I\/O from an arbitrary
38 function, unless that function is itself in the 'IO' monad and called
39 at some point, directly or indirectly, from @Main.main@.
41 'IO' is a monad, so 'IO' actions can be combined using either the do-notation
42 or the '>>' and '>>=' operations from the 'Monad' class.
44 newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #))