2025/03/17

Newest at the top

2025-03-17 19:07:42 +0100ft(~ft@p508db291.dip0.t-ipconnect.de) ft
2025-03-17 19:07:34 +0100pavonia(~user@user/siracusa) siracusa
2025-03-17 19:04:26 +0100Square(~Square4@user/square) (Ping timeout: 272 seconds)
2025-03-17 19:00:35 +0100Square2(~Square@user/square) Square
2025-03-17 18:56:43 +0100 <EvanR> that discriminates functions and macros
2025-03-17 18:56:12 +0100 <EvanR> alternative bindings ok
2025-03-17 18:53:46 +0100 <ski> with macros, you can implement your own variable-binding constructs (such as a `case', e.g. .. there's a Scheme library for this). sometimes, you can just pass a lambda abstraction instead. but sometimes you want a more exotic binding structure, which isn't easily captured in such a way (e.g. the paralell composition in list comprehensions, or the `proc' syntax for Arrows)
2025-03-17 18:53:45 +0100Googulator(~Googulato@2a01-036d-0106-4b74-b88c-ff83-9891-e272.pool6.digikabel.hu)
2025-03-17 18:53:27 +0100Googulator(~Googulato@2a01-036d-0106-4b74-b88c-ff83-9891-e272.pool6.digikabel.hu) (Quit: Client closed)
2025-03-17 18:52:06 +0100 <ski> EvanR : why isn't list comprehensions a function ? why isn't `case' a function ?
2025-03-17 18:50:27 +0100tccq(~user@user/tccq) tccq
2025-03-17 18:49:16 +0100Leary(~Leary@user/Leary/x-0910699) Leary
2025-03-17 18:47:32 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 244 seconds)
2025-03-17 18:46:15 +0100chele(~chele@user/chele) (Remote host closed the connection)
2025-03-17 18:45:50 +0100 <c_wraith> (and if you want your loop body or conditions to involve a macro, they won't work)
2025-03-17 18:45:44 +0100 <EvanR> why isn't the looping macro not a macro but a function
2025-03-17 18:44:56 +0100 <c_wraith> and remember that you can't use higher-order functions because macros aren't functions.
2025-03-17 18:43:51 +0100 <ski> the clauses in list comprehensions (generators, guards, "parallel" vs. sequential composition), in Haskell, form a small looping DSL
2025-03-17 18:43:08 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-03-17 18:42:27 +0100 <ski> (as opposed to explicitly spelling out your recursions, which (in case of tail recursion at least), amount to the same as programming with `goto's, apart from that you can pass parameters)
2025-03-17 18:41:32 +0100 <ski> a macro for, more composably, doing loops, yes, EvanR
2025-03-17 18:40:26 +0100 <ski> (the "types" here would be the "contexts"/"syntactic categories", like "expression","type","pattern","loop clause",&c.)
2025-03-17 18:39:34 +0100skiwould like to have typed macros, to be able to have them by-value, rather than by-name (being able to introduce macros for sub-languages implemented by DSL macros, without having to explicitly make your DSL macros integrate with these macro definitions)
2025-03-17 18:38:55 +0100 <EvanR> is a loop macro... a macro for doing loops
2025-03-17 18:37:29 +0100 <ski> this is also related to list comprehensions (e.g. <https://srfi.schemers.org/srfi-42/srfi-42.html>), or the (do)/2 construct in ECLiPSe Prolog <https://eclipseclp.org/doc/tutorial/tutorial025.html>,<https://eclipseclp.org/doc/userman/umsroot023.html>, or enumerators / internal iteration vs. cursors / external iteration <https://okmij.org/ftp/papers/LL3-collections-enumerators.txt>
2025-03-17 18:37:04 +0100 <ski> "Yow! LOOP macros are LOOPY!" by foof in 2006-09-06 at <https://groups.google.com/g/comp.lang.scheme/c/DLkZdLw1qGw> is also relevant. (foof is the author of a similar, but not quite identical, looping macro package, named `loopy-loop' <https://wiki.call-cc.org/eggref/4/loopy-loop>, as opposed to `foof-loop' by Riastradh <https://wiki.call-cc.org/eggref/4/loopy-loop>)
2025-03-17 18:35:52 +0100 <mauke> and there's streaming and lenses involved
2025-03-17 18:35:47 +0100 <haskellbridge> <Liamzee> i spent an hour (and it's my fault) trying to figure out why a HTML sample in Lucid2 was angering GHC
2025-03-17 18:35:22 +0100 <mauke> now imagine print (2 + 2), but instead of adding numbers, it fetches data over HTTP (path and parameters specified at the type level), which is implicitly decoded as CSV, whose format is again specified at the type level
2025-03-17 18:35:07 +0100 <haskellbridge> <Liamzee> iirc now custom type error messages are a thing, but i think part of. the problem with that is that it's hard to anticipate what type errors will result and figure out how to write the error messages for them are
2025-03-17 18:33:53 +0100 <mauke> no one writes (print :: Integer -> IO ()) (((+) :: Integer -> Integer -> Integer) (2 :: Integer) (2 :: Integer) :: Integer) :: IO ()
2025-03-17 18:33:05 +0100ash3en(~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de) (Client Quit)
2025-03-17 18:32:56 +0100 <EvanR> invisible types?
2025-03-17 18:32:20 +0100 <mauke> it's also pretty bad if half of your code is fairly generic functions and all the semantics are at the (invisible) type level
2025-03-17 18:31:54 +0100ash3en(~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de) ash3en
2025-03-17 18:31:13 +0100 <c_wraith> see https://hackage.haskell.org/package/BASIC
2025-03-17 18:29:59 +0100 <c_wraith> the worst abuses in Haskell are when everything is in a lawless class that happens to work magically until you edit something and then inference fails
2025-03-17 18:29:26 +0100 <haskellbridge> <Liamzee> but then again, I'm a pointfree addict, so I have no right to talk
2025-03-17 18:29:16 +0100 <c_wraith> types at least provide some context.
2025-03-17 18:29:14 +0100lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 268 seconds)
2025-03-17 18:28:22 +0100 <haskellbridge> <Liamzee> %s/FP/typed FP
2025-03-17 18:27:49 +0100 <haskellbridge> <Liamzee> it's not my criticism, it's just something I picked up from HN; and looking at some older and poorer Haskell codebases, Haskell can suffer from eDSL disease. The important thing is to know it exists and actively attempt to avoid it, and it's easier to do with FP than with more powerful, untyped macros
2025-03-17 18:27:41 +0100 <EvanR> or maybe the DSLs that appear are just saner
2025-03-17 18:26:03 +0100 <EvanR> do DSLs in haskell avoid Liamzee's criticism because there's a common point of contact usually, the idiomatic haskell types
2025-03-17 18:24:19 +0100 <c_wraith> oh. because it's two links and I'm trying to paste both at once
2025-03-17 18:24:07 +0100 <mauke> (do ((list list (cdr list)) ö_ö
2025-03-17 18:23:54 +0100 <c_wraith> ski: that first link seems to be a 404
2025-03-17 18:23:48 +0100 <EvanR> c_wraith, I can sympathize with equivocating between the choice of function call or macro call, because it seems to achieve the same purpose, and even after all this time I don't instantly see all the differences xD
2025-03-17 18:23:16 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 272 seconds)
2025-03-17 18:22:32 +0100 <ski> `foof-loop' is much more "Lispy", than the `loop' in Common Lisp, which could be argued to be "anti-Lispy"