The latest version of the Glasgow Haskell Compiler, as of December
2007, is GHC 6.8, and one
of its new features is that you can overload string literals,
auto-converting them to any type. All you have to do to enable this
feature is to put the {-# LANGUAGE
OverloadedStrings #-} pragma into your code. Then make the
type you want to represent in string form an instance of
the IsString typeclass. For example,
with an IsString instance of
ByteString, you can
write "foobar" instead of (B.pack
"foobar").
Now surely a feature like this will never be abused. I mean, nobody would begin using string literals in inappropriate ways, right? Right? Wrong.
Let's allow numeric functions implementable in RPN! For example, here's the factorial function:
"[dup [dup tor * swap 1 - 3 pick ap] [drop] ifte] 1 rot 3 pick ap"
More details here.
You can write integers in word form! How useful!