Skip to content

Commit ab78019

Browse files
committed
Rewrote null to check the empty string
1 parent c04a774 commit ab78019

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Data/String.purs

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ module Data.String
3636
import Prelude
3737

3838
import Data.Maybe (Maybe(..), isJust)
39-
import Data.Monoid (mempty)
4039
import Data.String.Unsafe as U
4140

4241
-- | Returns the character at the given index, if the index is within bounds.
@@ -73,7 +72,7 @@ foreign import _toChar :: (forall a. a -> Maybe a)
7372

7473
-- | Returns `true` if the given string is empty.
7574
null :: String -> Boolean
76-
null = eq mempty
75+
null s = s == ""
7776

7877
-- | Returns the first character and the rest of the string,
7978
-- | if the string is not empty.

0 commit comments

Comments
 (0)