Skip to content

Commit

Permalink
Merge pull request #12 from davidchambers/split
Browse files Browse the repository at this point in the history
add split to Data.String.Regex
  • Loading branch information
garyb committed Oct 24, 2014
2 parents 7f7bd7b + 211b6e1 commit 5037b3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,6 @@

source :: Regex -> String

split :: Regex -> String -> [String]

test :: Regex -> String -> Boolean
10 changes: 9 additions & 1 deletion src/Data/String/Regex.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module Data.String.Regex (
match,
replace,
replace',
search
search,
split
) where

import Data.String (indexOf)
Expand Down Expand Up @@ -116,3 +117,10 @@ foreign import search
\ return s.search(r);\
\ };\
\}" :: Regex -> String -> Number

foreign import split
"function split(r) {\
\ return function(s) {\
\ return s.split(r);\
\ };\
\}" :: Regex -> String -> [String]

0 comments on commit 5037b3e

Please sign in to comment.