Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-07 02:41:49 <yahb> olligobber: (1,1)
2021-04-07 02:41:52 <olligobber> ooh
2021-04-07 02:42:02 <olligobber> they are different
2021-04-07 02:42:18 <olligobber> that makes sense actually
2021-04-07 02:42:23 <olligobber> huh
2021-04-07 02:42:58 <olligobber> it feels kinda weird now that Integer isn't N...
2021-04-07 02:44:43 <olligobber> but yeah, now if I ask for a monoid, I could either mean `Monoid m => m -> ()` or `(forall m. Monoid m => m) -> ()`, and they are different things...
2021-04-07 02:44:55 <monochrom> Darn. I see.
2021-04-07 02:47:42 <monochrom> I should have applied what I learned formally, not intuitively.
2021-04-07 02:48:07 <glguy> data N = Plus N N | Minus N N | Times N N | Negate N | Abs N | Signum N | FromInteger Integer
2021-04-07 02:48:17 <monochrom> Yeah, that.
2021-04-07 02:48:20 <glguy> olligobber's N is a complicated way to write that
2021-04-07 02:48:47 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-04-07 02:49:04 <glguy> and since "The Haskell Report defines no laws for Num. [...]"
2021-04-07 02:49:11 <monochrom> Just mechanically translate the forall-type to ADT. Do not think. Do not pass Go. Do not collect $200.
2021-04-07 02:49:17 <glguy> we don't have to worry about any limitations in how to evaluate one of those :)
2021-04-07 02:53:30 × theDon quits (~td@94.134.91.185) (Ping timeout: 268 seconds)
2021-04-07 02:54:49 theDon joins (~td@muedsl-82-207-238-149.citykom.de)
2021-04-07 02:55:18 × drbean_ quits (~drbean@TC210-63-209-95.static.apol.com.tw) (Ping timeout: 240 seconds)
2021-04-07 02:56:38 FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716)
2021-04-07 02:56:38 finn_elija is now known as Guest29980
2021-04-07 02:56:38 FinnElija is now known as finn_elija
2021-04-07 02:57:40 trcm joins (~trcm@103.153.243.79)
2021-04-07 02:57:58 kiweun joins (~kiweun@cpe98524a8cef7c-cm98524a8cef7a.cpe.net.cable.rogers.com)
2021-04-07 02:59:33 × Guest29980 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 240 seconds)
2021-04-07 03:00:28 berberman_ joins (~berberman@unaffiliated/berberman)
2021-04-07 03:01:22 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 258 seconds)
2021-04-07 03:01:47 × myShoggoth quits (~myShoggot@75.164.73.93) (Remote host closed the connection)
2021-04-07 03:02:10 myShoggoth joins (~myShoggot@75.164.73.93)
2021-04-07 03:03:18 × ddellacosta quits (~ddellacos@86.106.143.174) (Remote host closed the connection)
2021-04-07 03:03:29 ddellacosta joins (~ddellacos@86.106.143.174)
2021-04-07 03:04:05 × ddellacosta quits (~ddellacos@86.106.143.174) (Remote host closed the connection)
2021-04-07 03:07:41 × myShoggoth quits (~myShoggot@75.164.73.93) (Ping timeout: 268 seconds)
2021-04-07 03:09:56 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-04-07 03:13:59 × quinn quits (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) (Quit: ZNC 1.8.1 - https://znc.in)
2021-04-07 03:14:25 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 252 seconds)
2021-04-07 03:16:48 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-04-07 03:18:10 <olligobber> % newtype The c = The { some :: forall x. c x => x }
2021-04-07 03:18:10 <yahb> olligobber:
2021-04-07 03:18:26 <olligobber> % some (The $ 1 + 2 :: The Num)
2021-04-07 03:18:26 <yahb> olligobber: 3
2021-04-07 03:18:46 <olligobber> % some (The mempty :: The Monoid)
2021-04-07 03:18:46 <yahb> olligobber: ()
2021-04-07 03:18:51 <olligobber> awesome
2021-04-07 03:19:43 <Axman6> % % some (The mempty :: The Monoid) :: [Int]
2021-04-07 03:19:43 <yahb> Axman6: ; <interactive>:75:1: error: parse error on input `%'
2021-04-07 03:19:48 <Axman6> % some (The mempty :: The Monoid) :: [Int]
2021-04-07 03:19:48 <yahb> Axman6: []
2021-04-07 03:20:55 <monochrom> "free algebras for all" >:)
2021-04-07 03:21:01 <olligobber> yeah
2021-04-07 03:21:17 <monochrom> pun intended in "for all"
2021-04-07 03:21:18 quinn joins (~quinn@c-73-223-224-163.hsd1.ca.comcast.net)
2021-04-07 03:24:54 <nshepperd> the monoid, the myth, the legend
2021-04-07 03:25:49 <olligobber> oh god
2021-04-07 03:25:58 <olligobber> % class (a x, b x) => (/\) a b x
2021-04-07 03:25:58 <yahb> olligobber: ; <interactive>:77:1: error:; * Potential superclass cycle for `/\'; one of whose superclass constraints is headed by a type variable: `a x'; Use UndecidableSuperClasses to accept this; * In the class declaration for `/\'
2021-04-07 03:26:16 <olligobber> % :set -XUndecidableSuperClasses
2021-04-07 03:26:16 <yahb> olligobber:
2021-04-07 03:26:20 <olligobber> % class (a x, b x) => (/\) a b x
2021-04-07 03:26:20 <yahb> olligobber:
2021-04-07 03:26:29 <olligobber> % instance (a x, b x) => (/\) a b x
2021-04-07 03:26:29 <yahb> olligobber:
2021-04-07 03:26:42 <olligobber> % some (The 1 :: The (Num /\ Show)) :: Int
2021-04-07 03:26:42 <yahb> olligobber: 1
2021-04-07 03:26:44 × cgfuh quits (~cgfuh@181.167.191.58) (Quit: WeeChat 3.0)
2021-04-07 03:27:15 <olligobber> % some (The $ 1 + read "1" :: The (Num /\ Read)) :: Int
2021-04-07 03:27:15 <yahb> olligobber: 2
2021-04-07 03:27:17 <Axman6> Using Fira Code in my terminal means that /\ shows up as a single ligature, and that makes me happy
2021-04-07 03:27:22 <olligobber> same
2021-04-07 03:27:37 <olligobber> actually my terminal doesn't do ligatures, but my text editor does
2021-04-07 03:29:11 <Axman6> get a better terminal
2021-04-07 03:29:20 <olligobber> but im lazy
2021-04-07 03:29:29 <Axman6> I understand
2021-04-07 03:30:21 slycelote[m] joins (slycelotem@gateway/shell/matrix.org/x-gzalokaoqcjbolje)
2021-04-07 03:30:51 <olligobber> % let x = (The $ 1 + read "1.5" :: The (Num /\ Read)) in (some x :: Float, some x :: Int)
2021-04-07 03:30:51 <yahb> olligobber: (2.5,*** Exception: Prelude.read: no parse
2021-04-07 03:30:58 slycelote[m] parts (slycelotem@gateway/shell/matrix.org/x-gzalokaoqcjbolje) ()
2021-04-07 03:31:05 slycelote[m] joins (slycelotem@gateway/shell/matrix.org/x-gzalokaoqcjbolje)
2021-04-07 03:31:19 <olligobber> cursed
2021-04-07 03:32:03 LKoen joins (~LKoen@65.250.88.92.rev.sfr.net)
2021-04-07 03:32:19 × kiweun quits (~kiweun@cpe98524a8cef7c-cm98524a8cef7a.cpe.net.cable.rogers.com) (Remote host closed the connection)
2021-04-07 03:34:08 <nshepperd> % instance (forall a. c a => Semigroup a) => Semigroup (The c) where { (<>) a b = The (a <> b) }
2021-04-07 03:34:08 <yahb> nshepperd: ; <interactive>:84:10: error:; * Variable `c' occurs more often in the constraint `c a' than in the instance head `Semigroup a'; (Use UndecidableInstances to permit this); * In the quantified constraint `forall a. c a => Semigroup a'; In the instance declaration for `Semigroup (The c)'
2021-04-07 03:34:51 <olligobber> wtf is that oh god
2021-04-07 03:35:04 <olligobber> % :set -XUndecidableInstances
2021-04-07 03:35:04 <yahb> olligobber:
2021-04-07 03:35:09 <olligobber> % instance (forall a. c a => Semigroup a) => Semigroup (The c) where { (<>) a b = The (a <> b) }
2021-04-07 03:35:10 <yahb> olligobber: ; <interactive>:86:10: error:; * Could not deduce: c (The c) arising from a use of `GHC.Base.$dmsconcat'; from the context: forall a. c a => Semigroup a bound by the instance declaration at <interactive>:86:10-60; * In the expression: GHC.Base.$dmsconcat @(The c); In an equation for `GHC.Base.sconcat': GHC.Base.sconcat = GHC.Base.$dmsconcat @(The c); In the instance declaration
2021-04-07 03:35:22 <nshepperd> wat
2021-04-07 03:35:27 <olligobber> infinite loop?
2021-04-07 03:35:46 <nshepperd> oh, typo
2021-04-07 03:36:00 <nshepperd> % instance (forall a. c a => Semigroup a) => Semigroup (The c) where { (<>) a b = The (some a <> some b) }
2021-04-07 03:36:00 <yahb> nshepperd: ; <interactive>:87:10: error:; * Could not deduce: c (The c) arising from a use of `GHC.Base.$dmsconcat'; from the context: forall a. c a => Semigroup a bound by the instance declaration at <interactive>:87:10-60; * In the expression: GHC.Base.$dmsconcat @(The c); In an equation for `GHC.Base.sconcat': GHC.Base.sconcat = GHC.Base.$dmsconcat @(The c); In the instance declaration
2021-04-07 03:36:43 <nshepperd> i dunno
2021-04-07 03:36:57 <olligobber> that typo should have caused a runtime (when we call <>) error rather than a compile time (when we define the instance) error
2021-04-07 03:37:13 <olligobber> I think because Semigroup a => Semigroup a it's infinite looping?
2021-04-07 03:37:47 <olligobber> % instance Semigroup (The Semigroup) where { a <> b = The (some a <> some b) }
2021-04-07 03:37:47 <yahb> olligobber:
2021-04-07 03:38:43 <olligobber> % :t (<>) @(The Semigroup)
2021-04-07 03:38:43 <yahb> olligobber: The Semigroup -> The Semigroup -> The Semigroup

All times are in UTC.