forked from haskell/haskell-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontlock.hs
49 lines (38 loc) · 1.49 KB
/
fontlock.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
-- Comments are coloured brightly and stand out clearly.
import qualified Foo as F hiding (toto)
import qualified Foo hiding (toto)
import qualified Foo as F (toto)
import Foo as F hiding (toto)
import Foo hiding (toto)
import Foo as F (toto)
hiding = 1
qualified = 3
as = 2
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.
recognize +++ infix :: Operator Declarations
as `well` as = This Form
(+) and this one = as well
instance Show Toto where
fun1 arg1 = foo -- FIXME: `fun1' should be highlighted.
constStr = "hello \
\asdgfasgf\
\asf"
{-
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.
-}
-- Note: the least significant bit is the first element of the list
bdigits :: Int -> [Int]
bdigits 0 = [0]
bdigits 1 = [1]
bdigits n | n>1 = n `mod` 2 :
-- arch-tag: a0d08cc2-4a81-4139-93bc-b3c6be0b5fb2