by hellofunk · 10y ago · 0 comments
There is no function
print :: String -> ()
(The type () implies "no interesting return value").This function could only be written via deliberate subversion of the type system. Instead it must be
print :: String -> IO ()
Which is similar, but the return is marked by this IO type. Essentially this restricts you to ensure that side effecting functions are executed in explicit sequence and cannot "poison" pure types.A lot of the performance and predictability problems in Haskell come from its laziness, so the ability to toggle that on and off on a per-module (read: per-file) basis will be a game changer.