Type inference
Closed this issue · 4 comments
gyzerok commented
It would be awesome to add an ability to see type of a particular expression
gabrielflorit commented
@gyzerok You might find this of use: https://github.com/ElmCast/elm-vim has this built in. Type :ElmShowDocs
when over a token (e.g. Signal
below) and you get lots of useful information:
gyzerok commented
Oh, sorry, I've mention ability to see this for my custom code.
search : String -> Query -> Effects (Maybe Response)
search endpoint query =
let url = Http.url ("http://example.com" ++ endpoint)
[ ( "key", "onlinedev" )
, ( "q", query.q )
, ( "region_id", "1" )
]
in
Http.get decode url
|> Task.toMaybe -- Show me type here
|> Effects.task
gyzerok commented
I'm talking not about Task.toMaybe
docs but about concrete return type after execution of this line
gyzerok commented
Maybe next example would better show my idea
search endpoint query = -- :type = String -> Query -> Effects (Maybe Response)
let url = Http.url ("http://example.com" ++ endpoint)
[ ( "key", "onlinedev" )
, ( "q", query.q )
, ( "region_id", "1" )
]
in
Http.get decode url
|> Task.toMaybe -- Show me type here
|> Effects.task