X-Git-Url: http://git.lukelau.me/?p=lsp-test.git;a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest%2FParsing.hs;h=09006b67859957aedab3ac045a3926ad09598037;hp=1fd394f3db1ee96a6810a25fa4e62e9be9f235e2;hb=ae9d99b56df5468816e476059f59537da18fab9c;hpb=14c48f727d1c049f33cd9b3e1e485a6ae1d6f574 diff --git a/src/Language/Haskell/LSP/Test/Parsing.hs b/src/Language/Haskell/LSP/Test/Parsing.hs index 1fd394f..09006b6 100644 --- a/src/Language/Haskell/LSP/Test/Parsing.hs +++ b/src/Language/Haskell/LSP/Test/Parsing.hs @@ -5,7 +5,8 @@ module Language.Haskell.LSP.Test.Parsing ( -- $receiving - message + satisfy + , message , anyRequest , anyResponse , anyNotification @@ -60,6 +61,9 @@ import Language.Haskell.LSP.Test.Session -- 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 @@ -85,7 +89,7 @@ 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