Skip to content

Commit

Permalink
Export Either
Browse files Browse the repository at this point in the history
  • Loading branch information
katsujukou committed Dec 26, 2023
1 parent 9163156 commit 77e6373
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Record/Optional/Export.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 77e6373

Please sign in to comment.