-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #606 from bloomberg/better_specialization_on_string
better string processing
- Loading branch information
Showing
15 changed files
with
214 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
|
||
console.log("list"); | ||
|
||
console.log("list"); | ||
|
||
function f(param) { | ||
if (param) { | ||
return "Some"; | ||
} | ||
else { | ||
return "None"; | ||
} | ||
} | ||
|
||
console.log(/* tuple */[ | ||
f(/* Some */[3]), | ||
"None", | ||
"Some" | ||
]); | ||
|
||
console.log(/* tuple */[ | ||
"A", | ||
"A" | ||
]); | ||
|
||
/* Not a pure module */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[@@@bs.config{no_export}] | ||
type t = | ||
| A_list | ||
| A_hashtable | ||
|
||
let string_of_associative_type = function | ||
| A_list -> "list" | ||
| A_hashtable -> "Hashtbl.t" | ||
|
||
|
||
;; Js.log (string_of_associative_type A_list) | ||
|
||
|
||
type t2 = | ||
| A_list | ||
| A_hashtable | ||
| A_bad | ||
let string_of_associative_type = function | ||
| A_list -> "list" | ||
| A_hashtable -> "Hashtbl.t" | ||
| A_bad -> "bad" | ||
|
||
|
||
;; Js.log (string_of_associative_type A_list) | ||
|
||
|
||
let v = Some 3 | ||
|
||
let f = function | ||
| Some _ -> "Some" | ||
| None -> "None" | ||
let u v = f (Some v ) | ||
;; Js.log (f v, f None, f (Some 3)) | ||
|
||
type v = | ||
| A of int | ||
| B of int | ||
| C of int | ||
| D of int | ||
| E of int | ||
| F of int | ||
| G of int | ||
| H of int | ||
|
||
let ff = function | ||
| A _ -> "A" | ||
| B _ -> "B" | ||
| C _ -> "C" | ||
| D _ -> "D" | ||
| E _ -> "E" | ||
| F _ -> "F" | ||
| G _ -> "G" | ||
| H _ -> "H" | ||
|
||
|
||
;; Js.log (ff (A 3), (function | ||
| A _ -> "A" | ||
| B _ -> "B" | ||
| _ -> "?" ) (A 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ var suites_001 = /* :: */[ | |
function () { | ||
return /* Eq */Block.__(0, [ | ||
3, | ||
v("abc") | ||
3 | ||
]); | ||
} | ||
], | ||
|
Oops, something went wrong.