String.uppercase bug in base?

27 views
Skip to first unread message

Stephen Bastians

unread,
Feb 25, 2018, 8:46:14 AM2/25/18
to ocaml-core
On Ubuntu, 4.06.1 release, ran opam update/upgrade today (25th Jan)

utop # open Base;;
─( 21:42:56 )─< command 1 >──────────────────────────────────────{ counter: 0 }─
utop # String.uppercase "x" = "X";;
Error: This expression has type string but an expression was expected of type
         int

But:

utop # open Core;;
─( 21:43:15 )─< command 1 >──────────────────────────────────────{ counter: 0 }─
utop # String.uppercase "x" = "X";;
- : bool = true

Philippe Veber

unread,
Feb 25, 2018, 11:06:56 AM2/25/18
to ocaml...@googlegroups.com
Hi Stephen,

the polymorphic `=` operator is now shadowed in Base, by the equality on ints. In your case, you should write `String.(uppercase "x" = "X")`. I'm guessing some next version of Core will follow the same trend. Hope this helps!

Philippe.

--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Weeks

unread,
Feb 25, 2018, 11:09:36 AM2/25/18
to ocaml...@googlegroups.com
In Base, [=] is [Int.equal]. In Core, [=] is [Poly.equal].
> --
> You received this message because you are subscribed to the Google Groups
> "ocaml-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ocaml-core+...@googlegroups.com.

Stephen Bastians

unread,
Mar 3, 2018, 12:38:56 AM3/3/18
to ocaml-core
Yes that helps, thank you both.
Reply all
Reply to author
Forward
0 new messages