Logs: freenode/#haskell
| 2020-10-26 20:32:43 | caubert | is now known as caubert_afk |
| 2020-10-26 20:36:32 | caubert_afk | is now known as caubert |
| 2020-10-26 20:37:17 | → | noname234234 joins (5e7be11d@94.123.225.29) |
| 2020-10-26 20:37:33 | <noname234234> | can I ask beginner question here? |
| 2020-10-26 20:37:39 | × | dansho quits (~dansho@ip68-108-167-185.lv.lv.cox.net) (Quit: Leaving) |
| 2020-10-26 20:38:15 | <dminuoso> | noname234234: Yes. |
| 2020-10-26 20:38:29 | <noname234234> | I don't know how to format code here, can you help me with that |
| 2020-10-26 20:38:43 | <dminuoso> | https://paste.tomsmeding.com/ |
| 2020-10-26 20:39:26 | <noname234234> | I'm trying to do the exercise here -> https://en.wikibooks.org/wiki/Haskell/Monoids#Monoid_laws |
| 2020-10-26 20:39:34 | → | oisdk joins (~oisdk@2001:bb6:3329:d100:844c:cd9a:b52a:ea47) |
| 2020-10-26 20:39:39 | → | thir joins (~thir@p200300f27f0b7e004c18ab60065ea01b.dip0.t-ipconnect.de) |
| 2020-10-26 20:39:52 | → | ransom joins (~c4264035@c-73-243-2-10.hsd1.co.comcast.net) |
| 2020-10-26 20:39:53 | × | geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Remote host closed the connection) |
| 2020-10-26 20:40:16 | <noname234234> | My code is https://paste.tomsmeding.com/BGe5UG1c |
| 2020-10-26 20:40:57 | <noname234234> | Uh forget to include this -> https://paste.tomsmeding.com/BGe5UG1c |
| 2020-10-26 20:41:07 | <noname234234> | Oops... this -> newtype Sum a = Sum { getSum :: a } |
| 2020-10-26 20:41:15 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-10-26 20:41:26 | <noname234234> | So I don't know how the correct syntax for this instance definition |
| 2020-10-26 20:42:01 | <dminuoso> | The syntax looks good. |
| 2020-10-26 20:42:12 | <dminuoso> | Do you get any error? |
| 2020-10-26 20:42:17 | <noname234234> | Yes -> Illegal instance declaration for ‘Monoid (Sum Bool)’ (All instance types must be of the form (T a1 ... an) where a1 ... an are *distinct type variables*, and each type variable appears at most once in the instance head. Use FlexibleInstances if you want to disable this.)• In the instance declaration for ‘Monoid (Sum |
| 2020-10-26 20:42:18 | <noname234234> | Bool)’typecheck |
| 2020-10-26 20:42:21 | <dminuoso> | Ah! |
| 2020-10-26 20:42:27 | <dminuoso> | Indeed, enable the specified extension |
| 2020-10-26 20:42:33 | <dminuoso> | Or change the newtype to `newtype Sum = Sum Bool` |
| 2020-10-26 20:42:51 | <dminuoso> | To do the former, just add {-# LANGUAGE FlexibleInstances #-} |
| 2020-10-26 20:43:09 | <dminuoso> | The extension is fairly benign |
| 2020-10-26 20:43:14 | <noname234234> | someone else said like this but I couldn't figure it out -> `The problem is wanting you to rewrite the Any and All wrappers from Data.Monoid which are data Any = Any { getAny :: Bool } etc` |
| 2020-10-26 20:43:50 | × | Kaivo quits (~Kaivo@ec2-15-222-231-32.ca-central-1.compute.amazonaws.com) (Ping timeout: 260 seconds) |
| 2020-10-26 20:43:55 | × | thir quits (~thir@p200300f27f0b7e004c18ab60065ea01b.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-10-26 20:44:05 | <noname234234> | what's the real problem here i don't understand, is syntax correct or not correct? |
| 2020-10-26 20:44:13 | <tomsmeding> | what that person meant is: the Any and All definitions in Data.Monoid are in essence the answers to this question |
| 2020-10-26 20:44:17 | <dminuoso> | noname234234: Formally, when you write an `instance T (C ...) where`, then you may only have type variables in the dots. |
| 2020-10-26 20:44:19 | <tomsmeding> | just with different na,es |
| 2020-10-26 20:44:35 | <tomsmeding> | *names |
| 2020-10-26 20:44:37 | <dminuoso> | noname234234: To specify an `instance T (C Bool)` is illegal 2010 haskell |
| 2020-10-26 20:44:57 | <dminuoso> | The reasons for this restrictions are somewhat subtle, but you can either lift them by enabling the pragma I have suggested |
| 2020-10-26 20:45:06 | <noname234234> | so type variable is something lke bool? |
| 2020-10-26 20:45:06 | <dminuoso> | or you change the newtype so you wont have to mention `Bool` in the instance head |
| 2020-10-26 20:45:08 | × | unlink2 quits (~unlink2@p200300ebcf180b00a39cfda93b79d512.dip0.t-ipconnect.de) (*.net *.split) |
| 2020-10-26 20:45:08 | × | ghoulguy quits (x@freenode/staff/haskell.developer.glguy) (*.net *.split) |
| 2020-10-26 20:45:08 | × | wi[m] quits (w1gzmatrix@gateway/shell/matrix.org/x-lfcylepzsrjwyrbr) (*.net *.split) |
| 2020-10-26 20:45:08 | × | materialfuture[m quits (materialfu@gateway/shell/matrix.org/x-djqhtahsalhhtmbv) (*.net *.split) |
| 2020-10-26 20:45:08 | × | mmynsted[m] quits (mmynstedtc@gateway/shell/matrix.org/x-cdvlrpxsdijgwogw) (*.net *.split) |
| 2020-10-26 20:45:08 | × | steve[m] quits (stevetrout@gateway/shell/matrix.org/x-yobseikaxycmhhfr) (*.net *.split) |
| 2020-10-26 20:45:08 | × | jiribenes1 quits (jbjiribene@gateway/shell/matrix.org/x-gbosxlytzboxghyk) (*.net *.split) |
| 2020-10-26 20:45:08 | × | srid quits (sridmatrix@gateway/shell/matrix.org/x-bahjeddkvcglhyrj) (*.net *.split) |
| 2020-10-26 20:45:08 | × | alvinsj[m] quits (alvinsjmat@gateway/shell/matrix.org/x-uvjjzjrrekrkslqu) (*.net *.split) |
| 2020-10-26 20:45:08 | × | michaelpj quits (michaelpjm@gateway/shell/matrix.org/x-ncpfrytegghonssp) (*.net *.split) |
| 2020-10-26 20:45:08 | × | tersetears[m] quits (tersetears@gateway/shell/matrix.org/x-dmulllmltwwxtjzn) (*.net *.split) |
| 2020-10-26 20:45:08 | × | lnxw37d4 quits (lnxw37d4ma@gateway/shell/matrix.org/x-rbikvwzhgsuamfor) (*.net *.split) |
| 2020-10-26 20:45:08 | × | maralorn quits (maralornma@gateway/shell/matrix.org/x-gdkwbeskgjiokzif) (*.net *.split) |
| 2020-10-26 20:45:08 | × | SlackIntegration quits (slackbotma@gateway/shell/matrix.org/x-tzgbprxkzzasbbnm) (*.net *.split) |
| 2020-10-26 20:45:08 | × | SolarAquarion quits (SolarAquar@gateway/shell/panicbnc/x-twsqpddkakzbghtr) (*.net *.split) |
| 2020-10-26 20:45:08 | × | Takumo quits (takumo@unaffiliated/takumokatekari) (*.net *.split) |
| 2020-10-26 20:45:08 | × | trevorriles quits (uid469656@gateway/web/irccloud.com/x-ruimatphqohrzmib) (*.net *.split) |
| 2020-10-26 20:45:08 | × | TheScoop quits (~TheScoop@unaffiliated/tryte) (*.net *.split) |
| 2020-10-26 20:45:08 | × | edmundnoble quits (sid229620@gateway/web/irccloud.com/x-gvfutybyprjhwlxz) (*.net *.split) |
| 2020-10-26 20:45:08 | × | fiadliel quits (sid399568@gateway/web/irccloud.com/x-ymacoburpwrvlgcx) (*.net *.split) |
| 2020-10-26 20:45:08 | × | benwr____ quits (sid372383@gateway/web/irccloud.com/x-grifljzptgiftdzy) (*.net *.split) |
| 2020-10-26 20:45:08 | × | uwap quits (~uwap@genja.uwap.name) (*.net *.split) |
| 2020-10-26 20:45:08 | × | taktoa[c] quits (sid282096@gateway/web/irccloud.com/x-nuycfigarigggsbg) (*.net *.split) |
| 2020-10-26 20:45:08 | × | dsal quits (sid13060@gateway/web/irccloud.com/x-kthuquovdrjebyop) (*.net *.split) |
| 2020-10-26 20:45:08 | × | Boarders quits (sid425905@gateway/web/irccloud.com/x-rullwqslalbceykx) (*.net *.split) |
| 2020-10-26 20:45:09 | × | raid quits (macbookpro@irc-1.coding4.coffee) (*.net *.split) |
| 2020-10-26 20:45:09 | × | jackhill quits (~jackhill@marsh.hcoop.net) (*.net *.split) |
| 2020-10-26 20:45:09 | × | acro quits (~acro@unaffiliated/acro) (*.net *.split) |
| 2020-10-26 20:45:09 | × | t36s_ quits (~t36s@2a03:b0c0:3:d0::1c23:5001) (*.net *.split) |
| 2020-10-26 20:45:09 | × | SegFaultAX quits (SegFaultAX@unaffiliated/segfaultax) (*.net *.split) |
| 2020-10-26 20:45:09 | × | yorick quits (~yorick@oftn/oswg-member/yorick) (*.net *.split) |
| 2020-10-26 20:45:09 | × | vjoki quits (vjoki@2a00:d880:3:1::fea1:9ae) (*.net *.split) |
| 2020-10-26 20:45:09 | × | grol quits (~quassel@2620:11e:1000:2:250:56ff:fea4:7) (*.net *.split) |
| 2020-10-26 20:45:16 | <dminuoso> | noname234234: sure, or just `a` |
| 2020-10-26 20:45:16 | → | acro joins (~acro@188.166.31.185) |
| 2020-10-26 20:45:16 | × | acro quits (~acro@188.166.31.185) (Changing host) |
| 2020-10-26 20:45:16 | → | acro joins (~acro@unaffiliated/acro) |
| 2020-10-26 20:45:17 | → | trevorriles joins (sid469656@gateway/web/irccloud.com/x-ojxdogvggwklcqfu) |
| 2020-10-26 20:45:19 | → | uwap joins (~uwap@genja.uwap.name) |
| 2020-10-26 20:45:22 | → | benwr____ joins (sid372383@gateway/web/irccloud.com/x-kvsrlvuwekbjywwv) |
| 2020-10-26 20:45:22 | <dminuoso> | anything with lower case |
| 2020-10-26 20:45:22 | → | vjoki joins (vjoki@2a00:d880:3:1::fea1:9ae) |
| 2020-10-26 20:45:23 | → | TheScoop joins (~TheScoop@unaffiliated/tryte) |
| 2020-10-26 20:45:23 | → | edmundnoble joins (sid229620@gateway/web/irccloud.com/x-qtgjwsrxfqtxbxld) |
| 2020-10-26 20:45:24 | → | fiadliel joins (sid399568@gateway/web/irccloud.com/x-yvsjefcorozedvpx) |
| 2020-10-26 20:45:24 | → | jackhill joins (~jackhill@marsh.hcoop.net) |
| 2020-10-26 20:45:25 | → | taktoa[c] joins (sid282096@gateway/web/irccloud.com/x-mhwfcebznpkovctx) |
| 2020-10-26 20:45:25 | → | dsal joins (sid13060@gateway/web/irccloud.com/x-ukyimvofbbobpxrr) |
| 2020-10-26 20:45:25 | → | Boarders joins (sid425905@gateway/web/irccloud.com/x-naslsmiaebxgaija) |
| 2020-10-26 20:45:26 | → | unlink2 joins (~unlink2@p200300ebcf180b00a39cfda93b79d512.dip0.t-ipconnect.de) |
| 2020-10-26 20:45:27 | → | t36s joins (~t36s@138.68.90.188) |
| 2020-10-26 20:45:27 | → | SegFaultAX joins (SegFaultAX@unaffiliated/segfaultax) |
| 2020-10-26 20:45:29 | → | Takumo joins (takumo@unaffiliated/takumokatekari) |
| 2020-10-26 20:45:41 | → | yorick1 joins (~yorick@oftn/oswg-member/yorick) |
| 2020-10-26 20:46:21 | → | raid joins (macbookpro@irc-1.coding4.coffee) |
| 2020-10-26 20:46:21 | → | grol joins (~quassel@2620:11e:1000:2:250:56ff:fea4:7) |
| 2020-10-26 20:46:31 | × | stree quits (~stree@50-108-72-205.adr01.mskg.mi.frontiernet.net) (Quit: Caught exception) |
| 2020-10-26 20:46:36 | → | Kaivo joins (~Kaivo@104-200-86-99.mc.derytele.com) |
| 2020-10-26 20:46:48 | → | stree joins (~stree@50-108-72-205.adr01.mskg.mi.frontiernet.net) |
| 2020-10-26 20:47:00 | <noname234234> | So in the exercise I have to write this two instance for sum and product |
| 2020-10-26 20:47:04 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
All times are in UTC.