Logs: freenode/#haskell
| 2021-03-24 22:12:23 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2021-03-24 22:12:24 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2021-03-24 22:12:54 | <bgamari> | solidus-river, I'm not entirely sure what you |
| 2021-03-24 22:13:00 | <monochrom> | Data.Binary.Builder also has putWord64be and putInt64be for Builder. |
| 2021-03-24 22:13:02 | <bgamari> | solidus-river, IIRC Builder is a synonym for Put |
| 2021-03-24 22:13:04 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection) |
| 2021-03-24 22:13:19 | <bgamari> | or rather, the other way around |
| 2021-03-24 22:13:40 | <solidus-river> | this doesn't type check and I'm wifing on why, still playing around in ghci |
| 2021-03-24 22:13:42 | <monochrom> | Neither. |
| 2021-03-24 22:13:53 | <solidus-river> | toLazyByteString . putWord64be . fromIntegral |
| 2021-03-24 22:14:08 | <solidus-river> | i think that should be Num a => a => ByteString |
| 2021-03-24 22:14:13 | × | malumore quits (~malumore@151.62.115.239) (Ping timeout: 245 seconds) |
| 2021-03-24 22:14:39 | <solidus-river> | erm: Num a => a -> ByteString |
| 2021-03-24 22:14:46 | × | shaunm quits (~shaunm@185.204.1.185) (Remote host closed the connection) |
| 2021-03-24 22:15:24 | <hololeap> | solidus-river: did you mean toInteger instead of fromIntegral? |
| 2021-03-24 22:15:46 | → | son0p joins (~son0p@181.136.122.143) |
| 2021-03-24 22:15:59 | <solidus-river> | :t toInteger |
| 2021-03-24 22:16:00 | <lambdabot> | Integral a => a -> Integer |
| 2021-03-24 22:16:05 | <solidus-river> | :t fromIntegral |
| 2021-03-24 22:16:06 | <lambdabot> | (Integral a, Num b) => a -> b |
| 2021-03-24 22:16:28 | → | conal joins (~conal@64.71.133.70) |
| 2021-03-24 22:17:40 | × | Lycurgus quits (~niemand@98.4.119.196) (Quit: Exeunt) |
| 2021-03-24 22:17:40 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-24 22:17:56 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-24 22:18:34 | → | usr25 joins (~usr25@unaffiliated/usr25) |
| 2021-03-24 22:19:16 | <hololeap> | ignore that last statement of mine, but it would be: Integral a => a -> ByteString |
| 2021-03-24 22:19:45 | × | is_null quits (~jpic@pdpc/supporter/professional/is-null) (Ping timeout: 264 seconds) |
| 2021-03-24 22:19:54 | × | kini quits (~kini@unaffiliated/kini) (Remote host closed the connection) |
| 2021-03-24 22:21:11 | → | kini joins (~kini@unaffiliated/kini) |
| 2021-03-24 22:21:49 | × | son0p quits (~son0p@181.136.122.143) (Quit: leaving) |
| 2021-03-24 22:22:02 | × | dhil quits (~dhil@80.208.56.181) (Ping timeout: 256 seconds) |
| 2021-03-24 22:23:08 | <bgamari> | monochrom, huh, so you are right |
| 2021-03-24 22:23:57 | <monochrom> | :) |
| 2021-03-24 22:24:19 | <monochrom> | YEAH DOCS |
| 2021-03-24 22:24:19 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-24 22:24:31 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-24 22:24:42 | <solidus-river> | toInteger didn't help but I'm getting closer... does ghci bot have these things imported? |
| 2021-03-24 22:25:07 | <solidus-river> | :t toLazyByteString . putWord64be . fromIntegral |
| 2021-03-24 22:25:09 | <lambdabot> | error: |
| 2021-03-24 22:25:09 | <lambdabot> | Variable not in scope: toLazyByteString :: b0 -> c |
| 2021-03-24 22:25:09 | <lambdabot> | error: |
| 2021-03-24 22:25:16 | × | usr25 quits (~usr25@unaffiliated/usr25) (Quit: Leaving) |
| 2021-03-24 22:25:16 | <solidus-river> | neope :P |
| 2021-03-24 22:25:36 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2021-03-24 22:25:45 | <solidus-river> | somethings messed up with my packages. Its claiming Data.ByteString has no toStrict |
| 2021-03-24 22:25:53 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-03-24 22:25:57 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) |
| 2021-03-24 22:26:01 | × | Franciman quits (~francesco@host-79-53-62-46.retail.telecomitalia.it) (Quit: Leaving) |
| 2021-03-24 22:26:44 | <monochrom> | toStrict belongs to Data.ByteString.Lazy |
| 2021-03-24 22:26:57 | <monochrom> | Do you have access to Hoogle? Docs? |
| 2021-03-24 22:27:29 | → | tempate joins (~tempate@unaffiliated/tempate) |
| 2021-03-24 22:27:42 | × | mice-user quits (7712037d@119-18-3-125.771203.syd.nbn.aussiebb.net) (Ping timeout: 240 seconds) |
| 2021-03-24 22:28:05 | <tempate> | Can anyone recommend a good set of coding problems specifically meant to be solved in Haskell? |
| 2021-03-24 22:28:49 | <hololeap> | it looks like PutM is basically the same as `Writer ByteString` (strict Writer), and `type Put = PutM ()` |
| 2021-03-24 22:29:01 | <maerwald> | tempate: write a compiler |
| 2021-03-24 22:30:00 | <Axman6> | tempate: https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems https://blog.tmorris.net/posts/20-intermediate-haskell-exercises/ |
| 2021-03-24 22:30:53 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 245 seconds) |
| 2021-03-24 22:30:53 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-24 22:30:58 | <tempate> | Thank you very much, Axman6 |
| 2021-03-24 22:30:58 | <Axman6> | the latter is excellent, I won't say much more about it because it's intentionally a set of problems designed to make you let the types guide you |
| 2021-03-24 22:31:07 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-24 22:31:19 | <Axman6> | Use the types Luke |
| 2021-03-24 22:32:30 | <solidus-river> | monochrom: i'm using hackage docs but i'm not very good at navigating them i guess |
| 2021-03-24 22:32:48 | <solidus-river> | toString is mentioned in the module documentation for Data.ByteString so i assumed it would be in there |
| 2021-03-24 22:33:14 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-24 22:33:25 | <tempate> | Axman6: the second one does seem quite interesting. If you don't mind I'll get back at you once I've given it a try. |
| 2021-03-24 22:34:02 | <Axman6> | yeah feel free to ask lots of questions here, it's likely you'll need some hints |
| 2021-03-24 22:35:30 | <tempate> | Well, to be honest I didn't even know there were classes in Haskell |
| 2021-03-24 22:35:49 | <Axman6> | you have much to learn then :) |
| 2021-03-24 22:35:53 | <tempate> | tfw you learn from the question itself |
| 2021-03-24 22:36:15 | × | Waifod quits (~Waifod@91.106.123.186) (Ping timeout: 240 seconds) |
| 2021-03-24 22:36:26 | <Axman6> | if you haven't seen classes before, they're somewhat analogous to interfaces in, say, Java |
| 2021-03-24 22:36:38 | <Axman6> | % :i Num |
| 2021-03-24 22:36:38 | <yahb> | Axman6: type Num :: * -> Constraint; class Num a where; (+) :: a -> a -> a; (-) :: a -> a -> a; (*) :: a -> a -> a; negate :: a -> a; abs :: a -> a; signum :: a -> a; fromInteger :: Integer -> a; {-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}; -- Defined in `GHC.Num'; instance forall a. Integral a => Num (Ratio a) -- Defined in `GHC.Real'; instance Num Int8 -- Defined in `GHC.In |
| 2021-03-24 22:36:43 | <monochrom> | solidus-river: Then consider version mismatch. bytestring-0.10.12.0 (from GHC 8.10.4) doesn't have toStrict in Data.ByteString. bytestring-0.11.* has it. Clearly, hackage always displays a version newer than what you actually use. |
| 2021-03-24 22:36:54 | <Axman6> | hmm, that's a big class |
| 2021-03-24 22:37:22 | <monochrom> | And Google, always 5 versions behind. |
| 2021-03-24 22:37:41 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Read error: Connection reset by peer) |
| 2021-03-24 22:37:42 | <tempate> | oh, right, I think a friend mentioned them once |
| 2021-03-24 22:37:49 | <monochrom> | This is why I don't understand why serious developers don't build and read local docs. Internet docs are always the wrong version. |
| 2021-03-24 22:38:02 | <tempate> | My only Haskell experience are days 1, 2 and 3 of Advent of Code 2020 |
| 2021-03-24 22:38:56 | <Axman6> | right, maybe you will find other resources a better place to start. |
| 2021-03-24 22:39:49 | <Axman6> | monochrom: I think in the haskell worls a lot of that comes from not having good integration with tools like IDEs, but that's changing with HLS, I find myself using the docs on hover a lot |
| 2021-03-24 22:40:07 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 2021-03-24 22:40:58 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit) |
| 2021-03-24 22:41:06 | → | is_null joins (~jpic@pdpc/supporter/professional/is-null) |
| 2021-03-24 22:42:50 | <solidus-river> | monochrom: good tip, running a haddock build now :) this is my first real big haskell project so I'm still getting the ropes of the dev workflow |
| 2021-03-24 22:43:31 | <Axman6> | tempate: not sure how useful it is for learning initially, but keep this handy, it's something that I've learned new things from again and again over the years: http://dev.stephendiehl.com/hask/ |
| 2021-03-24 22:43:34 | → | ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-03-24 22:43:55 | <monochrom> | http://www.vex.net/~trebla/tmp/hasdoc is my shell script that guesses local doc location and pops it up in your web browser by an xdg-open call. |
| 2021-03-24 22:44:28 | <tempate> | Axman6: well, I usually learn best by just diving right into problems and not going through endless books |
| 2021-03-24 22:44:28 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-24 22:44:42 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-24 22:44:48 | <tempate> | (funnily enough this only happens to me with coding; I love reading) |
| 2021-03-24 22:46:02 | → | notzmv joins (~zmv@unaffiliated/zmv) |
| 2021-03-24 22:46:03 | <Axman6> | Many people get tripped up by doing that with Haskell, as it;s quite fundamentally different to what they already know - having taught Haskell at university, I often find people who haven't done any programming before find it easier to pick up as they don't have bad habbits ingrained already |
| 2021-03-24 22:46:04 | → | jul1u5 joins (~julius@85.206.103.207) |
| 2021-03-24 22:46:31 | <monochrom> | RIght, dive-in works iff there is little surprise. |
| 2021-03-24 22:46:58 | <monochrom> | The old age of "easy to pick up another language because just syntax change" ended 20 years ago. |
| 2021-03-24 22:47:07 | <solidus-river> | tempate: welcome :) Haskells heavy on the learning up-front but I just started 2 weeks ago and have a non-trivial 7 socketed threaded zeromq server that deals with shared state etc in ~ 300 lines of pretty darn readable code |
All times are in UTC.