Permalink
Browse files

correct string matching

  • Loading branch information...
1 parent a16b6f6 commit 023a0c67795f4d81eab99c7d3cc3b902aea37182 @mmikulicic committed Jan 2, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/clarsec.clj
View
@@ -32,19 +32,20 @@
(. strn (substring 1))))
)
+(defmonadfn is-char [c]
+ (char-test (partial = c)))
(defmonadfn satisfy [pred]
(domonad [c any-char
:when (pred c)]
(str c)))
(defmonadfn string [strn]
- (domonad [x (m-seq (map (fn [x] any-char) strn))]
+ (domonad [x (m-seq (map (fn [x] (is-char x)) strn))]
(apply str x))
-
- ; (m-seq [any-char any-char])
)
+
(defmonadfn body []
(domonad [x any-char
y any-char] (str y x))

0 comments on commit 023a0c6

Please sign in to comment.