Skip to content
This repository was archived by the owner on Feb 1, 2019. It is now read-only.

Commit 799eb42

Browse files
committed
Support inferring the type of an expression again.
1 parent 8180950 commit 799eb42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

haskell/LTHaskellClient.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ execCommand state (LTCommand (cId, command, Just ltPayload)) =
9292
Right msg | isBlank msg -> respond "editor.eval.haskell.success" $ LTPayload "" line
9393
Right msg -> respond "editor.eval.haskell.result" $ LTPayload msg line
9494

95+
go "haskell.api.type" payloadData = do
96+
result <- evalInSession (":type " ++ payloadData) $ ltReplSession state
97+
let line = ltLine ltPayload
98+
case result of
99+
Left msg -> respond "editor.eval.haskell.exception" $ LTPayload msg line
100+
Right msg -> respond "editor.eval.haskell.result" $ LTPayload msg line
101+
95102
respond :: (ToJSON a) => Command -> a -> IO ()
96103
respond respCommand respPayload = sendResponse (ltHandle state) $ LTCommand (cId, respCommand, respPayload)
97104

0 commit comments

Comments
 (0)