Release 500
-
a [Char] is now printed as string, like in Haskell.
-
forkIO
andforkOS
are different now. The former submits a task in a fixed size thread pool executor which is provided by the runtime. The latter, as before, creates an OS thread. -
In IDE mode, compiler will replace unresolved variables with
undefined
, and will continue working, up to and including type check. This makes it probable that unrelated code (and in many cases also code near the error, asundefined
shouldn't introduce type errors) can still get typechecked, and IDE features like content assist will be able to do better work. -
Syntactic sugar:
_.foobar
desugars to(\it -> it.fooBar)
. This will typecheck if and only if: the argument type of the lambda is not a type variable and the type of the argument has afoobar
function orfoobar
is a class operation. A successful type check will rewrite the lambda like(\it -> T.fooBar it)
, whereT
is the type constructor of the type ofit
. Later, a simplifying compiler pass will un-eta-expand the lambda, and the result is justT.fooBar
. This way, we can TDNR a function even if we have no actual syntactic argument it is applied to! This comes in handy in point free or monadic context:letters = packed . filter _.isLetter . unpacked foolines sss = openReader sss >>= _.getLines >>= return . any (flip _.startsWith "foo")
The first example filters the letters of a string. The second one tells if a named file contains lines that start with
"foo
". Apart form saving a few keystrokes, the_.foobar
notation is immune against changes of the type name. Also, you do not even have to be able to name the type taht containsfoobar
. -
Access to characters in strings doesn't work anymore with syntax
str.[index]
. Use charAt. The syntactic sugar is only valid for arrays.