-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on ustring #92
Comments
I just ran into this myself. My gut was to look for a constructor on |
To help explain to others who may not be fully in on what makes this annoying in F# is to look at an example case in F# from the Sample in the README where we are instantiating an instance of the var win = new Window (new Rect (0, 1, top.Frame.Width, top.Frame.Height-1), "MyApp"); let win = new Window(new Rect(0, 1, top.Frame.Width, top.Frame.Height - 1), NStack.ustring.op_Implicit "MyApp") Notice the need in the F# example to call the underlying compiled name for the implicit |
Isn't the more functional approach in F# to pipe the value, such as |
@ebekker, that definitely looks valid as long as In this case since there are no additional parenthesis for needed for the prefix notation I think it comes down to which one is less characters and thus noise. "foobar" |> ustring v.s. ustring "foobar" |
Yeah, I think I might need to make ustring just an internal API, and an optional API everywhere :-( |
You run into the same issue using SharpDX. That's why I always define an implicit conversion operator:
Then you just write Agreed it would be better to avoid needing this, but just to say there's a half-decent workaround. |
Changed title of this Issue from "F# the ustring API makes it annoying to use F#". In v2.0 we should remove the dependency on ustring (at least externally) and use System.Rune instead. While ustring is neat, the fact that artifacts of it are exposed via the public Terminal.Gui API is problematic (F# support just being one). Another example is just simple usage of the API requires users to import NStack (see the C# Example in the main README). |
* Remove NStack and replace ustring to string. * Add unit test and improving some code. * Adjust code and fix all unit tests errors. * Add XML Document and move the Rune folder into the Text folder. * Improve unit tests with byte array on DecodeRune and DecodeLastRune. * Fix unit test. * 😂Code review * Reduce unit tests code. * Change StringExtensions.Make to StringExtensions.ToString and added some more unit tests. * Fix merge errors. * Remove GetTextWidth and calls replaced with StringExtensions.GetColumns. * Hack to use UseSystemConsole passed in the command line arguments. * Revert "Hack to use UseSystemConsole passed in the command line arguments." This reverts commit b74d11c. * Remove Application.UseSystemConsole from the config file. * Fix errors related by removing UseSystemConsole from the config file. * Fixes #2633. DecodeEscSeq throw an exception if cki is null. * Fix an exception if SelectedItem is -1. * Set SelectedItem to 0 and remove unnecessary ToString. * Using a unique ToString method for Rune and other for byte. * Fix a bug where a wider rune is added with only a width of 1. * Force the SelectedGlyph is the one that was typed after jumpList is executed. * Added more InlineData to RuneTests. * Reducing significantly the code by using Theory attribute in the TextFormatterTests. * Override PositionCursor to handle the CharMap cursor position. * Fix merge errors. * Minor tweaks to API docs --------- Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
We might need to introduce string overloads
The text was updated successfully, but these errors were encountered: