Logs: freenode/#haskell
| 2020-11-16 21:13:37 | × | benwr____ quits (sid372383@gateway/web/irccloud.com/x-ygzdfppyyhwzwtmh) (Read error: Connection reset by peer) |
| 2020-11-16 21:13:37 | × | d0liver quits (sid363046@gateway/web/irccloud.com/x-kkcazzfyjgmdigdk) (Read error: Connection reset by peer) |
| 2020-11-16 21:13:38 | → | bradparker joins (sid262931@gateway/web/irccloud.com/x-nbpjheuowgmlbzcp) |
| 2020-11-16 21:13:41 | × | banjiewen_ quits (sid115913@gateway/web/irccloud.com/x-pwjllhheogrzlube) (Read error: Connection reset by peer) |
| 2020-11-16 21:13:44 | → | benwr____ joins (sid372383@gateway/web/irccloud.com/x-wqbchwbubajgshwl) |
| 2020-11-16 21:13:45 | → | ryjm joins (sid383513@gateway/web/irccloud.com/x-xyruibfadgkaupwy) |
| 2020-11-16 21:13:50 | → | Cir0X joins (sid221743@gateway/web/irccloud.com/x-mvlinpkrmvmsfsvf) |
| 2020-11-16 21:13:56 | → | d0liver joins (sid363046@gateway/web/irccloud.com/x-lvzpszsyngerfkjs) |
| 2020-11-16 21:13:58 | → | banjiewen_ joins (sid115913@gateway/web/irccloud.com/x-jwitackpjevkejhs) |
| 2020-11-16 21:14:09 | → | ReinH__ joins (sid179972@gateway/web/irccloud.com/x-ujhxicmjajcluchu) |
| 2020-11-16 21:15:24 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2020-11-16 21:15:50 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2020-11-16 21:17:13 | <int-e> | :t (>>= modify) . traverse lift -- ah, that's it. |
| 2020-11-16 21:17:14 | <lambdabot> | (MonadState s (t m), Traversable ((->) s), MonadTrans t, Monad m) => (s -> m s) -> t m () |
| 2020-11-16 21:17:29 | <quarters> | I was wondering if anyone can recommend any site that help a noob like myself build out a minimal web app like on http://todomvc.com/ |
| 2020-11-16 21:17:36 | × | ystael quits (~ystael@160.sub-174-242-87.myvzw.com) (Read error: Connection reset by peer) |
| 2020-11-16 21:17:40 | × | conal quits (~conal@66.115.176.210) (Quit: Computer has gone to sleep.) |
| 2020-11-16 21:17:42 | × | cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: cosimone) |
| 2020-11-16 21:17:52 | <koz_> | int-e: The 'Traversable ((->) s)' constraint is a bit onerous, surely? |
| 2020-11-16 21:18:14 | <int-e> | indeed |
| 2020-11-16 21:18:28 | <int-e> | never mind then, I give up. |
| 2020-11-16 21:18:38 | <koz_> | The others were good, though. |
| 2020-11-16 21:18:50 | → | Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) |
| 2020-11-16 21:18:51 | <koz_> | I mean, if you wanna APL it, you can probably run attempt #2 through @pl. |
| 2020-11-16 21:18:54 | × | Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Remote host closed the connection) |
| 2020-11-16 21:19:01 | <koz_> | @pl \f -> traverse lift (Identity f) >>= put . runIdentity |
| 2020-11-16 21:19:01 | <lambdabot> | (put . runIdentity =<<) . traverse lift . Identity |
| 2020-11-16 21:19:06 | <quarters> | a haskell noob, rather. I noticed that there isn't a haskell version on that site and while I can try for something similar like the scala one, I figured that wouldn't give me the exposure to the tooling used for building out a haskell backed todo list web app |
| 2020-11-16 21:19:16 | → | cosimone joins (~cosimone@93-47-228-249.ip115.fastwebnet.it) |
| 2020-11-16 21:19:26 | <int-e> | koz_: #2 didn't quite have the right type |
| 2020-11-16 21:19:43 | <koz_> | int-e: Ah, yeah, upon further reading I can see why. |
| 2020-11-16 21:20:02 | → | Boomerang joins (~Boomerang@xd520f68c.cust.hiper.dk) |
| 2020-11-16 21:20:13 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds) |
| 2020-11-16 21:20:40 | <int-e> | :t \f -> get >>= \s -> traverse lift (Identity (f s)) >>= put . runIdentity -- and this is beginning to look awfully clumsy |
| 2020-11-16 21:20:41 | <lambdabot> | (MonadState s (t m), Monad m, MonadTrans t) => (s -> m s) -> t m () |
| 2020-11-16 21:21:01 | <int-e> | @pl \f -> get >>= \s -> traverse lift (Identity (f s)) >>= put . runIdentity |
| 2020-11-16 21:21:01 | <lambdabot> | (get >>=) . flip flip (put . runIdentity) . (((>>=) . traverse lift . Identity) .) |
| 2020-11-16 21:21:09 | <int-e> | eww. |
| 2020-11-16 21:21:20 | <koz_> | Dat flip . flip. |
| 2020-11-16 21:21:26 | <koz_> | I mean, 'flip flip'. |
| 2020-11-16 21:21:39 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2020-11-16 21:21:58 | × | machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Client Quit) |
| 2020-11-16 21:22:31 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2020-11-16 21:22:45 | <Flonk> | Say I have a simple BST (https://hastebin.com/bexopesayo.hs) with an insert function. If the element is already in the tree I'd like to save space and return the original tree - at the moment I'm creating a lot of duplicate nodes which is unneccessary. What programming pattern am I looking for? |
| 2020-11-16 21:23:08 | <int-e> | :t \f -> get >>= \s -> lift (f s) >>= put -- yeah the whole traverse idea is just stupid, I guess |
| 2020-11-16 21:23:10 | <lambdabot> | (MonadState s (t m), Monad m, MonadTrans t) => (s -> m s) -> t m () |
| 2020-11-16 21:23:16 | <Flonk> | Feels similar to exceptions in imperative languages. |
| 2020-11-16 21:24:13 | <int-e> | @pl \f -> get >>= \s -> lift (f s) >>= put |
| 2020-11-16 21:24:13 | <lambdabot> | (get >>=) . flip flip put . (((>>=) . lift) .) |
| 2020-11-16 21:24:21 | <int-e> | still double-flipping |
| 2020-11-16 21:24:40 | <int-e> | flipping out, with a typo? |
| 2020-11-16 21:25:00 | <koz_> | int-e: flipTable = flip flip |
| 2020-11-16 21:25:17 | <koz_> | :t flip flip |
| 2020-11-16 21:25:18 | <lambdabot> | b -> (a -> b -> c) -> a -> c |
| 2020-11-16 21:25:31 | <koz_> | Feels like there should be a bird for this. |
| 2020-11-16 21:26:01 | <int-e> | hmm, flipping the bird? |
| 2020-11-16 21:26:06 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 260 seconds) |
| 2020-11-16 21:26:14 | → | Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) |
| 2020-11-16 21:26:34 | <koz_> | The all-new Yelling Bird combinator. |
| 2020-11-16 21:27:34 | <int-e> | koz_: I'm still wondering whether there's something more natural for this. Or perhaps some obscure lens approach... |
| 2020-11-16 21:28:00 | → | ystael joins (~ystael@160.sub-174-242-87.myvzw.com) |
| 2020-11-16 21:28:23 | → | conal joins (~conal@66.115.176.210) |
| 2020-11-16 21:28:50 | → | moet joins (~moet@mobile-166-137-178-187.mycingular.net) |
| 2020-11-16 21:28:56 | → | mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) |
| 2020-11-16 21:29:43 | × | Boomerang quits (~Boomerang@xd520f68c.cust.hiper.dk) (Quit: Leaving) |
| 2020-11-16 21:29:59 | × | ystael quits (~ystael@160.sub-174-242-87.myvzw.com) (Read error: Connection reset by peer) |
| 2020-11-16 21:30:07 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2020-11-16 21:30:16 | → | Boomerang joins (~Boomerang@xd520f68c.cust.hiper.dk) |
| 2020-11-16 21:32:37 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-11-16 21:32:39 | → | vicfred joins (~vicfred@unaffiliated/vicfred) |
| 2020-11-16 21:34:51 | × | chaosmasttter quits (~chaosmast@p200300c4a73c52016862557d78ae998a.dip0.t-ipconnect.de) (Quit: WeeChat 2.9) |
| 2020-11-16 21:35:06 | ← | wtw parts (~wtw@unaffiliated/wtw) () |
| 2020-11-16 21:37:59 | × | Inoperable quits (~PLAYER_1@fancydata.science) (Excess Flood) |
| 2020-11-16 21:38:14 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-11-16 21:39:02 | → | machined1od joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2020-11-16 21:39:07 | × | Ariakenom quits (~Ariakenom@h-82-196-111-82.NA.cust.bahnhof.se) (Read error: Connection reset by peer) |
| 2020-11-16 21:39:21 | × | machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Remote host closed the connection) |
| 2020-11-16 21:39:36 | × | machined1od quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Remote host closed the connection) |
| 2020-11-16 21:39:51 | × | mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Quit: mputz) |
| 2020-11-16 21:40:00 | <dolio> | :t \f -> state (fmap ((,) ()) . f) |
| 2020-11-16 21:40:02 | <lambdabot> | MonadState ((), b) m => (((), b) -> (a, b)) -> m a |
| 2020-11-16 21:40:15 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2020-11-16 21:40:15 | <eacameron> | Question about TH. I barely know how to get my way around TH. Some libraries (here, postgresql-simple-interpolate) offer intelligent Haskell splicing into quasiquoters and they use haskell-ext-meta/etc. to parse the haskell code. This has numerous downsides though as the parser isn't aware of the all the extensions etc in the file using the QQ. However the thought came to me: Why parse these splices at all? |
| 2020-11-16 21:40:31 | <dolio> | Oh, that won't work, right. |
| 2020-11-16 21:40:34 | <eacameron> | Can't I just take them out and put them in a let binding with a new name and then use the name when building the string later? |
| 2020-11-16 21:40:38 | → | ystael joins (~ystael@160.sub-174-242-87.myvzw.com) |
| 2020-11-16 21:41:13 | × | boom quits (56ca6780@lfbn-lyo-1-7-128.w86-202.abo.wanadoo.fr) (Remote host closed the connection) |
| 2020-11-16 21:41:52 | <eacameron> | This presupposes I'm able to take raw strings in the QQ as supplied by the user and then tell TH: Just splat this verbatim into the output. |
| 2020-11-16 21:42:42 | → | falafel joins (~falafel@2600:1007:b0ad:6e87:7811:313f:d0f3:f9f4) |
| 2020-11-16 21:42:58 | × | AlterEgo- quits (~ladew@124-198-158-163.dynamic.caiway.nl) (Quit: Leaving) |
| 2020-11-16 21:43:31 | <Boomerang> | TH doesn't let you "splat" raw strings, you have to build the AST of the Haskell you want to generate |
| 2020-11-16 21:44:14 | × | ystael quits (~ystael@160.sub-174-242-87.myvzw.com) (Read error: Connection reset by peer) |
| 2020-11-16 21:44:55 | <eacameron> | Boomerang: Well that sucks :P |
| 2020-11-16 21:45:50 | <Boomerang> | It does have tools to make it easier, special TH QuasiQuotes [e| ... |], [t| ... |], ... |
| 2020-11-16 21:46:14 | → | Inoperable joins (~PLAYER_1@fancydata.science) |
| 2020-11-16 21:46:15 | <eacameron> | Boomerang: Yeah sounds like at that point I'd need Template template haskell... |
| 2020-11-16 21:46:48 | <Boomerang> | It might be possible/already exists, but I don't know of such a library |
| 2020-11-16 21:47:18 | × | falafel quits (~falafel@2600:1007:b0ad:6e87:7811:313f:d0f3:f9f4) (Read error: Connection reset by peer) |
| 2020-11-16 21:50:55 | × | britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Quit: This computer has gone to sleep) |
| 2020-11-16 21:54:01 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
All times are in UTC.