I believe that an unsafe function is a function that says that it will return a value of some type, but that it can actually throw an exception and end the execution therefore not returning any value at all, but I'm not sure.
Or could it be that an unsafe function is a function that can return a value of other type than the declared in the signature? Wouldn't that be a weakly typed function?
Or are weakly typed and unsafe synonyms in Haskell?
This may be a silly question, but I couldn't find a straightforward answer.
I checked the documentation of readLn
hoping to see a reference to unsafe functions, but there wasn't any.
This article, Unsafe functions, says something about breaking the type system, but it doesn't specify in which manner; through exceptions?, through returning values of the wrong type?
So, what is an unsafe function in Haskell?
seq
unsafe is a bit of an extreme position. – Salvatore