Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-05-15 17:07:37 <xenon-> yeah that is another error
2021-05-15 17:09:37 <int-e> The whole `PrintfArg` business is an implementation detail of `printf` that allows it to be variadic. It's an ingenious trick that you should study when you learn about type classes (not to ever use it, just to get an appreciation of how flexible they can be), but for a beginner it's just intimidating.
2021-05-15 17:10:39 <xenon-> while printf errors can be weird, not sure if that was the case in here. he didn't pass all the arguments to ShowFFloat
2021-05-15 17:10:42 <int-e> By specifying the intended type signature for your use of printf, you'll avoid seeing PrintfArg in the type errors.
2021-05-15 17:11:07 <int-e> :t showFFloat
2021-05-15 17:11:08 <lambdabot> RealFloat a => Maybe Int -> a -> ShowS
2021-05-15 17:11:11 <int-e> Oh right
2021-05-15 17:12:03 <int-e> (ShowS is String -> String)
2021-05-15 17:12:33 omikron joins (971f48a9@151.31.72.169)
2021-05-15 17:14:11 omikron parts (971f48a9@151.31.72.169) ()
2021-05-15 17:14:16 <int-e> My mistake, I guess. I'm not using showFFloat :P, I'd almost always reach for `printf "%f"` instead.
2021-05-15 17:15:42 <guest5> should I try using printf %f instead then? do you think that'd be better
2021-05-15 17:16:27 a6a45081-2b83 joins (~aditya@122.163.132.249)
2021-05-15 17:17:05 <int-e> kuribas: so at the level of names, there's a huge difference between 'a and mkName "a".
2021-05-15 17:17:54 × johnw quits (~johnw@haskell/developer/johnw) (Quit: ZNC - http://znc.in)
2021-05-15 17:18:21 <kuribas> int-e: "a" captures the name a in the current environment, no?
2021-05-15 17:18:30 <int-e> guest5: It would be simpler.
2021-05-15 17:18:45 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Ping timeout: 240 seconds)
2021-05-15 17:19:32 <int-e> kuribas: hehe, "current".
2021-05-15 17:20:11 <kuribas> int-e: current being the generated environment?
2021-05-15 17:21:13 × stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds)
2021-05-15 17:22:13 <guest5> I switched to %f and im getting the same error as before
2021-05-15 17:22:16 <guest5> - No instance for (Num [Char]) arising from a use of ‘+’
2021-05-15 17:22:36 <guest5> in the last bit of that line - ‘("m " + listToString XS)’
2021-05-15 17:22:46 <int-e> kuribas: I meant https://paste.debian.net/1197712/
2021-05-15 17:22:53 <geekosaur> it'd be ++ not +
2021-05-15 17:23:45 <kuribas> int-e: what does that quote do?
2021-05-15 17:23:55 <int-e> kuribas: capture a name
2021-05-15 17:24:44 kritzefitz joins (~kritzefit@212.86.56.80)
2021-05-15 17:26:14 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Ping timeout: 245 seconds)
2021-05-15 17:27:52 <guest5> can you think of any reason it would give 'Exception: printf: formatting string ended prematurely' after outputting the first line
2021-05-15 17:28:02 <guest5> because I think ive nearly got it working
2021-05-15 17:28:09 <int-e> guest5: yes
2021-05-15 17:28:23 <int-e> 19:07:26 <int-e> guest5: note that "%-10s" specifies *one* string format, but you're giving it two strings...
2021-05-15 17:30:11 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
2021-05-15 17:30:47 <guest5> so should I be joining the strings or is there a way to specify its 2?
2021-05-15 17:31:17 <geekosaur> that's what "format string ended prematurely" means. add a %s to it for the second string?
2021-05-15 17:31:22 <davean> You can say it twice
2021-05-15 17:31:46 <xenon-> > printf "%s %s" "first string" "second string"
2021-05-15 17:31:47 <lambdabot> error:
2021-05-15 17:31:47 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M464159718010...
2021-05-15 17:31:47 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
2021-05-15 17:31:53 <xenon-> > printf "%s %s" "first string" "second string" :: String
2021-05-15 17:31:54 <lambdabot> "first string second string"
2021-05-15 17:32:16 oish joins (~charlie@228.25.169.217.in-addr.arpa)
2021-05-15 17:33:00 ddellacosta joins (~ddellacos@86.106.143.10)
2021-05-15 17:33:17 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 265 seconds)
2021-05-15 17:33:30 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
2021-05-15 17:34:07 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-05-15 17:34:51 stree joins (~stree@68.36.8.116)
2021-05-15 17:35:42 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-05-15 17:36:37 <guest5> xenon- hero, thankyou
2021-05-15 17:37:33 × ddellacosta quits (~ddellacos@86.106.143.10) (Ping timeout: 240 seconds)
2021-05-15 17:37:38 <xenon-> :) np
2021-05-15 17:38:30 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 252 seconds)
2021-05-15 17:40:11 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
2021-05-15 17:40:26 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-05-15 17:41:55 frozenErebus joins (~frozenEre@37.231.244.249)
2021-05-15 17:42:21 × a6a45081-2b83 quits (~aditya@122.163.132.249) (Remote host closed the connection)
2021-05-15 17:42:22 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-05-15 17:43:08 <int-e> kuribas: https://paste.debian.net/1197713/ <-- of course if you dig deep enough you'll find that TH breaks abstraction boundaries
2021-05-15 17:44:49 <kuribas> does it break internal bindings?
2021-05-15 17:45:00 <kuribas> Can I look at internal bindings in packages?
2021-05-15 17:45:03 × rdivyanshu quits (uid322626@gateway/web/irccloud.com/x-yurqvpvnjnppvuit) (Quit: Connection closed for inactivity)
2021-05-15 17:45:07 × _noblegas quits (uid91066@gateway/web/irccloud.com/x-mtzrtyjcpxczquke) (Quit: Connection closed for inactivity)
2021-05-15 17:45:18 <int-e> kuribas: sorry, I meant to write module A () where
2021-05-15 17:46:37 <int-e> kuribas: actually this is weird territory...
2021-05-15 17:47:02 <int-e> kuribas: code that works interpreted but not compiled... fun
2021-05-15 17:48:19 LKoen joins (~LKoen@2a01cb0407597a0030b702bc5b5d599b.ipv6.abo.wanadoo.fr)
2021-05-15 17:48:51 <int-e> kuribas: Hah, there's some serious magic involved in this.
2021-05-15 17:49:31 <int-e> kuribas: https://paste.debian.net/1197718/ works interpreted and compiled
2021-05-15 17:50:21 <int-e> kuribas: so apparently, the occurrence of `'a` in the A module instructs the compiler to add the A.a export to the .hi file.
2021-05-15 17:51:04 Sgeo joins (~Sgeo@ool-18b9875e.dyn.optonline.net)
2021-05-15 17:51:32 <boxscape> did you post the same module twice in that last paste intentionally?
2021-05-15 17:51:54 <int-e> boxscape: uhm, no.
2021-05-15 17:51:56 chris__ joins (~chris@81.96.113.213)
2021-05-15 17:52:03 Cadey joins (~cadey@infoforcefeed/Xe)
2021-05-15 17:52:04 <boxscape> ok, I was confused for a minute :)
2021-05-15 17:52:22 <int-e> https://paste.debian.net/1197719/
2021-05-15 17:52:48 <int-e> (though B.hs hadn't changed)
2021-05-15 17:52:57 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-05-15 17:54:14 <boxscape> does TH care about import lists?
2021-05-15 17:54:21 rj joins (~x@gateway/tor-sasl/rj)
2021-05-15 17:54:48 <int-e> boxscape: yes. You can't just do `mkName "A.a"`; that will complain about A.a not being in scope
2021-05-15 17:54:56 <boxscape> I see
2021-05-15 17:55:18 <int-e> You really have to fake the whole resolved Name value (as I did there) to bypass that check.
2021-05-15 17:55:23 <boxscape> right, okay
2021-05-15 17:55:36 × frozenErebus quits (~frozenEre@37.231.244.249) (Ping timeout: 268 seconds)
2021-05-15 17:56:09 _xor joins (~xor@74.215.46.133)
2021-05-15 17:57:22 × sphi quits (~sphi@unaffiliated/sphi) (Remote host closed the connection)
2021-05-15 17:58:14 × _xor quits (~xor@74.215.46.133) (Client Quit)
2021-05-15 17:58:33 _xor joins (~xor@74.215.46.133)
2021-05-15 17:58:41 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 252 seconds)
2021-05-15 18:02:17 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-05-15 18:03:15 nicholasbulka joins (~nicholasb@2601:900:4301:da0:75d5:f759:9c55:c828)
2021-05-15 18:03:17 × joncol quits (~jco@c83-248-173-38.bredband.tele2.se) (Quit: leaving)
2021-05-15 18:06:44 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 252 seconds)
2021-05-15 18:07:45 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-05-15 18:08:23 nyd joins (~nyd@unaffiliated/elysian)
2021-05-15 18:08:56 × nyd quits (~nyd@unaffiliated/elysian) (Client Quit)

All times are in UTC.