3 ms·
With type inference, a REPL can even tell you things about code that can't run yet! Prelude> :t mapM undefined [5,6,7] mapM undefined [5,6,7] :: Monad
by dllthomas 11y ago
With type inference, a REPL can even tell you things about code that can't run yet!
Prelude> :t mapM undefined [5,6,7]
mapM undefined [5,6,7] :: Monad m => m [b]
This can get even more informative with Typed Holes:
Prelude> mapM _whatFunc [5,6,7]
<interactive>:14:6:
Found hole ‘_whatFunc’ with type: Integer -> m b
Where: ‘m’ is a rigid type variable bound by
the inferred type of it :: m [b] at <interactive>:14:1
‘b’ is a rigid type variable bound by
the inferred type of it :: m [b] at <interactive>:14:1
Relevant bindings include it :: m [b] (bound at <interactive>:14:1)
In the first argument of ‘mapM’, namely ‘_whatFunc’
In the expression: mapM _whatFunc [5, 6, 7]
In an equation for ‘it’: it = mapM _whatFunc [5, 6, 7]