Logs: freenode/#haskell
| 2020-11-17 22:37:07 | <monochrom> | You already know the name "Pat" so you can easily look up how many dozens of data constructors it has. |
| 2020-11-17 22:38:09 | <zephyz> | Geez thanks I guess I'll just keep reading undocumented TH source, thanks |
| 2020-11-17 22:38:39 | <monochrom> | I never read the source. I have only seen the doc. |
| 2020-11-17 22:39:26 | <zephyz> | it's literally the same, there is no documentation about how to use it, just constructors https://hackage.haskell.org/package/template-haskell-2.16.0.0/docs/Language-Haskell-TH.html#t:Pat |
| 2020-11-17 22:39:42 | <monochrom> | Language.Haskell.TH.Syntax |
| 2020-11-17 22:39:48 | <zephyz> | but now I see what you mean, "TupP" can have multple names |
| 2020-11-17 22:40:16 | <monochrom> | I trust that you know you can start with https://hackage.haskell.org/package/template-haskell-2.16.0.0/ |
| 2020-11-17 22:40:50 | <monochrom> | Alternatively, if you say "hoogle didn't tell me any other URL", well then that's why I never use hoogle either. |
| 2020-11-17 22:41:32 | <zephyz> | great thanks, but if someone's gonna tell me "just read the docs" I'd rather not ask at all |
| 2020-11-17 22:43:19 | <monochrom> | Damn right. |
| 2020-11-17 22:43:35 | × | Ariakenom quits (~Ariakenom@h-98-128-229-104.NA.cust.bahnhof.se) (Quit: Leaving) |
| 2020-11-17 22:43:43 | <monochrom> | If a question is already answered by the docs, I would rather no one ask it at all. |
| 2020-11-17 22:43:45 | × | spatchkaa quits (~spatchkaa@S010600fc8da47b63.gv.shawcable.net) (Ping timeout: 240 seconds) |
| 2020-11-17 22:44:38 | × | m4lvin quits (~m4lvin@w4eg.de) (Quit: m4lvin) |
| 2020-11-17 22:44:47 | → | Deide joins (~Deide@217.155.19.23) |
| 2020-11-17 22:44:59 | → | m4lvin joins (~m4lvin@w4eg.de) |
| 2020-11-17 22:45:37 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 272 seconds) |
| 2020-11-17 22:46:36 | <zephyz> | are you braindead? how can you expect every beginner to have read every single piece of haskell code in the universe before they ask a question? Especially when the documentation you talk about is literaly just type signatures with no indication on how to use them |
| 2020-11-17 22:48:40 | <_deepfire> | Given 'type Fallible = Either Foo'; how could it be that: Couldn't match expected type ‘Either Foo Blah’ with actual type ‘Fallible Blah’ ? |
| 2020-11-17 22:49:16 | × | Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 240 seconds) |
| 2020-11-17 22:49:40 | <monochrom> | Could you post some self-contained code that reproduces that? |
| 2020-11-17 22:50:15 | <_deepfire> | Not easily, unfortunately.. that'd take some time to work through. |
| 2020-11-17 22:50:22 | <Axman6> | I assume, without looking at the definitions, that the type for patterns contains a list, which implies it could have zero to infinite sub patterns, which include variables |
| 2020-11-17 22:51:16 | <_deepfire> | In any case, it's already reassuring that this isn't supposed to be normal behavior -- I was thinking I'm going mad.. |
| 2020-11-17 22:51:34 | <monochrom> | Then the explanation lies elsewhere. |
| 2020-11-17 22:55:21 | <Axman6> | zephyz: to be honest, we don't really expect a beginner to be looking at template haskell at all, since to understand it requires understanding Haskell quite well. Looking at the docs for Pat, it looks like the docs do a great job explaining what the type is and represents |
| 2020-11-17 22:57:29 | <zephyz> | Axman6 Cool thanks |
| 2020-11-17 22:58:27 | × | __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving) |
| 2020-11-17 23:01:37 | <unclechu> | it is still impossible in GHC to use higher-order type families? i mean that i can’t use partially applied type family as an argument for another type family |
| 2020-11-17 23:02:32 | <dolio> | I don't think you should expect to be able to do that. |
| 2020-11-17 23:04:03 | <monochrom> | _deepfire: Maybe do you have a name clash of two distinct "Foo"s hanging around? |
| 2020-11-17 23:04:31 | <unclechu> | dolio: why not? |
| 2020-11-17 23:04:51 | <unclechu> | it would be extremely useful and straightforward |
| 2020-11-17 23:05:19 | × | cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Remote host closed the connection) |
| 2020-11-17 23:05:41 | → | cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) |
| 2020-11-17 23:05:41 | <unclechu> | i could reduce amount of type families a lot by using “polymorphic” type famillies |
| 2020-11-17 23:05:47 | <dolio> | Because type families are definition by recursive matching on types, and type families are not generators the kind of types. |
| 2020-11-17 23:05:52 | → | inkbottle joins (~inkbottle@aaubervilliers-654-1-104-55.w86-212.abo.wanadoo.fr) |
| 2020-11-17 23:06:17 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-89-20.w86-212.abo.wanadoo.fr) (Ping timeout: 265 seconds) |
| 2020-11-17 23:07:44 | <unclechu> | dolio: maybe then i should expect instead to have an another way to define “type-level functions”? |
| 2020-11-17 23:08:18 | <unclechu> | or maybe i should expect dependent types implementation in GHC so this ability would be delivered with it? |
| 2020-11-17 23:09:32 | <unclechu> | does it makes sense? i’m probably not the only one who wants to define type-level `fmap` |
| 2020-11-17 23:09:36 | × | nuncanada quits (~dude@179.235.160.168) (Read error: Connection reset by peer) |
| 2020-11-17 23:09:50 | <_deepfire> | monochrom: no, it turns out that 'cabal clean' fixed it.. |
| 2020-11-17 23:10:13 | <monochrom> | Hrm that's a strange one indeed. |
| 2020-11-17 23:10:24 | <dolio> | Term-level functions don't allow this, either. You can't write definitions by higher-order matching against arbitrary other functions. |
| 2020-11-17 23:10:47 | <_deepfire> | I'm using a bit old cabal 3.0, so that might explain the occasional roughness.. |
| 2020-11-17 23:11:20 | <monochrom> | Standard tech support drone script: 1. have you saved? 2. have you cabal cleaned? 3. have you tried rebooting? 4. have you read the docs? |
| 2020-11-17 23:11:25 | <unclechu> | dolio: but i’m not trying to do any matching, i just use variables to use them as functions |
| 2020-11-17 23:12:40 | <unclechu> | dolio: i can reformulate my question as: is it still impossible in GHC to define `fmap`/`map` in type-level? |
| 2020-11-17 23:14:23 | <_deepfire> | monochrom: yeah.. : -) |
| 2020-11-17 23:15:31 | × | cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Remote host closed the connection) |
| 2020-11-17 23:15:51 | → | cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) |
| 2020-11-17 23:19:41 | → | servo joins (~servo@41.92.32.131) |
| 2020-11-17 23:21:28 | <dolio> | Oh, I see what you mean. I'm not sure if they're attempting to deliver that before all the dependent type stuff. |
| 2020-11-17 23:22:24 | → | conal joins (~conal@64.71.133.70) |
| 2020-11-17 23:25:09 | <monochrom> | I haven't checked whether map is definable or not. I worry more about possible use sites. At the use sites, you cannot have type-level lambda, you cannot have partially applied Haskell 2010 type aliases (so nevermind type families), so your map is not going to enjoy much desired use. |
| 2020-11-17 23:32:42 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2020-11-17 23:34:39 | <dolio> | I guess I would check if LiberalTypeSynonyms works, but I would guess it won't. |
| 2020-11-17 23:34:55 | <dolio> | I mean, it works, but not for that, I assume. |
| 2020-11-17 23:36:06 | → | nuncanada joins (~dude@179.235.160.168) |
| 2020-11-17 23:36:42 | ← | iqubic parts (~user@2601:602:9500:4870:3952:b8cb:aec4:a935) ("ERC (IRC client for Emacs 28.0.50)") |
| 2020-11-17 23:37:03 | <dolio> | Of course, it couldn't possibly work except for concrete lists. |
| 2020-11-17 23:39:13 | × | DavidEichmann quits (~david@62.110.198.146.dyn.plus.net) (Ping timeout: 264 seconds) |
| 2020-11-17 23:41:06 | <dolio> | I would also guess they aren't trying to provide this before whatever dependent type plan goes through, because with the current type checker, you'd probably be guaranteed to have to use a bunch of explicit type annotations on anything that used this. |
| 2020-11-17 23:41:15 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-11-17 23:41:56 | <dolio> | Type applications, even. |
| 2020-11-17 23:42:22 | <dolio> | But maybe I'm wrong about that. |
| 2020-11-17 23:45:27 | → | xerox__ joins (~xerox@unaffiliated/xerox) |
| 2020-11-17 23:45:38 | × | nineonine quits (~textual@50.216.62.2) (Read error: Connection reset by peer) |
| 2020-11-17 23:46:01 | <unclechu> | monochrom: actually you can have partially applied type family if it’s kind is `Constraint` if i’m not mistaken |
| 2020-11-17 23:46:46 | → | wroathe_ joins (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) |
| 2020-11-17 23:47:03 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds) |
| 2020-11-17 23:47:19 | <dolio> | I'd be surprised. |
| 2020-11-17 23:48:20 | × | xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 256 seconds) |
| 2020-11-17 23:48:39 | wroathe_ | is now known as wroathe |
| 2020-11-17 23:48:46 | xerox__ | is now known as xerox_ |
| 2020-11-17 23:49:49 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-11-17 23:50:35 | <unclechu> | maybe i’m mixing up something in my memory. i just remember some conclusion i made from long ago |
| 2020-11-17 23:51:28 | → | Sonderblade joins (~helloman@94.191.137.65.mobile.tre.se) |
| 2020-11-17 23:52:02 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 2020-11-17 23:54:54 | × | Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.) |
| 2020-11-17 23:55:14 | <Axman6> | there's a trick where you define a class which has other classes as superclasses, and have a single instance, is that what you're talking about? |
| 2020-11-17 23:55:16 | <unclechu> | hmm... maybe i mean type-classes back then, not type families |
| 2020-11-17 23:55:25 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2020-11-17 23:55:30 | <unclechu> | > f :: (a ~ MonadReader Int, m ~ b IO) => Proxy m -> String; f Proxy = mempty |
| 2020-11-17 23:55:32 | <lambdabot> | <hint>:1:58: error: <hint>:1:58: error: parse error on input ‘;’ |
| 2020-11-17 23:55:43 | <unclechu> | > f :: (a ~ MonadReader Int, m ~ b IO) => Proxy m -> String |
| 2020-11-17 23:55:44 | <lambdabot> | error: |
| 2020-11-17 23:55:44 | <lambdabot> | • Could not deduce (FromExpr [Char]) arising from a use of ‘f’ |
| 2020-11-17 23:55:44 | <lambdabot> | from the context: (a ~ MonadReader Int, m ~ b1 IO) |
| 2020-11-17 23:55:45 | <Axman6> | class (Foo a, Bar a) => Baz a; instance (Foo a, Bar a) => Baz a |
| 2020-11-17 23:56:02 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-17 23:56:46 | <unclechu> | > f :: (a ~ MonadReader Int, m ~ a IO) => Proxy m -> String |
| 2020-11-17 23:56:48 | <lambdabot> | error: |
| 2020-11-17 23:56:48 | <lambdabot> | • Could not deduce (FromExpr [Char]) arising from a use of ‘f’ |
| 2020-11-17 23:56:48 | <lambdabot> | from the context: (a ~ MonadReader Int, m ~ a IO) |
| 2020-11-17 23:56:59 | <unclechu> | anyway, that works in ghci |
| 2020-11-17 23:58:01 | hackage | predicate-typed 0.7.4.4 - Predicates, Refinement types and Dsl https://hackage.haskell.org/package/predicate-typed-0.7.4.4 (gbwey) |
| 2020-11-17 23:59:14 | <unclechu> | Axman6: i was talking about type families explicitly. what i want is if i have a `type family (x :: a) :: b` i want to make `type family (x :: [a]) :: [b]` of it without adding a new type family |
All times are in UTC.