Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-07 03:38:44 <nshepperd> seems like that quantified constraint is trickier than expected
2021-04-07 03:40:30 myShoggoth joins (~myShoggot@75.164.73.93)
2021-04-07 03:40:44 <nshepperd> might need a separate class to extract the Semigroup constraint from a tree of /\ so that you can make semigroup instances for any such The
2021-04-07 03:41:15 <hololeap> % :t fmap @(The Functor)
2021-04-07 03:41:15 <yahb> hololeap: ; <interactive>:1:8: error:; * Expected kind `* -> *', but `The Functor' has kind `*'; * In the type `(The Functor)'; In the expression: fmap @(The Functor); <interactive>:1:12: error:; * Couldn't match kind `* -> *' with `*'; Expected kind `* -> Constraint', but `Functor' has kind `(* -> *) -> Constraint'; * In the first argument of `The', namely `Functor'; In the type `
2021-04-07 03:46:26 × stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds)
2021-04-07 03:48:57 <olligobber> % newtype The1 c a = The1 { some1 :: forall f. c f => f x }
2021-04-07 03:48:57 <yahb> olligobber: ; <interactive>:91:55: error: Not in scope: type variable `x'
2021-04-07 03:49:03 <olligobber> % newtype The1 c a = The1 { some1 :: forall f. c f => f a }
2021-04-07 03:49:03 <yahb> olligobber:
2021-04-07 03:49:47 <olligobber> % :k The1 Functor
2021-04-07 03:49:48 <yahb> olligobber: * -> *
2021-04-07 03:49:50 <olligobber> hmm
2021-04-07 03:50:30 <olligobber> % instance Functor (The1 Functor) where fmap f x = The1 (fmap f (some x))
2021-04-07 03:50:30 <yahb> olligobber: ; <interactive>:94:69: error:; * Couldn't match expected type: The c0; with actual type: The1 Functor a; * In the first argument of `some', namely `x'; In the second argument of `fmap', namely `(some x)'; In the first argument of `The1', namely `(fmap f (some x))'; * Relevant bindings include; x :: The1 Functor a (bound at <interactive>:94:46); f ::
2021-04-07 03:50:48 <olligobber> % instance Functor (The1 Functor) where fmap f x = The1 (fmap f (some1 x))
2021-04-07 03:50:48 <yahb> olligobber:
2021-04-07 03:50:55 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-04-07 03:51:02 <olligobber> % :t fmap @(The1 Functor)
2021-04-07 03:51:02 <yahb> olligobber: (a -> b) -> The1 Functor a -> The1 Functor b
2021-04-07 03:51:07 <olligobber> lol
2021-04-07 03:51:23 × s00pcan quits (~chris@075-133-056-178.res.spectrum.com) (Ping timeout: 260 seconds)
2021-04-07 03:53:05 s00pcan joins (~chris@107.181.165.217)
2021-04-07 03:53:49 <olligobber> well, if anyone asks for a functor that isn't applicative, I now have the worst answer
2021-04-07 03:57:40 × vgtw quits (~vgtw@gateway/tor-sasl/vgtw) (Remote host closed the connection)
2021-04-07 03:57:59 vgtw joins (~vgtw@gateway/tor-sasl/vgtw)
2021-04-07 03:58:18 × alx741 quits (~alx741@181.196.68.238) (Quit: alx741)
2021-04-07 03:58:34 × Wuzzy quits (~Wuzzy@p5790e46d.dip0.t-ipconnect.de) (Quit: Wuzzy)
2021-04-07 03:58:58 jj2021 joins (~JJ@072-181-126-124.res.spectrum.com)
2021-04-07 03:59:03 stree joins (~stree@68.36.8.116)
2021-04-07 04:03:11 <olligobber> % fmap @(The1 Functor) show $ The1 $ pure 1 :: [String]
2021-04-07 04:03:11 <yahb> olligobber: ; <interactive>:97:1: error:; * Couldn't match expected type: [String]; with actual type: The1 Functor String; * In the expression: fmap @(The1 Functor) show $ The1 $ pure 1 :: [String]; In an equation for `it': it = fmap @(The1 Functor) show $ The1 $ pure 1 :: [String]
2021-04-07 04:03:23 <olligobber> % some1 $ fmap @(The1 Functor) show $ The1 $ pure 1 :: [String]
2021-04-07 04:03:23 <yahb> olligobber: ; <interactive>:98:44: error:; * Could not deduce (Applicative f) arising from a use of `pure'; from the context: Functor f; bound by a type expected by the context:; forall (f :: * -> *). Functor f => f Integer; at <interactive>:98:44-49; Possible fix:; add (Applicative f) to the context of; a type expected by the context:; fo
2021-04-07 04:03:49 <olligobber> % some1 $ fmap @(The1 Functor) show (The1 $ pure 1 :: The1 Applicative) :: [String]
2021-04-07 04:03:49 <yahb> olligobber: ; <interactive>:99:53: error:; * Expecting one more argument to `The1 Applicative'; Expected a type, but `The1 Applicative' has kind `* -> *'; * In an expression type signature: The1 Applicative; In the third argument of `fmap', namely `(The1 $ pure 1 :: The1 Applicative)'; In the second argument of `($)', namely `fmap @(The1 Functor) show (The1 $ pure 1 :: The1 Applicative)'
2021-04-07 04:03:57 <olligobber> % some1 $ fmap @(The1 Functor) show (The1 $ pure 1 :: The1 Applicative Int) :: [String]
2021-04-07 04:03:57 <yahb> olligobber: ; <interactive>:100:36: error:; * Couldn't match type `Applicative' with `Functor'; Expected: The1 Functor Int; Actual: The1 Applicative Int; * In the third argument of `fmap', namely `(The1 $ pure 1 :: The1 Applicative Int)'; In the second argument of `($)', namely `fmap @(The1 Functor) show (The1 $ pure 1 :: The1 Applicative Int)'; In the expression: some1 $ fmap @(The
2021-04-07 04:04:28 <olligobber> % some1 $ some1 $ fmap @(The1 Functor) show (The1 (The1 $ pure 1 :: The1 Applicative Int)) :: [String]
2021-04-07 04:04:28 <yahb> olligobber: ; <interactive>:101:1: error:; * Could not deduce: c0 [] arising from a use of `some1'; * In the expression: some1 $ some1 $ fmap @(The1 Functor) show (The1 (The1 $ pure 1 :: The1 Applicative Int)) :: [String]; In an equation for `it': it = some1 $ some1 $ fmap @(The1 Functor) show (The1 (The1 $ pure 1 :: The1 Applicative Int)) :: [String]; <interactive>:101:9: error:; * Ambiguous typ
2021-04-07 04:04:44 <olligobber> lol
2021-04-07 04:05:22 <olligobber> seems The1 Functor is kinda useless?
2021-04-07 04:06:28 <olligobber> yeah, you can only give fmap @(The1 Functor) values if they exist for all functors, but no values exist for all functors, since Const Void is a functor
2021-04-07 04:06:32 <olligobber> great
2021-04-07 04:08:00 hypercube joins (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com)
2021-04-07 04:09:23 × average quits (uid473595@gateway/web/irccloud.com/x-nfxnbiiogmdlamqs) (Quit: Connection closed for inactivity)
2021-04-07 04:09:53 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2021-04-07 04:10:41 × jonathanx quits (~jonathan@h-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
2021-04-07 04:11:06 jonathanx joins (~jonathan@h-176-109.A357.priv.bahnhof.se)
2021-04-07 04:14:12 × hypercube quits (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com) (Ping timeout: 246 seconds)
2021-04-07 04:14:26 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-07 04:15:16 takuan joins (~takuan@178-116-218-225.access.telenet.be)
2021-04-07 04:18:07 <gnumonic> Are there any libraries that allow for (for lack of a better description) "type-level records?" I'm working with singletons and kind-indexed GADTs and the number of type(kind) parameters is getting kinda ugly
2021-04-07 04:19:23 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds)
2021-04-07 04:19:54 hypercube joins (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com)
2021-04-07 04:22:31 <gnumonic> I guess I could just use nested promoted tuples but that's like... also kind of ugly.
2021-04-07 04:23:03 × waleee-cl quits (uid373333@gateway/web/irccloud.com/x-nfsshumoaduyxswb) (Quit: Connection closed for inactivity)
2021-04-07 04:24:31 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-fmeoowlskniejelz) (Quit: Connection closed for inactivity)
2021-04-07 04:24:33 × hypercube quits (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com) (Ping timeout: 258 seconds)
2021-04-07 04:24:43 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-07 04:24:43 justanotheruser joins (justanothe@gateway/vpn/protonvpn/justanotheruser)
2021-04-07 04:27:05 × Eprom quits (~Eprom@185.169.233.10) (Remote host closed the connection)
2021-04-07 04:27:35 hypercube joins (hypercube@gateway/vpn/protonvpn/hypercube)
2021-04-07 04:31:44 paddymahoney joins (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com)
2021-04-07 04:34:24 × paddymahoney quits (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com) (Remote host closed the connection)
2021-04-07 04:41:59 molehillish joins (~molehilli@2600:8800:8d06:1800:6d47:e2d7:e78c:8f4)
2021-04-07 04:53:55 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 260 seconds)
2021-04-07 04:54:53 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-07 04:57:29 <hololeap> gnumonic: have you looked at the vinyl package?
2021-04-07 04:57:47 <hololeap> i haven't really used it but that sounds like its synopsis
2021-04-07 04:58:16 <Axman6> vinyl is good for records
2021-04-07 04:59:02 × tanuki quits (~quassel@173.168.178.1) (Ping timeout: 246 seconds)
2021-04-07 04:59:16 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds)
2021-04-07 05:00:05 <hololeap> i got lost looking at the docs, tbh, ARec vs Rec... i got lost in they type shenanigans
2021-04-07 05:00:13 Alleria joins (~textual@2603-7000-3040-0000-c5e8-81b5-bd49-f2bd.res6.spectrum.com)
2021-04-07 05:00:36 Alleria is now known as Guest36071
2021-04-07 05:03:50 <hololeap> and i still don't know what a "universe" is
2021-04-07 05:04:39 × Guest36071 quits (~textual@2603-7000-3040-0000-c5e8-81b5-bd49-f2bd.res6.spectrum.com) (Ping timeout: 260 seconds)
2021-04-07 05:05:10 <hololeap> is that anything before the final (->) at the type level?
2021-04-07 05:06:54 <hololeap> like everything inside the first level of parens: (*) -> * or (* -> *) -> * or ((* -> *) -> *) -> *
2021-04-07 05:07:52 <gnumonic> Hm. That might work. I'll have to play with it and see. I don't want kind-indexed records of values though (which is what vinyl looks like from the examples but it still might work). I need, uh, like kind-indexed records of kinds? My use case is sorta weird I think
2021-04-07 05:10:25 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-04-07 05:10:34 <gnumonic> Right now i have things like: data SomeThing :: Property1 -> Property2 -> Property3 -> Property 4 (etc) -> Type and it's suuuppeerr annoying if I find I need to add a property. And the number of SingI constraints I have to type is also cumbersome
2021-04-07 05:11:30 <gnumonic> It'd be nice to just have one composite property that contains all the other ones that I can type-level-lens into. It's not essential but I'd like my type signatures to not be twice as long as my functions :P
2021-04-07 05:12:10 tanuki joins (~quassel@173.168.178.1)
2021-04-07 05:12:26 × Kaiepi quits (~Kaiepi@47.54.252.148) (Ping timeout: 240 seconds)
2021-04-07 05:13:07 × lawt quits (~lawt@c-73-151-3-92.hsd1.ca.comcast.net) (Read error: Connection reset by peer)
2021-04-07 05:15:06 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds)
2021-04-07 05:15:12 <hololeap> gnumonic: what is a "Property"? what kind does it have?
2021-04-07 05:17:51 paddymahoney joins (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com)
2021-04-07 05:18:58 <gnumonic> Well, each of the properties has a different kind. I might as well explain the use case: I'm making an engine for a trading-card game, and the "properties" are attributes of the cards (spell/creature/etc). The point of all this is to write type-level predicates so the compiler yells at me if I try to make a card that "doesn't make sense"
2021-04-07 05:20:33 aVikingTrex joins (789a2138@120.154.33.56)
2021-04-07 05:20:55 <hololeap> can you give an example of this? this sounds like something you could do safely at a lower level
2021-04-07 05:22:24 <hololeap> i'm not sure GHC supports a list of kinds, which is what i think you would need to implement this
2021-04-07 05:22:45 × tanuki quits (~quassel@173.168.178.1) (Ping timeout: 252 seconds)
2021-04-07 05:23:02 × jj2021 quits (~JJ@072-181-126-124.res.spectrum.com) (Remote host closed the connection)
2021-04-07 05:23:20 <hololeap> so going down a level might be what you need
2021-04-07 05:26:28 <hololeap> if you're looking to tag a card with a type-level string, this is easy. data Card (n :: Symbol) where ...
2021-04-07 05:26:39 <hololeap> i'm not sure what more you would need at the type level
2021-04-07 05:27:39 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)

All times are in UTC.