Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-05-14 14:34:48 HannaM joins (~quassel@p54849510.dip0.t-ipconnect.de)
2021-05-14 14:34:50 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-14 14:36:01 <absence> if i have data Contrived = Yes | No, is it somehow possible to use the monoid instance for All with it (DerivingVia?), or would it have to be a newtype wrapper around Bool?
2021-05-14 14:38:28 lightwave joins (~user@bras-vprn-nwmkon8540w-lp130-19-184-147-249-198.dsl.bell.ca)
2021-05-14 14:39:05 mateusz joins (~mateusz@77-254-3-194.adsl.inetia.pl)
2021-05-14 14:39:06 <lightwave> Hello newbie here! How are you fine folks doing?
2021-05-14 14:39:11 jakalx joins (~jakalx@base.jakalx.net)
2021-05-14 14:39:24 <mateusz> fine, how are you?
2021-05-14 14:39:50 <mniip> absence, All is a newtype wrapper around Bool. You would have to somehow explain which value you want to be the empty one
2021-05-14 14:39:55 <lightwave> Doing fine. Enjoying learning Haskell so far
2021-05-14 14:40:00 gemmaro joins (~Thunderbi@240f:74:d1f0:1:1bf:3730:3a54:b192)
2021-05-14 14:40:07 <mniip> what you can do is derive Ord and then derive monoid via Max or Min
2021-05-14 14:40:27 <mniip> deriving stock Ord will make Yes < No
2021-05-14 14:40:55 <mniip> deriving newtype Monoid via (Min Contrived) will make Yes <> x = Yes
2021-05-14 14:41:50 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-05-14 14:41:52 <mateusz> Is parametric polimorphism the only way to support multiple types inside single entry record?
2021-05-14 14:43:15 <mniip> type families? on top of parameteric polymorphism still
2021-05-14 14:43:15 <Uniaika> mateusz: I'm not sure I fully understand what you mean. Could you post some example code of what you're doing?
2021-05-14 14:43:34 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-05-14 14:44:21 × hendursaga quits (~weechat@gateway/tor-sasl/hendursaga) (Quit: hendursaga)
2021-05-14 14:44:26 <lightwave> I'm playing with Haskell using GHC installed from GHCup, but I'm not able to import System.Random. Is it a module I have to install separately?
2021-05-14 14:44:33 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-05-14 14:44:54 <geekosaur> yes, from the package "random"
2021-05-14 14:45:12 hendursaga joins (~weechat@gateway/tor-sasl/hendursaga)
2021-05-14 14:45:14 <lightwave> Ah... how do I install package?
2021-05-14 14:45:23 <geekosaur> using cabal
2021-05-14 14:45:53 ddellac__ joins (~ddellacos@86.106.143.20)
2021-05-14 14:46:25 chris___ joins (~chris@81.96.113.213)
2021-05-14 14:46:30 <mateusz> Uniaika, https://pastebin.com/45csJ7L0
2021-05-14 14:46:59 howdoi joins (uid224@gateway/web/irccloud.com/x-czjyemaoaqihlnkl)
2021-05-14 14:47:00 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-14 14:47:43 <boxscape> data Vehicle = Car | Bike | Horse; data CustomType = { field :: String, polymorphicField :: Vehicle }
2021-05-14 14:47:49 <mateusz> but quick look on type families seems like this is the answer
2021-05-14 14:48:05 <lightwave> Is there a concept of global package in haskell/cabal so that I don't have to create a cabal project before I install the random package?
2021-05-14 14:48:41 <mateusz> oh, Car, Bike and Horse are types itselfes like: data Car = Bmw | Fiat;
2021-05-14 14:49:02 <boxscape> data Vehicle = VCar Car | VBike Bike | VHorse Horse
2021-05-14 14:49:06 <boxscape> not pretty but a common pattern
2021-05-14 14:49:41 dyeplexer joins (~terpin@unaffiliated/terpin)
2021-05-14 14:50:42 × geekosaur quits (930099da@rrcs-147-0-153-218.central.biz.rr.com) (Ping timeout: 240 seconds)
2021-05-14 14:50:50 kayvan joins (~user@52-119-115-185.PUBLIC.monkeybrains.net)
2021-05-14 14:51:15 <mateusz> thanks boxscape
2021-05-14 14:51:41 × s00pcan quits (~chris@075-133-056-178.res.spectrum.com) (Remote host closed the connection)
2021-05-14 14:52:04 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-05-14 14:52:35 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-14 14:52:52 × seliopou quits (seliopou@entropy.tmok.com) (Ping timeout: 252 seconds)
2021-05-14 14:53:45 × acidjnk_new quits (~acidjnk@p200300d0c72b9585d94a8a519d1af897.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2021-05-14 14:53:51 <yushyin> lightwave: https://cabal.readthedocs.io/en/3.4/cabal-commands.html?highlight=package-env#cabal-v2-install if not stated otherwise it uses a global default
2021-05-14 14:55:23 <yushyin> lightwave: note: on recent versions of cabal 'v2-install' is the same command as 'install'
2021-05-14 14:56:46 <lightwave> Thanks yushyin
2021-05-14 14:57:08 s00pcan joins (~chris@075-133-056-178.res.spectrum.com)
2021-05-14 14:59:41 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-05-14 15:02:28 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-05-14 15:04:11 geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com)
2021-05-14 15:04:16 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-05-14 15:05:21 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-14 15:05:36 × s00pcan quits (~chris@075-133-056-178.res.spectrum.com) (Remote host closed the connection)
2021-05-14 15:05:51 <absence> mniip: interesting! thanks
2021-05-14 15:06:39 × juliagoda quits (~juliagoda@2a02:a31a:e13a:eb00:758f:d455:b475:46e4) (Quit: Leaving)
2021-05-14 15:08:04 × viluon quits (uid453725@gateway/web/irccloud.com/x-sfbwpdsukvhsninn) (Quit: Connection closed for inactivity)
2021-05-14 15:08:46 × xwvvvvwx quits (xwvvvvwx@gateway/vpn/mullvad/xwvvvvwx) (Ping timeout: 260 seconds)
2021-05-14 15:09:19 xwvvvvwx joins (xwvvvvwx@gateway/vpn/mullvad/xwvvvvwx)
2021-05-14 15:10:32 Guest25767 is now known as shapr
2021-05-14 15:10:46 × shapr quits (~shapr@162.243.9.169) (Changing host)
2021-05-14 15:10:46 shapr joins (~shapr@haskell/developer/shapr)
2021-05-14 15:13:09 × kayvan quits (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection)
2021-05-14 15:15:14 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-05-14 15:16:10 guest5 joins (5619784f@cpc143846-cosh20-2-0-cust78.6-1.cable.virginm.net)
2021-05-14 15:17:26 × jao quits (~jao@pdpc/supporter/professional/jao) (Ping timeout: 252 seconds)
2021-05-14 15:17:36 <guest5> hey guys im trying to get this function to work - https://paste.tomsmeding.com/g53ImtTT
2021-05-14 15:17:54 × lightwave quits (~user@bras-vprn-nwmkon8540w-lp130-19-184-147-249-198.dsl.bell.ca) (Ping timeout: 245 seconds)
2021-05-14 15:18:04 <guest5> which would call 'findCityandIndex' using a command like
2021-05-14 15:18:16 seliopou joins (seliopou@entropy.tmok.com)
2021-05-14 15:18:41 <guest5> 'demo 2 = putStrLn(findCityAndIndex (City "Madrid" 2 testData))'
2021-05-14 15:18:53 × gemmaro quits (~Thunderbi@240f:74:d1f0:1:1bf:3730:3a54:b192) (Ping timeout: 250 seconds)
2021-05-14 15:19:39 <guest5> at the moment im getting the error - https://paste.tomsmeding.com/CAIsMEEv
2021-05-14 15:20:11 <c_wraith> well... you've said that findCityAndIndex takes a String and an Int, not a City
2021-05-14 15:20:16 <c_wraith> But you're passing a City to it
2021-05-14 15:20:40 × kingswim quits (~kevinying@197.210.47.0) (Read error: Connection reset by peer)
2021-05-14 15:20:42 <boxscape> guest5 the reason you're getting that error is because `((City n ) -> n == name)` should be `(\(City n) -> n == name)`
2021-05-14 15:22:03 kingswim joins (~kevinying@197.210.47.0)
2021-05-14 15:22:48 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
2021-05-14 15:24:01 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-14 15:24:04 geowiesnot joins (~user@87-89-181-157.abo.bbox.fr)
2021-05-14 15:25:07 isovector joins (~isovector@172.103.216.166.cable.tpia.cipherkey.com)
2021-05-14 15:25:23 deviantfero joins (~deviantfe@190.150.27.58)
2021-05-14 15:26:22 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Quit: WeeChat 3.0.1)
2021-05-14 15:26:30 proofofkeags joins (~proofofke@205.209.28.54)
2021-05-14 15:27:02 × mateusz quits (~mateusz@77-254-3-194.adsl.inetia.pl) (Remote host closed the connection)
2021-05-14 15:29:38 <guest5> I think im getting somewhere
2021-05-14 15:30:53 <guest5> this is the error im getting now I've updated the code
2021-05-14 15:31:44 <guest5> https://paste.tomsmeding.com/TNTvC5Pj - I think its to do with how im passing "Madrid" and 2 and testData to it
2021-05-14 15:31:55 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
2021-05-14 15:32:18 Tario joins (~Tario@201.192.165.173)
2021-05-14 15:32:34 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
2021-05-14 15:32:42 <boxscape> guest5: you don't need the parentheses to parse multiple arguments, try findCityAndIndex "Madrid" 2 testData
2021-05-14 15:33:41 × kingswim quits (~kevinying@197.210.47.0) (Ping timeout: 240 seconds)
2021-05-14 15:33:53 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-05-14 15:34:07 kingswim joins (~kevinying@197.210.47.0)
2021-05-14 15:34:09 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 245 seconds)
2021-05-14 15:34:40 <boxscape> s/parse/pass

All times are in UTC.