Logs: freenode/#haskell
| 2020-11-09 13:25:23 | × | cosimone quits (~cosimone@5.171.26.80) (Read error: Connection reset by peer) |
| 2020-11-09 13:29:33 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-11-09 13:30:51 | → | invaser1 joins (~Thunderbi@31.148.23.125) |
| 2020-11-09 13:31:21 | × | invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 265 seconds) |
| 2020-11-09 13:31:21 | invaser1 | is now known as invaser |
| 2020-11-09 13:32:11 | → | ph88 joins (~ph88@ip5f5af72e.dynamic.kabel-deutschland.de) |
| 2020-11-09 13:32:30 | → | Kaivo joins (~Kaivo@104-200-86-99.mc.derytele.com) |
| 2020-11-09 13:32:36 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:a17b:c481:d5f1:9100) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-09 13:33:30 | × | sh9 quits (~sh9@softbank060116136158.bbtec.net) (Quit: WeeChat 2.8) |
| 2020-11-09 13:35:22 | → | sh9 joins (~sh9@softbank060116136158.bbtec.net) |
| 2020-11-09 13:38:00 | → | FreeBirdLjj joins (~freebirdl@101.228.42.108) |
| 2020-11-09 13:38:32 | → | chaosmasttter joins (~chaosmast@p200300c4a7087201c8e962581689150e.dip0.t-ipconnect.de) |
| 2020-11-09 13:42:10 | → | christo joins (~chris@81.96.113.213) |
| 2020-11-09 13:42:11 | × | knupfer quits (~Thunderbi@dynamic-046-114-148-248.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
| 2020-11-09 13:42:49 | × | FreeBirdLjj quits (~freebirdl@101.228.42.108) (Ping timeout: 264 seconds) |
| 2020-11-09 13:43:32 | ← | xikeon parts (~michael@i226028.upc-i.chello.nl) ("WeeChat 2.8") |
| 2020-11-09 13:45:21 | × | drbean quits (~drbean@TC210-63-209-199.static.apol.com.tw) (Ping timeout: 268 seconds) |
| 2020-11-09 13:45:34 | → | son0p joins (~son0p@181.136.122.143) |
| 2020-11-09 13:49:25 | → | Iceland_jack joins (~user@95.149.219.123) |
| 2020-11-09 13:50:37 | → | mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) |
| 2020-11-09 13:54:13 | → | sQVe joins (~sQVe@unaffiliated/sqve) |
| 2020-11-09 13:54:53 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2020-11-09 13:54:55 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:a17b:c481:d5f1:9100) |
| 2020-11-09 13:56:27 | × | avdb quits (~avdb@ip-83-134-109-5.dsl.scarlet.be) (Quit: WeeChat 2.9) |
| 2020-11-09 13:56:50 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:a17b:c481:d5f1:9100) (Client Quit) |
| 2020-11-09 13:57:55 | × | Lowl3v3l quits (~Lowl3v3l@dslb-002-203-195-108.002.203.pools.vodafone-ip.de) (Remote host closed the connection) |
| 2020-11-09 13:58:08 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2020-11-09 13:58:21 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 2020-11-09 13:58:26 | → | Lowl3v3l joins (~Lowl3v3l@dslb-002-203-195-108.002.203.pools.vodafone-ip.de) |
| 2020-11-09 13:59:43 | × | britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Quit: This computer has gone to sleep) |
| 2020-11-09 14:00:22 | × | Franciman quits (~francesco@host-79-36-167-172.retail.telecomitalia.it) (Ping timeout: 256 seconds) |
| 2020-11-09 14:00:32 | → | texasmynsted joins (~texasmyns@64.44.55.28) |
| 2020-11-09 14:00:43 | → | britva joins (~britva@2a02:aa13:7240:2980:8973:b5bc:951d:7f1f) |
| 2020-11-09 14:01:14 | → | renzhi joins (~renzhi@2607:fa49:655f:e600::28da) |
| 2020-11-09 14:02:04 | × | apoc quits (~apoc@bridge.mattzq.com) (Ping timeout: 256 seconds) |
| 2020-11-09 14:02:10 | × | texasmynsted quits (~texasmyns@64.44.55.28) (Read error: Connection reset by peer) |
| 2020-11-09 14:02:12 | → | Franciman joins (~francesco@host-82-56-223-169.retail.telecomitalia.it) |
| 2020-11-09 14:06:03 | × | Gurkenglas_ quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 258 seconds) |
| 2020-11-09 14:06:04 | → | apoc joins (~apoc@bridge.mattzq.com) |
| 2020-11-09 14:07:17 | → | bitmagie joins (~Thunderbi@200116b8068e9d000cdbc28af571c7f9.dip.versatel-1u1.de) |
| 2020-11-09 14:10:02 | × | Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Remote host closed the connection) |
| 2020-11-09 14:10:38 | → | Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer) |
| 2020-11-09 14:10:54 | × | adm_ quits (~adm@43.229.88.236) (Remote host closed the connection) |
| 2020-11-09 14:11:46 | → | avdb joins (~avdb@ip-83-134-109-5.dsl.scarlet.be) |
| 2020-11-09 14:12:10 | × | ambiso9 quits (~ambiso@209.182.239.205) (Quit: The Lounge - https://thelounge.chat) |
| 2020-11-09 14:12:11 | → | adm_ joins (~adm@43.229.88.236) |
| 2020-11-09 14:12:48 | × | avdb quits (~avdb@ip-83-134-109-5.dsl.scarlet.be) (Client Quit) |
| 2020-11-09 14:13:49 | → | ambiso9 joins (~ambiso@209.182.239.205) |
| 2020-11-09 14:15:02 | × | Cthalupa quits (~cthulhu@47.186.47.75) (Ping timeout: 264 seconds) |
| 2020-11-09 14:15:20 | × | chaosmasttter quits (~chaosmast@p200300c4a7087201c8e962581689150e.dip0.t-ipconnect.de) (Ping timeout: 244 seconds) |
| 2020-11-09 14:17:22 | → | hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net) |
| 2020-11-09 14:17:26 | → | Cthalupa joins (~cthulhu@47.186.47.75) |
| 2020-11-09 14:19:11 | → | Ariakenom joins (~Ariakenom@h-82-196-111-76.NA.cust.bahnhof.se) |
| 2020-11-09 14:21:08 | × | gproto23 quits (~gproto23@unaffiliated/gproto23) (Ping timeout: 265 seconds) |
| 2020-11-09 14:21:48 | × | adm_ quits (~adm@43.229.88.236) (Remote host closed the connection) |
| 2020-11-09 14:23:07 | × | shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection) |
| 2020-11-09 14:23:47 | → | shatriff joins (~vitaliish@176.52.219.10) |
| 2020-11-09 14:25:56 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-09 14:28:42 | × | apoc quits (~apoc@bridge.mattzq.com) (Ping timeout: 256 seconds) |
| 2020-11-09 14:29:40 | → | Eugleo joins (5ab552b3@gateway/web/cgi-irc/kiwiirc.com/ip.90.181.82.179) |
| 2020-11-09 14:30:07 | → | v_m_v joins (~vm_v@2a02:aa12:3200:6480:fc4f:fb56:796a:9a4a) |
| 2020-11-09 14:30:12 | <Eugleo> | Hey fellow Haskellers! How do I properly convert from Pico to Scientific and back? |
| 2020-11-09 14:30:48 | <merijn> | Depends on your definition of "proper" |
| 2020-11-09 14:30:48 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-11-09 14:30:53 | <merijn> | But you probably want |
| 2020-11-09 14:30:55 | <dminuoso> | unsafeCoerce? |
| 2020-11-09 14:30:58 | <merijn> | :t realToFrac |
| 2020-11-09 14:30:59 | <lambdabot> | (Real a, Fractional b) => a -> b |
| 2020-11-09 14:31:03 | <dminuoso> | Both get you there! |
| 2020-11-09 14:31:14 | <merijn> | :t realToFrac :: Pico -> Scientific |
| 2020-11-09 14:31:15 | <lambdabot> | error: |
| 2020-11-09 14:31:15 | <lambdabot> | Not in scope: type constructor or class ‘Scientific’ |
| 2020-11-09 14:31:23 | <Eugleo> | merijn: Thought it would. Thanks |
| 2020-11-09 14:31:26 | → | gproto23 joins (~gproto23@unaffiliated/gproto23) |
| 2020-11-09 14:31:41 | <Eugleo> | Forgot that Scientific was Fractional |
| 2020-11-09 14:32:09 | <Eugleo> | So I went Pico ->(realToFrac) Fractional ->(round) -> Integral ->(fromIntegral) Scientific |
| 2020-11-09 14:32:20 | <Eugleo> | And "proper" is then anything better than this :-D |
| 2020-11-09 14:32:28 | <merijn> | Yeah, that's weird |
| 2020-11-09 14:32:44 | <merijn> | Scientific is an instance of Fractional, so you can do that directy |
| 2020-11-09 14:33:59 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-09 14:35:08 | <Eugleo> | Ok, and how do I go back from Scientific to Pico? Never heard about fracToReal or somehting similar |
| 2020-11-09 14:36:01 | <dminuoso> | % :t toRational |
| 2020-11-09 14:36:01 | <yahb> | dminuoso: forall {a}. Real a => a -> Rational |
| 2020-11-09 14:36:09 | <dminuoso> | Clearly. |
| 2020-11-09 14:36:20 | <merijn> | Pico (aka Fixed) is an instance of Fractional to and Scientific is an instance of Real |
| 2020-11-09 14:36:27 | <dminuoso> | oh |
| 2020-11-09 14:36:29 | <dminuoso> | or just realToFrac again |
| 2020-11-09 14:36:32 | <merijn> | So the way you go back is: also realToFrac |
| 2020-11-09 14:36:57 | <dminuoso> | I just remember this: add fromIntegral and realToFrac until it compiels |
| 2020-11-09 14:37:03 | <dminuoso> | Close your eyes, and just pretend there's no narrowing going on |
| 2020-11-09 14:37:12 | → | jonatanb joins (~jonatanb@83.24.9.26.ipv4.supernova.orange.pl) |
| 2020-11-09 14:37:25 | × | darjeeling_ quits (~darjeelin@122.245.210.126) (Ping timeout: 264 seconds) |
| 2020-11-09 14:37:28 | <Eugleo> | dminuoso: Just added realToFrac to my arsenal. Was pretty surprised when fromIntegral didn't cut it |
| 2020-11-09 14:37:39 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-11-09 14:37:43 | <Eugleo> | merijn: Thanks a lot |
| 2020-11-09 14:37:48 | <dminuoso> | merijn: what was the library forsafe numeric conversions? |
| 2020-11-09 14:37:48 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 260 seconds) |
| 2020-11-09 14:38:12 | → | adm_ joins (~adm@43.229.88.236) |
| 2020-11-09 14:38:21 | × | shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection) |
| 2020-11-09 14:38:26 | × | sQVe quits (~sQVe@unaffiliated/sqve) (Quit: Bye!) |
All times are in UTC.