Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 7 8 9 10 11 12 13 14 15 16 17 .. 5022
502,152 events total
2020-09-17 01:58:13 <monochrom> Although, the pipes-conduit dichotomy is already a vast improvement compared to the long gone days of 3 choices of iteratees, 2 choices of enumeratees, and 5 choices of something in between.
2020-09-17 01:59:10 × lembot quits (~lembot@179.8.176.163) (Ping timeout: 272 seconds)
2020-09-17 02:00:20 <sm[m]> Yup
2020-09-17 02:00:43 ransom joins (~c4264035@c-73-243-2-10.hsd1.co.comcast.net)
2020-09-17 02:00:51 <sm[m]> also, higher level frameworks will continue to improve
2020-09-17 02:02:20 <sm[m]> I think the ide tools are going to be impactful, they will attract more devs
2020-09-17 02:04:03 <sm[m]> vs code with hls 0.4 really works and is a real step up IME
2020-09-17 02:06:04 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 260 seconds)
2020-09-17 02:07:55 × theDon quits (~td@94.134.91.86) (Ping timeout: 272 seconds)
2020-09-17 02:08:20 kleisli_ joins (~kleisli@2605:e000:1804:94c6:68bd:9d76:dbd8:24e7)
2020-09-17 02:09:38 theDon joins (~td@94.134.91.55)
2020-09-17 02:09:44 × shadowdaemon quits (~user@unaffiliated/shadowdaemon) (Remote host closed the connection)
2020-09-17 02:15:00 × lagothrix quits (~lagothrix@unaffiliated/lagothrix) (Killed (tolkien.freenode.net (Nickname regained by services)))
2020-09-17 02:15:08 lagothrix joins (~lagothrix@unaffiliated/lagothrix)
2020-09-17 02:15:46 <sshine> yes
2020-09-17 02:16:00 <sshine> I didn't have to manually compile a file and copy it into VSCode's directory!
2020-09-17 02:17:55 × howdoi quits (uid224@gateway/web/irccloud.com/x-udrxcrwykbilfjcr) (Quit: Connection closed for inactivity)
2020-09-17 02:20:35 drbean joins (~drbean@TC210-63-209-98.static.apol.com.tw)
2020-09-17 02:21:56 mdunnio joins (~mdunnio@208.59.170.5)
2020-09-17 02:22:55 shafox joins (~shafox@106.51.234.111)
2020-09-17 02:27:02 × mdunnio quits (~mdunnio@208.59.170.5) (Ping timeout: 272 seconds)
2020-09-17 02:27:07 × heatsink quits (~heatsink@2600:1700:bef1:5e10:99ca:18ad:4e5f:ffdf) (Remote host closed the connection)
2020-09-17 02:27:42 × nineonine quits (~nineonine@216.81.48.202) (Remote host closed the connection)
2020-09-17 02:31:55 rapskalian joins (~user@2601:804:8400:5750:6d07:cb01:64a9:36bb)
2020-09-17 02:32:51 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
2020-09-17 02:35:26 tylerjl joins (~leothrix@elastic/staff/leothrix)
2020-09-17 02:36:55 × rapskalian quits (~user@2601:804:8400:5750:6d07:cb01:64a9:36bb) (Ping timeout: 240 seconds)
2020-09-17 02:38:07 × leothrix quits (~leothrix@elastic/staff/leothrix) (Ping timeout: 240 seconds)
2020-09-17 02:39:32 asan parts (~yan4138@114.84.148.87) ()
2020-09-17 02:39:56 asan joins (~yan4138@114.84.148.87)
2020-09-17 02:40:01 <frdg> how can I go from `Functor f => f (g (a)) -> g a` without pattern matching ?
2020-09-17 02:40:17 <frdg> err and `Functor g`
2020-09-17 02:40:36 <c_wraith> You can't just collapse them for any old pair of functors
2020-09-17 02:40:57 <frdg> oh
2020-09-17 02:41:55 <frdg> what about Traversables?
2020-09-17 02:42:25 <c_wraith> :t sequenceA
2020-09-17 02:42:27 <lambdabot> (Traversable t, Applicative f) => t (f a) -> f (t a)
2020-09-17 02:42:35 <c_wraith> that's as close as they'll get you
2020-09-17 02:42:51 <frdg> hmm
2020-09-17 02:43:16 <ski> @type asum
2020-09-17 02:43:18 <lambdabot> (Foldable t, Alternative f) => t (f a) -> f a
2020-09-17 02:44:11 <frdg> this should work.
2020-09-17 02:44:14 <c_wraith> Oh, yeah. If Alternative is good enough, that works
2020-09-17 02:45:31 exodrifter joins (adacad5d@cpe-173-172-173-93.tx.res.rr.com)
2020-09-17 02:46:25 × robotmay quits (~beepboop@80.172.187.81.in-addr.arpa) (Quit: No Ping reply in 180 seconds.)
2020-09-17 02:47:08 <exodrifter> Does anyone happen to know if there's a Storable instance of Text floating around out there or how you'd generally represent UTF-8 in an FFI interface?
2020-09-17 02:47:58 robotmay joins (~beepboop@80.172.187.81.in-addr.arpa)
2020-09-17 02:48:37 <c_wraith> text isn't even UTF-8
2020-09-17 02:49:24 <exodrifter> oh, unicode and utf-8 are not the same thing?
2020-09-17 02:49:30 <c_wraith> nope
2020-09-17 02:49:36 <c_wraith> unicode is a character set
2020-09-17 02:49:44 <c_wraith> utf8 is one way of encoding that character set in bytes
2020-09-17 02:50:43 <exodrifter> ah, I see. I assumed Text was UTF8 because of decodeUtf8, but that's just what character set to use for the bytestring
2020-09-17 02:50:55 <c_wraith> exactly
2020-09-17 02:51:15 <c_wraith> well. just what encoding to use for the bytestring.
2020-09-17 02:51:35 <exodrifter> yeah. what does it mean for Text to be unicode then? is it not any particular character set until you decide to encode it?
2020-09-17 02:52:04 <c_wraith> unicode is a character set. How the characters are represented inside a computer is an implementation detail
2020-09-17 02:52:58 <c_wraith> There are a bunch of ways to serialize it that are standardizes, though. UTF-8, UTF-16, and UCS4 are the options that give you the full unicode character set.
2020-09-17 02:53:03 <c_wraith> *standardized
2020-09-17 02:53:17 <exodrifter> so if i wanted to, say, encode a text into a utf-8 bytestring then marshall that representation out using FFI -- that wouldn't necessarily work because the memory representation might be different?
2020-09-17 02:53:23 <dolio> You could represent it other ways in a bytestring, too.
2020-09-17 02:53:47 <dolio> But you'd need to be careful.
2020-09-17 02:53:50 <c_wraith> Right. You should go through an explicit conversion to the correct encoding you want in a ByteString, then use useAsCString for the bytestring
2020-09-17 02:54:42 × machinedgod quits (~machinedg@d67-193-126-196.home3.cgocable.net) (Ping timeout: 260 seconds)
2020-09-17 02:54:57 <exodrifter> well, i want to have a foreign function call the haskell code, not the other way around, so useAsCString wouldn't work for what i'm trying to do.
2020-09-17 02:55:04 <c_wraith> Ah, ok.
2020-09-17 02:55:29 Stanley00 joins (~stanley00@unaffiliated/stanley00)
2020-09-17 02:55:45 <exodrifter> dolio: what do you mean exactly? represent it in what other ways?
2020-09-17 02:56:21 <dolio> You could have UTF-16 in a byte string, but each byte would be half of one of the basic units of the encoding.
2020-09-17 02:56:51 <dolio> Also it probably gives you more ways to mess up the endianness.
2020-09-17 02:56:59 <exodrifter> Ah, okay, yeah that makes sense
2020-09-17 02:57:25 nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net)
2020-09-17 02:58:22 <exodrifter> so if the way the UTF-8 is represented is an implementation detail, is there then no way to marshall a UTF-8 string without implementing a decoder in the foreign code that knows how it's represented in haskell?
2020-09-17 02:59:32 <dolio> The foreign function is going to need to know the encoding used.
2020-09-17 02:59:44 × exodrifter quits (adacad5d@cpe-173-172-173-93.tx.res.rr.com) (Remote host closed the connection)
2020-09-17 02:59:48 <dolio> If it's UTF-8, it'll need to know that.
2020-09-17 03:00:01 × jbarnette quits (~jbarnette@185.204.1.185) ()
2020-09-17 03:00:51 exodrifter joins (adacad5d@cpe-173-172-173-93.tx.res.rr.com)
2020-09-17 03:00:55 alp_ joins (~alp@2a01:e0a:58b:4920:557f:9e9f:2eef:4c23)
2020-09-17 03:01:38 × nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Ping timeout: 246 seconds)
2020-09-17 03:01:58 <exodrifter> Hmm, okay. So if it knew the bytes were UTF-8, then it should be fine? I'm not sure if the UTF-8 standard defines how it would be represented in memory...
2020-09-17 03:02:18 <dolio> UTF-8 is a particular way of storing unicode.
2020-09-17 03:03:27 <exodrifter> Yes, so does that apply to in-memory? I'm aware that it would work for files, since i can usually open UTF-8 documents regardless of what computer i'm on.
2020-09-17 03:03:37 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-09-17 03:03:57 <dolio> It can be stored that way in memory, too. But Text doesn't.
2020-09-17 03:04:53 <exodrifter> sure. So I just need to encode the text into a UTF-8 bytestring, then figure out how to convert the bytestring into a CString, and that should work it sounds like
2020-09-17 03:04:55 <dolio> That's one of the resons there's `decodeUtf8`
2020-09-17 03:05:10 <dolio> Yeah, probably.
2020-09-17 03:05:39 <dolio> Although C doesn't necessarily know anything about UTF-8. That'd be up to libraries.
2020-09-17 03:06:20 <exodrifter> yeah, that makes sense. But, I'm assuming that if the user was using a library that had the equivalent of decodeUtf8 it should work
2020-09-17 03:06:55 <exodrifter> It's too bad ByteString doesn't expose a function that lets you return the CString... I'm looking at the implementation of it and i suuuuure don't understand it yet
2020-09-17 03:06:57 <dolio> And e.g. all sorts of Microsoft stuff uses UTF-16, I think.
2020-09-17 03:07:29 <exodrifter> I think i am satisfied limiting my use case to UTF-8.
2020-09-17 03:08:09 heatsink joins (~heatsink@2600:1700:bef1:5e10:99ca:18ad:4e5f:ffdf)
2020-09-17 03:08:19 <dolio> Yeah, that's pretty safe.
2020-09-17 03:09:21 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
2020-09-17 03:09:48 <exodrifter> oh -- i guess i don't really want a CString since I don't want to be limited by ascii. I want to return something more like an array of bytes or something.
2020-09-17 03:10:45 <exodrifter> ...wait, that is what byte is in c isn't it.
2020-09-17 03:10:47 <dolio> I think CString is a char pointer.
2020-09-17 03:10:58 <exodrifter> yeah, it's a char*
←Prev  Next→
Page 1 .. 7 8 9 10 11 12 13 14 15 16 17 .. 5022

All times are in UTC.