Created
July 17, 2014 17:51
-
-
Save jmitchell/e1240e169cdb31fbb23e 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
setInsert : Eq a => Vect n a -> a -> Either (Vect n a) (Vect (S n) a) | |
setInsert xs x = if elem x xs | |
then Left xs | |
else Right (x :: xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment