interactTCP :: Int -> (String -> IO String) -> IO ()
interactTCP port f = do
servSock <- listenOn $ PortNumber (fromIntegral port)
waitLoop f servSock
waitLoop :: (String -> IO String) -> Socket -> IO t
waitLoop f servSock = do
(h,_,_) <- accept servSock
forkIO $ finally (y (\f' ->
(do hSetBuffering h LineBuffering
hGetLine h >>= f >>= hPutStrLn h >> f')))
(hClose h)
waitLoop f servSock
There's some Haskell fag that has been spamming the board with Haskell since about a month ago. Must've just learn Haskell and be really eager to use it for everything.
Name:
Anonymous2007-03-23 16:09 ID:iiESCrXA
>>7
There's at least two of us actually (I'm a Haskell fag and I know that nearly all of the Haskell posts aren't mine).
>>8
Same here! I did start one Haskell thread this week though, and I troll a bit in most of them. In fact, I already posted twice (not including this reply) in this thread ;)
Name:
Anonymous2007-03-23 16:30 ID:4n7w3DgL
>>8
Ohh, three! No, four! Holy flippin' fudge, we're like a total clique here!
Name:
Anonymous2007-03-23 16:50 ID:PKRnfEoG
Five. OP here. We should start our own firm or something: writin' (more like divinin') Haskell code during the day, prowling the parks for buttsex during the night!
Name:
Anonymous2007-03-23 17:10 ID:iiESCrXA
writin' (more like divinin') Haskell code during the night, prowling the elementary schools for buttsex during the night!
fix'd
Name:
Anonymous2007-03-23 17:32 ID:SbkrxVz7
Six. I don't usually post in the threads though.
Name:
Anonymous2007-03-23 17:48 ID:EoOzoEui
I know haskell but I think its stupid so I just belittle you haskell fags
$ uname -mrsv
Darwin 8.9.0 Darwin Kernel Version 8.9.0: Thu Feb 22 20:54:07 PST 2007; root:xnu-792.17.14~1/RELEASE_PPC Power Macintosh
Name:
Anonymous2007-04-12 14:49 ID:inLg/6gb
Yes! I have attained the knowledge of double argument pointless functions through countless hours of meditation! > map . (,) :: a -> [b] -> [(a, b)]
FAP FAP FAP
>>30
Sure -- but what should I call it? I'm not good at coming up with brilliant titles such as "Distance preserving mappings from ternary vectors to permutations."
Name:
Anonymous2007-04-12 15:13 ID:GIsIR5/c
>>32
protip: no one gives a fuck tthat you can map the , operator across a list.
>>33
It doesn't just do that -- this is the equivalent pointful version: > map ((,) a) b
As you can clearly see, it takes a single element, and a list of elements, and returns a list of pairs of the first argument with every element in `b'.