aboutsummaryrefslogtreecommitdiff
path: root/test.txt
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-03-10 18:26:30 +0100
committertomsmeding <tom.smeding@gmail.com>2019-03-10 18:26:30 +0100
commit48d6f83c36f55471ba66281e6d9b272fb4b336f2 (patch)
tree0d605ad7140861e30af21c7489d5ea4957ef1c50 /test.txt
parent34d9f21c6ab529e415f38a5a886b1b612bcbd3bc (diff)
Enough to prove functoriality of Parser
Diffstat (limited to 'test.txt')
-rw-r--r--test.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/test.txt b/test.txt
index 88001e4..072ac19 100644
--- a/test.txt
+++ b/test.txt
@@ -8,3 +8,14 @@ fmapEither f e = case e of {
fmap1st f p = case p of {
(l, r) -> (f l, r)
};
+
+runParser p = case p of {
+ Parser g -> g
+};
+
+(.) f g x = f (g x);
+id x = x;
+
+v = fmap id (Parser g);
+x = fmap ((.) f g) (Parser g);
+y = ((.) (fmap f) (fmap g)) (Parser g);