I believe that an unsafe function is a function that says that it will return a value of some type, but can actually throw an exception and stop execution, therefore it does not return any value at all, but I'm not sure.
Or maybe an unsafe function is a function that can return a value of a different type than the one declared in the signature? Wouldn't that be a weakly typed function?
Or are these weakly typed and insecure synonyms in Haskell?
This may be a stupid question, but I could not find a direct answer.
I checked the readLn documentation hoping to see a link to unsafe functions, but there was none.
This article, Unsafe Functions , says something about a violation of the type system, but it does not indicate how; through exceptions ?, by returning values of the wrong type?
So what is an unsafe function in Haskell?
haskell unsafe
Lay gonzález
source share