Tuesday 15 February 2011

How to merge a txt file as a [string] and a output [string] to 1 string in Haskell? -


I am using the following code in Haskell to get the output of letter combinations.

  In combination, pre-dykes = prefixed ++ is enclosed, where perms = permutation characters prefixed = map (\ x -> pre ++ x) $ perms suffixed = map (\ x -> x ++ suf) $ perms   

I want to import a large text file such as dictonary.txt [LIKELY] ["Apple", "done .....] "With the structure of:

  Apple Banana Stawberry ...... and so on   

This imported [string] merge with production Wish [string] of combinations Is there anyone who can help me with this?

Edit: The combination function returns an output to make it more obvious:

["banana", "nanaba,. .. "] & lt; - All positive combinations of some characters

I want to merge this list with a list with a list that is created from a txt file (but I do not know whether to import a txt in the list of wires and merge it To use) So the output will be like.

After that, the double word will be printed in the string.

Another edit with a sprout code:

  prefixed the prefixed letters prefixed ++ where perms = permutation characters prefixed = map ( \ X - & gt; Pre ++ x) $ perms suffixed = map (\ x -> x ++ suf) $ perms fileLines :: FilePath - & gt; Io [string] file links file = reeffile file & gt; = (\ X -> return $ rows x) main = two lines & lt; - File line "directory .txt" putStr $ (combination Sufi letter) ++ lines   

I will get a parser error on it! : 22: 22: Parsing error on input `= '

Can someone help me how to order this code? So do not get these errors?

  file line :: file path -> Io [string] file links file = ref file file & gt; & Gt; = (\ X -> return $ rows x) main = two lines & lt; - File line "directory .txt" putStr $ $ showing (Combination Sufi letter) ++ lines    

No comments:

Post a Comment