Derive scalar changes and composition laws

This commit is contained in:
milner committed 2017-03-11 21:32:00 +00:00
1 parent 780136e802
commit 0c88eaa7c4
10 files changed
+527 -3

No files matched your search

+9 -1
View File
@@ -34,8 +34,16 @@ let rec drop count items =
let contains value items = List.exists (fun item -> item = value) items
let index_of_char text character =
let rec search index =
if index >= String.length text then None
else if text.[index] = character then Some index
else search (index + 1)
in
search 0
let string_before_char text character =
match String.index_opt text character with
match index_of_char text character with
| Some index -> String.sub text 0 index
| None -> text