Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-26 21:40:58 <shapr> b7471: it's fun
2020-11-26 21:41:21 <ski> shapr : occasionally i may boast a little in other channels about how friendly and welcoming i found #haskell, when i started chatting (and still do), and how i've since attempted to bring some of the same spirit also to other channels in which i've chatted a bit more
2020-11-26 21:41:30 × keviv quits (~keviv@35.142.17.117) (Read error: Connection reset by peer)
2020-11-26 21:42:20 <ski> b7471 : got it to type-check, at least ?
2020-11-26 21:42:48 <shapr> ski: Yeah, I attribute the root of that friendly culture to SPJ
2020-11-26 21:43:25 <b7471> ski what_
2020-11-26 21:43:33 <b7471> pardon?
2020-11-26 21:43:48 <ski> it's quite possible. he's a very amiable fellow
2020-11-26 21:44:12 <b7471> i dont understand english that well
2020-11-26 21:44:16 <ski> b7471 : i mean your `orderTriple' function, after you changed it, according to your last suggestion
2020-11-26 21:44:29 <b7471> well i tryed it
2020-11-26 21:44:36 <ski> did you get an error ?
2020-11-26 21:44:40 <b7471> and it says Error whatever...
2020-11-26 21:44:41 f-a parts (~f-a@151.34.157.206) ()
2020-11-26 21:44:42 <b7471> yes
2020-11-26 21:44:48 <ski> what was the error ?
2020-11-26 21:45:19 <b7471> just a second
2020-11-26 21:45:20 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-26 21:45:24 dirediresalt joins (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt)
2020-11-26 21:45:29 × DirefulSalt quits (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt) (Remote host closed the connection)
2020-11-26 21:45:49 <ski> shapr : i think it's quite likely been an important factor for the success that Haskell's had
2020-11-26 21:46:06 × bruce_wayne quits (~prateekpr@94.129.87.184) (Ping timeout: 272 seconds)
2020-11-26 21:46:25 × francesco_ quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Ping timeout: 264 seconds)
2020-11-26 21:46:41 <b7471> with actual type `(Int, Int, Int)' * In the expression: (x, y, y) In the expression: if x > y && z > y then (x, y, y) else y In an equation for `orderTriple': orderTriple (x, y, z) = if x > y && z > y then (x, y, y) else y | 46 | orderTriple(x,y,z)= if x>y && z>y then (x,y,y) else y | ^^^^^^^ Failed, no mod
2020-11-26 21:46:54 <b7471> lol
2020-11-26 21:46:55 DTZUZU joins (~DTZUZU@207.81.171.116)
2020-11-26 21:47:10 keviv joins (~keviv@35.142.17.117)
2020-11-26 21:47:37 <ski> b7471 : yes, you need to change both branches of the `if'-`then'-`else' (both the expression after the `then', and the expression after the `else'), to have the same type
2020-11-26 21:47:56 <ski> you can't have one of them giving back a number, and the other three numbers
2020-11-26 21:48:11 <b7471> https://pastebin.com/PnsM6Z7U
2020-11-26 21:48:16 <ski> the caller of your function wouldn't know what to expect back
2020-11-26 21:48:37 × chaosmasttter quits (~chaosmast@p200300c4a7107e01f87538c6eac6d35f.dip0.t-ipconnect.de) (Quit: WeeChat 2.9)
2020-11-26 21:49:33 <b7471> hmm
2020-11-26 21:50:07 <ski> what if the caller would try to do e.g. `1 + orderTriple (2,3,4)' .. if your code was allowed, it would add `1' to a number, in case the `else' branch was taken, but try to add a number to a triple (which doesn't work, what does that even mean ?), in case the `then' branch was taken
2020-11-26 21:50:26 × keviv quits (~keviv@35.142.17.117) (Read error: Connection reset by peer)
2020-11-26 21:50:46 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2020-11-26 21:50:53 oxfn joins (~dizzy_g@188.162.176.72)
2020-11-26 21:51:01 <ski> could you repeat your type signature for `orederTriple', btw ?
2020-11-26 21:51:05 bruce_wayne joins (~prateekpr@94.129.87.184)
2020-11-26 21:52:01 hackage ipfs 1.1.5.1 - Access IPFS locally and remotely https://hackage.haskell.org/package/ipfs-1.1.5.1 (expede)
2020-11-26 21:52:22 <b7471> haskell is not like these other languages
2020-11-26 21:52:38 <b7471> maybe i not understanding it anyway
2020-11-26 21:52:42 <b7471> its getting late
2020-11-26 21:52:58 <b7471> and so i wish you guys a good night
2020-11-26 21:53:06 <ski> it's a different programming paradigm
2020-11-26 21:53:21 <ski> it always takes more time to learn a new paradigm, than to learn yet another language in one you already know
2020-11-26 21:53:25 × knupfer quits (~Thunderbi@i59F7FFCD.versanet.de) (Ping timeout: 240 seconds)
2020-11-26 21:53:27 × dhouthoo quits (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be) (Quit: WeeChat 2.9)
2020-11-26 21:53:34 <ski> learning a new one is a bit like learning to program from scratch all over
2020-11-26 21:53:34 <shapr> b7471: it's worth learning!
2020-11-26 21:53:47 <ski> good night, b7471. happy Haskell learning !
2020-11-26 21:53:51 <b7471> well we shall see
2020-11-26 21:53:56 <b7471> thanks guy
2020-11-26 21:54:02 <b7471> goodbye
2020-11-26 21:54:11 <b7471> thanks guys*
2020-11-26 21:54:27 × b7471 quits (~kvirc@139.30.76.203) (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
2020-11-26 21:55:07 × maroloccio quits (~marolocci@2a02:8084:221:ce00:164f:8aff:fed8:411d) (Quit: WeeChat 2.3)
2020-11-26 21:55:34 hidedagger joins (~nate@unaffiliated/hidedagger)
2020-11-26 21:57:19 × hidedagger quits (~nate@unaffiliated/hidedagger) (Client Quit)
2020-11-26 21:57:23 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 272 seconds)
2020-11-26 21:58:01 mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de)
2020-11-26 21:58:41 × mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Client Quit)
2020-11-26 21:59:34 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2020-11-26 21:59:57 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-26 22:01:19 Rudd0 joins (~Rudd0@185.189.115.98)
2020-11-26 22:01:57 kasper1 parts (~u0_a549@cpc153669-craw9-2-0-cust163.16-3.cable.virginm.net) ("WeeChat 3.0")
2020-11-26 22:02:02 × gproto23 quits (~gproto23@unaffiliated/gproto23) (Ping timeout: 256 seconds)
2020-11-26 22:04:48 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
2020-11-26 22:06:49 × oxfn quits (~dizzy_g@188.162.176.72) (Ping timeout: 264 seconds)
2020-11-26 22:06:52 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2020-11-26 22:07:50 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-11-26 22:08:29 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
2020-11-26 22:09:37 × hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Ping timeout: 246 seconds)
2020-11-26 22:10:42 <incertia> is it possible to derive/write instances for type families?
2020-11-26 22:11:22 <incertia> i have data Test = A | B and type family F (t :: Test) where F 'A = Int, F 'B = Double
2020-11-26 22:11:46 <incertia> is it possible to get Eq (F t) and/or Show (F t)?
2020-11-26 22:12:05 <hpc> data Test = A | B deriving (Eq, ...)
2020-11-26 22:12:30 <hpc> oh wait, misread
2020-11-26 22:12:56 Franciman joins (~francesco@host-82-54-193-143.retail.telecomitalia.it)
2020-11-26 22:13:09 <hpc> F acts more like a type alias than a data type
2020-11-26 22:13:22 <hpc> so you should already have Eq (F t), for a specific value of t
2020-11-26 22:13:56 <incertia> right but when i stick it in a data type and try to derive ghc complains
2020-11-26 22:14:11 × Franciman quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Client Quit)
2020-11-26 22:14:22 <incertia> data MyData t = MyData { yolo :: F t } deriving (Show, Eq)
2020-11-26 22:14:47 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-11-26 22:14:59 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-26 22:17:02 <hpc> i think it can't figure out those are the only instances of F
2020-11-26 22:18:46 <hpc> a brute-force way past this could be GADTs
2020-11-26 22:19:20 <hpc> data MyData t where MyA :: F 'A -> MyData 'A; MyB :: etc etc
2020-11-26 22:19:31 <hpc> deriving (Show, Eq)
2020-11-26 22:19:59 <incertia> yeah problem here is there are more records in the actual case
2020-11-26 22:20:04 <incertia> which need lenses
2020-11-26 22:20:10 <ski> % data F a = F a a
2020-11-26 22:20:10 <yahb> ski:
2020-11-26 22:20:14 <ski> % data MyData t = Show (F t) => MyData { yolo :: F t }
2020-11-26 22:20:14 <yahb> ski:
2020-11-26 22:20:23 <ski> % deriving instance Show (MyData t)
2020-11-26 22:20:23 <yahb> ski:
2020-11-26 22:20:42 <hpc> oh right, that's a thing
2020-11-26 22:20:53 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)

All times are in UTC.