"Copyright (c) Simon Peyton Jones and John Hughes.
The authors intend this Report to belong to the entire Haskell community, and so we grant permission to copy and distribute it for any purpose, provided that it is reproduced in its entireity, including this Notice. Modified versions of this Report may also be copied and distributed for any purpose, provided that the modified version is clearly presented as such, and that it does not claim to be a definition of the language Haskell 98."
"If the indentation of the non-brace lexeme immediately following a where, let, do or of is less than or equal to the current indentation level, then instead of starting a layout, an empty list "{}" is inserted, and layout processing occurs for the current level (i.e. insert a semicolon or close brace)."
size :: Stack a -> Int
stmts -> stmt1 ... stmtn exp [;] (n>=0)
"Pattern matching against ConsSet also gives rise to an Eq a constraint. For example:
f (ConsSet a s) = athe function f has inferred type Eq a => Set a -> a."
"The pattern "F {}" matches any value built with constructor F, whether or not F was declared with record syntax."
The new phrase is "if v appears only in constraints of the form (C v) where C is a class". Without this condition the rest of the sentence does not make sense.
f :: (Monad m, Eq (m a)) => a -> m a -> Bool f x y = x == return yis wrong; it should read
f x y = return x == y
import Foo as A(f)
"The name occurring in a type signature or fixity declarations is always unqualified, and unambiguously refers to another declaration in the same declaration list (except that the fixity declaration for a class method can occur at top level --- Section 4.4.2). For example, the following module is legal:
module F where sin :: Float -> Float sin x = (x::Float) f x = Prelude.sin (F.sin x)The local declaration for sin is legal, even though the Prelude function sin is implicitly in scope. The references to Prelude.sin and F.sin must both be qualified to make it unambigous which sin is meant. However, the unqualified name "sin" in the type signature in the first line of F unambiguously refers to the local declaration for sin."
module A( null, nonNull ) where import Prelude hiding( null ) null, nonNull :: Int -> Bool null x = x == 0 nonNull x = not (null x)Module A redefines null, and contains an unqualified reference to null on the right hand side of nonNull. The latter would be ambiguous without the "hiding(null)" on the "import Prelude" statement. Every module that imports A unqualified, and then makes an unqualified reference to null must also resolve the ambiguous use of null just as A does. Thus there is little danger of accidentally shadowing Prelude names.
fromRealFrac :: (RealFrac a, Fractional b) => a -> bshould be replaced by
realToFrac :: (Real a, Fractional b) => a -> b
userError :: String -> IOErrorAlso add an index entry for userError on this page. (These changes are purely presentational.)
enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]
-- List index (subscript) operator, 0-origin (!!) :: [a] -> Int -> a xs !! n | n < 0 = error "Prelude.!!: negative index" [] !! _ = error "Prelude.!!: index too large" (x:_) !! 0 = x (_:xs) !! n = xs !! (n-1)(The original version had the property that ([] !! -100) reported "index too large".)
"Copyright (c) Simon Peyton Jones and John Hughes.
The authors intend this Report to belong to the entire Haskell community, and so we grant permission to copy and distribute it for any purpose, provided that it is reproduced in its entireity, including this Notice. Modified versions of this Report may also be copied and distributed for any purpose, provided that the modified version is clearly presented as such, and that it does not claim to be a definition of the Haskell 98 libraries."
data Permissions = Permissions { readable, writable, executable, searchable :: Bool } deriving ( Eq, Ord, Read, Show )