Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,802,991 events total
2021-07-18 21:11:12 <Hecate> % decimal "3"
2021-07-18 21:11:13 <yahb> Hecate: ; <interactive>:223:1: error:; Ambiguous occurrence `decimal'; It could refer to; either `Data.Text.Read.decimal', imported from `Data.Text.Read'; or `Numeric.Lens.decimal', imported from `Numeric.Lens'
2021-07-18 21:11:20 <Hecate> fair enough
2021-07-18 21:11:20 <Hecate> so
2021-07-18 21:11:25 × oso quits (~oso@2601:58c:c080:a950:e67d:b4e2:c5be:433f) (Ping timeout: 246 seconds)
2021-07-18 21:11:30 <monochrom> fib :: Int -> Int -> Int -> Int -> Int let wingman guess what I want!
2021-07-18 21:11:32 <Hecate> Data.Text.Read.decimal "3"
2021-07-18 21:11:35 <Hecate> % Data.Text.Read.decimal "3"
2021-07-18 21:11:35 <yahb> Hecate: ; <interactive>:224:24: error:; * Couldn't match type `[Char]' with `Data.Text.Internal.Text'; Expected: Data.Text.Internal.Text; Actual: GHC.Base.String; * In the first argument of `Data.Text.Read.decimal', namely `"3"'; In the expression: Data.Text.Read.decimal "3"; In an equation for `it': it = Data.Text.Read.decimal "3"
2021-07-18 21:11:39 <Hecate> curse
2021-07-18 21:11:46 <Hecate> % import qualified Data.Text as T
2021-07-18 21:11:46 <yahb> Hecate:
2021-07-18 21:11:52 <Hecate> % Data.Text.Read.decimal (T.pack "3")
2021-07-18 21:11:53 <yahb> Hecate: Right (3,"")
2021-07-18 21:11:57 <Hecate> % Data.Text.Read.decimal (T.pack "3x")
2021-07-18 21:11:57 <yahb> Hecate: Right (3,"x")
2021-07-18 21:12:08 <Hecate> dexterfoo: check this ^
2021-07-18 21:13:53 <lechner> davean: how do i use . in that line, please?
2021-07-18 21:15:08 <maerwald> sometimes I wonder why I even write documentation... all it does is confuse me 2 weeks later
2021-07-18 21:15:39 <maerwald> "I tried to figure out what this does, but didn't manage. But I wrote down my crippled thought regardless"
2021-07-18 21:15:45 <dexterfoo> Hecate: thanks!
2021-07-18 21:16:28 <Hecate> maerwald: because you don't know how to talk to yourself yet :P
2021-07-18 21:16:34 <Hecate> dexterfoo: you're welcome :)
2021-07-18 21:16:40 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 246 seconds)
2021-07-18 21:16:44 <maerwald> Hecate: preciousssss
2021-07-18 21:17:48 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
2021-07-18 21:18:40 oso joins (~oso@2601:58c:c080:a950:e67d:b4e2:c5be:433f)
2021-07-18 21:20:32 <lechner> Hi, in printf "%s:%d" $ map ($ struct) [stringAccessor intAccessor] does map work only when the return types are the same?
2021-07-18 21:20:55 <lechner> actually, there is a comma in there
2021-07-18 21:21:05 <geekosaur> all elements of a list must have the same type, yes
2021-07-18 21:22:27 <lechner> thanks. i could prosumably use 'show'
2021-07-18 21:23:05 <geekosaur> that's the usual way to do it, yes
2021-07-18 21:23:14 <geekosaur> don't forget to change the %d to %s
2021-07-18 21:24:18 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-07-18 21:24:18 <lechner> at some point, that tips the scale toward putStrLn
2021-07-18 21:24:30 <geekosaur> yes
2021-07-18 21:25:05 × smtnet3 quits (~asdfasdfa@202.36.244.28) (Read error: Connection reset by peer)
2021-07-18 21:26:05 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection)
2021-07-18 21:26:17 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
2021-07-18 21:26:31 smtnet3 joins (~asdfasdfa@202.36.244.28)
2021-07-18 21:27:08 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 268 seconds)
2021-07-18 21:27:08 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 268 seconds)
2021-07-18 21:27:28 <dsal> lechner: You could make a function that does the "%s:%d" part pretty easily and NamedFieldPuns or RecordWildCards would make it fairly short.
2021-07-18 21:28:16 aegon joins (~mike@174.127.249.180)
2021-07-18 21:28:22 × mikoto-chan quits (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) (Ping timeout: 268 seconds)
2021-07-18 21:29:28 <lechner> dsal: that sounds like a great idea! let's do that in one minute please.
2021-07-18 21:30:04 <lechner> meanwhile i am learning. why doesn't that work: printf "Expecting scheduler on %s:%s.\n" $ map ($ scheduler config) [Connection.host, show . Connection.listen_port]
2021-07-18 21:31:42 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
2021-07-18 21:31:55 <lechner> the point here is the partial application of 'show'
2021-07-18 21:32:01 <[exa]> lechner: what's the error?
2021-07-18 21:32:06 × myShoggoth quits (~myShoggot@97-120-70-214.ptld.qwest.net) (Ping timeout: 255 seconds)
2021-07-18 21:32:32 <lechner> https://paste.debian.net/1204829/
2021-07-18 21:32:44 <geekosaur> I think you have multiple problems there
2021-07-18 21:33:12 <geekosaur> for one, a list is not a collection of applications
2021-07-18 21:33:16 <dsal> lechner: A list isn't two arguments.
2021-07-18 21:33:26 <dsal> Or phrased how geekosaur said it.
2021-07-18 21:33:55 <[exa]> lechner: why still keep printf? (just curious)
2021-07-18 21:34:19 <lechner> just chewing on other things :)
2021-07-18 21:34:54 <lechner> [exa]: i am not so fond of ++ "[" ++ exa ++ "]" ++ ....
2021-07-18 21:35:14 <geekosaur> there is concat
2021-07-18 21:35:15 <oso> `concat`?
2021-07-18 21:35:43 <dsal> I don't use ++ in general, but I do use fold for logging.
2021-07-18 21:36:04 <monochrom> $ kills printf type inference. Seriously. Just don't use $.
2021-07-18 21:36:05 royo joins (~royo@user/royo)
2021-07-18 21:36:42 <[exa]> lechner: `concat [all, this, stuff]` is a widely used pattern. Esp good when combined with `intercalate`
2021-07-18 21:37:01 <lechner> monochrom: for some reason it seemed i needed $
2021-07-18 21:37:37 ph88^ joins (~ph88@2a02:8109:9e00:7e5c:f938:d06a:9ad7:b39c)
2021-07-18 21:37:40 <dsal> lechner: does it work with $ ?
2021-07-18 21:37:43 <monochrom> Sure, "map ($ x) [f, g, h]" has just cause. I am referring to "printf fmt $ ..."
2021-07-18 21:37:57 <lechner> okay, i'll change that but why is my partial application wrong. could someone please restate?
2021-07-18 21:37:57 <dsal> :t ($)
2021-07-18 21:37:58 <lambdabot> (a -> b) -> a -> b
2021-07-18 21:38:17 <geekosaur> lechner, you are attempting to use a list as two applications
2021-07-18 21:38:17 <lechner> monochrom: i meant that one
2021-07-18 21:38:25 <[exa]> lechner: the partial application is right (at least so it seems to me), the problem is that you're giving printf 1 argument and specify 2 in format
2021-07-18 21:38:37 <dsal> lechner: If it doesn't work, then it's not fair to say that you needed it.
2021-07-18 21:38:43 <geekosaur> one list is one application, not two
2021-07-18 21:39:17 <dsal> > (+) $ 1 $ 2
2021-07-18 21:39:18 <lambdabot> error:
2021-07-18 21:39:18 <lambdabot> • Could not deduce (Num t0)
2021-07-18 21:39:18 <lambdabot> from the context: (Num a, Num t, Num (t -> a))
2021-07-18 21:39:55 <dsal> $ isn't a syntactic feature. It's just a function. And it will break your applications if effective arity is > 1
2021-07-18 21:40:01 <lechner> [exa]: https://paste.debian.net/1204830/
2021-07-18 21:40:35 × slack1256 quits (~slack1256@191.125.28.13) (Remote host closed the connection)
2021-07-18 21:40:39 pavonia joins (~user@user/siracusa)
2021-07-18 21:40:44 <[exa]> dsal: you'd need -XChurchNumerals
2021-07-18 21:40:48 <dsal> You might try breaking that into different statements to understand it better.
2021-07-18 21:41:16 <geekosaur> lechner, contemplate this:
2021-07-18 21:41:25 <geekosaur> > (+) [1,2]
2021-07-18 21:41:27 <lambdabot> error:
2021-07-18 21:41:27 <lambdabot> • No instance for (Num [Integer]) arising from a use of ‘e_112’
2021-07-18 21:41:27 <lambdabot> • In the expression: e_112
2021-07-18 21:41:43 <geekosaur> hm, (+) is not the best example there
2021-07-18 21:41:54 <monochrom> (&&) [False, False]
2021-07-18 21:41:57 <[exa]> lechner: yeah there printf uses `map` as the first argument, likely not very printable
2021-07-18 21:41:57 <geekosaur> > (++) ["a","b"]
2021-07-18 21:42:00 <lambdabot> <[[Char]] -> [[Char]]>
2021-07-18 21:42:03 <lechner> geekosaur: isn't that here four applications? https://salsa.debian.org/lintian/kickoff/-/blob/master/Collect.hs#L68
2021-07-18 21:42:40 <lechner> [exa]: yeah, that part i get now
2021-07-18 21:42:40 <monochrom> one single list.

All times are in UTC.