File: fontlock.hs

package info (click to toggle)
haskell-mode 2.0-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 504 kB
  • ctags: 315
  • sloc: lisp: 3,790; makefile: 70; haskell: 20; sh: 19
file content (19 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Comments are coloured brightly and stand out clearly.

repeat :: a -> [a]
repeat xs = xs where xs = x:xs          -- Keywords are also bright.

head :: [a] -> a
head (x:_) = x
head [] = error "PreludeList.head: empty list" -- Strings are coloured softly.

data Maybe a = Nothing | Just a              -- Type constructors, data
             deriving (Eq, Ord, Read, Show)  -- constructors, class names
                                             -- and module names are coloured
                                             -- closer to ordinary code.

{-
map :: (a -> b) -> [a] -> [b]           -- Commenting out large sections of
map f []     = []                       -- code can be misleading.  Coloured
map f (x:xs) = f x : map f xs           -- comments reveal unused definitions.
-}