Created
April 26, 2015 19:46
-
-
Save danking/22270f0d20418a6ec660 to your computer and use it in GitHub Desktop.
>_>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance Monoid a => Monoid [(Either a b)] where | |
mempty = [] | |
mappend [] vs = vs | |
mappend vs [] = vs | |
mappend [(Left v1)] ((Left v2):vs) = (Left $ mappend v1 v2):vs | |
mappend (v1:v2:vs) vs' = v1 : (mappend (v2:vs) vs') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment