4 ms·
Two things: a) Maxime works on a compiler for JS, so even if something is documented to death, it usually makes analyses less precise and/or more complex. b)
by gnuvince 11y ago
Two things:
a) Maxime works on a compiler for JS, so even if something is documented to death, it usually makes analyses less precise and/or more complex.
b) Many statically-typed languages have a REPL (OCaml, Haskell, Scala); this is not an issue with the typing discipline, but with the tools available to the developers.
- dllthomas 11y agoWith 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]