« first day (49 days earlier)      last day (331 days later) » 

5:22 PM
anyone?
 
how are you?
 
I'm a bit annoyed that I'll have to drive in a couple of a hours.
 
 
5 hours later…
10:05 PM
[1 of 1] Compiling Main             ( M.hs, interpreted )

M.hs:13:18:
    My brain just exploded.
    ...
Mine too, GHC :)
 
10:43 PM
How would I get to only the string part of this: type: [(String, Int, SockAddr)]
 
@JFritsch Well, if you want all of them, use map (\(s, _, _) -> s) foo. If you just want the first one, you can use pattern matching.
 
let me try :D
 
Or if you prefer, a list comprehension might be clearer: [s | (s, _, _) <- foo].
 
11:09 PM
@hammar I think we misunderstand each other. this refers to your post. revFrom returns (String, Int, SockAddr) where I only need the String from. Can that really be done w pattern matching?
 
Ah, when you typed it in brackets, I assumed it was a list of tuples.
@JFritsch In that case, simple pattern matching will do. (s, _, _) <- recvFrom ... since you're in a do-block.
 
Thx
 
11:34 PM
@hammar you wrote "You'll have to check the return value to see how much was sent", the return value I get is always four "4". Where do I find the documentation to see what that actually means? 4 byte?
 
I forgot my glasses today :D
 
The ByteString version has a sendAll which takes care of it for you, though, so you might want to use that instead. (It's more precise to deal with bytes than characters anyway).
Sorry, I meant sendAllTo.
 
Then I would need to rewrite the whole thing? Both have a recvFrom in it and it leads to an ambiguity. Looks to me as if the bytestring version deals only w tcp.
Could it be that this (receiveMessages socket done = do) is messing up socket? Seems so to me.
 
11:56 PM
@JFritsch You can hide the other recvFrom, but it would probably be a good idea to use the ByteString version in both places. Faster, too. Both should work fine with UDP as long as you're using the ...To and ...From versions.
 
@hammar thx, I'll try this tomorrow. At my spot it is past midnight.
 

« first day (49 days earlier)      last day (331 days later) »