Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String Concatenation in Purescript

Playing with purescript and running into an odd problem with string concatenation. I've loaded and imported the Prelude, Data.List, Data.Maybe, and Data.String (also, tried importing Data.Array) but the PSCi still doesn't recognize (++). This would suggest that either, (++) is not contained in any of my imported modules (in which case a pointer to the appropriate module(s) to import would be appreciated), or there was some weird problem when I installed purescript and set my enviornment. I find the latter unlikely but hey I'll keep my considerations open.

Thanks in advance!

like image 408
Tshimanga Avatar asked Aug 25 '16 20:08

Tshimanga


People also ask

What is string concatenation example?

In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball".

What is string concatenation?

Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs. For string variables, concatenation occurs only at run time.

What is concatenation and example?

Concatenation is an associative operation, so that the concatenation of three or more strings, for example , , etc., is well-defined. The concatenation of two or more numbers is the number formed by concatenating their numerals. For example, the concatenation of 1, 234, and 5678 is 12345678.


1 Answers

Newer versions of PureScript (since 0.9 I think) have abandoned ++ in favor of <>. That operator should work out of the box, since it is contained in purescript-prelude.

Thanks @gb. for the clarification. Edited the incorrect part of my answer.

like image 116
stholzm Avatar answered Sep 19 '22 14:09

stholzm