It used to be the case in #Haskell that
:t 3
would give you
3 :: Num a => a
but
let x = 3
:t x
would give you
x :: Integer
because storing a value in variable forced the system to commit to a specific type.
Nowadays, though, the latter gives you
x :: Num a => a
What changed? I'm at a loss as to how to search the web for an answer to this one.
#programming #FunctionalProgramming
@freemo That got me a short answer
https://stackoverflow.com/a/73861151/1435803
that includes a link to a much deeper rabbit hole than I care to explore.
:t 3 gives 3 :: Num a => a, because the literal 3 doesn't have a specific type. Back in 2013 when I made this video, if I bound 3 to a variable name with let x = 3, Haskell would have to commit ...
stackoverflow.com