Hello i am trying to do a incFirst function in ML. The function does the following: incFirst "bad" = "cad" incFirst "shin" = "thin". This is what i try to do fun incFirst s = chr(ord s + 1) ^ substring(s, 1, size s -1);
I get the following error: Can't unify string (In Basis) with char (In Basis)
(Different type constructors)
Found near chr (ord s + 1) ^ substring (s, 1, ... - ...)
Exception- Fail "Static Errors" raised
Any idea how i can concatenate a char with a string if the "^" operator is not working?
Can't concatenate a char with a string ML
1.5k Views Asked by Sebi Danila At
1
There are 1 best solutions below
Related Questions in ML
- Creating an instance of a Binary Tree (Programming Standard ML by Robert Harper)
- Please answer this in SOSML
- Why is the result of the following functor not opaque?
- Multiplying real number extracted of a pair using case of in StandarML
- Please, help me. I'm a beginner and I don't really understand
- Meaning of a recursive data type definition in lazy vs strict languages
- Evaluation order of let-in expressions with tuples
- I'm stuck trying to implement this function in Racket and ML
- SML returns the same tuples
- Variables in Standard ML change if a new function declaration,was apllied by using the changed variable
- Symmetric Relation Recursive SML
- Composistion in SML (Discreate Math and Functional Programming)
- Recusive ML function of exponential with three variable helper function
- SML Uncaught Exception Empty
- How do you see if adjacent elements repeat in a list? (SML)
Related Questions in POLYML
- Obtain a function as tree in SML
- TextIO.openIn:"No such file or directory" in Poly/ML
- How to implement Label/TextVIew with giraffe library in SML
- Compiling Giraffe library Hello World on Ubuntu
- polyml CommandLine.arguments() returns nonsense
- RunCall structure of Poly/ML
- Datatype declaration by datatype in Standard ML
- Quotation mechanism for PolyML top level
- PolyML colored output to terminal in Linux
- What causes the SML error: Exception- InternalError: asGenReg raised while compiling
- Why am I getting this error for a function that simply adds a value to every integer in a list?
- Error compiling with polyc on Debian 10 Buster
- StandardML factorial evaluation enters infinite loop in Poly/ML REPL
- I don't know how to open and run sml files with PolyML
- Counting elements list without duplicates in Poly/ML programming
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The operator is working, it's just that you can only concatenate strings, and that
ordoperates on characters, not on strings.(A character is not the same as a one-character string.)
You need to extract the first character and then convert the result to a string
or you could take a detour through a list