Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 923 924 925 926 927 928 929 930 931 932 933 .. 18028
1,802,701 events total
2021-07-12 22:00:27 <geekosaur> think of it as type level undefined, maybe?
2021-07-12 22:00:40 <boxscape> it is bad if you want to have a consistent type theory
2021-07-12 22:01:05 <boxscape> (haskell's type system isn't consistent in more than one way)
2021-07-12 22:01:20 <monochrom> Haskell is not for arguing.
2021-07-12 22:01:21 <boxscape> s/isn't consistent/is inconsistent
2021-07-12 22:01:50 <monochrom> Unpopular opinion: It is the stance "use Haskell for proofs" that is inconsistent.
2021-07-12 22:02:20 × mikoto-chan quits (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) (Ping timeout: 256 seconds)
2021-07-12 22:02:48 <maralorn> monochrom: +1
2021-07-12 22:03:35 <chisui> Well I tried to create a category implementation `data Phantom k (a :: k) (b :: k) = Phantom` and `type Empty = Phantom Void`
2021-07-12 22:03:54 <maralorn> I have been confused and slightly insecure about the Haskell typesystem for years because people kept saying it is inconsistent.
2021-07-12 22:04:04 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-07-12 22:04:37 <monochrom> The Haskell term system, type system, and kind system are very much consistent.
2021-07-12 22:05:02 <monochrom> You do lose a few axioms you would expect from other logics, yes.
2021-07-12 22:05:03 <chisui> monochrom: if you allow bottom?
2021-07-12 22:05:21 <Hecate> 👀
2021-07-12 22:07:40 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-07-12 22:07:44 <monochrom> You should still feel insecure that you can still make a mistake of non-termination in Haskell, yes.
2021-07-12 22:08:10 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
2021-07-12 22:08:47 <monochrom> But looking at how C programmers don't really feel insecure with even less safety nets, I would say "take it easy".
2021-07-12 22:08:57 × rostero quits (uid236576@id-236576.tooting.irccloud.com) (Quit: Connection closed for inactivity)
2021-07-12 22:10:08 × oxide quits (~lambda@user/oxide) (Quit: oxide)
2021-07-12 22:10:36 <chisui> Well I like type systems where you can't write `unsafeCoerce`
2021-07-12 22:10:40 <monochrom> My opinion on ensuring termination and doing so ergonomically is still with: don't do it with types, do it with an extra static analysis tool.
2021-07-12 22:11:37 <monochrom> I can change my opinion when I see an ergonomic dependently typed language. I don't think Agda etc have achieved it.
2021-07-12 22:13:43 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b)
2021-07-12 22:13:46 alx741 joins (~alx741@186.178.108.22)
2021-07-12 22:14:13 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b) (Remote host closed the connection)
2021-07-12 22:14:22 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b)
2021-07-12 22:18:03 sheepduck joins (~sheepduck@user/sheepduck)
2021-07-12 22:18:21 <chisui> monochrom: You are completely right. Nevertheless I was stumped by this. I mean GHC even warned my that this would be an issue.
2021-07-12 22:18:33 × o1lo01ol1o quits (~o1lo01ol1@bl7-89-228.dsl.telepac.pt) (Remote host closed the connection)
2021-07-12 22:18:47 hololeap joins (~hololeap@user/hololeap)
2021-07-12 22:22:44 × Atum_ quits (IRC@user/atum/x-2392232) (Quit: Atum_)
2021-07-12 22:23:36 × hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection)
2021-07-12 22:24:04 hololeap joins (~hololeap@user/hololeap)
2021-07-12 22:24:11 × dudek quits (~dudek@185.150.236.155) (Quit: Leaving)
2021-07-12 22:25:23 <maralorn> chisui: I am not convinced that unsafeCoerce is even a property of the typesystem.
2021-07-12 22:27:13 <geekosaur> I see it as a property of the language to evade the typesystem
2021-07-12 22:29:46 <boxscape> Well, if your typesystem is logically inconsistent (like haskell's), that means it allows you to construct a function of type `forall a b . a -> b`, at least. Though whether it allows you to construct a function that behaves like unsafeCoerce is a different matter
2021-07-12 22:33:46 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
2021-07-12 22:33:55 × dfg quits (dfg@2600:3c00::f03c:92ff:feb4:be75) (Changing host)
2021-07-12 22:33:55 dfg joins (dfg@user/dfg)
2021-07-12 22:34:37 chomwitt joins (~Pitsikoko@2a02:587:dc04:e00:12c3:7bff:fe6d:d374)
2021-07-12 22:38:15 × zeenk quits (~zeenk@2a02:2f04:a106:9600:82fb:aed9:ca9:38d3) (Quit: Konversation terminated!)
2021-07-12 22:40:05 warnz joins (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452)
2021-07-12 22:41:58 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
2021-07-12 22:43:24 × wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-07-12 22:43:47 × chisui quits (~chisui@200116b8667bfd006d48966f94785d9f.dip.versatel-1u1.de) (Quit: Client closed)
2021-07-12 22:44:06 × son0p quits (~ff@181.136.122.143) (Remote host closed the connection)
2021-07-12 22:44:30 × Core8687 quits (~Core8687@2804:14c:8793:8e2f:c580:1df5:d4d4:84b3) (Ping timeout: 272 seconds)
2021-07-12 22:44:33 × warnz quits (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) (Ping timeout: 255 seconds)
2021-07-12 22:46:05 <monochrom> @quote monochrom unsafeCoerce
2021-07-12 22:46:05 <lambdabot> monochrom says: isTrue = (unsafeCoerce :: Either a b -> Bool) . (unsafeCoerce :: Maybe c -> Either a b) . (unsafeCoerce :: Bool -> Maybe c)
2021-07-12 22:47:04 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: Lost terminal)
2021-07-12 22:47:16 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-07-12 22:52:39 <Guest25> how efficient is Foreign.Storable.peek? like say I have a Ptr Int and need the value multiple times, should I call (peek ptr) each time or store the value as a Haskell Int on the first call?
2021-07-12 22:52:56 <Guest25> (doing some FFI stuff or I wouldn't be dealing with Ptrs manually)
2021-07-12 22:54:18 <geekosaur> reasonably efficient but it'll still do the peek each time instead of optimizing it down via CSE. then again if this matters to performance you're arguably making a mistake somewhere else
2021-07-12 22:55:47 <Guest25> cool thanks!
2021-07-12 22:55:52 <Guest25> and yeah, it probably won't matter
2021-07-12 22:56:58 <hololeap> with optparse-applicative, I want to use a specific configuration if no options are passed to the command line. how can I do this?
2021-07-12 22:58:27 <monochrom> I think I specified default values for every option.
2021-07-12 22:58:57 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 255 seconds)
2021-07-12 22:59:27 <hpc> it's also Alternative, so maybe you can have options <|> defaultOptions
2021-07-12 23:01:23 <hololeap> hpc, that's what I was thinking but I haven't used the library enough to have an intuition for how it works
2021-07-12 23:03:04 <hpc> it's pretty much like any other parser's Alternative, but you don't have to worry about using try to not consume input
2021-07-12 23:04:39 <monochrom> https://github.com/treblacy/random-read/blob/eb89d291e687b72269c30d2a2903cd26cf8f6f73/random-read.hs is how I did it with every option having "<> value mydefaultforthis"
2021-07-12 23:04:46 phaazon joins (~phaazon@2001:41d0:a:fe76::1)
2021-07-12 23:04:57 <hololeap> so, when does it fail (in the Alternative sense)? when options are given out-of-order? when they are not given?
2021-07-12 23:05:48 <hpc> whenever the parser would error out normally
2021-07-12 23:05:57 <hpc> if the program would bail out with help text, instead try this other parser
2021-07-12 23:06:18 <hololeap> hm, it sounds like I'll just have to play around with it until I build an intuition for it
2021-07-12 23:07:23 <geekosaur> sounds to me like it would work best if there's otherwise at least one required option
2021-07-12 23:08:34 <hpc> yeah, but if the program would do the right thing in that case problem solved :D
2021-07-12 23:08:50 <hpc> who even needs the alternate parser at that point
2021-07-12 23:09:43 <hpc> hololeap: if it helps, normally the Alternative instance is so you can do things like "foo --create --name=foo" vs "foo --delete --id=12345"
2021-07-12 23:10:57 <hpc> data FooAction = Create String | Delete Int | Version | Help | etc etc
2021-07-12 23:11:22 jakalx joins (~jakalx@base.jakalx.net)
2021-07-12 23:18:25 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b) (Remote host closed the connection)
2021-07-12 23:19:08 × caubert quits (~caubert@136.244.111.235) (Quit: WeeChat 3.1)
2021-07-12 23:19:20 caubert joins (~caubert@136.244.111.235)
2021-07-12 23:19:58 × acidjnk quits (~acidjnk@p200300d0c72b95096d4cdcac61b6b349.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
2021-07-12 23:22:03 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 276 seconds)
2021-07-12 23:25:16 o1lo01ol1o joins (~o1lo01ol1@bl7-89-228.dsl.telepac.pt)
2021-07-12 23:25:37 cjb joins (~cjb@user/cjb)
2021-07-12 23:27:53 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
2021-07-12 23:29:33 × amahl quits (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) (Ping timeout: 255 seconds)
2021-07-12 23:29:36 × o1lo01ol1o quits (~o1lo01ol1@bl7-89-228.dsl.telepac.pt) (Ping timeout: 256 seconds)
2021-07-12 23:32:49 zmt01 joins (~zmt00@user/zmt00)
2021-07-12 23:35:16 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 256 seconds)
2021-07-12 23:39:00 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 255 seconds)
2021-07-12 23:40:01 dre_ joins (~dre@2001:8003:c932:c301:44a6:1427:4d7d:b99a)
2021-07-12 23:42:04 Raugh joins (~mike@174.127.249.180)
2021-07-12 23:42:52 dre_ is now known as dre
2021-07-12 23:43:08 <Raugh> I'm trying to use Database.PostgreSQL.Simple with queries read from a file but I can't figure out how to go from [Char] to Query. The docs say to use overloaded strings and construct the Queries in place but I'm reading them from a file
2021-07-12 23:48:23 <geekosaur> https://hackage.haskell.org/package/postgresql-simple-0.6.4/docs/src/Database.PostgreSQL.Simple.Types.html#line-90
2021-07-12 23:48:30 <geekosaur> evil hack, but.
2021-07-12 23:48:45 <Axman6> @hoodle IsString
2021-07-12 23:48:45 <lambdabot> Data.String class IsString a
2021-07-12 23:48:45 <lambdabot> GHC.Exts class IsString a

All times are in UTC.