blob: 88001e4bfb8f83313c9c2fdda2e3ed82804a2c29 (
plain)
1
2
3
4
5
6
7
8
9
10
|
fmap f p = Parser ((.) (fmapEither (fmap1st f)) (runParser p));
fmapEither f e = case e of {
Left x -> Left x;
Right x -> Right (f x)
};
fmap1st f p = case p of {
(l, r) -> (f l, r)
};
|