Skip to content

Commit

Permalink
add split to Data.String.Regex
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Oct 24, 2014
1 parent 7f7bd7b commit 211b6e1
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 211b6e1

Please sign in to comment.