Logs: freenode/#haskell
| 2020-09-23 16:37:54 | → | lucasb joins (uid333435@gateway/web/irccloud.com/x-cwcxthrbdzneutud) |
| 2020-09-23 16:37:56 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 2020-09-23 16:38:20 | <geekosaur> | and no, unless you mean raw "text" as transmitted over the internet |
| 2020-09-23 16:38:24 | <cr0ssw1nd> | got it, kinds semi-string semi-bytes |
| 2020-09-23 16:38:37 | <maerwald> | geekosaur: it's the other way around :p String loses encoding info, ByteString doesn't. But you have to carry it around or programmatically figure it out |
| 2020-09-23 16:38:47 | <geekosaur> | but even then you want to distinguish between the raw octet form that's transmitted and characters in some useful encoding |
| 2020-09-23 16:38:48 | × | ryansmccoy quits (~ryansmcco@193.37.254.27) (Ping timeout: 272 seconds) |
| 2020-09-23 16:38:49 | × | modaljunk quits (~modaljunk@gateway/tor-sasl/modaljunk) (Quit: modaljunk) |
| 2020-09-23 16:38:51 | <cr0ssw1nd> | I'm trying to implement conversion of any type (String) into UUID |
| 2020-09-23 16:39:02 | → | ryansmccoy joins (~ryansmcco@156.96.151.132) |
| 2020-09-23 16:39:25 | <cr0ssw1nd> | the idea was to convert to ByteString, take 2 halves, hash them into Int, total I have 128 bit, then I can convert to UUID |
| 2020-09-23 16:39:45 | <cr0ssw1nd> | but what I found that UUId is being parsed from ByteString assuming that there are - characters |
| 2020-09-23 16:39:50 | <cr0ssw1nd> | '-' |
| 2020-09-23 16:39:57 | × | frdg quits (47b88ff9@pool-71-184-143-249.bstnma.fios.verizon.net) (Remote host closed the connection) |
| 2020-09-23 16:40:16 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Client Quit) |
| 2020-09-23 16:40:21 | <cr0ssw1nd> | (conversion from String to ByteString in the beginning actually makes no sens, I can hash halves of just String) |
| 2020-09-23 16:41:11 | <cr0ssw1nd> | https://github.com/wireapp/wire-server/blob/develop/libs/types-common/src/Data/Id.hs#L146 |
| 2020-09-23 16:41:20 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 2020-09-23 16:41:34 | → | Turmfalke joins (~user@unaffiliated/siracusa) |
| 2020-09-23 16:41:36 | <geekosaur> | that's pretty unfortunate, I'd expect the direct encoding myself given what ByteString is. but someone apparently used it as a textual type. (as maerwald said, ByteString is somewhat unfortunately named) |
| 2020-09-23 16:42:20 | <maerwald> | what about ByteStream |
| 2020-09-23 16:42:25 | <geekosaur> | that said,many network standards talk about octet strings and I'd again argue they're not really that string-like |
| 2020-09-23 16:42:27 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 2020-09-23 16:42:30 | <geekosaur> | that'd be better, yes |
| 2020-09-23 16:42:38 | → | justanotheruser joins (~justanoth@unaffiliated/justanotheruser) |
| 2020-09-23 16:42:51 | <geekosaur> | some standards talk about octet sequences which would also be better, but that's uncommon iirc |
| 2020-09-23 16:43:21 | × | nineonine quits (~nineonine@50.216.62.2) (Remote host closed the connection) |
| 2020-09-23 16:45:56 | → | NinjaTrappeur1 joins (~ninja@unaffiliated/ninjatrappeur) |
| 2020-09-23 16:46:02 | × | NinjaTrappeur1 quits (~ninja@unaffiliated/ninjatrappeur) (Client Quit) |
| 2020-09-23 16:46:13 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-23 16:46:20 | × | NinjaTrappeur quits (~ninja@unaffiliated/ninjatrappeur) (Quit: WeeChat 2.8) |
| 2020-09-23 16:46:46 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-23 16:47:27 | <dolio> | "String" is a synonym for array or list in English. |
| 2020-09-23 16:47:35 | → | NinjaTrappeur joins (~ninja@unaffiliated/ninjatrappeur) |
| 2020-09-23 16:47:59 | <cr0ssw1nd> | hmm |
| 2020-09-23 16:48:00 | <dolio> | And mathematicians sometimes refer to values of free monoids/groups as "words". |
| 2020-09-23 16:48:13 | → | DataComputist joins (~lumeng@static-50-43-26-251.bvtn.or.frontiernet.net) |
| 2020-09-23 16:48:14 | <cr0ssw1nd> | makes sense actually |
| 2020-09-23 16:48:25 | <geekosaur> | I'm not sure I'd drag English into the discussion. Consider "sort" |
| 2020-09-23 16:48:51 | <cr0ssw1nd> | but if list and string are the same, then there is even more confusion |
| 2020-09-23 16:49:06 | <maerwald> | :t sort of |
| 2020-09-23 16:49:08 | <lambdabot> | error: parse error on input ‘of’ |
| 2020-09-23 16:49:36 | <dolio> | The jargon you're talking about is borrowed from English. |
| 2020-09-23 16:50:07 | <geekosaur> | also it turns out that the basic String type is a list |
| 2020-09-23 16:50:16 | <maerwald> | I have a bytestring theory |
| 2020-09-23 16:50:22 | <yushyin> | in class we often called a list of bits a bitstring, for me bytestring is just bitstring in eightfold! |
| 2020-09-23 16:51:18 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-09-23 16:52:47 | <cr0ssw1nd> | technically all maths are deeply connected to texts :) |
| 2020-09-23 16:53:12 | <cr0ssw1nd> | would be difficult to do it without text symbols |
| 2020-09-23 16:53:24 | <cr0ssw1nd> | at least in the form it developed |
| 2020-09-23 16:54:02 | <dolio> | Anyhow, it's the same as "list" not necessarily meaning "linked list" to all people, even though in a specifically Haskell context, that's what people usually mean it to refer to. |
| 2020-09-23 16:54:17 | → | nineonine joins (~nineonine@50.216.62.2) |
| 2020-09-23 16:54:27 | × | ruffianeo quits (~ruffianeo@p200300e5271f091a8f8e3866ad788a59.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-09-23 16:55:33 | → | jdgr joins (601c428b@gateway/web/cgi-irc/kiwiirc.com/ip.96.28.66.139) |
| 2020-09-23 16:55:38 | → | macrover joins (~macrover@ip70-189-231-35.lv.lv.cox.net) |
| 2020-09-23 16:56:45 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-23 16:57:06 | → | RaitoBezarius joins (~Raito_Bez@unaffiliated/raito-bezarius/x-8764578) |
| 2020-09-23 16:57:25 | <cr0ssw1nd> | what is the quicker way to do this? |
| 2020-09-23 16:57:26 | <cr0ssw1nd> | Int -> (Word16, Word16, Word16, Word16) |
| 2020-09-23 16:57:34 | <cr0ssw1nd> | *quickest |
| 2020-09-23 16:57:50 | → | arguapacha joins (uid134895@gateway/web/irccloud.com/x-mqnmnbqhiqkhrgzy) |
| 2020-09-23 16:58:04 | × | machinedgod quits (~machinedg@45.78.189.122) (Ping timeout: 260 seconds) |
| 2020-09-23 16:58:04 | × | RaitoBezarius quits (~Raito_Bez@unaffiliated/raito-bezarius/x-8764578) (Client Quit) |
| 2020-09-23 16:58:18 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-09-23 16:58:19 | × | Xcalibur quits (~dvd@2a02:8070:89a8:c200::dd81) (Ping timeout: 272 seconds) |
| 2020-09-23 16:58:24 | <cr0ssw1nd> | hmm, I see "foundation" package |
| 2020-09-23 16:58:30 | <cr0ssw1nd> | but not sure that I should try it |
| 2020-09-23 16:58:34 | <yushyin> | better name would be CharString instead of String :P |
| 2020-09-23 16:58:35 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-23 16:58:49 | <davean> | cr0ssw1nd: You can but Data.Bits for example. |
| 2020-09-23 16:59:06 | <davean> | cr0ssw1nd: sadly (Word16, Word16, Word16, Word16) doesn't share a representation with Int. |
| 2020-09-23 16:59:21 | <cr0ssw1nd> | wait |
| 2020-09-23 16:59:32 | <cr0ssw1nd> | Int isn't 64 bit? |
| 2020-09-23 16:59:34 | <davean> | so its just shifts and ands |
| 2020-09-23 16:59:47 | <geekosaur> | the problem is, so is Word16 |
| 2020-09-23 16:59:55 | <davean> | Might not be, but if it was it definately wouldn't share a representation |
| 2020-09-23 17:00:01 | <davean> | Int64 is 64bits |
| 2020-09-23 17:00:03 | <dolio> | There's a whole module for Word8-based stuff on each bytestring type. |
| 2020-09-23 17:00:04 | <davean> | Int is whatever you get |
| 2020-09-23 17:00:14 | <davean> | Word16 is platform word size also |
| 2020-09-23 17:00:17 | <davean> | plus () boxes |
| 2020-09-23 17:00:21 | <davean> | so thats actually 4 pointers |
| 2020-09-23 17:00:24 | <dolio> | And the character ones are the ones that specifically mention characters. |
| 2020-09-23 17:00:26 | <geekosaur> | ghc doesn't like to deal with things smaller than a machine word |
| 2020-09-23 17:00:31 | <cr0ssw1nd> | [-2^29 .. 2^29-1] |
| 2020-09-23 17:00:36 | <cr0ssw1nd> | so 2^30 total |
| 2020-09-23 17:00:41 | <cr0ssw1nd> | why so? |
| 2020-09-23 17:00:52 | <cr0ssw1nd> | why not 2^32 |
| 2020-09-23 17:00:54 | <davean> | cr0ssw1nd: Marking bits. |
| 2020-09-23 17:00:58 | <geekosaur> | the standard mandates that as a minimum size, leaving room for tag bits |
| 2020-09-23 17:01:06 | <davean> | cr0ssw1nd: but, you generally do get 64bits on 64bit platforms |
| 2020-09-23 17:01:09 | <geekosaur> | ghc happens to ignore the standard there |
| 2020-09-23 17:01:13 | <davean> | theres just not guarrentee |
| 2020-09-23 17:01:22 | <davean> | but if you demand Int64, use Int64 |
| 2020-09-23 17:01:27 | <davean> | Don't guess at what a thing means |
| 2020-09-23 17:01:34 | monochrom | frowns. That's not "ingore", that's "exceed". |
| 2020-09-23 17:01:47 | <cr0ssw1nd> | but what metadata needed from integer? |
| 2020-09-23 17:02:07 | <cr0ssw1nd> | Int is used by Hashable.. |
| 2020-09-23 17:02:07 | <davean> | cr0ssw1nd: things like GC tags |
| 2020-09-23 17:02:09 | <geekosaur> | whether the garbage collector has seen that particular value yet or not |
All times are in UTC.