I am trying to confuse the attempt to haskell ' Scala One Liners equivalent that recently appeared on Reddit / Hacker News.
Here is what I have so far (people could make them much better than me, but these are my beginner level attempts)
https://gist.github.com/1005383
The one I'm stuck on checks to see if the items are in the list. Basically an example of Scala is
val wordlist = List("scala", "akka", "play framework", "sbt", "typesafe") val tweet = "This is an example tweet talking about scala and sbt." (words.foldLeft(false)( _ || tweet.contains(_) ))
I'm a little dumb how to do this in Haskell. I know what you can do:
any (=="haskell") $ words "haskell is great!"
To check if one word is present, but the Scala example asks if any of the words are in the word list in the test line.
I can not find the contains function or something like this. I know that you could probably write a function for this, but that defeats the execution point of this task on one line.
Any help would be appreciated.
source share