diff --git a/src/Record/Optional/Export.purs b/src/Record/Optional/Export.purs index f521480..76bd0c6 100644 --- a/src/Record/Optional/Export.purs +++ b/src/Record/Optional/Export.purs @@ -2,6 +2,7 @@ module Record.Optional.Export where import Prelude +import Data.Either (Either, either) import Data.Maybe (Maybe, maybe) import Data.Symbol (class IsSymbol, reflectSymbol) import Foreign (Foreign) @@ -38,6 +39,9 @@ instance exportArray :: Export a => Export (Array a) where instance exportMaybe :: Export a => Export (Maybe a) where export = maybe jsNull export +instance exportEither :: (Export a, Export b) => Export (Either a b) where + export = either export export + instance Export a => Export (Object a) where export = unsafeCoerce <<< map export