Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-23 14:59:07 <dmj`> kuribas: is there an FRP library that doesn't?
2021-04-23 14:59:20 howdoi joins (uid224@gateway/web/irccloud.com/x-vstezmgnvunlkcvf)
2021-04-23 14:59:21 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-23 14:59:25 <kuribas> dmj`: I mean that I can do database lookups.
2021-04-23 15:00:09 <dmj`> kuribas: that would be IO, so same question holds
2021-04-23 15:00:11 idhugo joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-23 15:00:28 <kuribas> they do, but it doesn't seem easy to model a database lookup into it.
2021-04-23 15:00:30 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-23 15:00:44 <dmj`> kuribas: why not
2021-04-23 15:00:52 idhugo_ joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-23 15:01:52 <kuribas> dmj`: what would you use for reactive-banana?
2021-04-23 15:01:55 nan` joins (~nan`@unaffiliated/nan/x-5405850)
2021-04-23 15:01:59 × idhugo_ quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-23 15:02:06 anandprabhu joins (~anand@94.203.71.143)
2021-04-23 15:02:39 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-23 15:02:52 boogsbunny joins (c09174ec@192.145.116.236)
2021-04-23 15:03:05 idhugo joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-23 15:03:16 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-23 15:03:45 idhugo joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-23 15:03:57 idhugo_ joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-23 15:04:20 stree joins (~stree@68.36.8.116)
2021-04-23 15:05:06 × idhugo_ quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Client Quit)
2021-04-23 15:05:46 × invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 240 seconds)
2021-04-23 15:05:56 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-23 15:07:28 lordcirth__ joins (~lordcirth@2607:f2c0:95b3:4400:11af:5eb6:2b18:3df9)
2021-04-23 15:07:48 <kuribas> dmj`: none of the functions seems useful for taking an event data, looking stuff up in the database, and generating a new even.
2021-04-23 15:08:18 <kritzefitz> kuribas, sound like you want Reactive.Banana.Frameworks.execute.
2021-04-23 15:09:19 × geekosaur quits (930099da@rrcs-147-0-153-218.central.biz.rr.com) (Quit: Connection closed)
2021-04-23 15:09:21 <merijn> kuribas: eh: https://hackage.haskell.org/package/reactive-banana-1.2.1.0/docs/Reactive-Banana-Frameworks.html#v:mapEventIO
2021-04-23 15:09:30 <merijn> mapEventIO :: (a -> IO b) -> Event a -> MomentIO (Event b)
2021-04-23 15:09:39 <merijn> That seems exactly what you're asking for?
2021-04-23 15:09:56 <kuribas> merijn: ah cool, yes!
2021-04-23 15:10:03 × lordcirth_ quits (~lordcirth@2607:f2c0:95b3:4400:11af:5eb6:2b18:3df9) (Ping timeout: 250 seconds)
2021-04-23 15:10:16 × anandprabhu quits (~anand@94.203.71.143) (Quit: Konversation terminated!)
2021-04-23 15:11:19 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
2021-04-23 15:11:38 Kaiepi joins (~Kaiepi@47.54.252.148)
2021-04-23 15:12:02 × boogsbunny quits (c09174ec@192.145.116.236) (Ping timeout: 240 seconds)
2021-04-23 15:14:19 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Quit: Lost terminal)
2021-04-23 15:15:29 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-04-23 15:15:50 × seven_three quits (~user@pool-96-233-64-53.bstnma.fios.verizon.net) (Remote host closed the connection)
2021-04-23 15:18:40 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Client Quit)
2021-04-23 15:19:08 dastomaten joins (~dastomate@0543f40b.skybroadband.com)
2021-04-23 15:19:08 Kaeipi joins (~Kaiepi@47.54.252.148)
2021-04-23 15:19:09 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
2021-04-23 15:19:09 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-04-23 15:19:09 ph88 joins (~ph88@2a02:8109:9e00:7e5c:d5ef:86b3:afc4:9258)
2021-04-23 15:19:32 seven_three joins (~user@pool-96-233-64-53.bstnma.fios.verizon.net)
2021-04-23 15:19:51 waleee-cl joins (uid373333@gateway/web/irccloud.com/x-aqzweplpcsywgnal)
2021-04-23 15:19:54 <seven_three> Is it possible to mix typeclass constraints into data declarations? I want to say something like `data Foo = (Num a) => Bar a | Integer`. If not how would you express this?
2021-04-23 15:20:25 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-23 15:20:35 vicfred joins (~vicfred@unaffiliated/vicfred)
2021-04-23 15:20:40 <kuribas> seven_three: with GADT syntax, but normally you don't want this.
2021-04-23 15:20:52 geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com)
2021-04-23 15:20:54 <kuribas> seven_three: just put the contraints on the functions.
2021-04-23 15:21:12 <dmj`> seven_three: that's what ExistentialQuantification is for
2021-04-23 15:21:24 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Remote host closed the connection)
2021-04-23 15:21:40 <kuribas> seven_three: is that "a" missing deliberately?
2021-04-23 15:21:59 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
2021-04-23 15:22:02 <seven_three> yes the a is missing deliberately
2021-04-23 15:22:04 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-04-23 15:22:09 <kuribas> that doesn't look very useful
2021-04-23 15:22:21 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-23 15:22:23 <dmj`> seven_three: don't do it though, hiding type variables in data types raises lots of other problems
2021-04-23 15:23:20 <dmj`> kuribas: the canonical usage is like polymorphic lists data PolyShowList = (Show a) => PolyShowList [a], but its not worth it.
2021-04-23 15:23:28 <seven_three> ok I will read about GADT's and ExistentialQuantification and then make a decision after
2021-04-23 15:23:33 <kuribas> seven_three: Bar will be completely useless, as you cannot access "a".
2021-04-23 15:23:48 <kuribas> dmj`: that's also a antipattern most of the cases.
2021-04-23 15:24:10 <kuribas> dmj`: since that is isomorphic to [String]
2021-04-23 15:24:51 <seven_three> kuribas: How would Bar be useless? `f :: Num a => Foo -> a; f (Bar num) = num + 1`
2021-04-23 15:25:01 <merijn> seven_three: Nope
2021-04-23 15:25:08 <merijn> seven_three: Can't do that with existentials
2021-04-23 15:25:11 <kuribas> seven_three: that will not work
2021-04-23 15:25:25 × ep1ctetus quits (~epictetus@ip72-194-54-201.sb.sd.cox.net) (Ping timeout: 252 seconds)
2021-04-23 15:25:29 <merijn> seven_three: That code means Bar has *an* instance of Num, but you don't know which
2021-04-23 15:26:02 <merijn> seven_three: So you example claims to be able to convert any (unknown) instance of Num into any other Num instance
2021-04-23 15:26:08 <merijn> seven_three: That's clearly not possible
2021-04-23 15:27:05 <seven_three> ok my whole plan isn't going to work then
2021-04-23 15:29:55 <merijn> seven_three: What do you want to do?
2021-04-23 15:31:56 lordcirth_ joins (~lordcirth@2607:f2c0:95b3:4400:11af:5eb6:2b18:3df9)
2021-04-23 15:32:14 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2021-04-23 15:32:18 × dpl quits (~dpl@77-121-78-163.chn.volia.net) (Remote host closed the connection)
2021-04-23 15:32:43 dpl joins (~dpl@77-121-78-163.chn.volia.net)
2021-04-23 15:33:26 knupfer joins (~Thunderbi@200116b82bdec0008957f7f04f607311.dip.versatel-1u1.de)
2021-04-23 15:33:27 × xff0x quits (~xff0x@2001:1a81:52f5:ac00:e7f3:bc3c:e7b8:4be7) (Ping timeout: 250 seconds)
2021-04-23 15:34:29 Carl6 joins (6bc3aca7@107-195-172-167.lightspeed.oshkwi.sbcglobal.net)
2021-04-23 15:34:49 × lordcirth__ quits (~lordcirth@2607:f2c0:95b3:4400:11af:5eb6:2b18:3df9) (Ping timeout: 276 seconds)
2021-04-23 15:35:17 xff0x joins (xff0x@gateway/vpn/mullvad/xff0x)
2021-04-23 15:35:42 <seven_three> merijn: I have multiple types that are instances of my typeclass and I am trying to unify them into another type. Here is some relevant code: http://dpaste.com/A3KYVGP3G
2021-04-23 15:36:29 <dexterfoo> I have an IORef (Maybe Foo) that starts out filled with 'Nothing', but then when it goes to (Just x) I know that it will always be (Just something) and never go back to Nothing. How can I encode this in the type system, so that when functions read from the variable IORef in later stages, they know that it will always have a (Just foo) value?
2021-04-23 15:36:40 × mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Read error: Connection reset by peer)
2021-04-23 15:37:10 × codygman` quits (~user@209.251.131.98) (Remote host closed the connection)
2021-04-23 15:37:58 <seven_three> I should probably just do: `data Operand = | IntRegOp IntegerRegister | FloatRegOp FloatingRegister | BlahBlah`
2021-04-23 15:38:39 <merijn> dexterfoo: eh, are you sure you don't want an MVar?
2021-04-23 15:40:28 × redmp quits (~redmp@172.58.22.142) (Ping timeout: 252 seconds)
2021-04-23 15:41:19 × Synthetica quits (uid199651@gateway/web/irccloud.com/x-hcuaynfkuabsmonx) (Quit: Connection closed for inactivity)
2021-04-23 15:41:30 mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh)
2021-04-23 15:43:03 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
2021-04-23 15:43:53 Kaeipi joins (~Kaiepi@47.54.252.148)
2021-04-23 15:44:28 <carbolymer> holy shit profiler is slowing down the code seriously; I'm profiling the code which was finishing in 1hr - with profiling enabled now it's running for 5hrs and it's still a lot left to go
2021-04-23 15:45:21 <dexterfoo> merijn: I'm actually using a TVar

All times are in UTC.