Skip to content

Commit c04a774

Browse files
committed
Rewrote null check to use mempty
1 parent 3f7ad6f commit c04a774

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Data/String.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module Data.String
3636
import Prelude
3737

3838
import Data.Maybe (Maybe(..), isJust)
39+
import Data.Monoid (mempty)
3940
import Data.String.Unsafe as U
4041

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

7374
-- | Returns `true` if the given string is empty.
7475
null :: String -> Boolean
75-
null s = length s == zero
76+
null = eq mempty
7677

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

0 commit comments

Comments
 (0)