Logs: freenode/#haskell
| 2020-11-20 05:58:03 | → | sord937 joins (~sord937@gateway/tor-sasl/sord937) |
| 2020-11-20 06:03:10 | → | SanchayanMaity joins (~Sanchayan@223.226.123.235) |
| 2020-11-20 06:04:25 | × | luigy quits (~luigy@104.236.106.229) (Ping timeout: 240 seconds) |
| 2020-11-20 06:05:25 | × | lukelau quits (~lukelau@46.101.13.214) (Quit: Bye) |
| 2020-11-20 06:05:41 | → | lukelau joins (~lukelau@46.101.13.214) |
| 2020-11-20 06:05:59 | Amras | is now known as Sarma |
| 2020-11-20 06:07:40 | <dsal> | hooper: what is the type of the area function? |
| 2020-11-20 06:09:12 | → | luigy joins (~luigy@104.236.106.229) |
| 2020-11-20 06:14:36 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-104-55.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2020-11-20 06:21:25 | × | sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 240 seconds) |
| 2020-11-20 06:22:37 | <koz_> | If you need a _closed_ set of shapes, your best bet as per glguy would be something like 'data Shape = Triangle Double Double Double | Square Double', then defining 'area :: Shape -> Double' and case-matching. |
| 2020-11-20 06:23:07 | × | aarvar quits (~foewfoiew@50.35.43.33) (Ping timeout: 246 seconds) |
| 2020-11-20 06:26:14 | <koz_> | If you need things that work for only one shape variety, you can either return Maybes, or you can do something like 'data Triangle = Triangle Double Double Double', 'data Square = Square Double', 'data Shape = ATriangle Triangle | ASquare Square', so then you can write functions that work only on triangles, only on squares, or on both. |
| 2020-11-20 06:27:53 | × | ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds) |
| 2020-11-20 06:29:17 | → | bitmagie joins (~Thunderbi@200116b8063a3200b470a8e4f2a94e1e.dip.versatel-1u1.de) |
| 2020-11-20 06:30:01 | → | wei2912 joins (~wei2912@unaffiliated/wei2912) |
| 2020-11-20 06:30:27 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Remote host closed the connection) |
| 2020-11-20 06:30:53 | → | alx741 joins (~alx741@181.196.68.156) |
| 2020-11-20 06:31:00 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-11-20 06:31:44 | × | hooper quits (2fe3e53b@047-227-229-059.res.spectrum.com) (Ping timeout: 245 seconds) |
| 2020-11-20 06:32:08 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2020-11-20 06:33:55 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Client Quit) |
| 2020-11-20 06:34:14 | → | Fractalis joins (~Fractalis@2601:987:280:8d40:9de1:6445:b757:a1c4) |
| 2020-11-20 06:34:35 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-11-20 06:34:51 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Client Quit) |
| 2020-11-20 06:35:13 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-11-20 06:36:09 | → | avoandmayo joins (~textual@122-58-109-105-adsl.sparkbb.co.nz) |
| 2020-11-20 06:36:48 | → | BarleyMo joins (2a02d45a@42-2-212-090.static.netvigator.com) |
| 2020-11-20 06:38:16 | → | alp joins (~alp@2a01:e0a:58b:4920:954a:8bbd:83ff:d679) |
| 2020-11-20 06:47:18 | × | nados quits (~dan@69-165-210-185.cable.teksavvy.com) (Quit: Leaving) |
| 2020-11-20 06:47:30 | → | mi23523523 joins (~Aman33333@85.253.192.47.cable.starman.ee) |
| 2020-11-20 06:47:49 | mi23523523 | is now known as Kr23523523 |
| 2020-11-20 06:49:38 | × | da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:6c06:f0fd:283a:1f37:de16) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-20 06:50:11 | × | DJWillis quits (~DJWillis@217.146.82.202) (Remote host closed the connection) |
| 2020-11-20 06:53:01 | × | Kr23523523 quits (~Aman33333@85.253.192.47.cable.starman.ee) (Quit: Leaving) |
| 2020-11-20 06:54:23 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:7958:7d8e:4908:c843) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-20 06:55:54 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-11-20 06:59:35 | × | quarters quits (~quarters@38-73-246-124.starry-inc.net) (Ping timeout: 256 seconds) |
| 2020-11-20 07:01:25 | × | bliminse quits (~bliminse@host109-156-197-211.range109-156.btcentralplus.com) (Ping timeout: 264 seconds) |
| 2020-11-20 07:01:32 | → | quarters joins (~quarters@38-73-246-124.starry-inc.net) |
| 2020-11-20 07:01:50 | → | bliminse joins (~bliminse@host109-156-197-211.range109-156.btcentralplus.com) |
| 2020-11-20 07:02:07 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-20 07:03:31 | × | electricityZZZZ quits (~electrici@108-216-157-17.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-11-20 07:04:26 | × | roconnor quits (~roconnor@host-104-157-230-3.dyn.295.ca) (Remote host closed the connection) |
| 2020-11-20 07:04:51 | → | roconnor joins (~roconnor@host-104-157-230-3.dyn.295.ca) |
| 2020-11-20 07:05:45 | × | quarters quits (~quarters@38-73-246-124.starry-inc.net) (Ping timeout: 240 seconds) |
| 2020-11-20 07:06:56 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-20 07:09:30 | → | daim2k5 joins (~daim2k5@185.204.1.185) |
| 2020-11-20 07:09:53 | × | oish quits (~charlie@228.25.169.217.in-addr.arpa) (Ping timeout: 260 seconds) |
| 2020-11-20 07:10:34 | → | coot joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl) |
| 2020-11-20 07:18:20 | <idnar> | so I ran `cabal build` in my project and now if I run `cabal install` it wants to rebuild everything; how do I see why? |
| 2020-11-20 07:18:21 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-11-20 07:18:55 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2020-11-20 07:22:53 | → | mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com) |
| 2020-11-20 07:24:18 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:6c06:f0fd:283a:1f37:de16) |
| 2020-11-20 07:25:05 | <glguy> | Install bundles up the source and does a build and install fresh from that sdist |
| 2020-11-20 07:25:38 | <glguy> | It won't rebuild libraries installed from hackage though |
| 2020-11-20 07:28:11 | → | vicfred_ joins (~vicfred@unaffiliated/vicfred) |
| 2020-11-20 07:28:26 | × | Kaeipi quits (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) (Read error: Connection reset by peer) |
| 2020-11-20 07:29:56 | → | Kaeipi joins (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 2020-11-20 07:30:01 | → | danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) |
| 2020-11-20 07:30:25 | × | alp quits (~alp@2a01:e0a:58b:4920:954a:8bbd:83ff:d679) (Ping timeout: 272 seconds) |
| 2020-11-20 07:31:04 | × | vicfred quits (~vicfred@unaffiliated/vicfred) (Ping timeout: 265 seconds) |
| 2020-11-20 07:32:15 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Remote host closed the connection) |
| 2020-11-20 07:32:34 | → | dhouthoo joins (~dhouthoo@ptr-eiv6509pb4ifhdr9lsd.18120a2.ip6.access.telenet.be) |
| 2020-11-20 07:32:38 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-11-20 07:34:19 | → | plutoniix joins (~q@ppp-223-24-158-101.revip6.asianet.co.th) |
| 2020-11-20 07:34:38 | × | bitmagie quits (~Thunderbi@200116b8063a3200b470a8e4f2a94e1e.dip.versatel-1u1.de) (Quit: bitmagie) |
| 2020-11-20 07:34:50 | × | borne quits (~fritjof@200116b86455d000feb15fd2865dc87d.dip.versatel-1u1.de) (Ping timeout: 264 seconds) |
| 2020-11-20 07:35:28 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-20 07:38:56 | × | jespada quits (~jespada@90.254.245.49) (Ping timeout: 240 seconds) |
| 2020-11-20 07:40:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-20 07:40:31 | → | falafel_ joins (~falafel@2601:547:1303:b30:7811:313f:d0f3:f9f4) |
| 2020-11-20 07:41:10 | × | Sgeo_ quits (~Sgeo@ool-18b982ad.dyn.optonline.net) (Read error: Connection reset by peer) |
| 2020-11-20 07:41:46 | → | jespada joins (~jespada@90.254.245.49) |
| 2020-11-20 07:42:51 | <Martinsos> | glguy, hooper: While I would also probably go with the approach you described, what is argument against not going with the typeclass approach? I was doing something similar recently and I had really hard time making this decision, it was mostly about trying to guess how I might extend this code later. With data types, adding a new function should be simple, but that function needs to know internals of all the shapes and has to be |
| 2020-11-20 07:42:51 | <Martinsos> | obviously in a separate module, so there is no encapsualtion there. Also, if I add a new shape, I have to modify all of these functions. With type class, I can have the `area` logic encapsualted together with the each shape, which sounds cool. If I add new shape, I don't need to modify any of the previous shapes or their logic. However if I add new method, I have to modify all of their type classes. Which actually sounds not so bad to |
| 2020-11-20 07:42:51 | <Martinsos> | me. Ok, one thing I can't do it put all these shapes in an array together, since they are different types, but I could create another data type that is just a box for them `data Shape = ShapeSquare Square | ShapeTriangle Triangle` and then make it also an instance of `IsShape` type class and I solved that problem. |
| 2020-11-20 07:44:18 | → | vilpan joins (~0@212.117.1.172) |
| 2020-11-20 07:45:05 | <Martinsos> | If I am correct this is officially called "expression problem"? |
| 2020-11-20 07:45:59 | <Martinsos> | I saw some solutions in Haskell for making it extendable in both types and functions direction, but all of them were pretty complicated and it seemed to me they were not really needed in pratice often. I would rather just go with simple, pragmatic solution that does not use complicated Haskell features, at least for the moment. |
| 2020-11-20 07:46:16 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 2020-11-20 07:47:05 | <dminuoso> | Martinsos: There's roughly two opposing properties of a language. Adding new operations and adding new data. |
| 2020-11-20 07:48:28 | <dminuoso> | In Haskell it is easy to add new operations/functions for a data type, but like you put it, adding more constructors (that is extending the data type) is hard. |
| 2020-11-20 07:51:54 | <idnar> | glguy: well, I'm seeing all the deps "needs build"; but if I rerun `cabal build` it doesn't build anything |
| 2020-11-20 07:52:57 | <idnar> | glguy: my guess is some flag like --enable-tests is changing |
| 2020-11-20 07:54:04 | <idnar> | err, "requires build" |
| 2020-11-20 07:56:16 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2020-11-20 07:56:43 | → | raichoo joins (~raichoo@213.240.178.58) |
| 2020-11-20 07:59:35 | → | invaser joins (~Thunderbi@31.148.23.125) |
| 2020-11-20 08:04:32 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2020-11-20 08:08:17 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds) |
| 2020-11-20 08:09:18 | → | cloudster joins (~cloudster@124.123.105.47) |
| 2020-11-20 08:09:24 | × | hyiltiz quits (~quassel@unaffiliated/hyiltiz) (Quit: hyiltiz) |
| 2020-11-20 08:09:26 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 2020-11-20 08:09:58 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-20 08:10:02 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-20 08:11:32 | × | hexfive quits (~hexfive@50-47-142-195.evrt.wa.frontiernet.net) (Quit: i must go. my people need me.) |
| 2020-11-20 08:11:53 | × | cloudster quits (~cloudster@124.123.105.47) (Remote host closed the connection) |
| 2020-11-20 08:12:17 | → | chele joins (~chele@ip5b416ea2.dynamic.kabel-deutschland.de) |
All times are in UTC.