Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 546 547 548 549 550 551 552 553 554 555 556 .. 18007
1,800,636 events total
2021-06-20 01:33:11 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1543:9aaf:78fa:158)
2021-06-20 01:34:33 <ski> @type uncurry (liftA2 (,))
2021-06-20 01:34:34 <lambdabot> Applicative f => (f a, f b) -> f (a, b)
2021-06-20 01:34:57 <boxscape> qrpnxz do you mean like one function that can uncurry functions with any number of arguments?
2021-06-20 01:35:06 × favonia quits (~favonia@user/favonia) (Ping timeout: 264 seconds)
2021-06-20 01:35:25 favonia joins (~favonia@user/favonia)
2021-06-20 01:35:39 <qrpnxz> yes
2021-06-20 01:35:50 <boxscape> I believe it requires a clever type class and overlapping instances
2021-06-20 01:37:12 <boxscape> (functions with a variable number of arguments generally are not well supported in Haskell)
2021-06-20 01:37:30 × xff0x quits (~xff0x@2001:1a81:5339:fe00:b030:ca5c:f625:5fbb) (Ping timeout: 264 seconds)
2021-06-20 01:37:32 <ski> @type uncurry . liftA2 . curry
2021-06-20 01:37:33 <lambdabot> Applicative f => ((a, b) -> c) -> (f a, f b) -> f c
2021-06-20 01:37:38 <ski> @type (. uncurry (liftA2 (,))) . fmap
2021-06-20 01:37:39 <lambdabot> Applicative f => ((a, b1) -> b2) -> (f a, f b1) -> f b2
2021-06-20 01:37:48 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 258 seconds)
2021-06-20 01:38:29 <ski> (all functions in Haskell take a single argument as input)
2021-06-20 01:38:46 <qrpnxz> (yes)
2021-06-20 01:38:52 xff0x joins (~xff0x@2001:1a81:5381:2000:b608:3aa5:8037:f5c5)
2021-06-20 01:40:21 <boxscape> yeah I suppose I meant that more in terms of an abstract interface
2021-06-20 01:40:39 × HotblackDesiato quits (~HotblackD@gateway/tor-sasl/hotblackdesiato) (Remote host closed the connection)
2021-06-20 01:40:53 HotblackDesiato joins (~HotblackD@gateway/tor-sasl/hotblackdesiato)
2021-06-20 01:41:30 notzmv joins (~zmv@user/notzmv)
2021-06-20 01:41:34 ski . o O ( defaulty & non-ground representations )
2021-06-20 01:43:32 <qrpnxz> reason i'm thinking about this is because i got no idea how you'd do applicatives in mainstream language.
2021-06-20 01:43:42 <qrpnxz> but maybe that's just utter lost cause lol
2021-06-20 01:45:50 <ski> if you can manipulate argument lists, you should probably be able to do it
2021-06-20 01:46:44 <ski> with a proper macro system, one could possibly use that
2021-06-20 01:47:11 × spoonm quits (spoonm@inaba.spoonm.org) (Quit: I might be back. I might not.)
2021-06-20 01:47:47 spoonm joins (~spoonm@inaba.spoonm.org)
2021-06-20 01:48:22 <qrpnxz> with a proper macro system you can do anything lol
2021-06-20 01:49:21 × spoonm quits (~spoonm@inaba.spoonm.org) (Client Quit)
2021-06-20 01:49:31 spoonm joins (spoonm@inaba.spoonm.org)
2021-06-20 01:50:42 × favonia quits (~favonia@user/favonia) (Ping timeout: 265 seconds)
2021-06-20 01:50:56 wennefer0 joins (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net)
2021-06-20 01:51:19 favonia joins (~favonia@user/favonia)
2021-06-20 01:52:58 × wennefer0 quits (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net) (Remote host closed the connection)
2021-06-20 01:53:44 wennefer0 joins (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net)
2021-06-20 01:54:24 × wennefer0 quits (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net) (Remote host closed the connection)
2021-06-20 01:56:56 <boxscape> Just run your favorite language through CPP before you compile it
2021-06-20 01:56:58 <boxscape> that's how Haskell did it
2021-06-20 01:57:40 <qrpnxz> xD
2021-06-20 01:58:16 <geekosaur> thought you wanted a proper macro system :þ
2021-06-20 01:59:34 wennefer0 joins (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net)
2021-06-20 01:59:48 <boxscape> CPP is the only macro system of which I know that it's purely functional, I'll take it
2021-06-20 02:00:06 Guest43 joins (~Guest43@pool-96-252-123-136.bstnma.fios.verizon.net)
2021-06-20 02:01:50 <qrpnxz> I don't so how, say, scheme macros would not be purely functional
2021-06-20 02:01:53 <qrpnxz> *see
2021-06-20 02:02:02 <qrpnxz> or almost any macro system
2021-06-20 02:02:34 × wennefer0 quits (~wennefer0@c-73-69-143-60.hsd1.ma.comcast.net) (Remote host closed the connection)
2021-06-20 02:02:38 <boxscape> you're probably right, but I've last used scheme 8 years ago, and haven't used any other macro system outside of CPP, so I stand by what I said about my state of knowledge :P
2021-06-20 02:03:06 <Guest43> Are programs that are defined by a bunch of functions that return ‘State ProgramState Value’ often able to be rewritten using continuation passing style where you return functions that are ‘Value -> ProgramState’?
2021-06-20 02:03:37 yd502 joins (~yd502@2409:891f:3020:22f7:fcc4:61ca:873d:3734)
2021-06-20 02:05:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-06-20 02:06:38 <ski> boxscape : `syntax-rules' ?
2021-06-20 02:06:42 ddellacosta joins (~ddellacos@86.106.121.100)
2021-06-20 02:06:53 × Axman6 quits (~Axman6@user/axman6) (Ping timeout: 256 seconds)
2021-06-20 02:07:04 <boxscape> ski I'm not sure what that's referring to
2021-06-20 02:07:22 <ski> it's the R⁵RS macro system
2021-06-20 02:07:36 <boxscape> ah. I'm not familiar with that
2021-06-20 02:07:56 <boxscape> wait
2021-06-20 02:08:08 <boxscape> I'm not familiar with the name R⁵RS
2021-06-20 02:08:18 <ski> it's not that composable, though, due to being call-by-name
2021-06-20 02:08:59 <ski> (you basically have to write non-trivial macros in CPS .. come to think of it, this also reminds me of writing server scripts in CPS)
2021-06-20 02:09:00 <boxscape> so iow `syntax-rules' is Scheme's macro system?
2021-06-20 02:09:39 <ski> Revised Revised Revised Revised Revised Report on the algorithmic language Scheme
2021-06-20 02:09:59 <boxscape> a very principled approach to nomenclature
2021-06-20 02:10:00 hmmmas joins (~chenqisu1@183.217.200.246)
2021-06-20 02:10:11 <ski> it's one Scheme macro system. the one that's standardized in R⁵RS
2021-06-20 02:10:15 <boxscape> I see
2021-06-20 02:10:16 <ski> there's various others, too
2021-06-20 02:10:26 <boxscape> I don't know which one I learned when I took the FP course in Uni
2021-06-20 02:11:11 <ski> `syntax-case',explicit renaming,syntactic closures,`defmacro' (low-level, unhygienic)
2021-06-20 02:11:26 ski probably forgets some
2021-06-20 02:11:32 × ddellacosta quits (~ddellacos@86.106.121.100) (Ping timeout: 258 seconds)
2021-06-20 02:13:06 <boxscape> defmacro sounds most familiar to me, I think
2021-06-20 02:13:22 <ski> it comes from the other Lisps
2021-06-20 02:13:22 × Ariakenom quits (~Ariakenom@2001:9b1:efb:fc00:8d64:c14b:88a:5ff6) (Quit: Leaving)
2021-06-20 02:13:28 <boxscape> I see
2021-06-20 02:13:47 <ski> the other Scheme macro systems support hygiene, though
2021-06-20 02:14:04 <ski> (which is basically lexical/static scoping, for macros)
2021-06-20 02:14:20 <boxscape> right, okay
2021-06-20 02:15:21 × yd502 quits (~yd502@2409:891f:3020:22f7:fcc4:61ca:873d:3734) (Ping timeout: 265 seconds)
2021-06-20 02:15:54 × favonia quits (~favonia@user/favonia) (Ping timeout: 264 seconds)
2021-06-20 02:17:28 elf_fortrez joins (~elf_fortr@adsl-64-237-239-58.prtc.net)
2021-06-20 02:17:46 favonia joins (~favonia@user/favonia)
2021-06-20 02:17:48 × beka quits (~beka@104.193.170-244.PUBLIC.monkeybrains.net) (Ping timeout: 265 seconds)
2021-06-20 02:18:11 <ski> (there's two parts of hygiene. (a) an identifier introduced by a macro shouldn't shadow a variable of the same name, in some user-supplied expression that's spliced into the macro expansion. (b) an identifier that's referred to by the macto body (the part that the macro expands to) should refer to what that identifier means, in the macro-definition scope, not what it might refer to at the macro invokation
2021-06-20 02:18:17 <ski> site)
2021-06-20 02:18:45 <ski> ((a) can generally be fixed by using `gensym' (although it's easy to forget to use it, so it's errorprone). (b) can't)
2021-06-20 02:18:49 <boxscape> got it
2021-06-20 02:19:01 <boxscape> ok
2021-06-20 02:19:20 <qrpnxz> RnRS is the Revised^n Report on the algorithmic language Scheme aka just Scheme, idk why ski is being so unclear
2021-06-20 02:19:32 <qrpnxz> syntax-rules is the name of a form you use to define macros
2021-06-20 02:19:39 × egoist quits (~egoist@186.235.85.100) (Quit: WeeChat 3.1)
2021-06-20 02:20:00 <boxscape> okay
2021-06-20 02:20:59 <ski> well, boxscape asked about R⁵RS, not RⁿRS ..
2021-06-20 02:21:35 <qrpnxz> just replace n
2021-06-20 02:21:49 <ski> `define-syntax' defines the macro. `syntax-rules' (or some other alternative form) is used to specify the macro
2021-06-20 02:22:02 <qrpnxz> yes
2021-06-20 02:22:15 <boxscape> what is the difference between definition and specification

All times are in UTC.