module Language.Haskell.LSP.Test.Parsing
( -- $receiving
- message
+ satisfy
+ , message
, anyRequest
, anyResponse
, anyNotification
-- anyResponse
-- @
+-- | Consumes and returns the next message, if it satisfies the specified predicate.
+--
+-- @since 0.5.2.0
satisfy :: (FromServerMessage -> Bool) -> Session FromServerMessage
satisfy pred = do
return x
else empty
--- | Matches a message of type 'a'.
+-- | Matches a message of type @a@.
message :: forall a. (Typeable a, FromJSON a) => Session a
message =
let parser = decode . encodeMsg :: FromServerMessage -> Maybe a