-
Notifications
You must be signed in to change notification settings - Fork 35
/
Combinator.hs
84 lines (54 loc) · 1.75 KB
/
Combinator.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
module Text.Parsec.String.Combinator where
{-
Wrappers for the Text.Parsec.Combinator module with the types fixed to
'Text.Parsec.String.Parser a', i.e. the stream is String, no user
state, Identity monad.
-}
import qualified Text.Parsec.Combinator as C
import Text.Parsec.String (Parser)
choice :: [Parser a] -> Parser a
choice = C.choice
count :: Int -> Parser a -> Parser [a]
count = C.count
between :: Parser open -> Parser close -> Parser a -> Parser a
between = C.between
option :: a -> Parser a -> Parser a
option = C.option
optionMaybe :: Parser a -> Parser (Maybe a)
optionMaybe = C.optionMaybe
optional :: Parser a -> Parser ()
optional = C.optional
skipMany1 :: Parser a -> Parser ()
skipMany1 = C.skipMany1
many1 :: Parser a -> Parser [a]
many1 = C.many1
sepBy :: Parser a -> Parser sep -> Parser [a]
sepBy = C.sepBy
sepBy1 :: Parser a -> Parser sep -> Parser [a]
sepBy1 = C.sepBy1
endBy :: Parser a -> Parser sep -> Parser [a]
endBy = C.endBy
endBy1 :: Parser a -> Parser sep -> Parser [a]
endBy1 = C.endBy1
sepEndBy :: Parser a -> Parser sep -> Parser [a]
sepEndBy = C.sepEndBy
sepEndBy1 :: Parser a -> Parser sep -> Parser [a]
sepEndBy1 = C.sepEndBy1
chainl :: Parser a -> Parser (a -> a -> a) -> a -> Parser a
chainl = C.chainl
chainl1 :: Parser a -> Parser (a -> a -> a) -> Parser a
chainl1 = C.chainl1
chainr :: Parser a -> Parser (a -> a -> a) -> a -> Parser a
chainr = C.chainr
chainr1 :: Parser a -> Parser (a -> a -> a) -> Parser a
chainr1 = C.chainr1
eof :: Parser ()
eof = C.eof
notFollowedBy :: Show a => Parser a -> Parser ()
notFollowedBy = C.notFollowedBy
manyTill :: Parser a -> Parser end -> Parser [a]
manyTill = C.manyTill
lookAhead :: Parser a -> Parser a
lookAhead = C.lookAhead
anyToken :: Parser Char
anyToken = C.anyToken