From 415dfe780ac6bdf8c517532d86346f5ae739c404 Mon Sep 17 00:00:00 2001
From: Bas van Dijk <v.dijk.bas@gmail.com>
Date: Wed, 14 Dec 2011 12:24:38 +0100
Subject: [PATCH] Use sharing in the Alternative instance of Maybe
---
Control/Applicative.hs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Control/Applicative.hs b/Control/Applicative.hs
index 248bbac..e69b56e 100644
|
a
|
b
|
|
| 157 | 157 | |
| 158 | 158 | instance Alternative Maybe where |
| 159 | 159 | empty = Nothing |
| 160 | | Nothing <|> p = p |
| 161 | | Just x <|> _ = Just x |
| | 160 | Nothing <|> r = r |
| | 161 | l <|> _ = l |
| 162 | 162 | |
| 163 | 163 | instance Applicative [] where |
| 164 | 164 | pure = return |