Skip to content

Commit 3009f11

Browse files
committed
Fix partial pattern match warning for fromJust
1 parent a0ff5eb commit 3009f11

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Data/Maybe/Unsafe.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* global exports */
2+
"use strict";
3+
4+
// module Data.Maybe.Unsafe
5+
6+
exports.unsafeThrow = function (msg) {
7+
throw new Error(msg);
8+
};

src/Data/Maybe/Unsafe.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ import Data.Maybe
99
-- | runtime.
1010
fromJust :: forall a. Maybe a -> a
1111
fromJust (Just x) = x
12+
fromJust Nothing = unsafeThrow "Data.Maybe.Unsafe.fromJust called on Nothing"
13+
14+
foreign import unsafeThrow :: forall a. String -> a

0 commit comments

Comments
 (0)