1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

🔥 the IsString constraint.

This commit is contained in:
Rob Rix 2019-10-10 15:58:23 -04:00
parent c2908ed497
commit 4044575648
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -10,7 +10,6 @@ module Control.Effect.Readline
) where
import Control.Effect.Carrier
import Data.String
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Terminal
import GHC.Generics (Generic1)
@ -25,8 +24,8 @@ instance HFunctor Readline
instance Effect Readline
prompt :: (IsString str, Member Readline sig, Carrier sig m) => String -> m (Int, Maybe str)
prompt p = fmap (fmap fromString) <$> send (Prompt p (curry pure))
prompt :: (Member Readline sig, Carrier sig m) => String -> m (Int, Maybe String)
prompt p = send (Prompt p (curry pure))
print :: (Carrier sig m, Member Readline sig) => Doc AnsiStyle -> m ()
print s = send (Print s (pure ()))