yeah. the rigid phase distinction means you can erase your types no matter how complex they are
Conversation
“erase” them? o_0
1
oh like infer them?
1
no! erase, literally. compiled haskell programs don't mention types at all
1
2
ah ok. and they don’t get inferred when run?
1
1
nope
1
2
that’s pretty cool…why do we want that tho? Go Fast, or because it somehow makes them safer, or another reason?
1
go faster! having types in your compiled program would just be overhead
2
2
mmmm I seeeeee
so is the phase distinction and subsequent erasure of types what “statically typed” means or is that slightly different? I’m used to thinking of it as “dealt with at compile time” but wasn’t aware haskell deals with them (in part) by abandoning them in the result!
2
1
These are often conflated, but they don't need to be. For example languages with full-spectrum dependent types are ‘statically typed‘, but *lack* a clear phase distinction, which can make it trickier to erase/specialise stuff and hence compile them to fast code.
1
1
Sorry if that is a bit nit-picky though – in the case of Haskell though, you can think of it like that (and many programmers in statically typed languages do) but yeah it's worth being a little careful!


