From 6f1c2e671a3c69c90d44ba379734ce200959588b Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Sat, 1 May 2021 19:04:27 +0000 Subject: [PATCH] Add documentation to unsafe section --- src/lib/Witch.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/Witch.hs b/src/lib/Witch.hs index 9cd38b0..c0dc6c5 100644 --- a/src/lib/Witch.hs +++ b/src/lib/Witch.hs @@ -26,6 +26,13 @@ module Witch , Witch.Utility.tryVia -- ** Unsafe + -- | These functions should only be used in two circumstances: When you know + -- a conversion is safe even though you can't prove it to the compiler, and + -- when you're alright with your program crashing if the conversion fails. + -- In all other cases you should prefer the normal conversion functions like + -- 'Witch.Cast.cast'. And if you're converting a literal value, consider + -- using the Template Haskell conversion functions like + -- 'Witch.Lift.liftedCast'. , Witch.Utility.unsafeCast , Witch.Utility.unsafeFrom , Witch.Utility.unsafeInto