1) What is the purpose of the used pound/"#" character here. (Looks
like some type-casting, but that's just a wild guess from me here.
This is not normal Haskell code you're looking at; it's using internals which are normally hidden, and # is not special in normal Haskell code. If you turn on the special meaning (MagicHash) then it usually means that something is unlifted.
In this case, 1# is an unboxed Int value: a raw machine word.
2) kinda the same for the "I#" in the "len [] ..." line. As the length
I# is the internal constructor for a normal Int value; the value (1 :: Int) is internally represented as (I# 1#), or the internal Int constructor wrapping a raw machine word.
3) Why is it giving a compile error on the "where" line. Error:
Because # does not have its special meaning in normal Haskell code.
--