Skip to content

Commit 6b2f89f

Browse files
committed
Merge pull request #6 from purescript/fix-warnings
Fix wildcard warning and use either's fromRight
2 parents 81b15e0 + 924ae85 commit 6b2f89f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Control/Monad/Rec/Class.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Data.Either (Either(..))
1515
import Data.Functor ((<$))
1616
import Data.Identity (Identity(..), runIdentity)
1717
import qualified Control.Monad.Eff.Unsafe as U
18+
import qualified Data.Either.Unsafe as U
1819

1920
-- | This type class captures those monads which support tail recursion in constant stack space.
2021
-- |
@@ -82,12 +83,10 @@ tailRecEff f a = runST do
8283
writeSTRef r e'
8384
return false
8485
Right b -> return true
85-
fromRight <$> readSTRef r
86+
U.fromRight <$> readSTRef r
8687
where
87-
f' :: forall h. a -> Eff (st :: ST h | eff) _
88+
f' :: forall h. a -> Eff (st :: ST h | eff) (Either a b)
8889
f' = U.unsafeInterleaveEff <<< f
89-
fromRight :: forall a b. Either a b -> b
90-
fromRight (Right b) = b
9190

9291
-- | `forever` runs an action indefinitely, using the `MonadRec` instance to
9392
-- | ensure constant stack usage.

0 commit comments

Comments
 (0)