Skip to content

Commit

Permalink
Merge pull request #2427 from BuckleScript/mutable_poly_set
Browse files Browse the repository at this point in the history
mutable poly set support
  • Loading branch information
bobzhang authored Jan 5, 2018
2 parents 19099ea + d2afa81 commit 8fa668b
Show file tree
Hide file tree
Showing 33 changed files with 2,494 additions and 893 deletions.
12 changes: 9 additions & 3 deletions jscomp/others/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ bs_HashSetString.cmj : bs_internalSetBuckets.cmj bs_internalBucketsType.cmj \
bs_HashSetInt.cmj : bs_internalSetBuckets.cmj bs_internalBucketsType.cmj \
bs_Array.cmj bs.cmj bs_HashSetInt.cmi
bs_Bag.cmj :
bs_BagM.cmj :
bs_Cmp.cmj : bs_Cmp.cmi
bs_Map.cmj : bs_internalAVLtree.cmj bs_Cmp.cmj bs_Bag.cmj bs_Array.cmj \
bs_Map.cmi
bs_Set.cmj : bs_internalAVLset.cmj bs_Cmp.cmj bs_Bag.cmj bs_Array.cmj bs.cmj \
bs_Set.cmi
bs_MapString.cmj : bs_internalAVLtree.cmj bs_Array.cmj bs_MapString.cmi
bs_MapInt.cmj : bs_internalAVLtree.cmj bs_Array.cmj bs_MapInt.cmi
bs_internalSet.cmj : bs_internalAVLset.cmj bs_Cmp.cmj bs_Bag.cmj \
bs_Array.cmj
bs_Set.cmj : bs_internalSet.cmj bs_internalAVLset.cmj bs_Cmp.cmj bs_Bag.cmj \
bs_Set.cmi
bs_SetM.cmj : bs_internalSet.cmj bs_internalAVLset.cmj bs_Cmp.cmj \
bs_BagM.cmj bs_SetM.cmi
bs_internalSetInt.cmj : bs_internalAVLset.cmj bs_Array.cmj
bs_internalSetString.cmj : bs_internalAVLset.cmj bs_Array.cmj
bs_SetInt.cmj : bs_internalSetInt.cmj bs_internalAVLset.cmj bs_SetInt.cmi
Expand Down Expand Up @@ -89,9 +94,10 @@ bs_HashSetString.cmi :
bs_HashSetInt.cmi :
bs_Cmp.cmi :
bs_Map.cmi : bs_Cmp.cmi bs_Bag.cmj
bs_Set.cmi : bs_Cmp.cmi bs_Bag.cmj
bs_MapString.cmi :
bs_MapInt.cmi :
bs_Set.cmi : bs_Cmp.cmi bs_Bag.cmj
bs_SetM.cmi : bs_Cmp.cmi
bs_SetInt.cmi :
bs_SetIntM.cmi :
bs_SetString.cmi :
Expand Down
6 changes: 5 additions & 1 deletion jscomp/others/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ SOURCE_LIST= node_path node_fs node_process dict node_module js_array js_string
bs_HashSetString\
bs_HashSetInt\
bs_Bag\
bs_BagM\
bs_Cmp\
bs_Map\
bs_MapString \
bs_MapInt\
bs_internalSet\
bs_Set\
bs_MapString bs_MapInt\
bs_SetM\
bs_internalSetInt\
bs_internalSetString\
bs_SetInt\
Expand Down
2 changes: 2 additions & 0 deletions jscomp/others/bs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

(**/*)
(**/*)
module BagM = Bs_BagM
module Bag = Bs_Bag
module Cmp = Bs_Cmp
module Hash = Bs_Hash
Expand All @@ -42,6 +43,7 @@ module Sort = Bs_Sort
module Range = Bs_Range
module Map = Bs_Map
module Set = Bs_Set
module SetM = Bs_SetM
module MapInt = Bs_MapInt
module MapString = Bs_MapString
module SetInt = Bs_SetInt
Expand Down
8 changes: 8 additions & 0 deletions jscomp/others/bs_Bag.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ type (+ 'k, + 'v) bag = {
dict : 'k ;
data : 'v
} [@@bs.deriving abstract]

(* without variance annotation
{[
let m = N.empty (module N)
]}
will not be allowed if m is polymoprhic
*)
6 changes: 6 additions & 0 deletions jscomp/others/bs_BagM.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


type (+ 'k, 'v ) bag = {
dict : 'k;
mutable data : 'v;
} [@@bs.deriving abstract]
Loading

0 comments on commit 8fa668b

Please sign in to comment.