mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 19:47:10 +03:00
Implement IsString instance for Unfold Identity
This commit is contained in:
parent
f08d73afa1
commit
eb7f738d7f
@ -250,6 +250,8 @@ import Control.Exception (Exception, mask_)
|
||||
import Control.Monad.Catch (MonadCatch)
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Control.Monad.Trans.Control (MonadBaseControl, liftBaseOp_)
|
||||
import Data.Functor.Identity (Identity, runIdentity)
|
||||
import Data.String
|
||||
import GHC.Types (SPEC(..))
|
||||
import Streamly.Internal.Control.Concurrent (MonadAsync)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
@ -1137,3 +1139,7 @@ handle :: (MonadCatch m, Exception e)
|
||||
=> Unfold m e b -> Unfold m a b -> Unfold m a b
|
||||
handle exc =
|
||||
gbracket_ return MC.try (\_ -> return ()) (discardFirst exc)
|
||||
|
||||
instance (a ~ Char) => IsString (Unfold Identity [a] a) where
|
||||
{-# INLINE fromString #-}
|
||||
fromString _ = fromList
|
||||
|
Loading…
Reference in New Issue
Block a user