Initial Commit
[packages] / xemacs-packages / haskell-mode / fontlock.hs
1 -- Comments are coloured brightly and stand out clearly.
2
3 repeat :: a -> [a]
4 repeat xs = xs where xs = x:xs          -- Keywords are also bright.
5
6 head :: [a] -> a
7 head (x:_) = x
8 head [] = error "PreludeList.head: empty list" -- Strings are coloured softly.
9
10 data Maybe a = Nothing | Just a              -- Type constructors, data
11              deriving (Eq, Ord, Read, Show)  -- constructors, class names
12                                              -- and module names are coloured
13                                              -- closer to ordinary code.
14
15 recognize +++ infix :: Operator Declarations
16 as `well` as = This Form
17 (+) and this one = as well
18
19 instance Show Toto where
20     fun1 arg1 = foo             -- FIXME: `fun1' should be highlighted.
21
22 constStr = "hello \
23            \asdgfasgf\
24            \asf"
25
26 {-
27 map :: (a -> b) -> [a] -> [b]           -- Commenting out large sections of
28 map f []     = []                       -- code can be misleading.  Coloured
29 map f (x:xs) = f x : map f xs           -- comments reveal unused definitions.
30 -}
31