Tagged Questions
1
vote
3answers
111 views
String concatenation with haskell state monad
I need to wrap my head around the state monad in haskell and I have some problems with that.
The task is to implement a function countConcat which concatenates string with the state monad and a ...
5
votes
1answer
129 views
How to write a pure String to String function in Haskell FFI to C++
there
I want to implement a function in C++ via Haskell FFI, which should have the (final) type of String -> String. Say, is it possible to re-implement the following function in C++ with the ...
3
votes
1answer
100 views
haskell read from file
i'm trying to read from file in haskell and process every line
what i have now
main = interact (unlines . (map calculate) . lines)
this let me get every line from input and send it to calculate
...
0
votes
1answer
85 views
Matching letters in 2 strings with haskell
I just started with haskell and im wondering if there is a easy way to match the letters between 2 string and output them.
like:
iced and liked will return i,e,d
Thank you!
4
votes
2answers
179 views
Removing a string from a list of strings in Haskell
I have a question regarding Haskell that's been stumping my brain. I'm currently required to write a function that removes a string i.e. "word" from a list of strings ["hi", "today", "word", "Word", ...
4
votes
2answers
107 views
Replacing strings with strings from a list
I am trying to write a function that takes a list of searchwords, a list of replacementwords and a string on which those will be used.
listReplace :: [String] -> [String] -> String -> ...
2
votes
3answers
126 views
Haskell - filter string list based on some conditions
I am new in this comunity. I learn Haskell and have difficulties with Haskell-coding.
I hope you can help me.
I searched here and in Google, without any success.
My problem ist as fowllows:
I want ...
0
votes
2answers
142 views
How to replace more than one element at the same time in a String (Haskell)
i want to take 2 lists for example like this;
find=["Hou","House","Mouse"]
repl=["Mou","Bird","House"]
So when i give a text like that;
"The House with Mouse is big"
Output should be this;
"The ...
0
votes
3answers
97 views
List included in another list in haskell
I want to see if a list is included in another list and extract that list from a list of lists, for example i want to see if ["bc","abc"] is included in ...
0
votes
1answer
134 views
Break string into substring in haskell
I am having a problem with my function, I want to do a pattern matching on a string with my function but I have a problem with breaking the string into substrings. I want for a string like ...
1
vote
2answers
90 views
Haskell, returning String while using IO Integer to compute that string
Today I ran into the following problem:
I can read the current screen resolution in Haskell using Xlib-bindings using a function called getScreenWidth (--> I get an IO Integer). This is working so ...
0
votes
4answers
140 views
Concatenate String and IO Integer in Haskell
I wrote a function returning the current screen width as IO Integer (working so far).
getScreenWidth:: IO Integer
getScreenWidth = do
(sx, sy, w, h) <- getScreenDim 0
...
0
votes
1answer
101 views
parsing parentheses from a string
So I have a logical statement such as "((A o B) a B) o (B a C)" and I want to parse each set of statements within the parenthesis to each part in a list... here is what i have so far but since im new ...
2
votes
1answer
84 views
++ operator with String and IO String
explandDol :: String -> String -> [String] -> IO String
explandDol conclusion operators atoms =
let (ys,zs) = splitAt (head (take 1 replacement)) conclusion in ys ++ getConclusion ...
0
votes
1answer
43 views
Rvar to String when randomizing list comprehension
Hey so im trying to pick a random element from this list of list Strings however when i try to add choice to the list comprehension ...
{-# LANGUAGE UnicodeSyntax #-}
import System.Random(randomRIO)
...