From 6588473adf96a3eb7cfac55820ec022d4533fcbf Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 24 Aug 2015 15:45:45 -0600 Subject: Foldables --- monad/h21.hs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 monad/h21.hs (limited to 'monad/h21.hs') diff --git a/monad/h21.hs b/monad/h21.hs new file mode 100644 index 0000000..c843dcb --- /dev/null +++ b/monad/h21.hs @@ -0,0 +1,3 @@ +(>>=) m f = join $ fmap f m +join x = x >>= id +fmap f x = x >>= (return . f) -- cgit v1.2.3-70-g09d2