diff --git a/src/Prelude.newt b/src/Prelude.newt index 0488c87..5b12249 100644 --- a/src/Prelude.newt +++ b/src/Prelude.newt @@ -304,8 +304,6 @@ pfunc arrayToList uses (Nil _::_) : ∀ a. Array a → List a := `(a,arr) => { return rval }` - - -- for now I'll run this in JS pfunc lines uses (arrayToList) : String → List String := `(s) => Prelude_arrayToList(null,s.split('\n'))` @@ -725,6 +723,10 @@ instance Bifunctor _×_ where instance Functor IO where map f a = bind a $ \ a => pure (f a) +instance ∀ a. Functor (Either a) where + map f (Left x) = Left x + map f (Right y) = Right (f y) + uncurry : ∀ a b c. (a → b → c) → (a × b) → c uncurry f (a,b) = f a b