As I didn't catch the whole thread, I hope I'm not just repeating
everyone else:
Roel van Dijk wrote:
I guess what unsafe should mean is a matter of taste. Personally I
find correctness more important that pureness. An unsafe function will
crash your program if evaluated when its
On Fri, Feb 6, 2009 at 1:00 PM, Antoine Latter aslat...@gmail.com wrote:
Tangential to all of this - sometimes my unsafeXXX functions are pure,
but partial. So I'll have:
foo :: a - b - Maybe c
and
unsafeFoo :: a - b - c
I use the unsafe prefix in the same way. For me it means 'assume
Roel == Roel van Dijk vandijk.r...@gmail.com writes:
Roel On Fri, Feb 6, 2009 at 1:00 PM, Antoine Latter aslat...@gmail.com
wrote:
Tangential to all of this - sometimes my unsafeXXX functions
are pure, but partial. So I'll have:
foo :: a - b - Maybe c
and
On Thu, Feb 5, 2009 at 3:11 PM, Andrew Wagner wagner.and...@gmail.com wrote:
So we all know the age-old rule of thumb, that unsafeXXX is simply evil and
anybody that uses it should be shot (except when it's ok).
I understand that unsafeXXX allows impurity, which defiles our ability to
reason
Do you document the preconditions?
Yes. The 'safe' variants of those functions have all preconditions
listed in the accompanying (haddock) comments. The 'unsafe' variants
simply state that they promote exceptions to errors.
It seems to me that this is more useful than naming a function
On Fri, Feb 6, 2009 at 5:22 PM, Alberto G. Corona agocor...@gmail.com wrote:
then Data.List.head Data.Maybe.fromMaybe etc are also unsafe?.
Yes, I consider them unsafe. Whenever I see those functions I know
that I have to look elsewhere to see if their preconditions hold. I
would have preferred
Then you are talking about something very different from the subject that
Andrew started.. He clearly ask about unsafeXXX understood as impurity
which defiles our ability to reason logically about haskell programs like
we would like to.
I also want to discuss here that any signature of type IO a
On 5 Feb 2009, at 22:11, Andrew Wagner wrote:
So we all know the age-old rule of thumb, that unsafeXXX is simply
evil and anybody that uses it should be shot (except when it's ok).
I understand that unsafeXXX allows impurity, which defiles our
ability to reason logically about haskell