File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed
Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 55exports . unsafePartial = function ( f ) {
66 return f ( ) ;
77} ;
8-
9- exports . unsafePartialBecause = function ( reason ) {
10- return function ( f ) {
11- try {
12- return exports . unsafePartial ( f ) ;
13- } catch ( err ) {
14- throw new Error ( "unsafePartial failed. The following " +
15- "assumption was incorrect: '" + reason + "'." ) ;
16- }
17- } ;
18- } ;
Original file line number Diff line number Diff line change @@ -10,10 +10,9 @@ import Partial (crashWith)
1010-- | Discharge a partiality constraint, unsafely.
1111foreign import unsafePartial :: forall a . (Partial => a ) -> a
1212
13- -- | Discharge a partiality constraint, unsafely. Raises an exception with a
14- -- | custom error message in the (unexpected) case where `unsafePartial` was
15- -- | used incorrectly.
16- foreign import unsafePartialBecause :: forall a . String -> (Partial => a ) -> a
13+ -- | *deprecated:* use `unsafePartial` instead.
14+ unsafePartialBecause :: forall a . String -> (Partial => a ) -> a
15+ unsafePartialBecause _ x = unsafePartial x
1716
1817-- | A function which crashes with the specified error message.
1918unsafeCrashWith :: forall a . String -> a
You can’t perform that action at this time.
0 commit comments