From 48d6f83c36f55471ba66281e6d9b272fb4b336f2 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 10 Mar 2019 18:26:30 +0100 Subject: Enough to prove functoriality of Parser --- test.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test.txt') 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); -- cgit v1.2.3-70-g09d2