Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-12 03:06:51 <monochrom> People already do too many bikesheds.
2021-03-12 03:07:34 <infinisil> Checking the instances in base at least, none of them have a custom many/some implementation
2021-03-12 03:07:58 <monochrom> You will have to look into parser libraries.
2021-03-12 03:08:50 <infinisil> megaparsec nope
2021-03-12 03:09:05 <monochrom> I think I heard that in parsers, "manyTill" has an efficient algorithm and is more fundamental, and then "many" is better off expressed as a use of manyTill.
2021-03-12 03:09:24 FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716)
2021-03-12 03:09:24 finn_elija is now known as Guest45740
2021-03-12 03:09:24 FinnElija is now known as finn_elija
2021-03-12 03:10:24 <infinisil> I see, though nope for parsec and aeson
2021-03-12 03:10:44 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving)
2021-03-12 03:11:15 <infinisil> Would be cool if hoogle/hackage could show all instances of Alternative of all libraries
2021-03-12 03:13:39 × Guest45740 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 268 seconds)
2021-03-12 03:16:19 nhs joins (~nhs@cpe-70-113-67-118.austin.res.rr.com)
2021-03-12 03:19:40 × urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna)
2021-03-12 03:21:12 × nhs quits (~nhs@cpe-70-113-67-118.austin.res.rr.com) (Ping timeout: 246 seconds)
2021-03-12 03:25:03 × jespada quits (~jespada@90.254.243.187) (Ping timeout: 245 seconds)
2021-03-12 03:29:21 jespada joins (~jespada@90.254.243.187)
2021-03-12 03:29:39 forgottenone joins (~forgotten@176.42.24.172)
2021-03-12 03:30:49 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
2021-03-12 03:34:38 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-03-12 03:35:46 nhs joins (~nhs@cpe-70-113-67-118.austin.res.rr.com)
2021-03-12 03:35:57 × theDon quits (~td@94.134.91.64) (Ping timeout: 264 seconds)
2021-03-12 03:36:17 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
2021-03-12 03:37:36 theDon joins (~td@muedsl-82-207-238-185.citykom.de)
2021-03-12 03:38:07 × barnowl_ quits (~barnowl@gateway/tor-sasl/barnowl) (Remote host closed the connection)
2021-03-12 03:38:23 × slack1256 quits (~slack1256@dvc-186-186-101-190.movil.vtr.net) (Remote host closed the connection)
2021-03-12 03:38:33 barnowl_ joins (~barnowl@gateway/tor-sasl/barnowl)
2021-03-12 03:40:45 × nhs quits (~nhs@cpe-70-113-67-118.austin.res.rr.com) (Ping timeout: 264 seconds)
2021-03-12 03:41:11 × Wuzzy quits (~Wuzzy@p5b0df7c2.dip0.t-ipconnect.de) (Remote host closed the connection)
2021-03-12 03:41:53 × alx741 quits (~alx741@186.178.108.206) (Quit: alx741)
2021-03-12 03:41:59 dansho joins (~dansho@ec2-52-194-244-43.ap-northeast-1.compute.amazonaws.com)
2021-03-12 03:47:06 × JokerAscensionEx quits (~egp_@2.95.74.168) (Remote host closed the connection)
2021-03-12 03:49:06 × erisco quits (~erisco@d24-57-249-233.home.cgocable.net) (Quit: Leaving)
2021-03-12 03:52:07 Tario joins (~Tario@201.192.165.173)
2021-03-12 03:58:52 × acidjnk_new2 quits (~acidjnk@p200300d0c72b9569d92adbcad5e9416b.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2021-03-12 04:00:53 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2021-03-12 04:01:04 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 256 seconds)
2021-03-12 04:02:37 × denisse quits (~spaceCat@gateway/tor-sasl/alephzer0) (Remote host closed the connection)
2021-03-12 04:02:57 denisse joins (~spaceCat@gateway/tor-sasl/alephzer0)
2021-03-12 04:03:27 conal joins (~conal@64.71.133.70)
2021-03-12 04:03:33 nhs joins (~nhs@cpe-70-113-67-118.austin.res.rr.com)
2021-03-12 04:08:27 × nhs quits (~nhs@cpe-70-113-67-118.austin.res.rr.com) (Ping timeout: 246 seconds)
2021-03-12 04:08:48 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-03-12 04:09:53 <edwardk> infinisil: hackage itself doesn't actually know anything about what is in the libraries you give it. it gets a rough index of modules it uses to spew out the front page and maybe some user generated haddocks
2021-03-12 04:11:51 <edwardk> infinisil: not just more efficient versions , but for some cps'd overly-strict alternatives using some/many from the class can make the difference between termination and not.
2021-03-12 04:12:01 <edwardk> (re some/many)
2021-03-12 04:12:31 <infinisil> Ah neat
2021-03-12 04:12:43 <infinisil> I do like things that terminate!
2021-03-12 04:12:57 fresheyeball joins (~isaac@c-71-237-105-37.hsd1.co.comcast.net)
2021-03-12 04:13:16 <fresheyeball> I think there is a way to take a quasi quote in ghci
2021-03-12 04:13:22 <fresheyeball> and get the Exp for it
2021-03-12 04:13:23 × minoru_shiraeesh quits (~shiraeesh@46.34.206.154) (Ping timeout: 245 seconds)
2021-03-12 04:13:27 <fresheyeball> but I don't remember how
2021-03-12 04:13:39 <fresheyeball> anyone know this trick?
2021-03-12 04:14:50 <edwardk> infinisil: re base nothing in base looks like a parser except ReadP, and ReadP is sufficiently lazy the defaults for some/many work.
2021-03-12 04:16:08 <fresheyeball> I tried [e|x=3|] in ghci, bit to throws a parse error instead of showing the Exp
2021-03-12 04:16:11 <edwardk> some/many became important as members when parsec moved to a cps'd encoding iirc. at that point they stop working off of separate definitions
2021-03-12 04:16:21 <edwardk> x=3 isn't an expression
2021-03-12 04:16:27 <edwardk> that sounds like a statement
2021-03-12 04:16:31 <edwardk> x==3
2021-03-12 04:16:33 <glguy> it's a quasiquoter
2021-03-12 04:16:35 <glguy> oh
2021-03-12 04:16:36 <glguy> no
2021-03-12 04:16:36 <edwardk> that looks like an expression
2021-03-12 04:16:39 <fresheyeball> I mean it as a top level declaration
2021-03-12 04:16:41 <glguy> [e| is not, it's an actual expression quote
2021-03-12 04:16:47 JokerAscensionEx joins (~egp_@2.95.74.168)
2021-03-12 04:16:54 <edwardk> [e| quotes expressions, not statements
2021-03-12 04:16:58 myShoggoth joins (~myShoggot@75.164.81.55)
2021-03-12 04:17:05 <glguy> Anyway, that's beside the point
2021-03-12 04:17:15 <glguy> the question is just how to look at the Exp if you did have good syntax
2021-03-12 04:17:28 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2021-03-12 04:17:37 <fresheyeball> what I am trying to build is a top level value
2021-03-12 04:17:42 <glguy> Prelude Language.Haskell.TH> $(stringE . show =<< [e| '1' |])
2021-03-12 04:17:42 <glguy> "LitE (CharL '1')"
2021-03-12 04:17:47 <fresheyeball> so if Exp is the wrong thing, then I am wrong
2021-03-12 04:17:57 <glguy> you can do that, but I remember there being a cuter way to look at the expr
2021-03-12 04:18:04 <glguy> For a top-level declaration you use a [d|
2021-03-12 04:18:57 × elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 246 seconds)
2021-03-12 04:19:05 <edwardk> ghci> $(stringE . show =<< [d| x = '1' |])
2021-03-12 04:19:05 <edwardk> "[ValD (VarP x_6989586621679035191) (NormalB (LitE (CharL '1'))) []]"
2021-03-12 04:19:19 <edwardk> mind you it defined with a fresh 'x'
2021-03-12 04:19:35 <glguy> I don't think there's such a thing as a fresh, top-level x
2021-03-12 04:19:39 <fresheyeball> there we go
2021-03-12 04:19:42 <fresheyeball> this will work for me
2021-03-12 04:20:06 <glguy> Prelude Language.Haskell.TH Language.Haskell.TH.Syntax> [d| x = 1 |] ;
2021-03-12 04:20:06 <glguy> Prelude Language.Haskell.TH Language.Haskell.TH.Syntax> x
2021-03-12 04:20:10 <fresheyeball> oh interesting
2021-03-12 04:20:22 <fresheyeball> the generated Name funkadelic
2021-03-12 04:21:12 <edwardk> glguy: was it happy with your x?
2021-03-12 04:21:18 <glguy> yeah
2021-03-12 04:21:18 × ixlun` quits (~user@213.205.241.136) (Read error: Connection reset by peer)
2021-03-12 04:21:26 <glguy> I meant to paste the resulting 1
2021-03-12 04:21:28 <edwardk> $(let x = varP (mkName "x") in stringE . show =<< [d| $(x) = '1' |])
2021-03-12 04:21:28 <edwardk> "[ValD (VarP x) (NormalB (LitE (CharL '1'))) []]"
2021-03-12 04:21:31 <edwardk> k
2021-03-12 04:21:43 <edwardk> ^- that will let you generate the name from a string if you must
2021-03-12 04:22:31 <edwardk> without the funkadelic x in the splice =)
2021-03-12 04:22:49 <glguy> [d| $(varP (mkName "x")) = 2 |] ;
2021-03-12 04:22:52 <glguy> if you don't want the let binding

All times are in UTC.