public
anonymous / gist:5751902
Created

Oppression Olympics in Haskell

  • Download Gist
gistfile1.hs
Haskell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
module Oppression where
 
tw' :: Int -> String
tw' n = foldl (\x y -> concat ["(tw: ", x, ") ", y]) "rape" (replicate n "rape")
 
tw'' :: Int -> String
tw'' n = foldl (\x y -> concat ["(tw: ", x, ")"]) "rape" (replicate n "rape")
 
tw''' :: [String] -> String
tw''' = foldl (\x y -> concat ["(tw: ", x, ") ", y]) "rape"
 
tw'''' :: [String] -> String
tw'''' rape = concat ["(tw: ", foldl (\x y -> concat ["(tw: ", x, ") ", y]) "rape" rape, ")"]
 
tw :: [String] -> String
tw rape = concat ["(tw: ", oppression, ")"]
where oppression = foldl triggers "rape" rape
triggers x y = concat ["(tw: ", x, ") ", y]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.