Question in video format : http://youtu.be/3_pvK-gcLMM
Question in text format : how can I get Leksah to tell me the type of unlisten
in the code below ?
Code is taken from https://github.com/SodiumFRP/sodium/blob/master/haskell/examples/tests/unit-tests.hs
If this is not possible with Leksah (to get a type of a term inside a do block) then how is it possible to extract that information ? Is there some other Haskell tool or IDE that can do that ?
module Main where
import FRP.Sodium
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Data.Char
import Data.IORef
import Test.HUnit
main = do
putStrLn "Give me a line"
event1 = TestCase $ do
(ev, push) <- sync newEvent
outRef <- newIORef ""
sync $ do
push '?'
unlisten <- sync $ do
push 'h'
unlisten <- listen ev $ \letter -> modifyIORef outRef (++ [letter])
push 'e'
return unlisten
sync $ do
push 'l'
push 'l'
push 'o'
unlisten
sync $ do
push '!'
out <- readIORef outRef
assertEqual "event1" "hello" =<< readIORef outRef
EDIT: It seems that haskell-vim-now can do it :
Would be nice to have the same in Leksah somehow.