2022/09/25

2022-09-25 00:01:38 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 00:02:00 +0200vorpuni(~pvorp@2001:861:3881:c690:488:11ee:612d:7b91) (Remote host closed the connection)
2022-09-25 00:06:04 +0200pera(~pera@user/pera) (Ping timeout: 265 seconds)
2022-09-25 00:06:52 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 244 seconds)
2022-09-25 00:08:26 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 260 seconds)
2022-09-25 00:09:48 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 00:20:28 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 00:22:26 +0200nate3(~nate@98.45.169.16) (Ping timeout: 260 seconds)
2022-09-25 00:25:19 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com)
2022-09-25 00:25:20 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
2022-09-25 00:25:20 +0200wroathe(~wroathe@user/wroathe)
2022-09-25 00:25:25 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 265 seconds)
2022-09-25 00:31:57 +0200 <EvanR> if I have a set of (Name, Either Name Value) where names have a literal value or forward to another name for their value (transitively), is there a slick way to solve all the values or fail due to a cycle
2022-09-25 00:32:20 +0200 <EvanR> or is this full graph algorithm
2022-09-25 00:33:46 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 246 seconds)
2022-09-25 00:33:51 +0200 <monochrom> If you just need to do a name lookup and report either "I've found the value" or "I've found a cycle", it doesn't need to be a full graph algorithm.
2022-09-25 00:34:08 +0200 <EvanR> well that replicated for each name would solve it
2022-09-25 00:34:54 +0200 <monochrom> See https://en.wikipedia.org/wiki/Cycle_detection for some algorithms for detecting "eventually periodic" without much space.
2022-09-25 00:35:17 +0200 <monochrom> Floyd's or Brent's.
2022-09-25 00:35:21 +0200 <david> Let's say I have a list of Maybe that I want to process, how do I return a Maybe processedList?
2022-09-25 00:35:33 +0200 <david> ie how to change [Maybe a] into a Maybe [a] ?
2022-09-25 00:35:34 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com)
2022-09-25 00:35:34 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
2022-09-25 00:35:35 +0200wroathe(~wroathe@user/wroathe)
2022-09-25 00:36:06 +0200 <geekosaur> % :t sequenceA @Maybe
2022-09-25 00:36:06 +0200 <yahb2> sequenceA @Maybe :: Applicative f => Maybe (f a) -> f (Maybe a)
2022-09-25 00:36:09 +0200 <david> ie how to change [a] into a Maybe [b] given you have a function that has type (a -> Maybe b)
2022-09-25 00:36:21 +0200 <geekosaur> % :t sequenceA @[] @Maybe
2022-09-25 00:36:21 +0200 <yahb2> sequenceA @[] @Maybe :: [Maybe a] -> Maybe [a]
2022-09-25 00:36:37 +0200 <david> thanhks
2022-09-25 00:36:52 +0200 <geekosaur> (you don't have to use the @s, just showing you it can do what you want)
2022-09-25 00:36:59 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 00:37:17 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-09-25 00:37:27 +0200 <david> is there something more generic?
2022-09-25 00:38:27 +0200 <david> ok it just work thank you
2022-09-25 00:38:41 +0200 <monochrom> EvanR: Oh! You did ask about doing all names in one go. Yeah then a full graph algorithm is better.
2022-09-25 00:39:40 +0200 <monochrom> Some modification of Floyd-Warshall or any all-pairs-shortest-paths algorithm will do. https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
2022-09-25 00:39:44 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 00:39:52 +0200 <geekosaur> sequenceA is pretty generic already
2022-09-25 00:40:20 +0200 <geekosaur> alkthough it does occur to me to wonder if it does the right thing the first time it hits a Nothing. there's also asum…
2022-09-25 00:40:26 +0200 <geekosaur> :t asum
2022-09-25 00:40:27 +0200 <lambdabot> (Foldable t, Alternative f) => t (f a) -> f a
2022-09-25 00:40:35 +0200 <EvanR> yeah I was thinking this is a matrix inverse or something
2022-09-25 00:40:36 +0200 <geekosaur> :t asum @[] @Maybe
2022-09-25 00:40:37 +0200 <lambdabot> error:
2022-09-25 00:40:37 +0200 <lambdabot> Pattern syntax in expression context: asum@[]
2022-09-25 00:40:37 +0200 <lambdabot> Did you mean to enable TypeApplications?
2022-09-25 00:40:43 +0200 <geekosaur> % :t asum @[] @Maybe
2022-09-25 00:40:44 +0200 <yahb2> <interactive>:1:1: error: ; • Variable not in scope: asum ; • Perhaps you meant ‘sum’ (imported from Prelude)
2022-09-25 00:40:46 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 246 seconds)
2022-09-25 00:40:49 +0200 <geekosaur> bah
2022-09-25 00:41:03 +0200 <david> thanks geekosaur At that point it doesn't matter I should start buliding automatisms and learn on this
2022-09-25 00:42:19 +0200 <geekosaur> % :t Control.Applicative.asum @[] @Maybe
2022-09-25 00:42:19 +0200 <yahb2> <interactive>:1:1: error: ; Not in scope: ‘Control.Applicative.asum’ ; Perhaps you meant ‘Control.Applicative.liftA2’ (imported from Control.Applicative)
2022-09-25 00:43:55 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 246 seconds)
2022-09-25 00:45:19 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-25 00:45:42 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2022-09-25 00:51:24 +0200chomwitt(~chomwitt@2a02:587:dc14:f500:27b7:f613:f2be:f46f) (Ping timeout: 264 seconds)
2022-09-25 00:52:28 +0200 <david> what should I write to enable TypeSynonymInstances
2022-09-25 00:52:42 +0200 <david> {#- GHC TypeSynonymInstances -#} ?
2022-09-25 00:53:20 +0200 <monochrom> s/GHC/language/
2022-09-25 00:53:37 +0200 <monochrom> And flip #-
2022-09-25 00:53:47 +0200 <jackdk> % :t Data.Foldable.asum @[] @Maybe -- geekosaur
2022-09-25 00:53:47 +0200 <yahb2> Data.Foldable.asum @[] @Maybe -- geekosaur :: [Maybe a] -> Maybe a
2022-09-25 00:53:47 +0200 <monochrom> {-# language TypeSynonymInstances #-}
2022-09-25 00:54:17 +0200 <geekosaur> wrong one, whoops
2022-09-25 00:56:28 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 00:58:03 +0200 <janus> % asum []
2022-09-25 00:58:03 +0200 <yahb2> <interactive>:110:1: error: ; • Variable not in scope: asum :: [a0] -> t ; • Perhaps you meant ‘sum’ (imported from Prelude)
2022-09-25 00:58:10 +0200 <janus> % Data.Foldable.asum []
2022-09-25 00:58:10 +0200 <yahb2> *** Exception: user error (mzero)
2022-09-25 00:58:14 +0200 <janus> why is this partial?
2022-09-25 00:58:26 +0200 <david> I still have some issue
2022-09-25 00:58:56 +0200 <david> http://vpaste.net/3svlE
2022-09-25 00:59:13 +0200 <janus> oooh it's mzero of IO
2022-09-25 00:59:58 +0200 <EvanR> how about some fear uncertainty and doubt that IO is a valid MonadPlus
2022-09-25 01:00:00 +0200sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-09-25 01:00:08 +0200 <janus> % Data.Foldable.asum [] :: [Int]
2022-09-25 01:00:08 +0200 <yahb2> []
2022-09-25 01:01:02 +0200 <janus> almost want to know why there is MonadPlus IO.. but i don't ;P
2022-09-25 01:01:36 +0200sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-09-25 01:02:09 +0200 <monochrom> Galactic wars have been fought over that. :)
2022-09-25 01:05:38 +0200nate3(~nate@98.45.169.16)
2022-09-25 01:09:36 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-25 01:10:03 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 01:10:10 +0200jgeerds_(~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 246 seconds)
2022-09-25 01:12:05 +0200nate3(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2022-09-25 01:12:43 +0200edrx(~Eduardo@2804:18:582f:9eb3:fe75:6517:93df:a9ea)
2022-09-25 01:15:35 +0200david(~david@2a01:e34:ec2b:d430:44a:f5ca:9867:d69d) (Ping timeout: 244 seconds)
2022-09-25 01:17:21 +0200 <edrx> hi all! two questions... 1) what are your favorite "free" Haskell tutorials? I am following Hutton's book, but I can't put links to the PDF that I have in the online version of my notes about it... and 2) is this the standard list of tutorials? https://wiki.haskell.org/Tutorials
2022-09-25 01:17:23 +0200redmp(~redmp@mobile-166-171-249-155.mycingular.net)
2022-09-25 01:17:31 +0200redmp(~redmp@mobile-166-171-249-155.mycingular.net) (Client Quit)
2022-09-25 01:17:54 +0200jero98772(~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff)
2022-09-25 01:20:41 +0200Lycurgus(~juan@user/Lycurgus)
2022-09-25 01:26:33 +0200 <geekosaur> @where learn
2022-09-25 01:26:33 +0200 <lambdabot> https://wiki.haskell.org/Learning_Haskell
2022-09-25 01:26:40 +0200 <geekosaur> hm, not the one I wanted
2022-09-25 01:27:11 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 01:27:17 +0200 <geekosaur> @where books
2022-09-25 01:27:18 +0200 <lambdabot> See `LYAH',`RWH',`YAHT',`SOE',`HR',`PIH',`TFwH',`wikibook',`PCPH',`HPFFP',`FSAF',`HftVB',`HTAC',`TwT',`FoP',`PFAD',`WYAH',`non-haskell-books'. Also https://www.extrema.is/articles/haskell-books,
2022-09-25 01:27:18 +0200 <lambdabot> https://www.vex.net/~trebla/haskell/learn-sources
2022-09-25 01:27:53 +0200 <ski> @where CIS194
2022-09-25 01:27:53 +0200 <lambdabot> https://www.seas.upenn.edu/~cis194/spring13/lectures.html
2022-09-25 01:28:36 +0200 <ski> edrx : we sometimes suggest this one ^, especially since it has excersices (unlike say LYAH)
2022-09-25 01:29:03 +0200 <edrx> thanks! =)
2022-09-25 01:30:31 +0200 <monochrom> My favourite free tutorial is the Gentle Introduction.
2022-09-25 01:32:21 +0200 <EvanR> that's what I was going to say
2022-09-25 01:34:16 +0200 <ski> @where tutorial
2022-09-25 01:34:17 +0200 <lambdabot> http://www.haskell.org/tutorial/
2022-09-25 01:35:11 +0200 <ski> that's the "Gentle" one (hint, some people don't consider it so "gentle". it assumes some basic familiarity with FP (like e.g. SML,OCaml,Erlang,Scheme))
2022-09-25 01:35:27 +0200 <ski> @where Data61
2022-09-25 01:35:27 +0200 <lambdabot> Data61 Functional Programming Course <https://github.com/data61/fp-course>,<https://qfpl.io/links/2017-october-fp-course/> by Tony Morris,Mark Hibberd. Also see the channel #qfpl
2022-09-25 01:35:40 +0200 <ski> is a more advanced one (than CIS194)
2022-09-25 01:35:57 +0200 <edrx> it's one of the first ones that I've downloaded =) now I'm trying to understand the makefile in https://www.haskell.org/tutorial/haskell-98-tutorial-sources.tar.gz to see how to compile the .lhs files...
2022-09-25 01:36:37 +0200 <ski> it's also pretty old, so some things may have to be changed, especially if there's library imports (i don't recall, off-hand)
2022-09-25 01:36:46 +0200 <edrx> yes, I guessed so
2022-09-25 01:37:14 +0200 <ski> @where wikibook
2022-09-25 01:37:15 +0200 <lambdabot> http://en.wikibooks.org/wiki/Haskell
2022-09-25 01:37:22 +0200 <ski> @where HTAC
2022-09-25 01:37:22 +0200 <lambdabot> "Haskell Tutorial and Cookbook" by Mark Watson in 2017-09-04 at <https://leanpub.com/haskell-cookbook>
2022-09-25 01:37:24 +0200Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt juan@acm.org)
2022-09-25 01:37:33 +0200 <ski> (from the `books' list above)
2022-09-25 01:38:17 +0200Tuplanolla(~Tuplanoll@91-159-69-34.elisa-laajakaista.fi) (Quit: Leaving.)
2022-09-25 01:38:44 +0200 <ski> then there's some monad tutorials. (<https://wiki.haskell.org/Monad_tutorials_timeline> has a bunch of links)
2022-09-25 01:40:02 +0200 <edrx> aha
2022-09-25 01:41:11 +0200 <ski> my favorite (also somewhat dated, in terms of library operations) might be "What the hell are Monads?" by Noel Winstanley in 1999-02 at <https://www-users.mat.umk.pl/~fly/materialy/fp/haskell-doc/Monads.html>
2022-09-25 01:41:54 +0200 <ski> there's a lot of monad tutorials out there, and i'd say most of them probably ranges from not too informative to misleading and bad
2022-09-25 01:41:58 +0200 <ski> @where burrito
2022-09-25 01:41:59 +0200 <lambdabot> http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/
2022-09-25 01:42:04 +0200 <ski> talks some about why
2022-09-25 01:43:01 +0200 <monochrom> People love misinformative monad tutorials when they have eye candies.
2022-09-25 01:43:12 +0200 <ski> as for some tutorials that cover a bit more than that Winstanley one (which might be the first non-paper general monad tutorial out there) :
2022-09-25 01:43:35 +0200 <ski> @where AAM
2022-09-25 01:43:35 +0200 <lambdabot> http://www.haskell.org/haskellwiki/All_About_Monads
2022-09-25 01:43:40 +0200 <ski> @where MTSS
2022-09-25 01:43:40 +0200 <lambdabot> "Monad Transformers Step by Step" by Martin Grabmüller in 2006-10-16 (draft) at <https://page.mi.fu-berlin.de/scravy/realworldhaskell/materialien/monad-transformers-step-by-step.pdf>
2022-09-25 01:43:43 +0200 <ski> also see
2022-09-25 01:43:50 +0200 <ski> @where Typeclassopedia
2022-09-25 01:43:50 +0200 <lambdabot> http://www.haskell.org/haskellwiki/Typeclassopedia
2022-09-25 01:43:52 +0200 <monochrom> People do not want an objective measure of understanding or truth. People want a subjective feeling of comfort.
2022-09-25 01:43:59 +0200 <ski> which also covers `Functor' and `Applicative'
2022-09-25 01:44:14 +0200nate3(~nate@98.45.169.16)
2022-09-25 01:44:25 +0200 <monochrom> Now, on the other end of the spectrum, there are pedants who oppose the name "flatMap".
2022-09-25 01:44:55 +0200ski. o O ( ".. and in the darkness bind them" )
2022-09-25 01:45:07 +0200 <monochrom> They need to know that Bart Jacabs in his draft probability theory book uses the name "flat" for join.
2022-09-25 01:45:44 +0200skiwas just reading/skimming the first chapter of that book, the other day .. nice book, ty for the link
2022-09-25 01:45:51 +0200 <monochrom> :)
2022-09-25 01:45:51 +0200 <EvanR> if monads can "flat" does that mean comonads "curve"
2022-09-25 01:46:12 +0200 <monochrom> No. Instead, "level up" >:)
2022-09-25 01:46:13 +0200 <geekosaur> "popup" 🙂
2022-09-25 01:46:14 +0200skisuggested `scaffold :: w a -> w (w a)'
2022-09-25 01:46:30 +0200 <c_wraith> unflatMap
2022-09-25 01:46:30 +0200 <ski> (not sure how good that is, but imho it's certainly better than `duplicate' ..)
2022-09-25 01:46:51 +0200 <EvanR> cool names
2022-09-25 01:48:08 +0200 <ski> (`duplicate' suggests `w -> (w,w)', to me, a `Comonoid' operation .. possibly in another category (e.g. Kleisli), if you want, to avoid triviality)
2022-09-25 01:48:55 +0200 <monochrom> unsafeDupableIO :: IO a -> IO (IO a)
2022-09-25 01:49:02 +0200mvk(~mvk@2607:fea8:5ce3:8500::778c)
2022-09-25 01:50:25 +0200beteigeuze(~Thunderbi@89.187.168.45) (Ping timeout: 246 seconds)
2022-09-25 01:51:03 +0200 <monochrom> class EndOfMainSequenceComonad m where gravitationalCollapse :: m a -> a; supernova :: m a -> m (m a)
2022-09-25 01:51:15 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 01:52:03 +0200 <geekosaur> that implies a black hole is m (m (… (m a…)
2022-09-25 01:52:16 +0200edrx(~Eduardo@2804:18:582f:9eb3:fe75:6517:93df:a9ea) (Ping timeout: 260 seconds)
2022-09-25 01:53:16 +0200 <monochrom> gravity : singularity :: types : occurs-check infinite type >:)
2022-09-25 01:53:26 +0200 <EvanR> that looks like a collapsing neutron star inside an einstein rosen bridge!
2022-09-25 01:53:53 +0200 <monochrom> negative types, fraction types, and astrophysics types :)
2022-09-25 01:54:07 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 268 seconds)
2022-09-25 01:58:01 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-09-25 02:03:49 +0200 <mniip> extend is a cool name
2022-09-25 02:07:45 +0200ski. o O ( `unsafeObserveRepresentation :: a -> Representation a' )
2022-09-25 02:08:16 +0200 <ski> "extend" is how i read `(=<<)' out, aloud
2022-09-25 02:09:03 +0200 <ski> ("monadic extension". pretty sure several monad papers uses that term for it)
2022-09-25 02:10:21 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 244 seconds)
2022-09-25 02:13:44 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 02:13:55 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597)
2022-09-25 02:16:18 +0200edrx(~Eduardo@2804:56c:d2dc:ac00:dab8:211d:d4eb:fa94)
2022-09-25 02:16:20 +0200notzmv(~zmv@user/notzmv)
2022-09-25 02:17:52 +0200edrx(~Eduardo@2804:56c:d2dc:ac00:dab8:211d:d4eb:fa94) (Remote host closed the connection)
2022-09-25 02:18:28 +0200edrx(~Eduardo@2804:56c:d2dc:ac00:dab8:211d:d4eb:fa94)
2022-09-25 02:18:41 +0200 <edrx> hi! sorry, I had to go offline...
2022-09-25 02:19:47 +0200 <edrx> do you have favorite ways - and possibly links to favorite ascii diagrams - of/for drawing Kleisli categories and monad operations?
2022-09-25 02:21:03 +0200 <monochrom> An ascii equation is worth a thousand ascii diagrams.
2022-09-25 02:22:03 +0200 <monochrom> Ironically some ascii equations can be even more efficiently expressed in ascii words, e.g., ">=> is associative and has an identity".
2022-09-25 02:22:31 +0200 <edrx> true
2022-09-25 02:22:49 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 02:22:58 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 246 seconds)
2022-09-25 02:23:21 +0200 <monochrom> An ascii equation is worth a thousand ascii diagrams. An ascii diagram is worth a thousand ascii words. An ascii word is worth a thousand ascii equations. The cycle is complete.
2022-09-25 02:23:55 +0200 <monochrom> Or rather, s/cycle/gravitational collapse singularity/
2022-09-25 02:24:17 +0200 <edrx> I work with diagrammatic languages, and I have ways to draw that Yoneda Lemma and Kan extensions that I am quite happy with... link: http://angg.twu.net/LATEX/2022on-the-missing.pdf#page=45
2022-09-25 02:25:12 +0200 <ski> "Monads, a Field Guide" by dpiponi in 2006-10-21 at <http://blog.sigfpe.com/2006/10/monads-field-guide.html> has some suggestive diagrams
2022-09-25 02:25:28 +0200 <edrx> but what I have for Kleisli categories still feel very preliminary... I was reading the source code of the prelude earlier today and it has some diagrams
2022-09-25 02:25:55 +0200 <monochrom> But no one can do those diagrams in ascii.
2022-09-25 02:26:19 +0200 <monochrom> Unless you appeal to the Turing-ascii tarpit: Every PDF can be base64-encoded to ascii.
2022-09-25 02:26:20 +0200 <ski> which reminds me that i probably also should have mentioned dpiponi's "You Could Have Invented Monads! (And Maybe You Already Have)" in 2006-08-07 at <http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html> before
2022-09-25 02:27:17 +0200 <edrx> ^ that's very good =)
2022-09-25 02:27:27 +0200 <EvanR> encode pdf in base64, display encoded data with a nice monospacefont (PDF), repeat
2022-09-25 02:27:41 +0200 <ski> together with the non-tutorial quick overview/taste "Escaping Hell with Monads" by Philip Nilsson in 2017-05-08 at <https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/>
2022-09-25 02:27:42 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 265 seconds)
2022-09-25 02:28:14 +0200 <monochrom> Escape hell but get trapped in monads.
2022-09-25 02:29:39 +0200 <ski> edrx : anyway, to tackle monads, you should first understand higher-order functions, parameterized data types, type classes. also, monads seem to best be tackled by first seeing a bunch of particular specific examples of monads (and what kind of boiler-plate code using them will allow you to abstract away), rather than trying to first understand monads in the abstract (a common mistake)
2022-09-25 02:30:26 +0200 <ski> oh, and you should probably have seen `Functor' before `Monad' .. and probably `Applicative' as well, at least nowadays that it's a superclass of `Monad'. Typeclassopedia does introduce these
2022-09-25 02:31:25 +0200 <EvanR> is that Continuation Monad to solve callback hell... actually Cont monad? or just some free monad
2022-09-25 02:31:38 +0200 <ski> there are also some particular diagrams for monads, like the "traintrack pictures for `Either
2022-09-25 02:31:41 +0200 <EvanR> or just IO
2022-09-25 02:31:46 +0200 <ski> e '/`Maybe'
2022-09-25 02:31:54 +0200 <edrx> I learned monads in Category Theory first, ages ago... then a few months ago, with some ideas from this video - http://www.youtube.com/watch?v=ZhuHCtR3xq8 Brian Beckman: Don't fear the Monad
2022-09-25 02:32:27 +0200 <ski> and there's also some data-flow diagrams for `State s' .. iirc, some of the original monad papers had some of those (?)
2022-09-25 02:33:00 +0200 <edrx> I was finally able to translate between the categorical operations and the ones that Haskell uses
2022-09-25 02:33:18 +0200 <monochrom> Cont or ContT solves callback hell, yeah. Usually ContT in practice because ContT IO because IO is involved for FFI-ing to C libraries that are heavy on callbacks.
2022-09-25 02:33:27 +0200 <ski> you could try the older Wadler papers at <https://homepages.inf.ed.ac.uk/wadler/topics/monads.html> -- Wadler papers are usually quite readable
2022-09-25 02:33:57 +0200 <monochrom> This: http://blog.sigfpe.com/2011/10/quick-and-dirty-reinversion-of-control.html
2022-09-25 02:34:40 +0200 <edrx> let me see if I can reconstruct my diagrams and asciify them
2022-09-25 02:35:19 +0200 <ski> actually, maybe the one with dataflow for state i was thinking about is "Lazy Functional State Threads" by John Launchbury,Simon L. Peyton Jones in 1994 at <https://homepages.dcc.ufmg.br/~camarao/fp/articles/lazy-state.pdf>
2022-09-25 02:36:19 +0200 <ski> (that one introduces the `ST' monad, for local state, implemented with update-in-place)
2022-09-25 02:36:39 +0200 <edrx> that one is great!!!
2022-09-25 02:36:49 +0200 <ski> you've seen it ?
2022-09-25 02:37:06 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 02:37:16 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597)
2022-09-25 02:37:43 +0200 <edrx> ski: no, first time
2022-09-25 02:38:20 +0200 <edrx> I'll try to follow its conventions
2022-09-25 02:38:23 +0200 <ski> @hackage managed
2022-09-25 02:38:23 +0200 <lambdabot> https://hackage.haskell.org/package/managed
2022-09-25 02:38:39 +0200 <ski> is `ContT IO', hidden behind a `newtype'
2022-09-25 02:38:56 +0200 <ski> (for handling callbacks)
2022-09-25 02:38:59 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 02:39:36 +0200 <monochrom> "mischief managed" :)
2022-09-25 02:39:37 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 02:39:38 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-09-25 02:39:38 +0200chexum_(~quassel@gateway/tor-sasl/chexum) (Read error: Connection reset by peer)
2022-09-25 02:39:42 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
2022-09-25 02:39:56 +0200califax(~califax@user/califx)
2022-09-25 02:40:04 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-09-25 02:40:27 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 02:40:32 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
2022-09-25 02:40:35 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-09-25 02:40:48 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-09-25 02:40:54 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-25 02:42:56 +0200 <ski> (<https://el-tramo.be/blog/async-monad/> is of a someewhat similar vein as the "Badness" one, although not as concise)
2022-09-25 02:44:00 +0200 <ski> hm .. i recall seeing a link in here about (iirc) using `sequence' on a list of `ContT o m'-actions. can't seem to find it
2022-09-25 02:45:11 +0200Me-me(~me-me@user/me-me) (Remote host closed the connection)
2022-09-25 02:45:58 +0200Me-me(~me-me@v.working.name)
2022-09-25 02:47:42 +0200 <ski> (apropos delimited continuations : <https://github.com/ghc-proposals/ghc-proposals/pull/313>,<http://tunes.org/~nef/logs/haskell/20.04.15>,<https://www.reddit.com/r/haskell/comments/f7p0qe/rfc_delimited_continuation_primops_ghc_proposal/>,<https://github.com/lexi-lambda/ghc-proposals/blob/delimited-continuation-primops/proposals/0000-de…>)
2022-09-25 02:55:43 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 02:55:51 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-09-25 02:56:51 +0200 <ski> edrx : some more links which might be interesting
2022-09-25 02:56:51 +0200 <ski> <https://github.com/tibbe/haskell-style-guide>,<https://github.com/tibbe/haskell-docs>,<https://github.com/bitemyapp/learnhaskell>,<https://github.com/bitemyapp/learnhaskell/blob/master/specific_topics.md>,<http://www.vex.net/~trebla/haskell/lazy.xhtml>,<https://apfelmus.nfshost.com/articles/lazy-eval.html>,<https://smunix.github.io/hackhands.com/guide-lazy-evaluation-haskell/index.html>
2022-09-25 02:57:08 +0200 <ski> (a few a bit opinionated)
2022-09-25 02:57:19 +0200 <ski> @tell david "ie how to change [a] into a Maybe [b] given you have a function that has type (a -> Maybe b)" -- you can also (in addition to `sequenceA,sequence :: [Maybe a] -> Maybe [a]') use `traverse,mapM :: (a -> Maybe b) -> ([a] -> Maybe b)'
2022-09-25 02:57:19 +0200 <lambdabot> Consider it noted.
2022-09-25 02:57:56 +0200 <edrx> ski: thanks =)
2022-09-25 02:58:27 +0200 <ski> (there's probably a few more which ought to be mentioned along those, but which i can't recall or find atm)
2022-09-25 03:03:41 +0200fresheyeball(~fresheyeb@c-76-25-93-164.hsd1.co.comcast.net)
2022-09-25 03:11:54 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 03:14:29 +0200TonyStone(~TonyStone@cpe-74-76-51-197.nycap.res.rr.com) (Remote host closed the connection)
2022-09-25 03:15:19 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-01cb-cda3-629f-bfc2.res6.spectrum.com)
2022-09-25 03:18:26 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 03:18:59 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
2022-09-25 03:27:22 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-25 03:32:48 +0200califax(~califax@user/califx)
2022-09-25 03:33:28 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 03:37:51 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 03:39:47 +0200geranim0(~geranim0@modemcable062.79-202-24.mc.videotron.ca)
2022-09-25 03:40:28 +0200bob(~geranim0@modemcable062.79-202-24.mc.videotron.ca)
2022-09-25 03:42:11 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 03:55:21 +0200mvk(~mvk@2607:fea8:5ce3:8500::778c) (Ping timeout: 260 seconds)
2022-09-25 04:01:24 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 04:03:03 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 04:19:49 +0200td_(~td@muedsl-82-207-238-005.citykom.de) (Ping timeout: 265 seconds)
2022-09-25 04:20:41 +0200fresheyeball(~fresheyeb@c-76-25-93-164.hsd1.co.comcast.net) (Quit: WeeChat 3.5)
2022-09-25 04:21:25 +0200td_(~td@muedsl-82-207-238-047.citykom.de)
2022-09-25 04:22:42 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2022-09-25 04:22:42 +0200finn_elija(~finn_elij@user/finn-elija/x-0085643)
2022-09-25 04:22:42 +0200finn_elijaFinnElija
2022-09-25 04:34:44 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 04:35:06 +0200c209e6dc-4d76-47(~aditya@2601:249:4300:1296:195:dac6:592c:a55a)
2022-09-25 04:39:07 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 246 seconds)
2022-09-25 04:39:29 +0200bilegeek(~bilegeek@2600:1008:b00e:f92:9f4b:938b:9188:448b)
2022-09-25 04:44:57 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 04:47:16 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 04:50:40 +0200mvk(~mvk@2607:fea8:5ce3:8500::778c)
2022-09-25 05:07:28 +0200luffy(~chenqisu1@183.217.203.170)
2022-09-25 05:10:53 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 05:11:03 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Remote host closed the connection)
2022-09-25 05:11:15 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 05:12:41 +0200 <edrx> I'm working on this, taken from the section on the state monad on Hutton's book...
2022-09-25 05:12:43 +0200 <edrx> http://angg.twu.net/HASKELL/State1.hs.html
2022-09-25 05:12:52 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 05:13:12 +0200 <EvanR> ST not to be confused with ST
2022-09-25 05:13:27 +0200 <edrx> question: I've defined fst and snd in the obvious way, and when I give this to the ghci repl - :t fst
2022-09-25 05:14:00 +0200 <edrx> it says
2022-09-25 05:14:04 +0200 <edrx> "Ambiguous occurrence `fst' It could refer to either `Prelude.fst', imported from `Prelude' at State1.hs:1:1 (and originally defined in `Data.Tuple') or `Main.fst', defined at State1.hs:37:1"
2022-09-25 05:14:14 +0200 <EvanR> confused not averted
2022-09-25 05:14:25 +0200 <EvanR> confusion* . You have two fst's in scope
2022-09-25 05:14:26 +0200 <edrx> what do I have to do to say that my definition should take precedence?
2022-09-25 05:14:34 +0200 <EvanR> import Prelude hiding (fst, snd)
2022-09-25 05:14:39 +0200dsrt^(~dsrt@173-160-76-137-atlanta.hfc.comcastbusiness.net)
2022-09-25 05:14:42 +0200 <edrx> thanks!
2022-09-25 05:14:57 +0200vglfr(~vglfr@145.224.100.190) (Read error: Connection reset by peer)
2022-09-25 05:15:09 +0200vglfr(~vglfr@145.224.100.190)
2022-09-25 05:15:16 +0200 <edrx> perfect =)
2022-09-25 05:16:43 +0200 <EvanR> now make the State type be a type variable, customizable
2022-09-25 05:17:55 +0200jero98772(~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection)
2022-09-25 05:18:48 +0200 <edrx> EvanR: that only happens in a later section
2022-09-25 05:20:23 +0200 <edrx> I'm testing the code in the book, checking the types in it by hand, and drawing box diagrams with type annotations... the next step is to draw diagrams with boxes and arrows
2022-09-25 05:20:48 +0200 <edrx> in ascii art, with much more information than the diagrams in Hutton's book
2022-09-25 05:29:46 +0200c209e6dc-4d76-47(~aditya@2601:249:4300:1296:195:dac6:592c:a55a) (Quit: Konversation terminated!)
2022-09-25 05:31:51 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 05:34:30 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 05:34:58 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 05:35:26 +0200 <EvanR> A → B "ascii art" xD
2022-09-25 05:36:03 +0200 <EvanR> → is old tech, appearing in that classic DOS codepage...
2022-09-25 05:36:31 +0200 <edrx> what do you use to typeset your diagrams?
2022-09-25 05:36:39 +0200 <EvanR> me?
2022-09-25 05:36:44 +0200 <edrx> yes
2022-09-25 05:36:47 +0200 <edrx> TikZ?
2022-09-25 05:37:36 +0200 <edrx> I was going to ask for examples of diagrams in TikZ with source code
2022-09-25 05:38:01 +0200 <edrx> but then I saw that I could leave that for another day
2022-09-25 05:39:19 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-25 05:40:24 +0200 <edrx> this looks great too: https://diagrams.github.io/doc/quickstart.html
2022-09-25 05:40:50 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Quit: ChaiTRex)
2022-09-25 05:42:56 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-09-25 05:44:30 +0200Infinite(~Infinite@106.51.13.146)
2022-09-25 05:46:54 +0200SystemVSysV
2022-09-25 05:58:50 +0200benin0(~benin@183.82.24.8)
2022-09-25 06:03:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 258 seconds)
2022-09-25 06:04:00 +0200Infinite(~Infinite@106.51.13.146) (Ping timeout: 252 seconds)
2022-09-25 06:07:14 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2022-09-25 06:08:03 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-09-25 06:10:49 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 06:15:15 +0200mvk(~mvk@2607:fea8:5ce3:8500::778c) (Ping timeout: 244 seconds)
2022-09-25 06:15:20 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 265 seconds)
2022-09-25 06:16:41 +0200dsrt^(~dsrt@173-160-76-137-atlanta.hfc.comcastbusiness.net) (Remote host closed the connection)
2022-09-25 06:17:01 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 250 seconds)
2022-09-25 06:17:19 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 06:17:52 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Quit: coot)
2022-09-25 06:21:13 +0200zmt00(~zmt00@user/zmt00) (Read error: Connection reset by peer)
2022-09-25 06:22:48 +0200zmt00(~zmt00@user/zmt00)
2022-09-25 06:26:19 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d)
2022-09-25 06:26:30 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 06:29:19 +0200bilegeek(~bilegeek@2600:1008:b00e:f92:9f4b:938b:9188:448b) (Quit: Leaving)
2022-09-25 06:30:46 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-25 06:34:16 +0200luffy(~chenqisu1@183.217.203.170) (Ping timeout: 246 seconds)
2022-09-25 06:39:05 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 06:44:31 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 06:44:37 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 06:52:56 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 06:53:27 +0200bilegeek(~bilegeek@2600:1008:b044:5e68:fad5:48ad:56ae:311c)
2022-09-25 06:56:27 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 06:56:38 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597)
2022-09-25 06:58:46 +0200bob(~geranim0@modemcable062.79-202-24.mc.videotron.ca) (Ping timeout: 246 seconds)
2022-09-25 06:58:57 +0200geranim0(~geranim0@modemcable062.79-202-24.mc.videotron.ca) (Ping timeout: 252 seconds)
2022-09-25 07:05:29 +0200Pickchea(~private@user/pickchea)
2022-09-25 07:14:45 +0200razetime(~quassel@117.193.6.133)
2022-09-25 07:26:20 +0200 <edrx> http://angg.twu.net/HASKELL/State1.hs.html
2022-09-25 07:27:15 +0200edrx(~Eduardo@2804:56c:d2dc:ac00:dab8:211d:d4eb:fa94) (Killed buffer)
2022-09-25 07:29:08 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 244 seconds)
2022-09-25 07:36:35 +0200shriekingnoise_(~shrieking@186.137.167.202)
2022-09-25 07:37:37 +0200shriekingnoise(~shrieking@186.137.167.202) (Ping timeout: 246 seconds)
2022-09-25 07:42:22 +0200`2jt(~jtomas@88.17.232.105)
2022-09-25 07:48:45 +0200gmg(~user@user/gehmehgeh)
2022-09-25 07:55:38 +0200Enrico63(~Enrico63@81.109.143.226)
2022-09-25 07:56:16 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 07:56:22 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 07:56:35 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Remote host closed the connection)
2022-09-25 07:56:47 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 08:00:58 +0200kenran(~kenran@200116b82b695400c991f380c8aeb97f.dip.versatel-1u1.de)
2022-09-25 08:02:05 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 08:02:17 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597)
2022-09-25 08:06:47 +0200mbuf(~Shakthi@49.205.83.245)
2022-09-25 08:21:31 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 08:25:58 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 08:28:28 +0200luffy(~chenqisu1@183.217.203.170)
2022-09-25 08:31:30 +0200Andrewhaxcpu
2022-09-25 08:33:01 +0200nate3(~nate@98.45.169.16) (Ping timeout: 260 seconds)
2022-09-25 08:34:32 +0200luffy(~chenqisu1@183.217.203.170) (Remote host closed the connection)
2022-09-25 08:36:13 +0200luffy(~chenqisu1@183.217.203.170)
2022-09-25 08:38:23 +0200khumba(~khumba@user/khumba) ()
2022-09-25 08:39:53 +0200arahael(~arahael@203.217.43.212) (Quit: "Downloading more RAM")
2022-09-25 08:40:00 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 08:40:00 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 08:46:16 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 08:51:03 +0200califax(~califax@user/califx)
2022-09-25 08:57:41 +0200zeenk(~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f)
2022-09-25 08:58:10 +0200nate3(~nate@98.45.169.16)
2022-09-25 09:02:40 +0200nate3(~nate@98.45.169.16) (Ping timeout: 246 seconds)
2022-09-25 09:02:44 +0200causal(~user@50.35.83.177) (Quit: WeeChat 3.6)
2022-09-25 09:06:11 +0200Pickchea(~private@user/pickchea) (Ping timeout: 252 seconds)
2022-09-25 09:07:16 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 09:08:24 +0200califax(~califax@user/califx)
2022-09-25 09:09:20 +0200`2jt(~jtomas@88.17.232.105) (Ping timeout: 265 seconds)
2022-09-25 09:09:29 +0200acidjnk_new(~acidjnk@p200300d6e7137a45b127f34fc59e5b8d.dip0.t-ipconnect.de)
2022-09-25 09:12:57 +0200`2jt(~jtomas@88.17.232.105)
2022-09-25 09:17:07 +0200nate3(~nate@98.45.169.16)
2022-09-25 09:17:19 +0200arahael(~arahael@203.217.43.212)
2022-09-25 09:20:04 +0200vorpuni(~pvorp@2001:861:3881:c690:bc6d:def:d698:14f7)
2022-09-25 09:24:31 +0200nate3(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2022-09-25 09:28:55 +0200raym(~raym@user/raym) (Ping timeout: 252 seconds)
2022-09-25 09:29:40 +0200raym(~raym@user/raym)
2022-09-25 09:43:39 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 09:45:59 +0200Tuplanolla(~Tuplanoll@91-159-69-34.elisa-laajakaista.fi)
2022-09-25 09:50:25 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 09:51:36 +0200zer0bitz_(~zer0bitz@2001:2003:f748:2000:add8:471e:b979:aa97)
2022-09-25 09:53:15 +0200chomwitt(~chomwitt@2a02:587:dc14:f500:e7c3:cde8:f4f3:a6bf)
2022-09-25 09:53:44 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Read error: Connection reset by peer)
2022-09-25 09:55:04 +0200instantaphex(~jb@c-73-171-252-84.hsd1.fl.comcast.net)
2022-09-25 09:55:40 +0200zer0bitz(~zer0bitz@2001:2003:f748:2000:6530:c280:4187:23f9) (Ping timeout: 268 seconds)
2022-09-25 09:55:59 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 09:59:22 +0200instantaphex(~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 246 seconds)
2022-09-25 10:01:46 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 10:02:10 +0200bilegeek(~bilegeek@2600:1008:b044:5e68:fad5:48ad:56ae:311c) (Quit: Leaving)
2022-09-25 10:05:56 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-09-25 10:06:04 +0200odnes(~odnes@ppp089210198232.access.hol.gr)
2022-09-25 10:08:23 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-09-25 10:08:47 +0200razetime(~quassel@117.193.6.133) (Ping timeout: 265 seconds)
2022-09-25 10:10:39 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 10:18:33 +0200odnes(~odnes@ppp089210198232.access.hol.gr) (Quit: Leaving)
2022-09-25 10:18:50 +0200odnes(~odnes@ppp089210198232.access.hol.gr)
2022-09-25 10:22:36 +0200acidjnk_new(~acidjnk@p200300d6e7137a45b127f34fc59e5b8d.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2022-09-25 10:25:00 +0200chomwitt(~chomwitt@2a02:587:dc14:f500:e7c3:cde8:f4f3:a6bf) (Ping timeout: 264 seconds)
2022-09-25 10:25:20 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Quit: Leaving)
2022-09-25 10:27:35 +0200razetime(~quassel@117.193.6.133)
2022-09-25 10:33:49 +0200luffy(~chenqisu1@183.217.203.170) (Ping timeout: 252 seconds)
2022-09-25 10:34:20 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-25 10:44:30 +0200jgeerds_(~jgeerds@55d46bad.access.ecotel.net)
2022-09-25 10:49:38 +0200 <ski> @tell edrx if you add a pragma line `{-# LANGUAGE InstanceSigs #-}' enabling that language extension, then you can write your method type signatures like `fmap :: (a -> b) -> (ST a -> ST b)' in your `instance' declarations without commenting them out. (for the infix operator `<*>' case, you will have to wrap the operator in brackets like `(<*>) :: ST (a -> b) -> (ST a -> ST b)')
2022-09-25 10:49:38 +0200 <lambdabot> Consider it noted.
2022-09-25 10:52:55 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com)
2022-09-25 10:54:46 +0200 <ski> @tell edrx it's also possible to use `fmap g (S st) = S (\s -> let .. = st s in ..)', matching on `S', rather than using `app', also for `(<*>)', and partially for `(>>=)' (unless you also use a `let' (or `case') also for the `f' call -- but that might lose (?) the tail-call, which can be important)
2022-09-25 10:54:47 +0200 <lambdabot> Consider it noted.
2022-09-25 10:55:29 +0200skiwishes there was "message-dispatching" / "copatterns" syntax in Haskell
2022-09-25 10:57:20 +0200Luj(~Luj@2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb) (Quit: The Lounge - https://thelounge.chat)
2022-09-25 10:58:24 +0200Luj(~Luj@2a01:e0a:5f9:9681:7264:29d6:8e89:14af)
2022-09-25 10:59:06 +0200waldo(~waldo@user/waldo)
2022-09-25 11:03:36 +0200kenran(~kenran@200116b82b695400c991f380c8aeb97f.dip.versatel-1u1.de) (Quit: WeeChat info:version)
2022-09-25 11:06:08 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 11:09:38 +0200david(~david@2a01:e34:ec2b:d430:44a:f5ca:9867:d69d)
2022-09-25 11:10:19 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 11:13:07 +0200jgeerds_(~jgeerds@55d46bad.access.ecotel.net) (Remote host closed the connection)
2022-09-25 11:21:20 +0200nate3(~nate@98.45.169.16)
2022-09-25 11:25:59 +0200chomwitt(~chomwitt@2a02:587:dc14:f500:7fb4:d182:20a9:76c8)
2022-09-25 11:26:12 +0200nate3(~nate@98.45.169.16) (Ping timeout: 264 seconds)
2022-09-25 11:28:17 +0200Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) (Read error: Connection reset by peer)
2022-09-25 11:28:56 +0200Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-09-25 11:34:50 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-25 11:35:31 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 11:36:00 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 11:37:09 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 11:39:39 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-09-25 11:40:31 +0200acidjnk(~acidjnk@p200300d6e7137a456d115bf0ec8996e0.dip0.t-ipconnect.de)
2022-09-25 11:40:51 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 11:40:54 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Quit: Leaving)
2022-09-25 11:43:52 +0200frost(~frost@user/frost)
2022-09-25 11:46:10 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 11:46:53 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Remote host closed the connection)
2022-09-25 11:52:29 +0200tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2022-09-25 11:53:26 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 11:54:52 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 11:55:11 +0200mc47(~mc47@xmonad/TheMC47)
2022-09-25 11:59:21 +0200ubert(~Thunderbi@77.119.195.69.wireless.dyn.drei.com)
2022-09-25 12:05:36 +0200WarzoneCommand(~Frank@77-162-168-71.fixed.kpn.net)
2022-09-25 12:09:17 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-09-25 12:09:45 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-25 12:13:39 +0200Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-09-25 12:13:49 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 12:14:07 +0200Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57)
2022-09-25 12:17:58 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 246 seconds)
2022-09-25 12:18:00 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-09-25 12:20:38 +0200SysVLinux
2022-09-25 12:21:52 +0200thyriaen(~thyriaen@2a02:8109:8340:686c:7383:e0e2:ad95:9fce)
2022-09-25 12:29:12 +0200`2jt(~jtomas@88.17.232.105) (Ping timeout: 264 seconds)
2022-09-25 12:38:58 +0200acidjnk(~acidjnk@p200300d6e7137a456d115bf0ec8996e0.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-09-25 12:41:46 +0200odnes(~odnes@ppp089210198232.access.hol.gr) (Ping timeout: 246 seconds)
2022-09-25 12:41:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2022-09-25 12:45:41 +0200vorpuni(~pvorp@2001:861:3881:c690:bc6d:def:d698:14f7) (Quit: bye)
2022-09-25 12:46:13 +0200__monty__(~toonn@user/toonn)
2022-09-25 12:54:02 +0200 <Profpatsch> I’m sometimes a bit annoyed by the unreadability of haddock instances. I feel like haddock should sort them according to some tagging
2022-09-25 12:54:14 +0200 <Profpatsch> e.g. generic instances should appear in one block
2022-09-25 12:54:35 +0200 <Profpatsch> An authors of instances should be able to say “these are important for using the type”
2022-09-25 12:55:07 +0200 <[exa]> as in, raising some of the instances out of the usual terse instance list?
2022-09-25 12:55:14 +0200 <Profpatsch> yes
2022-09-25 12:55:22 +0200 <Profpatsch> terse?
2022-09-25 12:55:42 +0200 <Profpatsch> Have you seen some modern base types
2022-09-25 12:55:52 +0200 <[exa]> it's kinda terse to me normally (it's just headers and you have to expand it manually)
2022-09-25 12:56:10 +0200 <[exa]> anyway yeah terse but loooooooong
2022-09-25 12:56:12 +0200 <Profpatsch> Show Eq Ord Show1 Eq1 Ord1 Rep Rep1 Typeable Data TestEquality
2022-09-25 12:56:22 +0200 <Profpatsch> Most of these are pretty much noise for most applications
2022-09-25 12:56:42 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 12:56:50 +0200 <Profpatsch> e.g. for Compose the two important instances are Applicative and Functor
2022-09-25 12:57:00 +0200 <Profpatsch> Everything else is impl detail
2022-09-25 12:58:08 +0200 <[exa]> hm so well, let's patch haddock?
2022-09-25 12:58:13 +0200 <Profpatsch> yep
2022-09-25 12:58:23 +0200 <Profpatsch> My idea is that class authors can give a list of tags
2022-09-25 12:58:25 +0200 <[exa]> like, I'd vote for having instances as a top-level rendered objects in the docs
2022-09-25 12:58:38 +0200 <[exa]> then they can get veeeeeeeeery briefly linked from the data docs and class docs
2022-09-25 12:58:41 +0200 <Profpatsch> and instance authors can also do that somehow
2022-09-25 12:59:00 +0200 <Profpatsch> (not trying to change a lot at first, just group things according to some order & priorityt
2022-09-25 13:00:35 +0200 <[exa]> yeah
2022-09-25 13:00:58 +0200 <[exa]> I kinda expect we'll get slammed in ~10 minutes with the actual reason why it's like this :D
2022-09-25 13:01:48 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 13:02:07 +0200 <Profpatsch> Might try to hack on that during Munihac
2022-09-25 13:02:12 +0200 <Profpatsch> Usually there’s some hackage people there
2022-09-25 13:02:15 +0200 <Profpatsch> err haddock
2022-09-25 13:02:53 +0200 <Profpatsch> Rust does it to some extend, so there’s some good precendent here :)
2022-09-25 13:02:57 +0200 <Profpatsch> *extent
2022-09-25 13:03:07 +0200 <[exa]> ah for me munihac is conflicting with another conference :(
2022-09-25 13:03:33 +0200 <Profpatsch> [exa]: If I get anything done, I I’ll make sure to let you know
2022-09-25 13:04:05 +0200 <[exa]> ah great, thanks!
2022-09-25 13:04:08 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 13:06:11 +0200 <[exa]> like, there might be 2 straightforward approaches, 1] the authors tag some of the toplevel objects "important" or "must read" or so, and they get a corresponding star/exclamationmark/whatever in the documentation so that they're more visible 2] the instances are rendered as top-level so they are easy to organize, and the loooong lists below classes and types are only links 3] both of that
2022-09-25 13:07:41 +0200shriekingnoise_(~shrieking@186.137.167.202) (Quit: Quit)
2022-09-25 13:10:03 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 265 seconds)
2022-09-25 13:13:15 +0200luffy(~chenqisu1@183.217.203.170)
2022-09-25 13:19:34 +0200ubert(~Thunderbi@77.119.195.69.wireless.dyn.drei.com) (Remote host closed the connection)
2022-09-25 13:20:30 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 13:23:04 +0200jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 246 seconds)
2022-09-25 13:24:59 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 13:26:18 +0200Guest13(~Guest13@2001:9e8:33d1:9c00:4cea:de98:c891:d5c7)
2022-09-25 13:26:30 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-09-25 13:28:06 +0200 <Profpatsch> [exa]: I’d do a simple mix of priority & magging
2022-09-25 13:28:07 +0200acidjnk(~acidjnk@p200300d6e7137a45914c45594824ebd8.dip0.t-ipconnect.de)
2022-09-25 13:28:10 +0200 <Profpatsch> *tagging
2022-09-25 13:28:16 +0200 <Profpatsch> (bad wifif on train)
2022-09-25 13:28:53 +0200 <Profpatsch> i.e. you can give stuff tags, and each tag gets a central priority
2022-09-25 13:29:21 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 13:29:24 +0200 <Profpatsch> or idk
2022-09-25 13:29:30 +0200 <Profpatsch> I’d hvae to experiment a bit
2022-09-25 13:30:01 +0200 <Profpatsch> It should be reasonably eas y to use and intuitive, that’s probably the hardest thing to achieve
2022-09-25 13:32:00 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 13:35:59 +0200 <Profpatsch> In particular, if an instance has multiple tags, I think it should appear multiple times as well.
2022-09-25 13:36:29 +0200 <Profpatsch> But maybe highlighting instances would already improve legibility?
2022-09-25 13:40:53 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 13:41:29 +0200doyougnu(~doyougnu@cpe-74-69-132-225.stny.res.rr.com)
2022-09-25 13:47:53 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-09-25 13:54:16 +0200califax(~califax@user/califx)
2022-09-25 13:55:12 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-09-25 13:57:38 +0200Guest1332(~Guest13@47-183-142-46.pool.kielnet.net)
2022-09-25 13:58:02 +0200 <Guest1332> Hi, I just learned from a tutorial that Num is no strict subset of Ord. I don't understand why this should be the case (think) Or did I understand something wrong?
2022-09-25 13:59:56 +0200Guest13(~Guest13@2001:9e8:33d1:9c00:4cea:de98:c891:d5c7) (Ping timeout: 252 seconds)
2022-09-25 14:01:23 +0200 <Profpatsch> Guest1332: one defines > < <= etc the other is a dumping ground for numeric functions
2022-09-25 14:01:30 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 14:01:35 +0200 <Profpatsch> you an also compare things that are not numbers
2022-09-25 14:01:52 +0200 <Rembane> Is Ord a subset of Eq?
2022-09-25 14:02:19 +0200 <Profpatsch> e.g. Foo = A | B | C deriving (Ord) will mean A<B an B<C and A<C
2022-09-25 14:02:20 +0200 <pavonia> Both Num and Eq are
2022-09-25 14:02:34 +0200 <pavonia> Both Num and *Ord are
2022-09-25 14:03:08 +0200 <Guest1332> thank you, it's a bit clearer now!
2022-09-25 14:03:08 +0200 <Profpatsch> Rembane: https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Ord.html#t:Ord
2022-09-25 14:03:16 +0200 <Profpatsch> Eq a => Ord a
2022-09-25 14:03:26 +0200 <Profpatsch> meaning you have to impl Eq inorder to be able to impl Ord
2022-09-25 14:04:13 +0200nate3(~nate@98.45.169.16)
2022-09-25 14:05:50 +0200docter_d(~docter_d@47-183-142-46.pool.kielnet.net)
2022-09-25 14:06:06 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 14:06:07 +0200 <Rembane> Profpatsch: Interesting. My hypothesis was that equivalence of floating point numbers is a bit shaky, and thus why things look like they do, but I think that wasn't quite correct.
2022-09-25 14:06:11 +0200docter_dslaps Guest1332 around a bit with a large trout
2022-09-25 14:06:29 +0200davean(~davean@davean.sciesnet.net) (Ping timeout: 252 seconds)
2022-09-25 14:06:57 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 14:07:42 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Remote host closed the connection)
2022-09-25 14:07:53 +0200ft(~ft@p3e9bc57b.dip0.t-ipconnect.de) (Remote host closed the connection)
2022-09-25 14:09:02 +0200nate3(~nate@98.45.169.16) (Ping timeout: 244 seconds)
2022-09-25 14:09:13 +0200 <ski> `Num' does not require `Eq' !
2022-09-25 14:10:13 +0200 <Profpatsch> Rembane: the Haskell number stack is a point of contention
2022-09-25 14:10:51 +0200 <ski> @let instance Num a => Num (rho -> a) where (f + g) r = f r + g r; (f - g) r = f r - g r; (f * g) r = f r * g r; negate f r = negate (f r); abs f r = abs (f r); signum f r = signum (f r); fromInteger n r = fromInteger n
2022-09-25 14:10:53 +0200 <lambdabot> Defined.
2022-09-25 14:11:06 +0200 <Profpatsch> It’s neither particularly easy to use, nor does it have a lot of nice mathematical properties
2022-09-25 14:11:37 +0200 <ski> @let instance Fractional a => Fractional (rho -> a) where (f / g) r = f r / g r; recip f r = recip (f r); fromRational x r = fromRational x
2022-09-25 14:11:38 +0200 <lambdabot> Defined.
2022-09-25 14:11:46 +0200 <ski> agreed
2022-09-25 14:12:18 +0200 <ski> > map (id^2 - id + 1) [-3 .. 3]
2022-09-25 14:12:20 +0200 <lambdabot> [13,7,3,1,1,3,7]
2022-09-25 14:12:24 +0200odnes(~odnes@ppp089210198232.access.hol.gr)
2022-09-25 14:13:02 +0200 <david> Hello
2022-09-25 14:13:11 +0200 <ski> > map (fst^2 - fst*snd + snd^2) [(x,y) | [x,y] <- replicateM 2 [-1 .. 2]]
2022-09-25 14:13:13 +0200 <lambdabot> [1,1,3,7,1,0,1,4,3,1,1,3,7,4,3,4]
2022-09-25 14:13:30 +0200 <Guest1332> that lambdabot is cool
2022-09-25 14:13:36 +0200 <Guest1332> Profpatsch, Rembane, ski thanks for the nice chat, it was helping alot! C ya, bye!
2022-09-25 14:13:38 +0200 <david> https://rosettacode.org/wiki/Poker_hand_analyser#Haskell <- what is 'consumed = pure . (, "") ?
2022-09-25 14:13:39 +0200 <ski> > map (cos^2 + sin^2) [-pi,-pi+pi/4,pi]
2022-09-25 14:13:41 +0200 <lambdabot> [1.0,1.0,1.0]
2022-09-25 14:13:47 +0200 <ski> > map (cos^2 + sin^2) [-pi,-pi+pi/4 .. pi] -- sorry
2022-09-25 14:13:49 +0200 <lambdabot> [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
2022-09-25 14:14:15 +0200 <ski> note that function types can't (in general) have `Eq' instances
2022-09-25 14:14:24 +0200Guest1332(~Guest13@47-183-142-46.pool.kielnet.net) (Quit: Client closed)
2022-09-25 14:14:26 +0200 <king_gs> > map (cos) [1..10]
2022-09-25 14:14:27 +0200 <ski> hello again, david
2022-09-25 14:14:27 +0200 <lambdabot> [0.5403023058681398,-0.4161468365471424,-0.9899924966004454,-0.6536436208636...
2022-09-25 14:14:33 +0200 <Profpatsch> ski: can they have Eq1?
2022-09-25 14:14:39 +0200 <ski> david : did you see the messages i left for you ?
2022-09-25 14:14:40 +0200 <david> Hello ski :)
2022-09-25 14:14:48 +0200 <david> Yes, I just saw it through lambdabot
2022-09-25 14:14:51 +0200 <Profpatsch> doesn’t look like it
2022-09-25 14:14:53 +0200 <king_gs> > a = 1
2022-09-25 14:14:55 +0200 <lambdabot> <hint>:1:3: error: parse error on input ‘=’
2022-09-25 14:15:02 +0200 <ski> (well, checking, i see it was just one)
2022-09-25 14:16:15 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Ping timeout: 265 seconds)
2022-09-25 14:17:26 +0200waldo(~waldo@user/waldo) (Quit: quit)
2022-09-25 14:17:48 +0200 <ski> david : well, the `pure' there is `const', so it's ignoring the input (the string), and the other bit sets the output (apart from the result value) to be the empty string
2022-09-25 14:18:52 +0200 <ski> (the latter part is ok, since the strings that are being matched contain nothing after the matched token .. however, i think it is actually incorrect, as an implementation of `readsPrec' to not allow there to be any more tokens after the matched one !)
2022-09-25 14:19:13 +0200 <ski> so, i would argue these `Read' instances are incorrect
2022-09-25 14:19:30 +0200 <ski> @src (->) pure
2022-09-25 14:19:30 +0200 <lambdabot> pure = const
2022-09-25 14:19:52 +0200 <ski> consumed = pure . (,"")
2022-09-25 14:20:00 +0200 <ski> = const . (,"")
2022-09-25 14:20:15 +0200 <ski> consumed x = (const . (,"")) x
2022-09-25 14:20:27 +0200 <ski> = const ((,"") x)
2022-09-25 14:20:31 +0200 <ski> = const (x,"")
2022-09-25 14:20:51 +0200 <ski> consumed x s = const (x,"") s
2022-09-25 14:21:01 +0200 <ski> = (x,"")
2022-09-25 14:21:09 +0200 <ski> consumed x _ = (x,"")
2022-09-25 14:21:13 +0200 <ski> @src const
2022-09-25 14:21:13 +0200 <lambdabot> const x _ = x
2022-09-25 14:21:33 +0200 <ski> that ^ expands what `consumed' is doing
2022-09-25 14:26:08 +0200 <[exa]> Profpatsch: I'd avoid any "global" priorities because you literally don't know what's important for which users. Tags could be useful (like at least the ones for "used almost everywhere" and "technical detail")
2022-09-25 14:26:22 +0200 <ski> hm, additionally, i don't think this custom user data format should be parsed by defining `Read'/`readsPrec' at all ! (reserving those for parsing a `String' representation of a *Haskell* value (using Haskell syntax) .. so that one could copy an expression from source, or from `Show' output, and feed it to `Read' operations)
2022-09-25 14:32:11 +0200 <ski> well .. i guess it *would* be possible to make e.g. `(4 ♥)' (or `(♥) 4', if you prefer) (rather than `♥4', which is a syntax error) a valid Haskell code representation (`♥' becoming an operator)
2022-09-25 14:32:43 +0200acidjnk(~acidjnk@p200300d6e7137a45914c45594824ebd8.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-09-25 14:33:07 +0200 <ski> (in that case, it would be fine to define `Read'/`readsPrec'/`reads' for this)
2022-09-25 14:35:02 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 14:36:45 +0200 <ski> (oh, actually i misread (the `Read Card' instance). it's using the `4♥' format)
2022-09-25 14:37:27 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 14:39:01 +0200 <ski> i would not use `mapMaybe' (with `readMaybe') like this, because it discards parse errors
2022-09-25 14:39:23 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 14:40:00 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Remote host closed the connection)
2022-09-25 14:40:14 +0200 <ski> (e.g. `"q♣ 10♣ Bad 7♣ input 6♣ 7♣"' would not be reported as being `Invalid Input', instead ignoring the noise)
2022-09-25 14:40:33 +0200xff0x(~xff0x@2405:6580:b080:900:87ff:1eaa:6690:ed86) (Ping timeout: 244 seconds)
2022-09-25 14:41:16 +0200Arsen(arsen@managarm/dev/Arsen) (Quit: Quit.)
2022-09-25 14:41:27 +0200docter_d(~docter_d@47-183-142-46.pool.kielnet.net) ()
2022-09-25 14:41:40 +0200Arsen(arsen@managarm/dev/Arsen)
2022-09-25 14:41:55 +0200 <ski> (nor would `"q♣ 10♣ Bad 7♣ input 6♣ 4♣"' be reported as `Invalid hand', since there's still five distinct valid cards in there)
2022-09-25 14:44:57 +0200 <dminuoso> What I wouldn't give for case-of fallthrough right now. :(
2022-09-25 14:44:59 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 252 seconds)
2022-09-25 14:45:06 +0200 <ski> howso ?
2022-09-25 14:46:35 +0200 <dminuoso> I would like to express this elegantly https://gist.github.com/dminuoso/547ceccc082453ed31e25b945c0884a6
2022-09-25 14:46:44 +0200ski's pondered a bit how fallthrough in `case'-`of', in the sense of being able to have a "reverse pointer forest" with branch entry points inside of it (entry points being in "or"-branches)
2022-09-25 14:47:18 +0200 <ski> ah, looks like you're actually wanting disjunctive / "or"- patterns
2022-09-25 14:47:39 +0200 <dminuoso> Yeah I suppose that's the SML term for it
2022-09-25 14:48:00 +0200 <int-e> that lone `else` confused me much more than I feel comfortable with
2022-09-25 14:48:34 +0200 <dminuoso> Heh, both `do` and `else` were meant as English pseudo code. Yes those were poor choices. :)
2022-09-25 14:48:44 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-09-25 14:48:47 +0200 <ski> (e.g. Ocaml has them <https://v2.ocaml.org/manual/patterns.html#sss:pat-or>)
2022-09-25 14:49:30 +0200 <ski> case ty of
2022-09-25 14:49:45 +0200doyougnu(~doyougnu@cpe-74-69-132-225.stny.res.rr.com) (Ping timeout: 252 seconds)
2022-09-25 14:49:45 +0200 <ski> Ty1 | Ty2 | Ty3 -> do something
2022-09-25 14:49:55 +0200 <ski> Ty4 -> do something else
2022-09-25 14:50:06 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2022-09-25 14:50:08 +0200 <ski> Ty5 | Ty6 -> and another thing..
2022-09-25 14:51:03 +0200 <ski> iirc, they have come up in Haskell Prime or something
2022-09-25 14:52:19 +0200luffy(~chenqisu1@183.217.203.170) (Ping timeout: 246 seconds)
2022-09-25 14:53:35 +0200 <Profpatsch> [exa]: by global priorities I mean that you have a 1–5 prio, and stuff like Eq, Show etc is in `stock`, which is defined to have priority 2, so it would be sorted pretty low
2022-09-25 14:54:41 +0200 <Profpatsch> But maybe that’s too simplistic
2022-09-25 14:55:48 +0200 <Profpatsch> I’m gonna create a test suite from existing classes, sorting things like I think they should appear, then the mechanism could be devised from that
2022-09-25 14:55:59 +0200 <[exa]> that's gonna spawn infinite discussions on what instances should have what priority
2022-09-25 14:56:07 +0200 <[exa]> but yeah at least something will be available
2022-09-25 14:56:13 +0200 <Profpatsch> that’s why authors should have the last say
2022-09-25 14:56:15 +0200 <Profpatsch> within reason
2022-09-25 14:56:31 +0200 <Profpatsch> maybe we give them two tools, sort to top and highlight
2022-09-25 14:57:10 +0200 <Profpatsch> So that you can say “this instance should get special treatment for doc reasons”
2022-09-25 14:57:31 +0200 <Profpatsch> And everything else gets a nice default sorting, and within the default sorting things could also be highlighted
2022-09-25 14:57:36 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d) (Ping timeout: 244 seconds)
2022-09-25 14:59:04 +0200 <Profpatsch> The good thing about the current system is that I think there’s no author influence on how things get sorted, so there is no existing state to take care of
2022-09-25 14:59:32 +0200 <Profpatsch> which means there’s no backwards compat considerations
2022-09-25 15:00:46 +0200 <Profpatsch> So considering I wouldn’t give authors too much leverage on determining sorting order, so that we could tinker with it after the first impl
2022-09-25 15:01:53 +0200xff0x(~xff0x@2405:6580:b080:900:4297:67ba:b919:fbb3)
2022-09-25 15:04:15 +0200[exa]carefully opens the haddock source
2022-09-25 15:08:43 +0200jakalx(~jakalx@base.jakalx.net)
2022-09-25 15:10:30 +0200 <Profpatsch> def not starting in the haddock sources lol
2022-09-25 15:10:44 +0200king_gs(~Thunderbi@187.201.192.184)
2022-09-25 15:14:52 +0200 <[exa]> oh here we go https://gitlab.haskell.org/ghc/haddock/-/blob/ghc-head/haddock-api/src/Haddock/Interface/AttachIns…
2022-09-25 15:15:50 +0200 <[exa]> the `instHead` makes a list of integers basically as `map argCount instanceTypes` that is used for sorting stuff
2022-09-25 15:19:16 +0200 <Profpatsch> [exa]: I’m more afraid of getting a dev shell with hls in it for haddock
2022-09-25 15:19:28 +0200 <Profpatsch> Do I have to recompile GHC for that
2022-09-25 15:21:44 +0200 <[exa]> guess not
2022-09-25 15:21:46 +0200 <[exa]> just omit hls
2022-09-25 15:25:35 +0200 <ski> david : i'd probably replace the `Read Suit' instance with something like
2022-09-25 15:25:53 +0200 <ski> readsSuit :: ReadS Suit
2022-09-25 15:26:08 +0200 <ski> readsSuit s0 = [(Heart ,s) | ("♥",s) <- lex s0]
2022-09-25 15:26:27 +0200 <ski> ++ [(Diamond,s) | ("♦",s) <- lex s0]
2022-09-25 15:26:37 +0200 <ski> ++ [(Spade ,s) | ("♣",s) <- lex s0]
2022-09-25 15:26:46 +0200 <ski> ++ [(Club ,s) | ("♠",s) <- lex s0]
2022-09-25 15:27:04 +0200 <ski> ++ [(Heart ,s) | ("h",s) <- lex s0] -- not sure i'd keep this case, though
2022-09-25 15:27:09 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2022-09-25 15:27:17 +0200 <ski> and similarly replacing the `Read Rank' instance with a `readsRank :: ReadS Rank'
2022-09-25 15:28:13 +0200 <ski> (one could alternatively do a single `lex' call, matching on `(token,s)', and then do a `case token of ...', but then one needs to reintroduce explicit failure in the catch-call branch)
2022-09-25 15:28:22 +0200 <ski> also, note
2022-09-25 15:28:25 +0200Enrico63(~Enrico63@81.109.143.226) ()
2022-09-25 15:29:35 +0200 <ski> type ReadS a = String -> [(a,String)] -- note this is a type synonym for a function converting an input `String' containing tokens to a list (possible alternative parses/reads) of pairs of parsed values (consuming some prefix of the input) together with the remaining input
2022-09-25 15:30:33 +0200 <ski> this is better (a) because you're not artificially/incorrectly restricting these to only accept the input when there's no tokens after the parsed/read token
2022-09-25 15:32:34 +0200 <ski> (`Read'/`read'/`reads'/`readsPrec' are meant to leave the remaining tokens of the input in the output, letting later parsing continue from where we left off. `readMaybe' (used on top-level of parsing) will check that there's no extra tokens (not counting white space) at the end)
2022-09-25 15:32:46 +0200 <ski> .. then i'd replace the `Read Card' instance by
2022-09-25 15:32:55 +0200 <ski> readsCard :: ReadS Card
2022-09-25 15:33:06 +0200king_gs(~Thunderbi@187.201.192.184) (Ping timeout: 265 seconds)
2022-09-25 15:34:39 +0200 <ski> readsCard s0 = [ (Card suit rank,s)
2022-09-25 15:34:58 +0200 <ski> | (rank,s1) <- readsRank s0
2022-09-25 15:35:11 +0200 <ski> , (suit,s ) <- readsSuit s1
2022-09-25 15:35:16 +0200 <ski> ]
2022-09-25 15:35:27 +0200 <ski> (er, fix alignment)
2022-09-25 15:35:34 +0200 <ski> or perhaps
2022-09-25 15:36:12 +0200 <ski> readsCard = runStateT (flip Card <$> StateT readsRank <*> StateT readsSuit)
2022-09-25 15:36:57 +0200 <ski> (possibly also using `StateT' in definitions of `readsSuit',`readsRank' .. or perhaps altogether using `ReadP', or maybe `ReadE', instead)
2022-09-25 15:38:33 +0200 <ski> and then in `testHands' i'd replace `mapMaybe readMaybe . words' by `(readsToMaybe . runStateT . many . StateT) readsCard' (or maybe `replicateM 5' instead of `many' ?)
2022-09-25 15:38:54 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-25 15:39:26 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 15:39:43 +0200 <ski> (.. hm, no. actually not using `replicateM 5' to only read five cards, since the current code uses `nub' before checking count, so, i think (?), the important part is that it's five *after* removing duplicates, not before)
2022-09-25 15:39:55 +0200 <ski> anyway .. where
2022-09-25 15:40:14 +0200 <ski> readsToMaybe :: ReadS a -> (String -> Maybe a)
2022-09-25 15:41:36 +0200 <ski> readsToMaybe reads s0 = case [a | (a,s) <- reads s0,("","") <- lex s] of -- filter away all reads with extra tokens
2022-09-25 15:41:37 +0200acidjnk(~acidjnk@p200300d6e7137a45914c45594824ebd8.dip0.t-ipconnect.de)
2022-09-25 15:41:58 +0200 <ski> [a] -> Just a -- check there's just one solution left after filtering
2022-09-25 15:42:03 +0200 <ski> _ -> Nothing
2022-09-25 15:43:04 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 244 seconds)
2022-09-25 15:48:12 +0200 <ski> compare `on` snd could be replaced by comparing snd (and then not importing `on'. also with `consumed' removed, there's no need to keep the `TupleSections' line)
2022-09-25 15:49:44 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 15:50:03 +0200skiwould also remove all uses of the `$' operation .. and maybe change some of the `<$>'s to calls to `map'
2022-09-25 15:51:10 +0200 <ski> and `isSucc' could use an "as/at pattern" `isSucc (x:xs@(y:_)) = .. && isSucc xs'
2022-09-25 15:53:05 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 15:53:11 +0200 <ski> oh, i didn't go into how one could make `(4 ♥)' (or `(♥) 4') be valid Haskell syntax (and then one could use `Read', defining `readsPrec' instead of `readsSuit',`readsRank',`readsCard' -- still using `many' in `testHands', though)
2022-09-25 15:53:20 +0200 <ski> david : i guess that's that
2022-09-25 15:55:19 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 258 seconds)
2022-09-25 15:55:25 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 15:57:36 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 15:58:00 +0200frost(~frost@user/frost) (Ping timeout: 252 seconds)
2022-09-25 16:00:53 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 252 seconds)
2022-09-25 16:02:11 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-25 16:03:39 +0200 <zzz> where can i learn about records and how they are stored internally?
2022-09-25 16:05:46 +0200caryhartline(~caryhartl@2600:1700:2d0:8d30:cd27:ded2:4351:8688) (Quit: caryhartline)
2022-09-25 16:08:37 +0200 <[exa]> zzz: records as in the record syntax for the algebraic datatypes in `data` ?
2022-09-25 16:09:31 +0200 <EvanR> glad I tuned in in time to see readsSuit that's cool
2022-09-25 16:09:44 +0200 <[exa]> zzz: (in that case, this answer would be useful: https://stackoverflow.com/questions/3254758/memory-footprint-of-haskell-data-types )
2022-09-25 16:10:48 +0200 <zzz> [exa]: thank you that's exactly it
2022-09-25 16:11:05 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 16:16:48 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-25 16:20:33 +0200skilaments the lack of knowledge about how to properly/correctly make `Read' and `Show' instances (including handling precedences, using `readParen';`showParen', and incrementing levels where appropriate) (and knowing when that's appropriate) ; knowing how to define and use `readsPrec',`readList';`showsPrec',`showList', and how to use
2022-09-25 16:20:38 +0200ski`reads',`readParen',`lex',..;`shows',`showParen',`showString',`showChar',`showLitChar',..
2022-09-25 16:20:57 +0200 <EvanR> hey I implemented all that. Once
2022-09-25 16:21:22 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 16:22:02 +0200 <ski> one could argue `Read' and `Show' have issues .. but one's going to use them, one ought to use them correctly
2022-09-25 16:22:10 +0200 <ski> s/but/but if/
2022-09-25 16:25:00 +0200 <EvanR> :i gives the precedence of + 6, but prints nothing on !! or ! from Data.Map. Is the default 7 or
2022-09-25 16:25:07 +0200ski. o O ( <https://downloads.haskell.org/ghc/latest/docs/libraries/base-4.17.0.0/Numeric.html> )
2022-09-25 16:25:37 +0200qhong(~qhong@rescomp-21-400677.stanford.edu) (Ping timeout: 268 seconds)
2022-09-25 16:26:46 +0200 <ski> default is `infixl 9'
2022-09-25 16:27:48 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-09-25 16:29:00 +0200 <EvanR> ohdang
2022-09-25 16:29:28 +0200 <EvanR> I was using readOct yesterday but it didn't give me what I wanted
2022-09-25 16:30:39 +0200 <EvanR> > readOct "777" ""
2022-09-25 16:30:45 +0200 <lambdabot> error:
2022-09-25 16:30:47 +0200 <EvanR> > readOct "777"
2022-09-25 16:30:49 +0200 <lambdabot> • Couldn't match expected type ‘[Char] -> t’
2022-09-25 16:30:53 +0200 <lambdabot> [(511,"")]
2022-09-25 16:30:59 +0200 <EvanR> > readOct "778"
2022-09-25 16:31:01 +0200 <lambdabot> [(63,"8")]
2022-09-25 16:31:04 +0200 <EvanR> > readOct "779"
2022-09-25 16:31:06 +0200 <lambdabot> [(63,"9")]
2022-09-25 16:31:30 +0200 <EvanR> according to dusty document from 1972, 9 would be accepted and counted as... nine
2022-09-25 16:32:06 +0200 <EvanR> or in their words "9 = 11" xD
2022-09-25 16:32:10 +0200king_gs(~Thunderbi@187.201.192.184)
2022-09-25 16:32:25 +0200 <hpc> it's like microwave numbers
2022-09-25 16:32:37 +0200 <hpc> if you type 130 into a microwave, it's the same as typing 90
2022-09-25 16:33:00 +0200narendraj9(~user@2a02:8109:b63f:c344::31ee)
2022-09-25 16:33:30 +0200 <EvanR> lol yeah
2022-09-25 16:36:32 +0200`2jt(~jtomas@88.17.232.105)
2022-09-25 16:40:38 +0200 <ski> (`9' being strongest level just weaker than function application, which is `10' (and `infixl'). arguably `~' would then be at `11' (and `prefixr'), `->' (view patterns) at `12' (and `infixr'), `!' at `13' (and `prefix'), and record construction/update at `14' (and `infixl') ? .. not sure if i'm missing some relevant "syntactic operators" here)
2022-09-25 16:40:45 +0200Everything(~Everythin@37.115.210.35)
2022-09-25 16:42:27 +0200 <ski> > (readOct :: ReadS Integer) "777"
2022-09-25 16:42:29 +0200 <lambdabot> [(511,"")]
2022-09-25 16:42:47 +0200 <ski> EvanR : for octal in general, or for permissions in particular ?
2022-09-25 16:43:12 +0200ski. o O ( "seventyeleven" )
2022-09-25 16:43:45 +0200 <EvanR> for numeric constants like 01357 =
2022-09-25 16:44:15 +0200 <EvanR> > (readOct :: ReadS Integer) "01357"
2022-09-25 16:44:17 +0200 <lambdabot> [(751,"")]
2022-09-25 16:44:17 +0200jrm(~jrm@user/jrm)
2022-09-25 16:44:39 +0200 <EvanR> > (readOct :: ReadS Integer) "019357"
2022-09-25 16:44:41 +0200 <lambdabot> [(1,"9357")]
2022-09-25 16:45:22 +0200 <EvanR> (this feature was not implemented at all sites using B)
2022-09-25 16:46:53 +0200 <ski> what about `0b0123', should this be equal to `0b1011', iow `9' ?
2022-09-25 16:47:14 +0200 <EvanR> 0b ?
2022-09-25 16:47:17 +0200 <ski> binary
2022-09-25 16:47:22 +0200 <ski> % :set -XBinaryLiterals
2022-09-25 16:47:22 +0200 <yahb2> <interactive>:1:1: error: Not in scope: ‘Yahb2Defs.limitedPrint’
2022-09-25 16:47:29 +0200 <ski> % 0b1011
2022-09-25 16:47:30 +0200 <yahb2> 11
2022-09-25 16:47:39 +0200 <ski> ah, i guess `11', not `9'
2022-09-25 16:47:48 +0200 <EvanR> lol
2022-09-25 16:48:29 +0200 <EvanR> ask me what F times 9 is. It's fleventy-five
2022-09-25 16:48:30 +0200 <ski> and what about `0b01a2' and `02b'/`0o2b' ?
2022-09-25 16:49:50 +0200 <ski> i guess one could allow alternative residues in other residue systems than the least one (digits from `0' upto (but not including) the base `b')
2022-09-25 16:50:23 +0200 <EvanR> the extension of interpreting the wrong digits as their value in the right place seems straightforward but decimal and octal are the only options I have seen xD
2022-09-25 16:50:24 +0200 <ski> (there is already negative bases `b', where one typically uses digits in `[0 .. -b-1]')
2022-09-25 16:51:32 +0200 <ski> well, i guess one could also ask about `0x10jc'
2022-09-25 16:52:21 +0200 <ski> (since decimal typically has no distinguishing prefix, one might prefer `4d' to be two tokens rather than meaning `53')
2022-09-25 16:53:04 +0200 <ski> (.. then there's also the type suffices in C, like `0L')
2022-09-25 16:53:35 +0200 <EvanR> http://www.bzarg.com/p/how-to-pronounce-hexadecimal/
2022-09-25 16:54:04 +0200 <ski> hehe :)
2022-09-25 16:55:03 +0200ski's just suffixed "-ty"," hundred",&c., in private
2022-09-25 16:56:18 +0200jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c)
2022-09-25 16:56:47 +0200 <EvanR> a8 vs 88?
2022-09-25 16:57:10 +0200zeenk(~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) (Quit: Konversation terminated!)
2022-09-25 16:57:20 +0200 <EvanR> alphaty eight
2022-09-25 16:58:18 +0200 <hpc> if your math adds up to F0, is that an 'efty sum?
2022-09-25 17:00:01 +0200 <EvanR> wow those higher levels of precedence are... high. tilde is 11 where, lazy pattern?
2022-09-25 17:00:27 +0200nate3(~nate@98.45.169.16)
2022-09-25 17:00:46 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net) (Ping timeout: 246 seconds)
2022-09-25 17:02:48 +0200acidjnk(~acidjnk@p200300d6e7137a45914c45594824ebd8.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2022-09-25 17:04:34 +0200waldo(~waldo@user/waldo)
2022-09-25 17:05:32 +0200acidjnk(~acidjnk@p200300d6e7137a29b83d7bde232748fa.dip0.t-ipconnect.de)
2022-09-25 17:15:34 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 17:16:03 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 17:18:17 +0200titibandit(~titibandi@xdsl-87-78-162-143.nc.de)
2022-09-25 17:20:12 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 17:20:17 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 17:20:22 +0200narendraj9(~user@2a02:8109:b63f:c344::31ee) (Read error: Connection reset by peer)
2022-09-25 17:23:16 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2022-09-25 17:29:23 +0200ft(~ft@p3e9bc57b.dip0.t-ipconnect.de)
2022-09-25 17:31:07 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-25 17:38:59 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 17:39:20 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net)
2022-09-25 17:41:38 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 17:45:33 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 17:47:54 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Quit: _)
2022-09-25 17:50:22 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-25 17:51:53 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-09-25 17:53:17 +0200qwedfg(~qwedfg@user/qwedfg) (Ping timeout: 244 seconds)
2022-09-25 17:53:48 +0200jespada_(~jespada@cpc121060-nmal24-2-0-cust249.19-2.cable.virginm.net) (Ping timeout: 264 seconds)
2022-09-25 17:55:02 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 17:55:14 +0200qwedfg(~qwedfg@user/qwedfg)
2022-09-25 17:59:33 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 265 seconds)
2022-09-25 18:00:45 +0200jespada(~jespada@cpc121060-nmal24-2-0-cust249.19-2.cable.virginm.net)
2022-09-25 18:02:01 +0200acidjnk(~acidjnk@p200300d6e7137a29b83d7bde232748fa.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-09-25 18:02:14 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2022-09-25 18:03:28 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 18:08:14 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Remote host closed the connection)
2022-09-25 18:08:55 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-25 18:09:14 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-25 18:10:26 +0200king_gs(~Thunderbi@187.201.192.184) (Read error: Connection reset by peer)
2022-09-25 18:11:36 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d)
2022-09-25 18:14:14 +0200odnes(~odnes@ppp089210198232.access.hol.gr) (Quit: Leaving)
2022-09-25 18:16:51 +0200causal(~user@50.35.83.177)
2022-09-25 18:19:20 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 18:19:51 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 260 seconds)
2022-09-25 18:26:15 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
2022-09-25 18:26:15 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-09-25 18:26:41 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-09-25 18:27:55 +0200 <ski> EvanR : hm, i guess it works less well in english
2022-09-25 18:28:28 +0200 <ski> yes, `~' is irrefutable / "lazy" pattern, `!' is strict pattern
2022-09-25 18:29:27 +0200 <ski> > let foo !MkFoo {} = () in foo undefined
2022-09-25 18:29:29 +0200 <lambdabot> *Exception: Prelude.undefined
2022-09-25 18:29:31 +0200 <ski> > let foo ~MkFoo {} = () in foo undefined
2022-09-25 18:29:33 +0200 <lambdabot> ()
2022-09-25 18:29:35 +0200 <ski> > let foo ! ~MkFoo {} = () in foo undefined
2022-09-25 18:29:38 +0200 <lambdabot> *Exception: Prelude.undefined
2022-09-25 18:29:40 +0200 <ski> > let foo ~ !MkFoo {} = () in foo undefined
2022-09-25 18:29:42 +0200 <lambdabot> <hint>:1:11: error: parse error on input ‘!’
2022-09-25 18:29:53 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 18:30:01 +0200 <ski> hence `!' binds tighter than `~'
2022-09-25 18:30:10 +0200 <ski> > let foo ! !MkFoo {} = () in foo undefined
2022-09-25 18:30:11 +0200 <lambdabot> <hint>:1:11: error: parse error on input ‘!’
2022-09-25 18:30:29 +0200 <ski> (hence `prefix')
2022-09-25 18:30:35 +0200 <ski> > let foo ~ ~MkFoo {} = () in foo undefined
2022-09-25 18:30:37 +0200 <lambdabot> ()
2022-09-25 18:30:39 +0200 <ski> (hence `prefixr')
2022-09-25 18:31:04 +0200 <ski> > let (! not -> x) = False in x
2022-09-25 18:31:05 +0200 <lambdabot> <hint>:1:12: error: parse error on input ‘->’
2022-09-25 18:31:22 +0200 <zzz> ?
2022-09-25 18:31:46 +0200 <ski> > let (~ not -> x) = False in x
2022-09-25 18:31:48 +0200 <lambdabot> error:
2022-09-25 18:31:48 +0200 <lambdabot> Pattern syntax in expression context: ~not
2022-09-25 18:32:16 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 18:33:24 +0200 <monochrom> maybe you need ~(not->x)
2022-09-25 18:33:44 +0200 <ski> oh .. i did manage to goof it up. it should be : application,strict,view,lazy,record. i managed to swap strict and lazy
2022-09-25 18:33:49 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-25 18:34:07 +0200 <EvanR> expand ~(not->x)
2022-09-25 18:34:13 +0200 <ski> `~' binds tighter than `!' (contrary to what i just claimed above)
2022-09-25 18:34:17 +0200 <EvanR> ~ ( not -> x )
2022-09-25 18:34:29 +0200 <ski> and `->' is inbetween, `~' binds looser, and `!' tighter
2022-09-25 18:35:33 +0200 <int-e> > let !(not -> ~False) = False in 42
2022-09-25 18:35:34 +0200 <lambdabot> 42
2022-09-25 18:36:00 +0200 <monochrom> This is one of those times I want the opposite of what most people want. Most people want "how do I avoid parentheses?". I want "how do I avoid the precedence table?".
2022-09-25 18:36:17 +0200 <EvanR> apparently precedence er, associativity of _ ? _ : _ matters because _ ? _ : _ ? _ : _ is ambiguous. no idea if I implemented my parser correctly xD
2022-09-25 18:36:35 +0200 <int-e> > (*) 1 ((+) 3 4)
2022-09-25 18:36:36 +0200 <lambdabot> 7
2022-09-25 18:36:52 +0200 <EvanR> code only a lisper could love
2022-09-25 18:37:06 +0200 <int-e> no precedences
2022-09-25 18:37:38 +0200 <monochrom> I still like infix. I can take 1*(3+4) and 1+(3*4)
2022-09-25 18:38:20 +0200 <int-e> EvanR: For fun, I'll write this with pleasure. I wouldn't want to see it in production anywehre.
2022-09-25 18:38:31 +0200 <ski> hence it complaining about `~' in expression syntax, since it reads `~ not -> x' as `(~ not) -> x'. while not complaining about that for `! not -> x', hmm .. yes `! (not -> x)' is allowed, so i guess that means `->' doesn't bind tighter than `!' (keeping in mind that is `prefix' rather than `prefixr'). so `->' ought to be either the same precedence as `!', or less
2022-09-25 18:39:10 +0200 <int-e> (there's a huge difference between an ephemeral IRC message of no particular purpose and code that might be read dozens of times)
2022-09-25 18:39:21 +0200 <EvanR> true ? false : true ? false : true
2022-09-25 18:39:22 +0200 <ski> EvanR : how is that ambiguous ?
2022-09-25 18:39:46 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-09-25 18:40:02 +0200 <EvanR> I mean it's not ambiguous if you decide which way to put parens
2022-09-25 18:40:09 +0200 <int-e> ...
2022-09-25 18:40:51 +0200 <ski> `_ ? _ : (_ ? _ : _)' is ok, `_ ? (_ : _ ? _) : _' is nonsense (syntax error). which is the alternative interpretation ?
2022-09-25 18:41:05 +0200 <EvanR> (_ ? _ : _) ? _ : _
2022-09-25 18:41:10 +0200 <ski> oh, i guess it's .. that :)
2022-09-25 18:41:15 +0200 <ski> right, ty
2022-09-25 18:41:36 +0200 <EvanR> now I'm paranoid about like, every construction
2022-09-25 18:41:36 +0200 <int-e> > let (?) = (-) in 1 ? 2 ? 3 -- unrelated
2022-09-25 18:41:38 +0200 <lambdabot> -4
2022-09-25 18:43:05 +0200 <int-e> `_ ? (_ : _ ? _) : _` makes perfect sense in Haskell. Well... maybe not quite perfect. But it makes sense.
2022-09-25 18:43:15 +0200int-eis having trouble with context as usual
2022-09-25 18:43:52 +0200 <EvanR> code should start in the middle and grow left or right, mario3 instead of like mario1
2022-09-25 18:43:58 +0200 <EvanR> er, left and right
2022-09-25 18:44:02 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-09-25 18:44:13 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Remote host closed the connection)
2022-09-25 18:47:05 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-09-25 18:47:07 +0200Guest53(~Guest53@p200300ef971835186586f89dc41cda0a.dip0.t-ipconnect.de)
2022-09-25 18:48:02 +0200jakalx(~jakalx@base.jakalx.net)
2022-09-25 18:49:00 +0200dolio(~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 18:49:18 +0200 <EvanR> > let (?) = (++) in [] ? ([] : [] ? []) : []
2022-09-25 18:49:20 +0200 <Guest53> Is dependency hell still a thing? I have one executable "build-depends: yesod", a second executable "build-depends: shakespeare, blaze-html" and I get "Dependency on unbuildable library from yesod". If I comment out of the executables "cabal build/run" works fine.
2022-09-25 18:49:20 +0200 <lambdabot> [[[]]]
2022-09-25 18:49:45 +0200 <Guest53> *one of
2022-09-25 18:50:06 +0200 <zzz> i have no idea how i, as a beginner, was able to follow any conversation in this channel and keep my motivation up
2022-09-25 18:50:26 +0200dolio(~dolio@130.44.130.54)
2022-09-25 18:51:02 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-09-25 18:51:39 +0200 <EvanR> you're either driven mad running away from cthulu or drawn in closer to the inner circle, before going mad later
2022-09-25 18:52:05 +0200 <dminuoso> Bah interleaving effects in a parser is such a bad idea. :(
2022-09-25 18:52:22 +0200 <dminuoso> I think I will ditch megaparsec for alex
2022-09-25 18:52:48 +0200dolio(~dolio@130.44.130.54) (Client Quit)
2022-09-25 18:53:08 +0200 <Guest53> Is it possible that the dependencies of my first exe (shakespeare, blaze-html) are are clashing with the fact that yesod depends on shakespeare and blaze-html and my second exe depends on yesod? Could this be the problem?
2022-09-25 18:53:41 +0200 <dminuoso> Guest53: Dependency hell is a thing that arises when installing dependencies into a singular global namespace
2022-09-25 18:53:55 +0200 <dminuoso> But that has been removed a long time ago with cabal new-style build, which for many years has become the default.
2022-09-25 18:53:59 +0200dolio(~dolio@130.44.130.54)
2022-09-25 18:55:16 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 244 seconds)
2022-09-25 18:55:22 +0200 <Guest53> dminuoso: I see. Do you have any suggestions where I could to fix this "Dependency on unbuildable library from yesod"?
2022-09-25 18:55:30 +0200 <Guest53> *where I could look
2022-09-25 18:56:06 +0200 <dminuoso> Guest53: Based on the diagnostic you are seeing, you should probably update cabal
2022-09-25 18:56:32 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Quit: coot)
2022-09-25 18:56:48 +0200 <dminuoso> Since 3.4.0.0 you should be seeing *which* library is apparently unbuildable
2022-09-25 18:57:45 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 18:57:56 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Remote host closed the connection)
2022-09-25 18:58:07 +0200coot(~coot@89-76-160-4.dynamic.chello.pl)
2022-09-25 19:00:59 +0200 <Guest53> Updated cabal to 3.8.1.0. Same problem.     Dependency on unbuildable library from yesod. In the stanza 'executable exe2'. In the inplace package 'myproject' where exe 2 is the exe depending on yesod and myproject ist just the name of my project / the unnamend library stanza.
2022-09-25 19:02:13 +0200 <Guest53> Or do you mean I should update the cabal-version and not cabal itself. I read somewhere that these are different things.
2022-09-25 19:02:35 +0200 <dminuoso> Guest53: Ah okay hold on, Im diving into the cabal source code
2022-09-25 19:03:03 +0200 <dminuoso> So `Dependency on unbuidlable library from yesod` means that the main library of yesod itself is considered unbuildable
2022-09-25 19:03:21 +0200 <Guest53> ok
2022-09-25 19:03:35 +0200redmp(~redmp@mobile-166-171-249-135.mycingular.net)
2022-09-25 19:03:50 +0200 <Guest53> So is it wrong to simply do "build-depends: yesod"? Is there a more elaborate approach to install it?
2022-09-25 19:04:08 +0200 <dminuoso> Let me look at `yesod`
2022-09-25 19:04:53 +0200 <dminuoso> https://hackage.haskell.org/package/yesod-1.6.2.1/src/yesod.cabal
2022-09-25 19:04:57 +0200 <dminuoso> It looks very much buildable to me mmm
2022-09-25 19:05:12 +0200 <dminuoso> Can you share your cabal file perhaps for contexdt?
2022-09-25 19:05:28 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 19:05:33 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Remote host closed the connection)
2022-09-25 19:05:36 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-25 19:06:58 +0200 <Guest53> Upload it somewhere? Don't want to spam.
2022-09-25 19:07:24 +0200 <dminuoso> Feel free to use https://paste.tomsmeding.com/
2022-09-25 19:09:13 +0200redmp(~redmp@mobile-166-171-249-135.mycingular.net) (Ping timeout: 246 seconds)
2022-09-25 19:10:37 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Ping timeout: 246 seconds)
2022-09-25 19:10:43 +0200 <Guest53> dminuoso: https://paste.tomsmeding.com/QrnXHu9c
2022-09-25 19:11:08 +0200redmp(~redmp@mobile-166-137-178-096.mycingular.net)
2022-09-25 19:12:42 +0200econo(uid147250@user/econo)
2022-09-25 19:13:28 +0200 <dminuoso> Guest53: Okay that looks surprising. Can you provide a reproducer maybe at github or gitlab?
2022-09-25 19:14:32 +0200 <Guest53> Surprisingly ok or surprising as in "weird project setup"?
2022-09-25 19:14:52 +0200 <dminuoso> The former
2022-09-25 19:22:49 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 19:24:09 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 19:25:58 +0200 <sm> it might be worth searching the bet for that error also if you haven't
2022-09-25 19:26:17 +0200 <sm> the net, even
2022-09-25 19:27:29 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-09-25 19:29:59 +0200 <sm> does that example cabal file reproduce the error ?
2022-09-25 19:31:12 +0200 <sm> does "cabal build yesod" work ?
2022-09-25 19:32:30 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2022-09-25 19:37:02 +0200mbuf(~Shakthi@49.205.83.245) (Quit: Leaving)
2022-09-25 19:37:09 +0200raym(~raym@user/raym) (Quit: leaving)
2022-09-25 19:40:06 +0200 <Guest53> sm: currently trying to reproduce the error in a new minimal project and so far failing to reproduce it ;)
2022-09-25 19:40:20 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-09-25 19:44:12 +0200notzmv(~zmv@user/notzmv) (Ping timeout: 264 seconds)
2022-09-25 19:46:37 +0200 <EvanR> if you can't reproduce it, it doesn't exist and never did! That's science
2022-09-25 19:47:15 +0200 <EvanR> (warped science)
2022-09-25 19:51:02 +0200f-a(~f-a@151.82.158.94)
2022-09-25 19:52:22 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-25 19:52:28 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-25 19:54:12 +0200raym(~raym@user/raym)
2022-09-25 19:56:23 +0200szkl(uid110435@id-110435.uxbridge.irccloud.com)
2022-09-25 19:58:54 +0200 <Guest53> Ok I copied everything bit by bit recompiling every time to reproduce the error. diff says the files are identical (apart from some comments). I don't know I'm just happy it works now. thanks everyone.
2022-09-25 20:00:21 +0200 <sm> try to make them identical ? could be an invisible character in there
2022-09-25 20:01:13 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 250 seconds)
2022-09-25 20:02:14 +0200 <Guest53> Could be. The only difference now is that the old project contains file names Like__this3___.hs and comments containing unicode symbols.
2022-09-25 20:03:42 +0200 <sm> next time, just mention that the paste isn't a reproducer
2022-09-25 20:03:47 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-25 20:04:46 +0200matthewmosior(~matthewmo@37.19.200.26)
2022-09-25 20:05:12 +0200ski. o O ( parsers over `STM' )
2022-09-25 20:05:38 +0200Oiyqlk(~rscastilh@191-214-26-24.user.veloxzone.com.br)
2022-09-25 20:08:01 +0200redmp(~redmp@mobile-166-137-178-096.mycingular.net) (Quit: leaving)
2022-09-25 20:08:17 +0200 <zzz> ok let's imagine that i have `class (Eq a, Enum a, Bounded a) => Cycle a where next a = if a == maxBound then minBound else succ a ; prev a = if a == minBound then maxBound else pred a`
2022-09-25 20:08:23 +0200 <Guest53> sm: Do you mean the tomsmeding paste? That is from the original project the one that doesn't work.
2022-09-25 20:08:23 +0200 <zzz> why can't i just derive this class?
2022-09-25 20:09:23 +0200 <sm> Guest53: oh so that is the exact failing cabal file ? that's what I was asking
2022-09-25 20:09:35 +0200 <Guest53> yes it is
2022-09-25 20:09:50 +0200 <sm> 👍🏻
2022-09-25 20:10:30 +0200 <ski> zzz : why not just define `next :: (Eq a,Enum a,Bounded a) => a -> a', without any `Cycle' class ?
2022-09-25 20:10:40 +0200 <ski> why do you want / think you need a class at all ?
2022-09-25 20:10:45 +0200 <monochrom> :)
2022-09-25 20:11:27 +0200 <zzz> fair enough
2022-09-25 20:11:37 +0200 <ski> what utility would using a class buy you (over such a freestanding, class-overloaded, `next') ? especially since you say you can't derive it
2022-09-25 20:13:31 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2022-09-25 20:13:43 +0200 <ski> (`deriving' is mostly ad-hoc magic. `GeneralizedNewtypeDeriving'/`GeneralisedNewtypeDeriving' is general (not specific to particular classes), but already assumes that the representation type is an instance of the class)
2022-09-25 20:14:20 +0200f-a(~f-a@151.82.158.94) ()
2022-09-25 20:14:25 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 20:16:01 +0200 <zzz> i'm still cultivating my intuition for when to use classes
2022-09-25 20:17:25 +0200vorpuni(~pvorp@2001:861:3881:c690:bc6d:def:d698:14f7)
2022-09-25 20:18:33 +0200 <EvanR> so generalized newtype deriving is good and normal deriving is bad?
2022-09-25 20:19:29 +0200razetime(~quassel@117.193.6.133) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-09-25 20:23:05 +0200 <ski> (also there's `DerivingVia',`DeriveAnyClass' .. latter to be used with default method implementations in the class, possibly also with `DefaultSignatures')
2022-09-25 20:23:24 +0200 <ski> ad-hoc is bad ?
2022-09-25 20:23:56 +0200 <ski> it's .. ad hoc. in some senses i guess one could claim it's bad
2022-09-25 20:24:02 +0200 <EvanR> sounds bad
2022-09-25 20:24:42 +0200 <EvanR> but now I'm projecting many usages of ad-hoc from blogs on such as Badness monad post
2022-09-25 20:25:26 +0200 <EvanR> making adhoc overloading less adhoc
2022-09-25 20:26:04 +0200qhong(~qhong@rescomp-21-400677.stanford.edu)
2022-09-25 20:26:08 +0200ski. o O ( "post hoc","post/cum hoc, ergo propter hoc","ex post" )
2022-09-25 20:26:49 +0200 <EvanR> when you get used to stuff that's apparently not ad hoc in haskell, it's addictive and you wonder what could solve the ad hoc stuff better
2022-09-25 20:28:22 +0200davean(~davean@davean.sciesnet.net)
2022-09-25 20:29:09 +0200 <monochrom> Absolute ad hoc is bad, but as usual, nothing in practice is absolute ad hoc.
2022-09-25 20:29:32 +0200 <EvanR> speaking of adhoc, is there a "this library slaps" level replacement for Show
2022-09-25 20:29:51 +0200 <EvanR> pretty print the stuff the Show would normally show
2022-09-25 20:30:06 +0200 <EvanR> or full scale replacement
2022-09-25 20:30:09 +0200 <monochrom> Eq and Ord show that relative, reasoned ad hoc is good.
2022-09-25 20:30:58 +0200Guest53(~Guest53@p200300ef971835186586f89dc41cda0a.dip0.t-ipconnect.de) ()
2022-09-25 20:33:16 +0200 <ski> i guess there's several pretty-printing packages
2022-09-25 20:33:28 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d) (Remote host closed the connection)
2022-09-25 20:33:46 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d)
2022-09-25 20:34:26 +0200 <sm> EvanR: like pretty-show, pretty-simple ?
2022-09-25 20:34:53 +0200 <EvanR> checking those out now
2022-09-25 20:35:21 +0200 <EvanR> I randomly tried one the other day and it was... drab
2022-09-25 20:35:54 +0200michalz(~michalz@185.246.207.217)
2022-09-25 20:39:20 +0200skirecalls reading a few pretty-printing papers
2022-09-25 20:39:48 +0200matthewmosior(~matthewmo@37.19.200.26) (Remote host closed the connection)
2022-09-25 20:40:39 +0200 <ski> (one of them related the multiple passes to attribute grammars, talking about how one can represent an attribute grammar using a "tying-the-knot" fold (as well as the explicit staging fold))
2022-09-25 20:44:30 +0200matthewmosior(~matthewmo@37.19.200.26)
2022-09-25 20:44:48 +0200ski. o O ( <https://wiki.haskell.org/Attribute_grammar> )
2022-09-25 20:45:24 +0200dtman34(~dtman34@2601:446:4400:2ad9:49aa:be6d:b3ac:4bab) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2022-09-25 20:45:45 +0200dtman34(~dtman34@c-73-62-246-247.hsd1.mn.comcast.net)
2022-09-25 20:47:22 +0200vulpine(xfnw@tilde.team) (Quit: Connection reset by purr)
2022-09-25 20:49:35 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv)
2022-09-25 20:49:55 +0200Cerins(~Cerins@balticom-142-106-43.balticom.lv) (Remote host closed the connection)
2022-09-25 20:53:16 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
2022-09-25 20:53:54 +0200jmdaemon(~jmdaemon@user/jmdaemon)
2022-09-25 20:54:13 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2022-09-25 20:55:55 +0200pavonia(~user@user/siracusa)
2022-09-25 20:56:10 +0200Sgeo(~Sgeo@user/sgeo)
2022-09-25 20:56:46 +0200matthewmosior(~matthewmo@37.19.200.26) (Ping timeout: 260 seconds)
2022-09-25 20:57:31 +0200 <EvanR> oooooo pretty-simple has colors, mind blown
2022-09-25 21:00:46 +0200 <EvanR> but is a bit conservative with pairs... https://i.imgur.com/nzRcCW2.png
2022-09-25 21:01:15 +0200 <EvanR> a whole line just for a lists comma
2022-09-25 21:05:21 +0200matthewmosior(~matthewmo@37.19.200.26)
2022-09-25 21:05:28 +0200 <EvanR> better than the default though
2022-09-25 21:07:05 +0200arjun(~arjun@user/arjun)
2022-09-25 21:10:28 +0200`2jt(~jtomas@88.17.232.105) (Ping timeout: 265 seconds)
2022-09-25 21:16:12 +0200 <ski> points
2022-09-25 21:16:22 +0200 <ski> (default being ?)
2022-09-25 21:17:18 +0200 <ski> hm, i guess it's using (logical ?) tabs for indentation ?
2022-09-25 21:19:25 +0200 <sm> yeah, pretty-show is more compact, but didn't handle dates/times (that might have changed since)
2022-09-25 21:19:28 +0200 <ski> would be nice with a system that could do "parallel alignment"
2022-09-25 21:19:40 +0200 <ski> (one might also call it "commutative", as in how there's multiple down-right paths from the upper corner of a rectangle to a point in it, but they all commute)
2022-09-25 21:19:53 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-25 21:22:44 +0200redmp(~redmp@mobile-166-137-178-096.mycingular.net)
2022-09-25 21:23:30 +0200acidjnk(~acidjnk@p200300d6e7137a29b83d7bde232748fa.dip0.t-ipconnect.de)
2022-09-25 21:28:11 +0200 <zzz> what is naturalNegate?
2022-09-25 21:28:16 +0200 <zzz> can't find the source
2022-09-25 21:29:24 +0200mniip(mniip@libera/staff/mniip) (Quit: This page is intentionally left blank)
2022-09-25 21:30:24 +0200 <EvanR> context?
2022-09-25 21:30:56 +0200 <zzz> i was wondering about Numeric.Natural's instance of Num
2022-09-25 21:31:20 +0200 <zzz> an there's a negate but if you use it it invariably gives you an error
2022-09-25 21:32:02 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 21:32:49 +0200 <zzz> from the source: `negate = naturalNegate`
2022-09-25 21:32:52 +0200 <zzz> which leads nwhere
2022-09-25 21:33:36 +0200 <EvanR> i found some source
2022-09-25 21:33:39 +0200 <EvanR> https://hackage.haskell.org/package/ghc-bignum-1.2/docs/src/GHC.Num.Natural.html#naturalNegate
2022-09-25 21:33:48 +0200nate3(~nate@98.45.169.16) (Ping timeout: 268 seconds)
2022-09-25 21:34:07 +0200waldo(~waldo@user/waldo) (Ping timeout: 246 seconds)
2022-09-25 21:34:08 +0200 <EvanR> it works for zero, otherwise raise an exception
2022-09-25 21:34:44 +0200 <EvanR> > negate (0 :: Natural)
2022-09-25 21:34:46 +0200 <lambdabot> error:
2022-09-25 21:34:46 +0200 <lambdabot> Not in scope: type constructor or class ‘Natural’
2022-09-25 21:36:34 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 265 seconds)
2022-09-25 21:44:09 +0200dsrt^(~dsrt@173-160-76-137-atlanta.hfc.comcastbusiness.net)
2022-09-25 21:47:55 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 21:52:53 +0200shriekingnoise(~shrieking@186.137.167.202)
2022-09-25 21:54:31 +0200jakalx(~jakalx@base.jakalx.net) ()
2022-09-25 21:55:49 +0200redmp(~redmp@mobile-166-137-178-096.mycingular.net) (Ping timeout: 252 seconds)
2022-09-25 21:56:22 +0200jakalx(~jakalx@base.jakalx.net)
2022-09-25 21:58:36 +0200king_gs(~Thunderbi@2806:103e:29:ac5e:a16e:4ac9:a89b:4d) (Ping timeout: 264 seconds)
2022-09-25 21:59:34 +0200nate3(~nate@98.45.169.16)
2022-09-25 22:04:07 +0200nate3(~nate@98.45.169.16) (Ping timeout: 265 seconds)
2022-09-25 22:04:26 +0200 <EvanR> say you have a working interpreter written in haskell. is there a slick way to bundle the haskell runtime with the script to form a "standalone" exe
2022-09-25 22:05:53 +0200Lycurgus(~juan@user/Lycurgus)
2022-09-25 22:06:08 +0200notzmv(~zmv@user/notzmv)
2022-09-25 22:06:38 +0200Guest53(~Guest53@p5b0627ab.dip0.t-ipconnect.de)
2022-09-25 22:09:11 +0200 <Guest53> Can I see the return "type" of a QuasiQuoter? The docs say "shamlet :: QuasiQuoter" but "[shamlet|...|] :: Markup". How do I know that shamlet produces a Markup value without using a type hole?
2022-09-25 22:09:42 +0200coot(~coot@89-76-160-4.dynamic.chello.pl) (Quit: coot)
2022-09-25 22:09:48 +0200biberu(~biberu@user/biberu) (Read error: Connection reset by peer)
2022-09-25 22:11:16 +0200 <c_wraith> QuasiQuoters don't use typed TH so.. You can't from the types of anything in that API.
2022-09-25 22:11:43 +0200 <c_wraith> You have to hope the documentation tells you
2022-09-25 22:12:04 +0200 <Guest53> So the only way to know is to put it in "[quasiquoter|...]" and then ":: _"
2022-09-25 22:12:07 +0200matthewmosior(~matthewmo@37.19.200.26) (Ping timeout: 244 seconds)
2022-09-25 22:12:11 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2022-09-25 22:13:28 +0200 <c_wraith> Usually the documentation tells you, so you can skip that step
2022-09-25 22:14:15 +0200 <Guest53> thanks
2022-09-25 22:14:39 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-09-25 22:16:20 +0200biberu(~biberu@user/biberu)
2022-09-25 22:19:59 +0200 <c_wraith> QuasiQuoters are... kind of unfortunately too general. They are designed to be usable to generate declarations, types, expressions, or patterns.
2022-09-25 22:20:10 +0200 <c_wraith> Except very few actually do that
2022-09-25 22:20:27 +0200 <c_wraith> You have to define a separate handler for each context, and very few do anything other than expressions
2022-09-25 22:21:27 +0200 <c_wraith> We'd probably benefit from a second type of QuasiQuoter. One that uses the same splice syntax, but only generates expressions, and goes via typed TH so that the type of the generated expression shows up in the type of the QuasiQuoter
2022-09-25 22:22:50 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2022-09-25 22:24:09 +0200matthewmosior(~matthewmo@37.19.200.26)
2022-09-25 22:26:15 +0200dsrt^(~dsrt@173-160-76-137-atlanta.hfc.comcastbusiness.net) (Ping timeout: 252 seconds)
2022-09-25 22:27:40 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-25 22:28:05 +0200ddellacosta(~ddellacos@89.45.224.187)
2022-09-25 22:31:52 +0200titibandit(~titibandi@xdsl-87-78-162-143.nc.de) (Ping timeout: 246 seconds)
2022-09-25 22:32:12 +0200titibandit(~titibandi@137.226.196.214)
2022-09-25 22:32:21 +0200Everything(~Everythin@37.115.210.35) (Quit: leaving)
2022-09-25 22:34:01 +0200titibandit(~titibandi@137.226.196.214) (Read error: Connection reset by peer)
2022-09-25 22:34:09 +0200pera(~pera@user/pera)
2022-09-25 22:35:07 +0200Me-me(~me-me@v.working.name) (Changing host)
2022-09-25 22:35:07 +0200Me-me(~me-me@user/me-me)
2022-09-25 22:36:19 +0200Athas(athas@2a01:7c8:aaac:1cf:5a6a:37a5:b994:6597) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-25 22:36:28 +0200Athas(athas@sigkill.dk)
2022-09-25 22:37:25 +0200 <dminuoso> EvanR: You can use TemplateHaskell to write a program that loads the interpreter as a library, and loads the script off the harddisk at compilation time.
2022-09-25 22:38:12 +0200nate3(~nate@98.45.169.16)
2022-09-25 22:38:39 +0200 <EvanR> interesting
2022-09-25 22:41:20 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 22:42:56 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-01cb-cda3-629f-bfc2.res6.spectrum.com) (Quit: Leaving)
2022-09-25 22:43:31 +0200 <sm> or you can embed the script in the executable
2022-09-25 22:44:05 +0200 <dminuoso> Doesnt cabal have some facility to do this?
2022-09-25 22:44:46 +0200 <sm> that's stack or cabal scripts - a weaker definition of bundle and exe. You can ship a single file, but it also requires the stack or cabal executable
2022-09-25 22:45:08 +0200 <EvanR> yeah that's less standalone
2022-09-25 22:45:09 +0200dsrt^(~dsrt@173-160-76-137-atlanta.hfc.comcastbusiness.net)
2022-09-25 22:45:26 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-01cb-cda3-629f-bfc2.res6.spectrum.com)
2022-09-25 22:45:39 +0200arjun(~arjun@user/arjun) (Quit: Leaving)
2022-09-25 22:45:43 +0200 <sm> in between these two.. you can ship a bash script which installs stack or cabal and then runs or compiles the thing
2022-09-25 22:47:11 +0200 <sm> I think the slickest for a user would be a compiled binary containing both interpreter and script - not sure why it would need TH dminuoso ?
2022-09-25 22:47:51 +0200 <EvanR> presumably for the binary creator to swap in different scripts
2022-09-25 22:48:13 +0200 <dminuoso> sm: TH lets you do IO at compilation time.
2022-09-25 22:48:21 +0200 <dminuoso> So you can readFile the script and bake it into the binary
2022-09-25 22:48:40 +0200 <sm> oh right you are.. file-embed which I'm thinking of uses TH
2022-09-25 22:48:47 +0200 <dminuoso> As long as the interpreter already has an API interface, this requires an absolute minimum of effort
2022-09-25 22:49:17 +0200 <sm> I guess there is another way (embed as a haskell literal as a separate step)
2022-09-25 22:49:36 +0200 <dminuoso> I have various other options in mind, but none of them are trivial, like rewrapping the ELF
2022-09-25 22:49:56 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-01cb-cda3-629f-bfc2.res6.spectrum.com) (Ping timeout: 260 seconds)
2022-09-25 22:50:01 +0200 <sm> can we involve Actually Portable Executables somehow...
2022-09-25 22:50:01 +0200 <dminuoso> Oh there is one other idea!
2022-09-25 22:50:04 +0200 <EvanR> oh that sounds like fun
2022-09-25 22:50:15 +0200 <dminuoso> EvanR: You can just ship everything in a bash script!
2022-09-25 22:50:24 +0200 <EvanR> compile to bash
2022-09-25 22:50:29 +0200 <EvanR> it's finally solved
2022-09-25 22:50:35 +0200 <EvanR> then turns out their on windows
2022-09-25 22:50:46 +0200 <sm> I was considering that once
2022-09-25 22:50:56 +0200 <sm> even windows can run bash now ? but I guess still not easily
2022-09-25 22:51:02 +0200 <monochrom> Let them have WSL.
2022-09-25 22:51:09 +0200 <int-e> dminuoso: and gog is doing it
2022-09-25 22:51:14 +0200 <EvanR> compile to DOS commands. Ok it's not DOS anymore
2022-09-25 22:51:21 +0200david(~david@2a01:e34:ec2b:d430:44a:f5ca:9867:d69d) (Quit: Konversation terminated!)
2022-09-25 22:51:23 +0200 <EvanR> powershell
2022-09-25 22:51:24 +0200 <int-e> (shipping as bash scripts)
2022-09-25 22:51:53 +0200 <sm> not entirely compiled to bash though, I imagine
2022-09-25 22:52:12 +0200 <dminuoso> Starting with the wrapper script, and then in a trailing heredoc you include the script + haskell executable. Keep script length around as an offset, extract haskell executable, run it and feed script via stdin.
2022-09-25 22:52:30 +0200titibandit(~titibandi@xdsl-87-78-162-143.nc.de)
2022-09-25 22:52:38 +0200 <monochrom> In the last days of King Louis XVI of France, the common people were upset because they couldn't run Louis's bash scripts on Windows. Queen Marie Antonique said "so just use WSL", and that started the French Revolution.
2022-09-25 22:52:48 +0200 <dminuoso> But honestly, I would just flip on TH. :)
2022-09-25 22:53:12 +0200 <dminuoso> It's extremely low effort, and works relatively portably
2022-09-25 22:53:14 +0200 <sm> embed script in interpreter, or embed interpreter in script :)
2022-09-25 22:53:57 +0200 <int-e> monochrom: be careful, you might end up like https://esoteric.codes/blog/the-128-language-quine-relay
2022-09-25 22:54:11 +0200 <dminuoso> EvanR: You might be able to pull something off with a custom Setup.hs too, something where you auto-generate modules based off local disks.
2022-09-25 22:54:19 +0200 <dminuoso> I *think* this is the cleanest solution
2022-09-25 22:54:29 +0200 <sm> ugh, that sounds like pain
2022-09-25 22:54:30 +0200 <dminuoso> Except you will have to endure the headaches of dealing with Cabal-the-library
2022-09-25 22:55:18 +0200 <EvanR> actualling using Setup.hs
2022-09-25 22:55:27 +0200 <EvanR> actually*. crazy
2022-09-25 22:57:05 +0200LinuxQNX
2022-09-25 22:57:46 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 265 seconds)
2022-09-25 22:58:29 +0200 <dminuoso> It would be kind of nice if we had a way to simply include assets into the build process, such that they get baked into the binary but accessible via say readFile
2022-09-25 22:58:45 +0200 <dminuoso> Heck or even custom functions for that
2022-09-25 22:58:48 +0200 <dminuoso> readFileFromAssets
2022-09-25 22:59:09 +0200 <dminuoso> This would solve a major problem I have right now. :)
2022-09-25 22:59:10 +0200edrx(~Eduardo@2804:56c:d2dc:ac00:dab8:211d:d4eb:fa94)
2022-09-25 22:59:20 +0200 <EvanR> construct a Handle that looks inside the program itself and use hGet etc?
2022-09-25 22:59:45 +0200 <c_wraith> You can build that.
2022-09-25 22:59:48 +0200 <EvanR> can Handles be arbitrarily repurposed
2022-09-25 23:00:12 +0200 <int-e> embed a user-space file system
2022-09-25 23:00:28 +0200 <int-e> if custom Handles seem too easy
2022-09-25 23:00:30 +0200 <dminuoso> Well you can craft a custom Handle__ and sneak it inside a FileHandle...
2022-09-25 23:00:42 +0200 <dminuoso> That part seems relatively easy
2022-09-25 23:01:04 +0200 <EvanR> nothing to it
2022-09-25 23:02:08 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 23:03:56 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-01cb-cda3-629f-bfc2.res6.spectrum.com)
2022-09-25 23:07:01 +0200 <dminuoso> Under the hood all we have to do is just generate a symbol for some binary blob and
2022-09-25 23:07:16 +0200 <dminuoso> Then sprinkle some magic on GHC and cabal
2022-09-25 23:07:26 +0200 <dminuoso> Think I have some dust left..
2022-09-25 23:08:01 +0200 <c_wraith> dminuoso: https://hackage.haskell.org/package/template-haskell-2.19.0.0/docs/Language-Haskell-TH-Lib.html#v:…
2022-09-25 23:08:24 +0200 <dminuoso> Mmmm
2022-09-25 23:08:38 +0200 <c_wraith> It gives you an Addr# at runtime
2022-09-25 23:08:54 +0200 <dminuoso> c_wraith: I guess we can also generate a module with a big fat Addr# literal too.
2022-09-25 23:08:55 +0200pera(~pera@user/pera) (Quit: leaving)
2022-09-25 23:09:04 +0200 <dminuoso> Avoids the need for TH
2022-09-25 23:09:24 +0200 <edrx> why is the first "do" below ok but not the second?
2022-09-25 23:09:26 +0200 <edrx> do x <- [1..3]; y <- [1..3]; return (x,y)
2022-09-25 23:09:26 +0200 <edrx> do x <- [1..3]; y <- [1..3]; return 10*x+y
2022-09-25 23:09:40 +0200 <c_wraith> I was recently surprised to learn TH isn't the slowdown for compilation that it used to be
2022-09-25 23:09:49 +0200 <EvanR> (return 10)*x+y
2022-09-25 23:09:49 +0200 <edrx> the error is: <interactive>:20:1: error: * Non type-variable argument in the constraint: Enum [b] (Use FlexibleContexts to permit this) * When checking the inferred type it :: forall b. (Enum [b], Num b, Num [b]) => [b]
2022-09-25 23:09:58 +0200 <dminuoso> edrx: function application binds tighter than almost everything.
2022-09-25 23:10:34 +0200 <dminuoso> c_wraith: It's certainly not as bad as Generics most of the time.
2022-09-25 23:10:37 +0200 <EvanR> this ain't your Dad's C return
2022-09-25 23:10:44 +0200 <edrx> aaaaahhhhh!!!!!
2022-09-25 23:10:49 +0200 <edrx> sorry! =)
2022-09-25 23:11:06 +0200 <dminuoso> With Generics you get extremely poor compilation time *and* not even a guarantee of Generics being erased
2022-09-25 23:11:06 +0200 <EvanR> aka pure
2022-09-25 23:11:11 +0200 <dminuoso> Worst of all worlds.
2022-09-25 23:12:57 +0200Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt juan@acm.org)
2022-09-25 23:14:30 +0200 <sm> what's the major problem dminuoso ?
2022-09-25 23:15:58 +0200 <dminuoso> sm: I want to publish a RADIUS library, as part of it I want to include the freeRADIUS dictionaries. And Im somewhat stuck debating how to do that.
2022-09-25 23:16:13 +0200 <sm> I access files like https://hackage.haskell.org/package/hledger-1.27.1/docs/src/Hledger.Cli.DocFiles.html#toolDocs with custom code. But there have been situations where I had to interact with something external that had to read from disk, for those I write it out to /tmp at runtime
2022-09-25 23:16:15 +0200 <dminuoso> One solution is to use TemplateHaskell, and include their parsed artifacts as just top level bindings, exposing them to the user.
2022-09-25 23:16:40 +0200 <sm> nod
2022-09-25 23:27:29 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-25 23:29:02 +0200titibandit(~titibandi@xdsl-87-78-162-143.nc.de) (Remote host closed the connection)
2022-09-25 23:35:53 +0200 <edrx> ski: I just got - and, read, and understood - your hints about the pragma InstanceSigns! thanks =)
2022-09-25 23:41:06 +0200rockymarine(~rocky@user/rockymarine)
2022-09-25 23:42:28 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-09-25 23:46:33 +0200ellensol(~ellen@178-78-210-152.customers.ownit.se) (Ping timeout: 252 seconds)
2022-09-25 23:48:44 +0200jargon(~jargon@184.101.186.15)
2022-09-25 23:50:30 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com)
2022-09-25 23:55:47 +0200Tuplanolla(~Tuplanoll@91-159-69-34.elisa-laajakaista.fi) (Quit: Leaving.)
2022-09-25 23:55:52 +0200burnsidesLlama(~burnsides@119247164140.ctinets.com) (Ping timeout: 246 seconds)
2022-09-25 23:56:28 +0200 <Guest53> I don't understand why badFoo doesn't work. The 3 lines look equivalent to me:
2022-09-25 23:56:30 +0200 <Guest53> goodFoo1 = renderHtml [shamlet|#{reverse $ fmap toUpper "foo" }|]
2022-09-25 23:56:31 +0200 <Guest53> goodFoo2 = renderHtml [shamlet|#{reverse $ fmap toUpper $ "foo" }|]
2022-09-25 23:56:32 +0200 <Guest53> badFoo = renderHtml[shamlet|#{reverse . fmap toUpper $ "foo" }|]
2022-09-25 23:57:21 +0200 <Guest53> Is function composition not allowed when interpolation Haskell expressions?
2022-09-25 23:57:27 +0200thyriaen(~thyriaen@2a02:8109:8340:686c:7383:e0e2:ad95:9fce) (Remote host closed the connection)
2022-09-25 23:59:41 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se)