<commit_before>import Network hiding (accept)
import Network.Socket (fdSocket, accept)
import Network.Socket.ByteString
import Data.List (intercalate)
import Data.ByteString.Char8 hiding (length, intercalate)
import GHC.Event
import System.Posix
import System.Posix.IO

main :: IO ()
main = withSocketsDo $ do
    sock <- listenOn $ PortNumber 1337
    let fd = fromIntegral (fdSocket sock)
    mgr <- new
    registerFd mgr (client sock) fd evtRead
    loop mgr

client :: Socket -> FdKey -> Event -> IO ()
client sock _ _ = do
    (c, _) <- accept sock
    sendAll c msg
    sClose c

httpify :: String -> String
httpify content = 
    intercalate "\r\n" [
          "HTTP/1.0 200 OK"
        , "Content-Length: " ++ (show $ length content)
        , ""
        , content
        , ""]

-- Feck off, standards
html :: String -> String
html body = "<html><pre>" ++ body

msg = pack $ httpify $ html "Piss off."<commit_msg>Update HTTP 200 response reason<commit_after>import Network hiding (accept)
import Network.Socket (fdSocket, accept)
import Network.Socket.ByteString
import Data.List (intercalate)
import Data.ByteString.Char8 hiding (length, intercalate)
import GHC.Event
import System.Posix
import System.Posix.IO

main :: IO ()
main = withSocketsDo $ do
    sock <- listenOn $ PortNumber 1337
    let fd = fromIntegral (fdSocket sock)
    mgr <- new
    registerFd mgr (client sock) fd evtRead
    loop mgr

client :: Socket -> FdKey -> Event -> IO ()
client sock _ _ = do
    (c, _) <- accept sock
    sendAll c msg
    sClose c

httpify :: String -> String
httpify content = 
    intercalate "\r\n" [
          "HTTP/1.0 200 PISS OFF"
        , "Content-Length: " ++ (show $ length content)
        , ""
        , content
        , ""]

-- Feck off, standards
html :: String -> String
html body = "<html><pre>" ++ body

msg = pack $ httpify $ html "Piss off."
{'fraction_non_alphanumeric': 0.11657754010695187, 'fraction_numerical': 0.01229946524064171, 'mean_word_length': 2.8028455284552845, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3880077', 'n_tokens_mistral': 612, 'n_tokens_neox': 590, 'n_words': 194}