3 ms·
Looks problematic. Is a string in Haskell a list? I would think that in Racket a string is a vector. FIRST and REST operations then would have very different im
by lispm 3y ago
Looks problematic. Is a string in Haskell a list? I would think that in Racket a string is a vector. FIRST and REST operations then would have very different implementations.
- pitkali 2y agoYes, the String is a list of characters. The Haskell code uses head and tail on it. In Racket, they provided string-first and string-rest (at the end) to replace those.
- lispm 2y agoWhich makes it very different in Racket. STRING-REST creates a new string with the contents copied from the original string, minus one character.
- nine_k 2y agoMuch like in Rust or C++, there are several ways to represent sequences of characters in Haskell. The default way is a List, which is like a classic Lisp list,va chain of cons cells.