Logs: freenode/#haskell
| 2020-09-19 08:26:50 | <Agiza> | I don't understand what I did wrong here: boomBangs xs = [if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x ] |
| 2020-09-19 08:27:28 | <[exa]> | Agiza: what's that supposed to do? |
| 2020-09-19 08:27:55 | <[exa]> | currently it prints one boom for each odd number below 10 and one bang for all other odd numbers in xs |
| 2020-09-19 08:28:00 | <siraben> | Agiza: that seems well-typed to me |
| 2020-09-19 08:28:05 | × | bahamas quits (~lucian@unaffiliated/bahamas) (Ping timeout: 240 seconds) |
| 2020-09-19 08:28:26 | <Agiza> | It's from a tutorial: "Let's say we want a comprehension that replaces each odd number greater than 10 with "BANG!" and each odd number that's less than 10 with "BOOM!". If a number isn't odd, we throw it out of our list." but I only get an error |
| 2020-09-19 08:28:46 | <Agiza> | The error is: <interactive>:35:11: error: • No instance for (Num [Integer]) arising from the literal ‘23’ • In the first argument of ‘boomBangs’, namely ‘23’ In the expression: boomBangs 23 In an equation for ‘it’: it = boomBangs 23 |
| 2020-09-19 08:29:05 | <siraben> | Agiza: that's because boomBangs takes a list of numbers |
| 2020-09-19 08:29:07 | <[exa]> | Agiza: you must give it a list, like in: boomBangs [23] |
| 2020-09-19 08:29:08 | <siraben> | Type :t boomBangs in the repl |
| 2020-09-19 08:29:20 | <siraben> | or try, boomBangs [1..100] |
| 2020-09-19 08:29:39 | <dansho> | whew ok figured out the correct overlap pragmas: OVERLAPPABLE on the first, nothing on the second, and OVERLAPPING on the third |
| 2020-09-19 08:29:42 | <Agiza> | Ooooh now I understand! I was writing boomBangs 23 |
| 2020-09-19 08:30:04 | <Agiza> | Thank you for the help! |
| 2020-09-19 08:30:25 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 08:31:12 | <siraben> | Agiza: FYI, "No instance for (Num [Integer]) arising from the literal ‘23’ " means that GHC is trying to interpret 23 as a list of numbers. |
| 2020-09-19 08:32:04 | <[exa]> | Agiza: btw this might be a nice exercise for catMaybes/map; try constructing `oneBoomBang :: Int -> Maybe String` for converting a single integer, and only then expand it to work with lists |
| 2020-09-19 08:32:09 | <edwardk> | siraben: anyways the idea is Nat only exists as a kind in ghc, Type only exists as a kind, Symbol is only a kind, and Int is only a type, Char is only a type. I want to be able to use Int as a kind, and lift term level ints into it, same with term level chars as types inhabiting the Char kind, and i want to go the other way. i want a Nat type that has Z and S as terms in it, same with Symbol holding strings and values for types letting |
| 2020-09-19 08:32:09 | <edwardk> | me check type equality |
| 2020-09-19 08:33:13 | <edwardk> | siraben: and then Sing a can be written once and for all for all of these and let me lift terms in a type to types in a kind of singletons, such that each of those singleton types only has one inhabitant |
| 2020-09-19 08:33:42 | <edwardk> | the api is sort of the bastard child of the singletons library and my reflection library |
| 2020-09-19 08:35:05 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 258 seconds) |
| 2020-09-19 08:35:23 | → | mmohammadi98126 joins (~mmohammad@5.238.164.128) |
| 2020-09-19 08:36:40 | <Agiza> | [exa] What would that look like? I am too new to this (started yesterday) so it's very confusing |
| 2020-09-19 08:36:45 | × | Lycurgus quits (~niemand@98.4.96.130) (Quit: Exeunt) |
| 2020-09-19 08:36:56 | <Agiza> | siraben Thank you! |
| 2020-09-19 08:38:16 | <siraben> | I see. |
| 2020-09-19 08:38:35 | <siraben> | In a dependently typed language, this would not be necessary at all, correct? |
| 2020-09-19 08:41:38 | → | ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) |
| 2020-09-19 08:42:09 | → | knupfer joins (~Thunderbi@mue-88-130-61-068.dsl.tropolys.de) |
| 2020-09-19 08:43:29 | × | ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Read error: Connection reset by peer) |
| 2020-09-19 08:44:43 | → | ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) |
| 2020-09-19 08:49:05 | × | ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Ping timeout: 240 seconds) |
| 2020-09-19 08:51:17 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 08:51:28 | hackage | uniqueness-periods-vector-filters 0.2.0.0 - A library allows to change the structure of the 'RealFrac' function output. https://hackage.haskell.org/package/uniqueness-periods-vector-filters-0.2.0.0 (OleksandrZhabenko) |
| 2020-09-19 08:56:01 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 264 seconds) |
| 2020-09-19 08:56:18 | → | jedws joins (~jedws@121.209.139.222) |
| 2020-09-19 08:56:32 | → | mmohammadi981260 joins (~mmohammad@5.238.182.16) |
| 2020-09-19 08:57:34 | × | jedws quits (~jedws@121.209.139.222) (Client Quit) |
| 2020-09-19 08:58:59 | × | mmohammadi98126 quits (~mmohammad@5.238.164.128) (Ping timeout: 260 seconds) |
| 2020-09-19 08:58:59 | mmohammadi981260 | is now known as mmohammadi98126 |
| 2020-09-19 09:00:02 | × | zacts1 quits (~zacts@s91904426.blix.com) () |
| 2020-09-19 09:00:29 | × | ntwoaaci^ quits (ntwoaaci@ip98-184-89-2.mc.at.cox.net) () |
| 2020-09-19 09:02:27 | hackage | Z-Data 0.1.2.0 - Array, vector and text https://hackage.haskell.org/package/Z-Data-0.1.2.0 (winterland) |
| 2020-09-19 09:04:29 | <[exa]> | Agiza: oh so. Basically, make a simple function that converts eg. 23 to `Just "BANG"` and 8 to `Nothing`, and try using some higher order functions to expand this functionality to lists without actually touching the lists plumbing manually; in particular try `map` and `catMaybes` |
| 2020-09-19 09:05:01 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 2020-09-19 09:06:38 | × | p-core quits (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) (Remote host closed the connection) |
| 2020-09-19 09:06:57 | → | p-core joins (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) |
| 2020-09-19 09:07:02 | × | deviantfero quits (~deviantfe@190.99.48.231) (Quit: WeeChat 2.9) |
| 2020-09-19 09:09:35 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-19 09:12:08 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 09:12:42 | <Agiza> | [exa] Oh okay! That sounds honestly too complicated for me right now so I will skip it but thank you for the advice |
| 2020-09-19 09:13:04 | <Agiza> | @[exa] |
| 2020-09-19 09:13:04 | <lambdabot> | Unknown command, try @list |
| 2020-09-19 09:13:27 | hackage | futhark 0.17.1 - An optimising compiler for a functional, array-oriented language. https://hackage.haskell.org/package/futhark-0.17.1 (TroelsHenriksen) |
| 2020-09-19 09:13:47 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-09-19 09:16:02 | × | mmohammadi98126 quits (~mmohammad@5.238.182.16) (Quit: I quit (╯°□°)╯︵ ┻━┻) |
| 2020-09-19 09:17:12 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 272 seconds) |
| 2020-09-19 09:20:42 | × | shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection) |
| 2020-09-19 09:21:00 | × | platypine quits (~platypine@c-73-249-162-185.hsd1.ct.comcast.net) (Ping timeout: 272 seconds) |
| 2020-09-19 09:22:00 | × | lagothrix quits (~lagothrix@unaffiliated/lagothrix) (Killed (orwell.freenode.net (Nickname regained by services))) |
| 2020-09-19 09:22:06 | → | lagothrix joins (~lagothrix@unaffiliated/lagothrix) |
| 2020-09-19 09:25:45 | × | lucid_0x80 quits (~lucid_0x8@188.253.237.250) (Remote host closed the connection) |
| 2020-09-19 09:26:08 | → | lucid_0x80 joins (~lucid_0x8@188.253.237.250) |
| 2020-09-19 09:29:10 | × | p-core quits (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) (Quit: p-core) |
| 2020-09-19 09:29:32 | → | p-core joins (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) |
| 2020-09-19 09:31:42 | × | jb55 quits (~jb55@gateway/tor-sasl/jb55) (Remote host closed the connection) |
| 2020-09-19 09:32:59 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 09:34:11 | → | jb55 joins (~jb55@gateway/tor-sasl/jb55) |
| 2020-09-19 09:34:16 | × | p-core quits (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) (Ping timeout: 256 seconds) |
| 2020-09-19 09:35:02 | → | p-core joins (~Thunderbi@koleje-wifi-0046.koleje.cuni.cz) |
| 2020-09-19 09:35:52 | × | jb55 quits (~jb55@gateway/tor-sasl/jb55) (Remote host closed the connection) |
| 2020-09-19 09:37:46 | × | Agiza quits (2eef7ad3@larka.olf.sgsnet.se) (Remote host closed the connection) |
| 2020-09-19 09:37:49 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 260 seconds) |
| 2020-09-19 09:38:02 | → | jb55 joins (~jb55@gateway/tor-sasl/jb55) |
| 2020-09-19 09:39:08 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-19 09:39:58 | hackage | composite-aeson-writeonly 0.1.0.0 - WriteOnly indicators for composite-aeson. https://hackage.haskell.org/package/composite-aeson-writeonly-0.1.0.0 (locallycompact) |
| 2020-09-19 09:44:28 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2020-09-19 09:46:40 | → | toorevitimirp joins (~tooreviti@117.182.182.33) |
| 2020-09-19 09:48:25 | × | aarvar quits (~foewfoiew@50.35.43.33) (Ping timeout: 240 seconds) |
| 2020-09-19 09:50:26 | → | kleisli_ joins (~kleisli@172-8-147-49.lightspeed.irvnca.sbcglobal.net) |
| 2020-09-19 09:51:57 | hackage | composite-aeson-cofree-list 0.1.0.0 - Print a Cofree [] as a JSON value. https://hackage.haskell.org/package/composite-aeson-cofree-list-0.1.0.0 (locallycompact) |
| 2020-09-19 09:52:10 | × | knupfer quits (~Thunderbi@mue-88-130-61-068.dsl.tropolys.de) (Ping timeout: 256 seconds) |
| 2020-09-19 09:52:57 | × | endorphin quits (~kleisli@2600:1700:4640:c560:68bd:9d76:dbd8:24e7) (Ping timeout: 260 seconds) |
| 2020-09-19 09:53:54 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 09:55:03 | → | Moe_Epsilon joins (~Moe_Epsil@185.163.110.116) |
| 2020-09-19 09:57:15 | → | utopic_int0x80 joins (~lucid_0x8@188.253.235.170) |
| 2020-09-19 09:58:28 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 256 seconds) |
| 2020-09-19 10:00:16 | × | lucid_0x80 quits (~lucid_0x8@188.253.237.250) (Ping timeout: 272 seconds) |
| 2020-09-19 10:10:23 | → | Amras joins (~Amras@unaffiliated/amras0000) |
| 2020-09-19 10:11:01 | × | wavemode quits (~wavemode@097-070-075-143.res.spectrum.com) (Ping timeout: 264 seconds) |
| 2020-09-19 10:11:47 | → | reppertj joins (~textual@pool-96-246-209-59.nycmny.fios.verizon.net) |
| 2020-09-19 10:11:53 | × | oxide quits (~lambda@unaffiliated/mclaren) (Ping timeout: 260 seconds) |
| 2020-09-19 10:12:31 | × | mirrorbird quits (~psutcliff@2a00:801:44a:a00b:20c3:c64:eb15:73a2) (Quit: Leaving) |
| 2020-09-19 10:12:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-19 10:14:45 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 10:15:56 | → | mmohammadi98126 joins (~mmohammad@2.178.222.79) |
| 2020-09-19 10:16:33 | × | rprije quits (~rprije@27.143.220.203.dial.dynamic.acc01-myal-dub.comindico.com.au) (Ping timeout: 260 seconds) |
| 2020-09-19 10:16:36 | × | __Joker quits (~Joker@180.151.105.74) (Ping timeout: 256 seconds) |
| 2020-09-19 10:18:20 | → | __Joker joins (~Joker@106.206.8.71) |
All times are in UTC.