Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 367 368 369 370 371 372 373 374 375 376 377 .. 17994
1,799,308 events total
2021-06-09 17:30:13 <ski> knu : i was just about to ask if your issue was resolved
2021-06-09 17:30:26 <zzz> imagine i have some type T = TA Bool | TB Bool and i want to have a list [T] where all T values alternate between True and False. Is there a way I can express this constraint at the type level?
2021-06-09 17:30:26 Morrow joins (~Morrow@31.154.96.164)
2021-06-09 17:30:35 <maerwald> monochrom: yeah, there are multiple ways to interpret this
2021-06-09 17:30:40 <knu> ski: not perfectly, but it's the best solution until now
2021-06-09 17:30:43 <ski> okay
2021-06-09 17:30:53 <knu> it still claims to export a lot of patterns
2021-06-09 17:30:57 <ski> zzz : not alternate between `TA' and `TB', then ?
2021-06-09 17:31:11 <knu> but I can import them at least without using a pragma
2021-06-09 17:31:22 <zzz> ski: no, so [TA True, TA False, TA True...] would be valid
2021-06-09 17:31:50 <knu> and it doesn't spam the documentation with every instance
2021-06-09 17:31:55 <ski> zzz : how about only storing the initial `Bool', and then a list of `TA's/`TB's, with no `Bool's in them ?
2021-06-09 17:32:22 <monochrom> I realize that I don't know what to make of: haha :: IO (); haha = do { x <- getLine; print (head x) }
2021-06-09 17:32:47 <ski> possibly partial
2021-06-09 17:32:56 <monochrom> Firstly it is not a function. Secondly it is not bottom of IO(). But it still bottoms out.
2021-06-09 17:32:58 <maerwald> Maybe Partial => IO ()
2021-06-09 17:33:41 <ski> partial on some executions. just like `head' is partial, for some calls to it
2021-06-09 17:33:52 <monochrom> At which point my usual reaction is "these are useless dichotomies: bottom vs non-bottom, function vs non-function value, partial vs total"
2021-06-09 17:34:05 <maerwald> everything is a...?
2021-06-09 17:34:35 <ski> do we need another word for a "dichotomy" which is not decidable, but only observable / semi-decidable ?
2021-06-09 17:34:58 <monochrom> No.
2021-06-09 17:35:22 <monochrom> Some undecidable dichotomies are still useful.
2021-06-09 17:35:26 <ski> knu : btw, i wonder whether `module C (module A,Foo (Zonk)) where ...' would work, too
2021-06-09 17:35:50 <monochrom> At least, useful for stating useful undecidable problems? haha
2021-06-09 17:36:40 <maerwald> Anyway, HasCallStack seems much less controversial, but some consider this will have negative effect on... teaching
2021-06-09 17:38:12 <monochrom> This is because HasCallStack is not nagware but IsPartial is.
2021-06-09 17:40:04 <monochrom> But I may like to hear how HasCallStack can be negative for teaching.
2021-06-09 17:41:10 <monochrom> "module C(Foo(Zonk))" should be just fine, but I haven't tested.
2021-06-09 17:41:12 chomwitt joins (~Pitsikoko@athedsl-20549.home.otenet.gr)
2021-06-09 17:41:32 <maerwald> monochrom: https://mail.haskell.org/pipermail/libraries/2021-June/031281.html
2021-06-09 17:41:35 <maerwald> there are the arguments
2021-06-09 17:41:57 <monochrom> I am just reading https://downloads.haskell.org/~ghc/8.10.5/docs/html/users_guide/glasgow_exts.html#import-and-export
2021-06-09 17:42:23 <monochrom> Thanks maerwald
2021-06-09 17:42:33 <knu> ski: just checked, importing works fine, but haddock now lists Foo with every instance, not only Zonk. At least, there is nothing about patterns.
2021-06-09 17:43:42 × Morrow quits (~Morrow@31.154.96.164) (Ping timeout: 252 seconds)
2021-06-09 17:44:04 <ski> knu : "now lists Foo with every instance, not only Zonk" -- is that preferrable ?
2021-06-09 17:44:34 <knu> for my case no
2021-06-09 17:44:40 <tomsmeding> delYsid: Sorry to see you having trouble with the paste site! I see I apparently forgot to send a content-type of text/html (that's now fixed). Are there other specific things that don't work for you?
2021-06-09 17:45:04 Bartosz joins (~textual@24.35.90.211)
2021-06-09 17:45:08 <knu> there a lot of instances, so it should only list importable instances
2021-06-09 17:45:33 <tomsmeding> incidentally, for the cases where I use a text-mode browser, I use elinks rather than lynx because it has better support for various web constructs, but I don't know what works for you
2021-06-09 17:47:15 danidiaz1 joins (~ESDPC@static-35-0-85-188.ipcom.comunitel.net)
2021-06-09 17:47:24 <monochrom> I ditched lynx for elinks too.
2021-06-09 17:47:41 jmcarthur joins (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2021-06-09 17:47:44 <monochrom> lynx makes you remember hotkeys. elinks offers a browsable menu.
2021-06-09 17:48:08 <tomsmeding> also, the line numbers table on my paste site works in elinks whereas it doesn't in lynx :p
2021-06-09 17:48:55 <monochrom> The problem with hotkeys is the long tail. There are a lot of hotkeys you use infrequently enough that you will never remember, but still frequent enough that you still actually need.
2021-06-09 17:49:26 sqrt2 joins (~ben@tunnel330957-pt.tunnel.tserv6.fra1.ipv6.he.net)
2021-06-09 17:49:35 <monochrom> The only merit of lynx is first-to-market, as usual.
2021-06-09 17:49:38 Izem joins (~Izem@bras-base-london1483w-grc-38-65-95-41-91.dsl.bell.ca)
2021-06-09 17:49:50 × danidiaz quits (~ESDPC@static-35-0-85-188.ipcom.comunitel.net) (Ping timeout: 244 seconds)
2021-06-09 17:49:53 <monochrom> and stronger propaganda.
2021-06-09 17:49:55 <Izem> what are type annotations in Haskell, expressions?
2021-06-09 17:50:05 <Rembane_> Izem: No, they are type annotations.
2021-06-09 17:50:14 × jmcarthur quits (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2021-06-09 17:50:17 <monochrom> type expressions >:)
2021-06-09 17:50:36 <monochrom> "everything is an expression"
2021-06-09 17:50:48 <Izem> ok, I suppose they are just newline delimited also?
2021-06-09 17:50:55 <tomsmeding> except the things that aren't :p
2021-06-09 17:51:11 <monochrom> yes until you find out about semicolon
2021-06-09 17:51:18 <boxscape> I'd say depending on whether they're inline type annotations or type annotations belonging to a declaration, they can be part of an expression or part of a declaration. But they are not these things by themselves
2021-06-09 17:51:19 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
2021-06-09 17:51:24 × pera quits (~pera@user/pera) (Ping timeout: 252 seconds)
2021-06-09 17:52:05 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-06-09 17:52:13 <Izem> haskell doesn't seem use semi colon insertion
2021-06-09 17:52:13 <monochrom> I agree with boxscape.
2021-06-09 17:52:25 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 244 seconds)
2021-06-09 17:52:26 <Izem> so I guess they are just used in specific places
2021-06-09 17:53:19 <boxscape> Izem semicolons and braces can be used optionally instead of newlines and indentation
2021-06-09 17:53:20 <boxscape> % let {semicolon = ";"; colon = ":"} in do {print semicolon; print colon}
2021-06-09 17:53:20 <yahb> boxscape: ";"; ":"
2021-06-09 17:54:13 <Izem> impressive
2021-06-09 17:54:27 <ski> Izem : type signatures are one thing, type ascriptions another
2021-06-09 17:54:56 <Izem> the former is for functions, the later for simple variables?
2021-06-09 17:55:05 <ski> no
2021-06-09 17:55:23 <ski> undefinedBool :: Bool
2021-06-09 17:55:29 <ski> undefinedBool = undefined :: Bool
2021-06-09 17:55:52 <Izem> ok
2021-06-09 17:56:00 <Izem> that looks like a type declaration
2021-06-09 17:56:02 <ski> the first line is a type signature. the expression (body of the definition, after the `=') on the second line is a type ascription
2021-06-09 17:56:23 <Izem> have not seen anyone use the word ascription :P
2021-06-09 17:56:40 <boxscape> (I haven't, either)
2021-06-09 17:57:05 <ski> data Bool = False | True -- this is a data type declaration (and definition)
2021-06-09 17:57:09 <boxscape> the haskell report uses type signature for it
2021-06-09 17:57:23 <boxscape> ("expression type signature", to be precise)
2021-06-09 17:57:48 <Izem> why did they need a data keyword to distinguish?
2021-06-09 17:58:02 <ski> it's also possible (with extension), to put an ascription on a pattern
2021-06-09 17:58:15 <ski> idBool (b :: Bool) = b
2021-06-09 17:58:26 <ski> or, inside `do' :
2021-06-09 17:58:36 <ski> b :: Bool <- readLn
2021-06-09 17:58:49 <ski> or in a lambda expression
2021-06-09 17:59:00 <ski> \ (b :: Bool) -> ..b..
2021-06-09 17:59:03 <boxscape> % True = False
2021-06-09 17:59:03 <yahb> boxscape:
2021-06-09 17:59:04 <boxscape> hm
2021-06-09 17:59:06 × Bartosz quits (~textual@24.35.90.211) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-06-09 17:59:11 <boxscape> gonna put this at the top level of my next file
2021-06-09 17:59:44 <ski> Izem : `data' is for declaring data types. there's also `newtype' and `type', which also declares types
2021-06-09 18:00:09 Bartosz joins (~textual@24.35.90.211)
2021-06-09 18:00:31 <ski> % let !True = False

All times are in UTC.