Newt - a dependent typed programming language

Add Functor Either a

+4 -2
+4 -2
src/Prelude.newt
··· 304 304 return rval 305 305 }` 306 306 307 - 308 - 309 307 -- for now I'll run this in JS 310 308 pfunc lines uses (arrayToList) : String → List String := `(s) => Prelude_arrayToList(null,s.split('\n'))` 311 309 ··· 724 722 725 723 instance Functor IO where 726 724 map f a = bind a $ \ a => pure (f a) 725 + 726 + instance ∀ a. Functor (Either a) where 727 + map f (Left x) = Left x 728 + map f (Right y) = Right (f y) 727 729 728 730 uncurry : ∀ a b c. (a → b → c) → (a × b) → c 729 731 uncurry f (a,b) = f a b