Logs on 2021-02-17 (freenode/#haskell)
| 00:00:37 | <edwardk> | each of those returns a bottom, just like my let x = x in x. there is _nothing_ you can do in pure code that allows you to distinguish between different exception types or that infinite looping case, so we just colloquially lump them all into 'bottom'. |
| 00:01:12 | × | ContessaFortuna quits (88385f6e@136.56.95.110) (Quit: Connection closed) |
| 00:02:01 | <karasu1[m]> | I've worked with Scheme before, but I thought #f just meant false (like False in Haskell). But in Scheme, everything that's not #f is actually considered "True" |
| 00:02:15 | <edwardk> | its the act of case/pattern matching that takes your 'lifted type' and figures out what to do next. a "lifted type" is a type that can contain bottoms, (e.g. every type in haskell except some stuff in GHC.Prim you almost never see) |
| 00:02:17 | <karasu1[m]> | And '() is also false |
| 00:02:22 | <karasu1[m]> | in scheme |
| 00:02:28 | <edwardk> | in karasu1[m] have you ever used letrec in scheme? |
| 00:02:31 | <dolio> | Scheme just lets anything happen anywhere, so it's kind of a harder analogy to draw. |
| 00:02:44 | <karasu1[m]> | letrec is used for mutual recursion, and yes I have used it |
| 00:02:55 | <karasu1[m]> | not sure about the actual implementation underneath though |
| 00:03:49 | <karasu1[m]> | But I do often get worried that things won't terminate in Mutual recursion, so I'm always extra careful when using it |
| 00:03:53 | <edwardk> | when you go to write a letrec definition and you to to define just the equivalent of x = cons 1 x how does the compiler build the cons cell? it has to put something in for x temporarily. in scheme it'll put an #f in there as a placeholder then patch it up |
| 00:04:12 | <edwardk> | this is the way you do it in strict languages |
| 00:04:29 | <edwardk> | in a lazy language you can |
| 00:04:31 | <edwardk> | > let ones = 1 : ones in ones |
| 00:04:33 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... |
| 00:04:37 | <ephemient> | (e.g. every let is a letrec in Haskell) |
| 00:04:58 | <edwardk> | and it makes a 'thunk' that evaluates to the result of 1 consed onto itself when forced. |
| 00:04:59 | ski | . o O ( `call-with-current-continuation' can distinguish a Y-based `letrec' from a mutation-based one ) |
| 00:05:09 | <edwardk> | we never slip a #f or null into that slot. |
| 00:05:26 | <edwardk> | the damning part about letrec in the scheme case is that you can find cases where it becomes visible to user code. |
| 00:05:38 | <edwardk> | so when you go to think about typed scheme letrec becomes hairy |
| 00:05:52 | <dolio> | call/cc can implement Y. :þ |
| 00:06:00 | <edwardk> | in ml dialects you get the same probem. this is one reason why they tend to be so ref-happy. |
| 00:06:00 | <ski> | that too :) |
| 00:06:00 | <dolio> | I think. |
| 00:06:09 | <monochrom> | Yikes, I need to show that to my students! |
| 00:06:54 | <ski> | ((call/cc call/cc) (call/cc call/cc)) ; try this ? |
| 00:07:12 | <edwardk> | ski: my eyes |
| 00:07:42 | <monochrom> | That breaks my mind but I'll try it one day. Hey it doesn't look too far off from (delta delta) |
| 00:07:47 | <dolio> | http://okmij.org/ftp/continuations/undelimited.html#fix-callcc |
| 00:08:25 | <ski> | thought it was Oleg, yes |
| 00:08:44 | × | LKoen quits (~LKoen@96.252.88.92.rev.sfr.net) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”) |
| 00:08:49 | <karasu1[m]> | <edwardk "when you go to write a letrec de"> hmmm, in a sense this sucks, since this is actually modifying the list from #f to the value it's patched up to (meaning it's not purely functional) |
| 00:09:09 | <edwardk> | exactly |
| 00:09:28 | × | usr25_tm quits (~usr25@unaffiliated/usr25) (Quit: Leaving) |
| 00:09:41 | <edwardk> | 'tying the knot' in a strict language over a linked list you want to make circular fundamentally involves putting a null in somewhere, then apologizing and cleaning up your mess. |
| 00:10:32 | <edwardk> | in a lazy language 'tying the knot' involves putting in a thunk, a promise to compute a value with the right type when forced, and then evaluating that thunk when forced, which can now refer to itself as a "better" undistinguishable null |
| 00:11:02 | <edwardk> | the downside is bottoms clutter up your semantics and bob harper gets mad at you for not using all his work on ml |
| 00:11:42 | × | Lowl3v3l quits (~Lowl3v3l@dslb-002-203-233-121.002.203.pools.vodafone-ip.de) (Quit: Leaving.) |
| 00:11:42 | <karasu1[m]> | what is a thunk? I thought this word just referred to a lambda function with no arguments? |
| 00:11:55 | <dolio> | Well, he'll get mad even if you use Haskell. |
| 00:11:56 | <karasu1[m]> | But not sure if this makes sense anymroe |
| 00:11:56 | <edwardk> | yes bob, the sml module system is a work of art, now where was i... |
| 00:12:05 | <karasu1[m]> | * But not sure if this makes sense anymore |
| 00:12:21 | <edwardk> | well, its not exactly that. it also replaces itself with its answer when run |
| 00:13:04 | <edwardk> | in ml you'd usually use a function from () as a poor man's thunk, some way to defer a calculation you aren't ready to do yet. but the 'and it replaces itself with its answer' is a big part of the haskell story. |
| 00:13:52 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 00:14:00 | <edwardk> | call-by-name is one way to implement a lazy language, call-by-need is another. the former feels like what you're thinking. 'a function with no arguments', but it lacks the fact that if you ask for the value of the same thunk twice in haskell you get the answer the second time with no work |
| 00:14:23 | <ephemient> | thunk = to-be-evaluated. in a strict language, it can only be implemented as a lambda. but that's (basically) every expression in Haskell. we don't have no-arg lambdas |
| 00:14:47 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 00:14:53 | <ephemient> | if you have threads then ... it depends on blackholing I guess |
| 00:15:36 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 00:15:36 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 240 seconds) |
| 00:16:37 | × | Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.) |
| 00:17:15 | × | carif quits (~mcarifio@cpe-67-246-227-118.rochester.res.rr.com) (Quit: leaving) |
| 00:18:35 | <karasu1[m]> | You can't make a no argument lambda in Haskell? |
| 00:18:38 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 260 seconds) |
| 00:18:51 | <karasu1[m]> | In Scheme it would look something like (lambda () (do something)) |
| 00:19:14 | <edwardk> | in scheme you can make + take n-many arguments as well. we don't have that syntactic marker in haskell |
| 00:19:18 | <edwardk> | so we use an explicit fold |
| 00:19:24 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 00:19:29 | <edwardk> | (f) = f |
| 00:20:21 | <edwardk> | you can make a function in haskell that takes an object of type (), but it still takes an argument |
| 00:20:41 | <edwardk> | > let f :: () -> Int; f () = 12 in f |
| 00:20:43 | <lambdabot> | <() -> Int> |
| 00:20:45 | <edwardk> | > let f :: () -> Int; f () = 12 in f () |
| 00:20:46 | <lambdabot> | 12 |
| 00:20:59 | <edwardk> | so to write the 'zero argument' version you just say f = 12 |
| 00:21:01 | <ephemient> | and then it might be strict or lazy in its argument... |
| 00:21:08 | <ski> | all functions in Haskell take exactly one argument |
| 00:21:22 | <Axman6> | karasu1[m]: a thunk is basically an expression which hasn't had its value demanded: |
| 00:21:24 | <karasu1[m]> | Wow |
| 00:21:26 | <karasu1[m]> | ((+) 1 2 3) |
| 00:21:33 | <karasu1[m]> | I thought this would have worked in Haskell |
| 00:21:34 | <ski> | @let newCyclicIORef :: (IORef a -> a) -> IO (IORef a); newCyclicIORef f = mfix (newIORef . f) |
| 00:21:35 | <lambdabot> | Defined. |
| 00:21:36 | <karasu1[m]> | but it doesn't |
| 00:21:43 | <ski> | > sum [1,2,3] -- works |
| 00:21:45 | <lambdabot> | 6 |
| 00:21:46 | <Axman6> | > let foo = ("hello",7^239498729832974598723) in show (fst foo) |
| 00:21:47 | <lambdabot> | "\"hello\"" |
| 00:21:48 | <edwardk> | > foldr (+) 0 [1,2,3] |
| 00:21:49 | <ephemient> | > foldl' (+) [1, 2, 3] |
| 00:21:50 | <lambdabot> | 6 |
| 00:21:51 | <lambdabot> | error: |
| 00:21:51 | <lambdabot> | • No instance for (Num [Integer]) arising from a use of ‘e_1123’ |
| 00:21:51 | <lambdabot> | • In the expression: e_1123 |
| 00:21:58 | <ephemient> | oops, forgot the initial value |
| 00:22:08 | <edwardk> | > foldl1 (+) [1,2,3] |
| 00:22:10 | <lambdabot> | 6 |
| 00:22:42 | <Axman6> | 7^239498729832974598723 is an expression, which when some other code needs its value will run the exponentiation but since nothing asked for its value, it's just sitting around as (^) 7 239498729832974598723 |
| 00:22:42 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 00:22:42 | <edwardk> | but 'do i mean for it to have left to right or right to left fold semantics matters. i mean when you to write (- 1 2 3 4 5) which you mean is pretty important! |
| 00:22:53 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 00:23:06 | <Axman6> | :t (+) |
| 00:23:07 | <lambdabot> | Num a => a -> a -> a |
| 00:23:36 | <Axman6> | karasu1[m]: clearly that type can only apply be applied to two arguments* - this isn't lisp |
| 00:23:42 | <edwardk> | ((((1 - 2) - 3) - 4) - 5) is quite differnt from (1 - (2 - (3 - (4 - 5)))) |
| 00:23:51 | <Axman6> | (it's actually not necessarilly clear, if a is some function type, but we'll ignore that) |
| 00:24:05 | <edwardk> | so yeah, in scheme you get the ()'s to act as a marker. (p) isn't p in general. |
| 00:24:14 | <edwardk> | in haskell nope |
| 00:24:17 | <ski> | > foldr1 (-) [1,2,3,4,5] :: Expr |
| 00:24:18 | <lambdabot> | 1 - (2 - (3 - (4 - 5))) |
| 00:24:20 | <ski> | > foldl1 (-) [1,2,3,4,5] :: Expr |
| 00:24:22 | <lambdabot> | 1 - 2 - 3 - 4 - 5 |
| 00:24:39 | <ski> | (the latter means `(((1 - 2) - 3) - 4) - 5') |
| 00:25:21 | <edwardk> | this is one reason why haskell doesn't _directly_ offer you a way to deal with named arguments like many other languages do |
| 00:25:42 | <edwardk> | (yeah you can emulate them by making a record, using field accessors and passing the record as an argument) |
| 00:25:45 | <ski> | (OCaml does have named arguments, though) |
| 00:26:36 | → | lep_ joins (~lep@94.31.101.183) |
| 00:27:22 | × | lep-delete quits (~lep@94.31.81.183) (Ping timeout: 265 seconds) |
| 00:27:26 | → | astronavt joins (~astronavt@unaffiliated/astronavt) |
| 00:27:26 | <edwardk> | the sketch of a problem here is that if i tried to call f (x=12) (y=23) -- it isn't clear if i should stop and call the thing now damnit, or if i should wait for more arguments for currying purposes. |
| 00:28:21 | <ski> | well, depends on whether there's more arguments, no ? |
| 00:28:46 | <edwardk> | most of the systems that offer named arguments also offer default arguments |
| 00:28:52 | lep_ | is now known as lep-delete |
| 00:29:10 | <ski> | yea .. different syntax for those, in OCaml, iirc |
| 00:29:11 | <dolio> | Agda has named arguments, too. :) |
| 00:29:14 | <edwardk> | its the defaulting bit that trips you up |
| 00:29:15 | <dolio> | But not defaults. |
| 00:29:24 | <ski> | yep :( |
| 00:29:27 | <Axman6> | Agda is also martian language |
| 00:29:49 | <edwardk> | Martin would not approve of that label |
| 00:30:14 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 00:30:39 | ski | . o O ( Martin, or Martian ? ) |
| 00:30:45 | → | PaperGamma joins (~PaperGamm@124.160.154.40) |
| 00:30:56 | × | PaperGamma quits (~PaperGamm@124.160.154.40) (Remote host closed the connection) |
| 00:30:56 | <karasu1[m]> | <edwardk "this is one reason why haskell d"> wait what do you mean? I can define `f :: Int -> Int -> Int ; f x y = x + y`, so x and y are named right? |
| 00:31:20 | <ski> | karasu1[m] : those are local to the definition. the call site knows nothing of `x' and `y' |
| 00:31:46 | <Axman6> | you can't do something like f{y = 7} 5 |
| 00:31:46 | <karasu1[m]> | yea, but isn't that the case in all languages? |
| 00:31:51 | <Axman6> | no |
| 00:31:51 | <ski> | no |
| 00:31:53 | <karasu1[m]> | unless we have global variables going on |
| 00:32:03 | <ski> | that's something else entirely |
| 00:32:04 | <karasu1[m]> | which is usually bad style |
| 00:32:16 | <Axman6> | mant languages let you say f(y = 6, x = 4) and the order no longer matters |
| 00:32:28 | <edwardk> | martin escardo once objected when someone on the agda mailing list wanted to call something from brazil a 'brazilian functor' (i think), he was like "but I'm from Brazil and I'd never use that...", so then the response was a proposal was to rename them 'martian functors', and his reply was 'but my name is martin!' |
| 00:32:36 | <edwardk> | i apologize for mangling the anecdote |
| 00:32:53 | <ski> | oh, Martín |
| 00:33:13 | <edwardk> | yeah, as an american i had my ability to type accent marks removed at birth. |
| 00:33:49 | <Boarders> | I am trying to use Alex but getting an error of the form: "templates/GenericTemplate.hs:54:1: error: |
| 00:33:49 | <Boarders> | parse error (possibly incorrect indentation or mismatched brackets)" |
| 00:34:27 | <Axman6> | ads and/or delete random brackets until the error disappears! |
| 00:34:30 | <Axman6> | add* |
| 00:34:30 | <Boarders> | What does that mean? |
| 00:34:40 | × | sz0 quits (uid110435@gateway/web/irccloud.com/x-weszrhezblvvfxue) (Quit: Connection closed for inactivity) |
| 00:34:47 | <ephemient> | karasu1[m]: Python as an example, def f(x, y): pass; f(y = 2, x = 1) |
| 00:34:51 | <ski> | perhaps it means the indentation is wrong ? |
| 00:34:54 | <Axman6> | it means the haskell isn't syntactically valid, you're probably missing a bracket somewhere |
| 00:34:58 | <Boarders> | my problem is it is talking about templates which is not part of my code |
| 00:34:59 | <ski> | is that generated code ? did you edit it ? |
| 00:35:08 | <Boarders> | I didn't edit it |
| 00:35:14 | → | lmw joins (1f1d2079@gateway/web/thelounge/ip.31.29.32.121) |
| 00:35:32 | <Axman6> | wihtout more information we're even more clusless than you |
| 00:35:34 | lmw | hugs ski |
| 00:35:38 | <edwardk> | Boarders: alex doesn't give very good error messages. it generally means something is wrong with your code that it spliced into the template |
| 00:36:00 | <edwardk> | look very closely at the file you are feeding alex |
| 00:36:02 | <karasu1[m]> | <ephemient "karasu1: Python as an example, d"> I see.. So the reason this isn't allowed in Haskell is because it would mess up folding? |
| 00:36:05 | <Boarders> | thanks ekwardk! I just wanted to know if the problem is on my end or somethig weirder |
| 00:36:20 | <edwardk> | karasu1[m]: no, it messes up the fact that in haskell 'everything is a function of one argument' |
| 00:36:20 | <Boarders> | * |
| 00:36:26 | <edwardk> | :t (+) |
| 00:36:27 | <lambdabot> | Num a => a -> a -> a |
| 00:36:33 | <edwardk> | note that says a -> a -> a |
| 00:36:37 | <edwardk> | a -> (a -> a) |
| 00:36:48 | <edwardk> | it is a function that takes one argument and returns a function that takes another argument |
| 00:36:53 | <Axman6> | first thiwe teach when teaching Haskell is: _all_ functions take exactly one argument, there are no exceptions |
| 00:37:03 | <Axman6> | thing we* |
| 00:37:08 | <edwardk> | > let f = (+) 1 in f 2 |
| 00:37:09 | <lambdabot> | 3 |
| 00:37:14 | <edwardk> | > let f = (+) 1 in (f 2, f 4) |
| 00:37:16 | <lambdabot> | (3,5) |
| 00:37:30 | <karasu1[m]> | OK makes sense |
| 00:37:51 | <karasu1[m]> | I thought Scheme was curried |
| 00:37:54 | <karasu1[m]> | But I guess not |
| 00:37:57 | <edwardk> | in a scheme like language (+ 1) -- would just give back 1, and its not going to build a function that sticks around waiting for another |
| 00:38:04 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 00:38:06 | <ephemient> | :t (+ 1) |
| 00:38:07 | <lambdabot> | Num a => a -> a |
| 00:38:08 | <edwardk> | you can make a macro in scheme that gives you currying |
| 00:38:09 | <Axman6> | in many ways, Haskell is much _less_ magic than most languages. It is actually an extremely simple language, but can be used to make quite complex abstractions |
| 00:38:19 | <lmw> | :? |
| 00:38:21 | <edwardk> | e.g. http://comonad.com/reader/2009/curried-scheme/ |
| 00:38:25 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 00:39:37 | <Boarders> | scheme functions have an 'arity kind' (including polymorphic arity) which prohibits any nice currying story |
| 00:39:46 | <Boarders> | Python has the same feature |
| 00:40:16 | × | m0rphism1 quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 240 seconds) |
| 00:40:19 | × | quinn quits (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) (Quit: ZNC 1.8.1 - https://znc.in) |
| 00:40:22 | <ephemient> | Haskell has a lot of syntactic sugar (relative to ML siblings, anyhow), which I think can get perceived as magic, but once you know what they desugar to it's all pretty mechanical |
| 00:41:40 | <Axman6> | yeah, the main magical things are numbers, list syntax, strings and possibly do notation, they seem to be the things which trip up newcomers the most very early on |
| 00:41:48 | <karasu1[m]> | Today I learned Haskell is a sibling of Machine Learning (this is a joke..) |
| 00:42:21 | ski | hugs lmw back |
| 00:43:05 | <karasu1[m]> | thanks for the help everyone. |
| 00:43:15 | × | vqrs quits (~vqrs@learnprogramming/regular/vqrs) (Ping timeout: 272 seconds) |
| 00:43:44 | <ski> | karasu1[m] : "I thought Scheme was curried" -- neither Scheme nor Haskell "are curried" .. nor are they "not curried". currying is not a property of a language, it's a programmer convention, it's all in your head |
| 00:44:50 | <karasu1[m]> | ? But it's the way Haskell works though right? There can't be any other programming convention in Haskell, since every function will only ever take one argument right |
| 00:44:51 | × | Tesseraction quits (~Tesseract@unaffiliated/tesseraction) (Read error: Connection reset by peer) |
| 00:45:04 | <ski> | no, that's a misconception |
| 00:45:16 | <ski> | it's not "the way Haskell works" |
| 00:45:22 | → | Tesseraction joins (~Tesseract@unaffiliated/tesseraction) |
| 00:46:03 | <ski> | currying is a particular way in which you can represent/encode "multiparameter functions" .. e.g. in a language (like Haskell), which lacks the latter |
| 00:46:13 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 00:46:57 | <karasu1[m]> | But this convention is enforced in Haskell, since it can't have "multiparameter functions", is that correct? |
| 00:47:03 | <ski> | or, rather, "curried style" is that particular way. "currying" refers to converting to curried style (e.g. from "tupled style", which is *another* way to represent multiparameter functions) |
| 00:47:07 | <ski> | no, it's not enforced |
| 00:47:08 | <karasu1[m]> | Since it "lacks" them, as you said |
| 00:47:11 | <karasu1[m]> | ?? |
| 00:47:13 | <ski> | you can write |
| 00:47:25 | <ski> | sumOfSquares (x,y) = x^2 + y^2 |
| 00:47:27 | <ski> | if you want to |
| 00:47:35 | → | kw joins (d4662d5d@212.102.45.93) |
| 00:47:40 | <ski> | it's just that it's more idiomatic, more according to community conventions, to instead write |
| 00:47:44 | <ski> | sumOfSquares x y = x^2 + y^2 |
| 00:47:46 | <monochrom> | No, all conventions are enforced by community not language. Including the currying convention. |
| 00:48:10 | → | quinn joins (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) |
| 00:48:13 | <lmw> | I have first read muhroom instead of monochrom ... |
| 00:48:17 | <monochrom> | Since Haskell has a generous supply of tuple types, nothing stops you from "f :: (Int, Int, Int) -> Double". Only peer pressure does. |
| 00:48:18 | <ski> | (the language does make it syntactically easier to use curried style, though) |
| 00:49:17 | <liyang> | We used to have SyntaxPolice here but not anymore it seems, so you can write whatever the f you like now. \^_^/ |
| 00:49:18 | <ski> | `sumOfSquares (x,y) = x^2 + y^2' would be "tupled style", while `sumOfSquares x y = x^2 + y^2' would be "curried style". both are ways to encode multiparameter functions |
| 00:49:34 | ski | idly recalls SyntaxNinja |
| 00:49:37 | <Axman6> | most languages which require all arguments to be passed at the same time have an optimisation which means they don't need to pass in a tuple though :) |
| 00:49:45 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 00:49:49 | <monochrom> | And even if you raise the doesn't-matter-really technical point that (Int,Int,Int)->Foo is less efficient than currying, GHC has a generous supply of (# Int, Int, Int #) to restore efficiency. Problem solved. |
| 00:50:13 | <lmw> | Reminds of guys who say "ip classes doesnt exist anymore, use cidr!" |
| 00:50:16 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 240 seconds) |
| 00:50:17 | <liyang> | Wrong kind. Needs more MagicHash. |
| 00:50:21 | → | vqrs joins (~vqrs@learnprogramming/regular/vqrs) |
| 00:50:42 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 00:50:50 | <dolio> | It's not going to be less efficient unless you write something pretty weird. |
| 00:51:02 | <ephemient> | (# Int#, Int#, Int# #) {- enough MagicHash now? -} |
| 00:51:04 | <monochrom> | Wait really? Can't I have an unboxed tuple of pointers? |
| 00:51:07 | <ski> | Axman6 : in most such languages, either there's no way, or no easy and nice way, to pass, and receive, such a tuple (or "argument list" as it's also called) as a first-class object |
| 00:51:48 | → | conal joins (~conal@64.71.133.70) |
| 00:52:00 | <dolio> | (# Int, Int, Int #) is fine. |
| 00:52:03 | <ephemient> | but yeah, I thought unboxed tuples of heap values were allowed... |
| 00:52:10 | <karasu1[m]> | In python I think that would work, (x, y) would just be a tuple as well |
| 00:52:21 | <karasu1[m]> | C++ would be a different story |
| 00:52:35 | <karasu1[m]> | Something like make_pair(x, y) would be needed |
| 00:52:52 | <liyang> | Oh, I thought you could only have unboxed tuples of unboxed things. Shows you how often I write _that_ kind of code. |
| 00:52:58 | <ski> | % :type (# Just EQ , False #) |
| 00:52:58 | <yahb> | ski: (# Maybe Ordering, Bool #) |
| 00:53:07 | <monochrom> | Anyway Scheme is very different from Haskell and vice versa. Please lower your expectation. Hell please assume nothing. |
| 00:53:09 | <ephemient> | Python: () is a tuple, (x, y) is a tuple, (x) is not. because reasons |
| 00:53:13 | <karasu1[m]> | wait what are those hashtags at the ends? |
| 00:53:34 | <monochrom> | On many aspects Scheme is the antipodal antithetical opposite of Haskell. |
| 00:53:47 | <ephemient> | https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/magic_hash.html |
| 00:54:07 | <ephemient> | also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/primitives.html#unboxed-tuples |
| 00:54:13 | <ephemient> | but don't worry about those |
| 00:54:22 | <monochrom> | And if you say "but both are functional..." ... |
| 00:54:44 | <Axman6> | karasu1[m]: magic, literally :) |
| 00:54:46 | <monochrom> | Observe how left-wing people and right-wing people are at each other's throats but both count as politics. |
| 00:54:46 | <ephemient> | now {-# pragmas #-} are something you will want to know about |
| 00:55:00 | <ephemient> | https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/pragmas.html |
| 00:55:53 | × | pengjiz quits (~user@cmu-secure-128-237-82-2.nat.cmu.net) (Quit: ERC (IRC client for Emacs 27.1)) |
| 00:55:59 | <ephemient> | e.g. to turn on the MagicHash language extension, put {-# LANGUAGE MagicHash #-} at the top of the source file, etc. |
| 00:57:20 | <ski> | % :type (# (##) #) -- unboxed unituple (containing unboxed empty tuple) |
| 00:57:20 | <yahb> | ski: (# (# #) #) |
| 00:57:28 | <monochrom> | (# Int, Int, Int #) is syntax for low-level code. It means "don't create tuple on the heap, just scatter the fields over registers and/or stack local vars" |
| 00:58:15 | <lmw> | weird language.. |
| 00:59:35 | <ephemient> | well that's how multiple arguments or return values work in most other languages that compile to machine code (with a notable exception of Go whose ABI calling convention always spills on the stack. although I think they're changing it...) |
| 01:00:39 | → | pagnol joins (~user@n112120223083.netvigator.com) |
| 01:00:54 | <ephemient> | in GHC, the optimizer may do that anyway, (# #) just makes sure of it in specific cases where you can't leave it up to that |
| 01:01:02 | × | viluon quits (uid453725@gateway/web/irccloud.com/x-wptflvzisznxlukx) (Quit: Connection closed for inactivity) |
| 01:02:04 | <monochrom> | Yes. |
| 01:04:11 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.0) |
| 01:05:06 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 01:06:02 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 265 seconds) |
| 01:08:03 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds) |
| 01:11:42 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 01:12:11 | → | aliuser joins (~aliuser@161.8.19.35) |
| 01:12:14 | <aliuser> | Don't miss Energy Lab! |
| 01:12:14 | <aliuser> | Play to get items for only US $0.01! |
| 01:12:14 | <aliuser> | https://a.aliexpress.com/_mMrefHt |
| 01:12:25 | × | aliuser quits (~aliuser@161.8.19.35) (K-Lined) |
| 01:12:38 | <karasu1[m]> | So the normal `Map` seems to be part of `Data.Map.Internal`, which seems to be separate from both `Data.Map.Lazy` and `Data.Map.Strict`. I think it was said that the default `Map` that you get from `Data.Map` is the same as `Data.Map.Lazy`, but is there somewhere in the documentation where this is stated? |
| 01:12:51 | <karasu1[m]> | https://hackage.haskell.org/package/containers-0.6.4.1/docs/Data-Map-Internal.html#t:Map |
| 01:13:00 | <karasu1[m]> | This doesn't mention that the values are lazily evaluated |
| 01:14:18 | <hololeap> | Data.Map shows that it imports from Data.Map.Lazy |
| 01:14:30 | <hololeap> | https://hackage.haskell.org/package/containers-0.6.4.1/docs/Data-Map.html |
| 01:14:35 | <hololeap> | "module Data.Map.Lazy" |
| 01:14:56 | <ski> | "The functions in \"Data.Map.Strict\" are careful to force values before installing them in a 'Map'. This is usually more efficient in cases where laziness is not essential. The functions in this module do not do so." |
| 01:15:02 | <ski> | from <https://hackage.haskell.org/package/containers-0.6.4.1/docs/src/Data.Map.Lazy.html> |
| 01:15:02 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 01:15:10 | <monochrom> | There is only one Map type. The difference introduced by Data.Map.Strict is function behaviour, not a different type. |
| 01:15:41 | <hololeap> | i don't think i've ever come across a situation where the laziness was essential |
| 01:15:45 | <ski> | (at the bottom, it says `import Data.Map.Internal') |
| 01:17:27 | <karasu1[m]> | What is the meaning of `import Data.Map.Internal` at the bottom? Does it use parts of `Data.Map.Internal`? |
| 01:17:44 | <karasu1[m]> | Usually imports are at the top, right? |
| 01:18:08 | <monochrom> | doc order does not have to preserve code order, right? RIGHT? |
| 01:18:08 | <karasu1[m]> | oh wait I have no idea what's going on |
| 01:18:27 | <monochrom> | especially s/doc/generated html/ |
| 01:18:37 | <ski> | karasu1[m] : it reexports operations (and types) that it imports from `Data.Map.Internal' |
| 01:18:53 | → | Matthias1 joins (~matthias@li890-22.members.linode.com) |
| 01:19:00 | <ski> | (among them, the `Map' type) |
| 01:19:01 | → | geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) |
| 01:19:52 | <ski> | karasu1[m] : "Usually imports are at the top, right?" -- they come after the `module' declaration (if any). then comes the definitions in the module. in this case, there are no definitions in the module, though |
| 01:20:17 | <karasu1[m]> | right, I realized after |
| 01:20:21 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds) |
| 01:20:27 | <ski> | (technically, both imports and definitions are part of the module declaration) |
| 01:20:30 | <karasu1[m]> | So what's happening is that all the definitions are actually in Data.Map.Internal |
| 01:20:34 | <ski> | yes |
| 01:20:55 | <karasu1[m]> | And then Data.Map.Lazy just imports those things, and exports them again.. |
| 01:20:59 | <karasu1[m]> | OK |
| 01:22:32 | karasu1[m] | uploaded an image: image.png (328KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/tqCXmlZoXFbPmIZiiAVEHvzz/image.png > |
| 01:22:41 | <karasu1[m]> | What does `module Data.Map.Lazy` mean at the bottom? |
| 01:22:50 | <karasu1[m]> | Just that they are "module synonyms"? |
| 01:23:24 | <ephemient> | Data.Map documents what it exports. part of what it exports (in fact, pretty much the only export) is the Data.Map.Lazy module |
| 01:23:27 | <Axman6> | man I wish Matrix wasn't so annoying |
| 01:23:51 | <ephemient> | Matrix isn't terrible, but it gives no indication about how terrible its IRC interop is |
| 01:24:15 | <Axman6> | essentially Data.Map is an alias for Data.Map.Lazy - it imports Data.Map.Lazy, and then reexoports the whole module, and nothing more |
| 01:24:24 | <Axman6> | yeah |
| 01:24:25 | <ski> | karasu1[m] : it means that `Data.Map' reexports everything that it imports from `Data.Map.Lazy' (see the export list at <https://hackage.haskell.org/package/containers-0.6.4.1/docs/src/Data.Map.html>, it mentions `module Data.Map.Lazy') |
| 01:25:04 | <ephemient> | the source looks like this: ```module Data.Map (module Data.Map.Lazy) where { import Data.Map.Lazy }``` |
| 01:25:05 | <Axman6> | I like the idea of matrix, but am also happy just using IRC. I would love if glirc supported matrix though *cough*glguy*cough* |
| 01:25:51 | <karasu1[m]> | Is viewing images difficult in Freenode? Sorry about that |
| 01:26:12 | <glguy> | I dislike matrix too much to try and support anything about it |
| 01:26:45 | <karasu1[m]> | I'm very new to all this but someone said matrix preserved chat history so I've been using it ever since.. |
| 01:26:45 | <Axman6> | basically any feature of matrix that isn't sending a text mmessage is a pain in the bum for IRC users. replying to messages looks super weird, and editing messages is amazingly annoying |
| 01:27:16 | <ephemient> | don't multiline or extra-long messages, don't attachments, don't edit |
| 01:27:28 | ski | likes the feature of IRC clients of (generally) not displaying images inline .. |
| 01:27:33 | <ephemient> | (and especially not in combination) |
| 01:27:55 | <Axman6> | we get things like: "11:36 karasu1[m]: <ephemient "karasu1: Python as an example, d"> I see.. So the reason this isn't allowed in Haskell because it would mess up folding? " |
| 01:27:57 | <ephemient> | also quote-reply doesn't really work, but that's more tolerable |
| 01:28:29 | <Axman6> | all these new hipster features of chat clients |
| 01:29:41 | <karasu1[m]> | I can also react emojis to messages apparently |
| 01:29:55 | × | Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa) |
| 01:30:10 | <Axman6> | If you just tried it, I saw nothing |
| 01:30:33 | <ski> | (please refrain from doing so) |
| 01:30:47 | <karasu1[m]> | (I would send you a picture of what it looks like for me but that would entail attaching things...) |
| 01:31:01 | <karasu1[m]> | OK, I will refrain from matrix things |
| 01:31:11 | <hololeap> | irc is like a 40-year-old protocol, isn' it? trying to shove all these new features into that is going to be ugly |
| 01:31:15 | <Axman6> | images are probably the least annoying thing, since it just sends a message with a link to the image |
| 01:31:39 | <ski> | yea, it would be more annoying if it displayed the image |
| 01:31:43 | <Axman6> | 12:22 * karasu1[m] uploaded an image: image.png (328KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/tqCXmlZoXFbPmIZiiAVEHvzz/image.png > |
| 01:32:02 | <Axman6> | if I were using iTerm it would be possible to display the image inline... |
| 01:32:21 | <hololeap> | i guess it's 30 years old |
| 01:32:42 | <Axman6> | I can't imagine how much that would mess up glirc's display if it tried to do it though... (glguy please don't do this) |
| 01:33:01 | <karasu1[m]> | Are images ok then? |
| 01:33:04 | <ski> | karasu1[m] : anyway, it's mostly a minor annoyance, |
| 01:33:12 | <karasu1[m]> | okie |
| 01:33:14 | <ski> | if it' |
| 01:33:40 | <ski> | if it's just text, it's more polite to link to a paste with the text, rather than to a screenshot image of the text |
| 01:34:00 | <ski> | (e.g. we can't copy code out of an image to try it ourselves) |
| 01:34:03 | → | rajivr joins (uid269651@gateway/web/irccloud.com/x-rpaywpmedacdhsxn) |
| 01:34:39 | <ski> | (in your case, you were asking about how a particular web page looked to you, though) |
| 01:35:08 | <karasu1[m]> | yeah, makes sense. i will try to be a better denizen of the free software world |
| 01:35:10 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 01:35:50 | → | alx741 joins (~alx741@186.178.109.49) |
| 01:38:41 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving) |
| 01:38:50 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 01:38:54 | × | geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 260 seconds) |
| 01:43:25 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 01:45:51 | × | elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 246 seconds) |
| 01:46:30 | → | mizu_no_oto joins (~textual@cpe-66-66-222-11.rochester.res.rr.com) |
| 01:46:56 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:2ddb:1faf:7144:5905) (Remote host closed the connection) |
| 01:53:38 | → | kum0 joins (~kumo@139.180.144.166) |
| 01:54:05 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds) |
| 01:55:05 | <Axman6> | karasu1[m]: do you have a better understanding of the difference between Data.Map.(Lazy|Strict) now? |
| 01:55:46 | <karasu1[m]> | Axman6: yes, I think so |
| 01:56:00 | <Axman6> | laziness is a tricky topic, so make sure you ask more questions |
| 01:56:25 | <karasu1[m]> | I am familiar with laziness, I do it everyday |
| 01:56:40 | <karasu1[m]> | But yes I will ask more questions lol, thanks! |
| 01:56:57 | <Axman6> | but what about guiltfree laziness? |
| 01:58:58 | <karasu1[m]> | That is something I will try to do everyday from now on |
| 02:00:15 | × | mirrorbird quits (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f) (Quit: Leaving) |
| 02:01:28 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:2ddb:1faf:7144:5905) |
| 02:02:35 | × | elliott_ quits (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 265 seconds) |
| 02:05:43 | <Axman6> | random thoughts on TDD and Haskell; if using TDD wehen writing Haskell, you aim should be to a) when a bug is found, write s test which shows the presence of the bug then b) to fix the code in a way that writing that bug becomes impossible and to delete the test, not to keep the test around so demonstrate the absence of the bug |
| 02:05:58 | → | elliott_ joins (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) |
| 02:07:16 | × | lmw quits (1f1d2079@gateway/web/thelounge/ip.31.29.32.121) (Quit: The Lounge - https://thelounge.chat) |
| 02:09:26 | × | thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds) |
| 02:09:34 | <Axman6> | I've always felt uneasy about TDD, it seems to lead to a false sense of security and tends to make code reach a point where refactoring becomes difficult sooner, because the tests also need substantial refactoring at the same time |
| 02:10:10 | → | lep_ joins (~lep@94.31.86.183) |
| 02:10:19 | <glguy> | I think in the languages where it's the most popular refactoring is already impossible, so that's not a big loss |
| 02:10:30 | <Axman6> | this is true |
| 02:11:16 | <Axman6> | I went to an uncle Bob talk a few years ago, where he was trying to push some developer pledge or something which included always using TDD. my first thought was "But what about types?" |
| 02:12:02 | × | lep-delete quits (~lep@94.31.101.183) (Ping timeout: 272 seconds) |
| 02:12:28 | lep_ | is now known as lep-delete |
| 02:15:09 | × | cocytus quits (~cocytus@cpe-76-95-48-109.socal.res.rr.com) (Ping timeout: 265 seconds) |
| 02:15:38 | × | xff0x quits (~xff0x@2001:1a81:5376:4800:e291:4b9:510e:7433) (Ping timeout: 264 seconds) |
| 02:16:09 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 02:17:00 | × | jlamothe_ quits (~jlamothe@198.251.55.207) (Ping timeout: 246 seconds) |
| 02:17:07 | → | xff0x joins (~xff0x@2001:1a81:53b4:e300:4f5:8344:c7ce:bd4a) |
| 02:17:37 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 02:17:39 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 02:22:51 | → | slack1256 joins (~slack1256@45.4.2.52) |
| 02:24:37 | × | kw quits (d4662d5d@212.102.45.93) (Quit: Connection closed) |
| 02:25:44 | → | refusenick joins (~user@2601:644:8502:d700::eeeb) |
| 02:26:57 | × | perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Ping timeout: 264 seconds) |
| 02:28:42 | → | cocytus joins (~cocytus@cpe-76-95-48-109.socal.res.rr.com) |
| 02:29:45 | <refusenick> | What would be an example of a language whose type system forms a lattice where the infimum is not Bottom? |
| 02:32:09 | → | Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362) |
| 02:32:17 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 02:32:42 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 02:32:58 | travisb_ | is now known as tabemann |
| 02:33:50 | × | Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 256 seconds) |
| 02:33:51 | Lord_of_Life_ | is now known as Lord_of_Life |
| 02:34:08 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 02:34:10 | <ski> | what do you mean by `Bottom' ? |
| 02:34:48 | <refusenick> | like in Haskell |
| 02:35:02 | <refusenick> | (the type which can't have any values) |
| 02:35:04 | <Axman6> | (_|_) |
| 02:35:09 | <refusenick> | yeah |
| 02:35:18 | <ski> | the type, or the value ? |
| 02:35:27 | <refusenick> | the type, I think |
| 02:35:31 | <ski> | `_|_' usually refers to a value |
| 02:35:37 | <ski> | an empty type ? |
| 02:35:41 | <refusenick> | yeah |
| 02:35:50 | <shapr> | Where would I read up on making Control.Parallel code go faster? |
| 02:35:52 | <Axman6> | (That was the first result for "bottom emoticon" on google btw, thought it was incredibly apt) |
| 02:35:52 | <refusenick> | a type which subtypes all other types |
| 02:36:25 | × | minoru_shiraeesh quits (~shiraeesh@109.166.59.19) (Ping timeout: 265 seconds) |
| 02:36:28 | <ski> | i guess if you have a language with subtyping, in which all types share some value (`null' ?) |
| 02:36:31 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 02:36:45 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 02:37:31 | <refusenick> | I think I read that anything in Haskell can evaluate to _|_, as a kind of escape hatch to make the logic work out? |
| 02:37:59 | <refusenick> | I'm not sure I totally understand, but I've seen it be said "don't (ab)use that" (paraphrasing, obv) |
| 02:38:04 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 02:38:25 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 02:38:54 | → | airspace_ joins (~airspace@90.218.153.39) |
| 02:38:57 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 264 seconds) |
| 02:39:08 | <Axman6> | :t error "I am EVERYTHING" |
| 02:39:09 | <lambdabot> | a |
| 02:39:54 | × | cig_in_mouth quits (cig_in_mou@gateway/vpn/mullvad/ciginmouth/x-85815230) (Quit: Textual IRC Client: www.textualapp.com) |
| 02:40:11 | <swarmcollective> | IMHO, TDD can be useful in cases where you plan to write the code to some specification, then only touch it to fix bugs. If a major change comes along, you kind of have to start over with a new version. Microservices can be handled this way; new version for any breaking change (where versions run in parallel for a period of time). Open only for extension, not modification. |
| 02:41:03 | → | cig_in_mouth joins (cig_in_mou@gateway/vpn/mullvad/ciginmouth/x-85815230) |
| 02:41:11 | <swarmcollective> | I've not found TDD to be helpful when writing Haskell. DocTests, on the other hand, have been useful for providing examples in the documentation. The fact that they can be validated helps to keep them up-to-date?! |
| 02:41:39 | <Axman6> | yeah, I should use more doctests |
| 02:42:06 | <shapr> | On this channel, I can never tell if TDD is "test driven development" or "TYPE driven development". |
| 02:42:16 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 02:42:38 | <swarmcollective> | Ah, well, yes, Type Driven Development = Helpful! :) |
| 02:43:09 | <Axman6> | I'm all for type defiven development |
| 02:43:18 | <Axman6> | driven* |
| 02:43:41 | <Axman6> | Pushing as much code into types so the compiler can write the actual code for me is a lot of fun |
| 02:44:54 | <swarmcollective> | TBH, I'm not quite there yet, but I do appreciate that the compiler will tell me "Nope, you are trying to do something stupid." and I have to fix it before I can move forward. |
| 02:45:26 | <Axman6> | I was playing with something at work the other day where we're dealing with types which are isomorphic to certain XML dopcuments, and we often need both lenses into nested fields in those documents, and the XML path to those same fields, so I came up with something which could describe the path and types and have the compiler generate the code for both for me |
| 02:46:13 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 02:46:29 | <shapr> | Lemme guess, the smart way to tune my Control.Parallel code is to break out threadscope like the book says? |
| 02:46:43 | <Axman6> | Ideally it would look like: Path '["Document","Header","DateTime"] SomeRequest LocalTime, and give me both a Lens' SomeRequest LocalTime and a Text with "/Document/Header/DateTime" |
| 02:46:56 | × | cig_in_mouth quits (cig_in_mou@gateway/vpn/mullvad/ciginmouth/x-85815230) (Quit: WeeChat 3.0.1) |
| 02:47:05 | → | cig_in_mouth joins (cig_in_mou@gateway/vpn/mullvad/ciginmouth/x-85815230) |
| 02:47:23 | × | cig_in_mouth quits (cig_in_mou@gateway/vpn/mullvad/ciginmouth/x-85815230) (Client Quit) |
| 02:48:28 | <Axman6> | making use of HasField "document" SomeRequest Header means all the types can be inferred, makig error messages really nice |
| 02:49:14 | × | borne quits (~fritjof@200116b864444400d8bba186ea6b909e.dip.versatel-1u1.de) (Ping timeout: 264 seconds) |
| 02:52:05 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 02:53:03 | × | yahb quits (xsbot@haskell/bot/yahb) (Ping timeout: 256 seconds) |
| 02:53:15 | × | urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna) |
| 02:54:20 | × | mizu_no_oto quits (~textual@cpe-66-66-222-11.rochester.res.rr.com) (Quit: Computer has gone to sleep.) |
| 02:54:47 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Ping timeout: 265 seconds) |
| 02:56:42 | <pagnol> | Does anyone here happen to be familiar with the xstate NPM package? It's a library with associated tooling around defining state machines. I'm curious what something like this would look like in the context of a pure functional language. |
| 02:58:14 | → | minoru_shiraeesh joins (~shiraeesh@109.166.59.19) |
| 02:58:41 | → | yahb joins (xsbot@haskell/bot/yahb) |
| 03:03:22 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 03:04:32 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 03:06:53 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 03:10:46 | <karasu1[m]> | I'm having trouble figuring out the best way to "append" two tuples. I have a function `h` that calls 2 functions, f and g. f returns a tuple of type (String, Int). g returns an Integer. I want the return value of `h` to be append results of f and g so I end up getting `(String, Int, Integer)` as my end result.. |
| 03:10:51 | <karasu1[m]> | How would one do this? |
| 03:11:04 | ← | [itchyjunk] parts (~itchyjunk@unaffiliated/itchyjunk/x-1640057) ("Leaving") |
| 03:11:37 | <koz_> | karasu1[m]: The best thing you can do is write a function like 'foo :: (a, b) -> c -> (a, b, c)' and use that. |
| 03:11:57 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds) |
| 03:12:02 | <koz_> | Or just do the equivalent inline with whatever else you were doing. |
| 03:12:08 | <koz_> | pagnol: I don't see how it would be different? |
| 03:12:12 | × | minoru_shiraeesh quits (~shiraeesh@109.166.59.19) (Ping timeout: 272 seconds) |
| 03:12:22 | <koz_> | Like, you just have an eDSL to spell out your FSM then some kind of 'compile and run this' thing. |
| 03:14:34 | × | jdwidari quits (~jdwidari@173.38.117.75) (Ping timeout: 260 seconds) |
| 03:16:08 | × | alx741 quits (~alx741@186.178.109.49) (Quit: alx741) |
| 03:16:30 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 03:20:05 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 03:20:40 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 03:20:58 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 03:21:03 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 03:21:39 | → | minoru_shiraeesh joins (~shiraeesh@109.166.59.19) |
| 03:21:57 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 03:22:18 | → | jlamothe joins (~jlamothe@198.251.55.207) |
| 03:23:29 | → | loller_ joins (uid358106@gateway/web/irccloud.com/x-thbrxkemfqgbwuky) |
| 03:23:48 | × | Sheilong quits (uid293653@gateway/web/irccloud.com/x-wsxjljkamhkjndqg) () |
| 03:25:29 | → | giogiogio joins (5e89ad7c@94.137.173.124) |
| 03:26:36 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 03:27:12 | → | FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) |
| 03:27:12 | finn_elija | is now known as Guest89560 |
| 03:27:12 | FinnElija | is now known as finn_elija |
| 03:30:59 | × | Guest89560 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 268 seconds) |
| 03:34:12 | → | elliott__ joins (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) |
| 03:34:42 | × | shailangsa quits (~shailangs@host86-185-58-207.range86-185.btcentralplus.com) (Ping timeout: 246 seconds) |
| 03:38:05 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 03:38:15 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 03:38:27 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 03:38:29 | → | Tario joins (~Tario@201.192.165.173) |
| 03:38:38 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 03:39:15 | → | DirefulSalt joins (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt) |
| 03:40:03 | → | Saukk joins (~Saukk@83-148-239-3.dynamic.lounea.fi) |
| 03:40:18 | × | Jd007 quits (~Jd007@162.156.11.151) (Quit: Jd007) |
| 03:42:55 | × | theDon quits (~td@94.134.91.14) (Ping timeout: 256 seconds) |
| 03:43:36 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 03:44:28 | → | theDon joins (~td@94.134.91.226) |
| 03:54:19 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 03:55:25 | <shapr> | I made a fun thing this evening! https://github.com/shapr/takedouble |
| 03:55:43 | <shapr> | I grabbed an existing duplicate file finder off the internet and slapped Control.Parallel on top |
| 03:58:28 | <giogiogio> | shapr: hi |
| 03:59:39 | × | thunderrd quits (~thunderrd@183.182.113.172) (Remote host closed the connection) |
| 04:01:54 | → | thunderrd joins (~thunderrd@183.182.113.172) |
| 04:02:34 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 04:02:58 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 04:03:14 | → | Shailangsa_ joins (~shailangs@host86-186-191-40.range86-186.btcentralplus.com) |
| 04:04:31 | <karasu1[m]> | Thanks koz_ |
| 04:05:09 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 04:06:17 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 04:06:35 | × | jollygood2 quits (~bc8134e3@217.29.117.252) (Quit: http://www.okay.uz/ (EOF)) |
| 04:07:07 | × | ubert quits (~Thunderbi@p200300ecdf25d974e6b318fffe838f33.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 04:07:38 | → | ubert joins (~Thunderbi@p200300ecdf25d969e6b318fffe838f33.dip0.t-ipconnect.de) |
| 04:08:09 | <karasu1[m]> | For Haskell, what is the best way to debug a function in a module? I have a function in module.hs, and inside a `where` for that function, I have defined a value called `x` that is computed by calling another function. |
| 04:08:16 | <karasu1[m]> | But, I am not sure if the function is producing the correct `x` value. Normally I would just print out what the value of `x` is at the point that it is computed to see for myself, but I would have to define a main in Haskell to do that right? |
| 04:08:36 | <karasu1[m]> | But should I put a `main` in the module just for now and delete it later? |
| 04:09:54 | <glguy> | karasu1[m], rather than making a new main for quickly testing something in a module it can be nice to open the module in ghci to experiment with it |
| 04:10:39 | <Axman6> | yeah ghci is definitely the first step |
| 04:10:58 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 04:11:02 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 04:12:24 | <karasu1[m]> | Hmm, load up ghci and then doing `:l Module.hs`? |
| 04:12:32 | <Axman6> | yeah |
| 04:12:34 | <glguy> | cabal repl |
| 04:12:36 | <karasu1[m]> | and then calling that function so that the return value is printed right? |
| 04:12:36 | <glguy> | to open your project |
| 04:12:37 | <karasu1[m]> | I see |
| 04:12:37 | <Axman6> | or just ghci Module.hs |
| 04:12:39 | <glguy> | and then you can :m Module |
| 04:13:50 | <karasu1[m]> | What does the `:m` do? |
| 04:14:45 | <glguy> | Tells GHCi to switch which modules are currently in scope |
| 04:14:48 | <Axman6> | loads a module, can be used to load modules from libraries or your project |
| 04:15:01 | <glguy> | :load goes a step further and actually loads files from disk |
| 04:15:24 | × | boxscape quits (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) (Quit: Connection closed) |
| 04:16:50 | <giogiogio> | Axman6: hi |
| 04:17:00 | <Axman6> | Helo giogiogio |
| 04:17:04 | <Axman6> | Hello too |
| 04:17:13 | <giogiogio> | may I pm for a second? |
| 04:17:59 | <Axman6> | IS there a good reason why you can't ask your question here? is it Haskell related? |
| 04:18:10 | <giogiogio> | somehow... |
| 04:18:20 | <giogiogio> | it is not related to haskell |
| 04:18:39 | → | rdivyanshu joins (uid322626@gateway/web/irccloud.com/x-nffqoepzevgmqfup) |
| 04:18:46 | <Axman6> | what's it about? |
| 04:18:58 | <giogiogio> | i can tell in pm... if possible |
| 04:19:08 | <Axman6> | ok, go ahead |
| 04:20:13 | <giogiogio> | seems, I am unable to send pm |
| 04:20:25 | <giogiogio> | getting error message |
| 04:21:06 | <Axman6> | is your nick registered? |
| 04:21:08 | <giogiogio> | it asks to register nick |
| 04:21:11 | <giogiogio> | no |
| 04:21:26 | <Axman6> | you should register your nick, try /msg nickserv help |
| 04:21:51 | <giogiogio> | /msg nickserv register |
| 04:22:04 | <giogiogio> | /nickserv register |
| 04:22:06 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 04:22:16 | <Axman6> | stop putting spaces at the beginning :) |
| 04:22:19 | <giogiogio> | :) |
| 04:23:45 | <giogiogio> | /msg NickServ VERIFY REGISTER giogiogio uonabzyeijam |
| 04:23:50 | <Axman6> | -_- |
| 04:23:53 | <giogiogio> | /NickServ VERIFY REGISTER giogiogio uonabzyeijam |
| 04:24:01 | <Axman6> | I hope you don't use that password for anything |
| 04:24:03 | <giogiogio> | uh |
| 04:24:12 | <giogiogio> | sorry.... |
| 04:24:17 | <glguy> | that's not the password, it's the verification code |
| 04:24:30 | <Axman6> | ah right, well that's good |
| 04:24:32 | <glguy> | giogiogio, since you aren't that good at avoiding leading spaces you really should switch out of the channel window to send these commands |
| 04:24:33 | <giogiogio> | :) |
| 04:24:47 | → | plutoniix joins (~q@ppp-223-24-189-173.revip6.asianet.co.th) |
| 04:25:07 | <Axman6> | it's been a _very_ long time since I needed to register a nick |
| 04:25:46 | <Axman6> | We have made contact, wish us luck |
| 04:27:42 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 04:28:14 | → | Tario joins (~Tario@201.192.165.173) |
| 04:29:49 | × | Shailangsa_ quits (~shailangs@host86-186-191-40.range86-186.btcentralplus.com) () |
| 04:33:06 | → | average joins (uid473595@gateway/web/irccloud.com/x-gyibtnnaloxfprfu) |
| 04:35:23 | <karasu1[m]> | For my debugging question earlier, I know I was recommended GHCI, but I think it |
| 04:35:47 | <karasu1[m]> | might be non-trivial to call the function with the arguments that are in the actual program |
| 04:36:45 | → | hiroaki joins (~hiroaki@ip4d166d67.dynamic.kabel-deutschland.de) |
| 04:36:51 | <karasu1[m]> | IDK if that makes sense |
| 04:37:27 | <karasu1[m]> | Is there something more like printf in other programming languages, so it can be printed when it is encountered? |
| 04:38:04 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 04:38:26 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 04:39:40 | <karasu1[m]> | Or a debugger maybe? hmmm |
| 04:39:53 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 04:41:36 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 04:41:47 | <Axman6> | we have both, but we're usually reluctant to recommend them to new users of the language because using them discourages cleaner software design |
| 04:42:16 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Ping timeout: 240 seconds) |
| 04:43:36 | × | minoru_shiraeesh quits (~shiraeesh@109.166.59.19) (Ping timeout: 256 seconds) |
| 04:44:51 | × | gabiruh quits (~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in) |
| 04:45:53 | → | gabiruh joins (~gabiruh@vps19177.publiccloud.com.br) |
| 04:47:31 | <xsperry> | > printf "Hello %d" 10 :: String |
| 04:47:33 | <lambdabot> | "Hello 10" |
| 04:47:36 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds) |
| 04:48:49 | <koz_> | > printf "Hello %d" :: String |
| 04:48:51 | <lambdabot> | "Hello *Exception: printf: argument list ended prematurely |
| 04:49:33 | <Axman6> | karasu1[m]: the Debug.Trace module is often qquite helpful. if you have some function foo : a -> b -> c which you need to know its arguments, you can add: foo a b | traceShow ("foo",a,b) False = undefined to the top of foo to print out all the arguments it's passed |
| 04:49:33 | <koz_> | > printf "Hello %s" 0x567 :: String |
| 04:49:35 | <lambdabot> | "Hello *Exception: printf: bad formatting char 's' |
| 04:50:07 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 04:50:53 | <xsperry> | koz_, yeah, we got your point. I still use it, both in haskell and C (where result will be far uglier than getting an exception) |
| 04:51:22 | <koz_> | xsperry: You do you. |
| 04:51:46 | → | shailangsa joins (~shailangs@host86-186-191-40.range86-186.btcentralplus.com) |
| 04:52:11 | <Axman6> | C compilers have hidden type level strings though |
| 04:52:19 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 04:52:30 | <Axman6> | just so that you can use printf safely |
| 04:52:59 | <koz_> | Axman6: Explain? |
| 04:53:00 | <karasu1[m]> | I probably couldn't explain it will, but the reason simple GHCI function calling would be cumbersome in my case is because the arguments to this function are the result of a bunch of complicated things like reading in files, pattern matching on other functions, etc, so it would be hard to just do it on GHCi |
| 04:53:02 | <karasu1[m]> | *well |
| 04:53:42 | <xsperry> | some C compiler inspect printf string and argument types. this is not part of C, though, not required, and no reason why ghc couldn't do it as well (if they cared enough, which they probably don't) |
| 04:53:46 | <xsperry> | compilers* |
| 04:53:59 | <xsperry> | and give a warning if specifiers don't match the types |
| 04:54:22 | → | jollygood2 joins (~bc8134e3@217.29.117.252) |
| 04:55:28 | → | Tario joins (~Tario@201.192.165.173) |
| 04:56:04 | <jollygood2> | hi. what is the difference between (<>) in Data.Monoid and Data.Semigroup? what should I use? they both seem to work with optparse-applicative |
| 04:56:23 | <koz_> | jollygood2: Nowadays, none. |
| 04:56:35 | × | Cthalupa quits (~cthulhu@47.186.47.75) (Ping timeout: 256 seconds) |
| 04:56:36 | <koz_> | And you can use whichever if your GHC is reasonably modern. |
| 04:56:52 | <jollygood2> | why none? |
| 04:57:05 | <jollygood2> | optparse-applicative uses <> in their examples. what's the alternative? |
| 04:57:16 | <koz_> | jollygood2: None was in response to your first question. |
| 04:57:19 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds) |
| 04:57:22 | <jollygood2> | oh |
| 04:57:24 | <koz_> | Your question was 'What is the difference ... ?'. |
| 04:57:33 | <koz_> | Response 'None'. In the sense of 'there isn't one'. |
| 04:58:16 | × | slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 240 seconds) |
| 04:58:22 | <jollygood2> | :t (<>) |
| 04:58:23 | <lambdabot> | Semigroup a => a -> a -> a |
| 04:58:39 | <Axman6> | koz_: most C compilers will type check your usage of printf format strings, if you write printf("Hello %s", 1); you'll get compile errors/warnings |
| 04:58:52 | <koz_> | Ah, that's what you meant, OK. |
| 04:59:19 | <jollygood2> | I've only seen gcc doing that |
| 04:59:36 | × | Tario quits (~Tario@201.192.165.173) (Ping timeout: 240 seconds) |
| 04:59:38 | <Axman6> | so implicitly, C in many compilers is dependantly typed or has type level strings |
| 04:59:42 | <koz_> | Clang can likely do it too. |
| 04:59:48 | <Axman6> | yeah Clang does it |
| 05:00:18 | <dolio> | I think a special case for printf is kind of a stretch to call dependent types or type level strings. |
| 05:00:50 | <Axman6> | the inferred type of printf is dependant on the value of the string passed to it |
| 05:01:17 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 05:01:47 | <dolio> | So what's it do if the string isn't statically known? |
| 05:02:20 | <monochrom> | Then it behaves as untyped languages. |
| 05:02:22 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 05:02:23 | <Axman6> | tell you to read up on well known security vulnerabilities in C programs |
| 05:02:27 | <monochrom> | @quote monochrom poor |
| 05:02:27 | <lambdabot> | monochrom says: dynamic type is poor man's dependent type, they are so poor they can't buy a theorem prover. |
| 05:02:44 | × | rajivr quits (uid269651@gateway/web/irccloud.com/x-rpaywpmedacdhsxn) (Quit: Connection closed for inactivity) |
| 05:02:50 | <monochrom> | which is poor people's dependent typing. So it's still dependent typing >:) |
| 05:02:58 | <Axman6> | yeah |
| 05:03:00 | <koz_> | monochrom sounds like PLT_borat there. |
| 05:03:02 | <dolio> | My point is that a single opportunistic static check isn't, "dependent types". |
| 05:03:30 | <Axman6> | it is, it just defaults to saying the program is ok if it can't prove it isn't :) |
| 05:03:31 | <Squarism> | I often find myself in the situation i want to create a class for many types i create just to group functions / dependencies for them. Anyone else doing this? When doing so I struggle with finding a non moronic name for them. |
| 05:03:44 | <Axman6> | "Hmm, I can't figure this out, I'm sure the author knows what they're doing" |
| 05:05:00 | <hololeap> | Squarism: wouldn't this be a better job for namespaces than typeclasses? |
| 05:05:04 | <monochrom> | To be fair, real dependent typing takes the stance "I can't figure this out, I'm sure the author doesn't know what they're doing, let me delete this code". |
| 05:05:12 | <monochrom> | OK just kidding on the deletion part. |
| 05:06:15 | <Squarism> | hololeap, in my current project i have tons of types spread over like 10 files. Giving each a namespace would be tons of extra files. Cause you cannot have multiple modules per file? |
| 05:06:34 | × | elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 260 seconds) |
| 05:06:53 | <monochrom> | Perhaps the other extreme to what hololeap said is associated type family so you have a class plus a type family. |
| 05:07:13 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds) |
| 05:07:30 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 05:10:46 | → | jdwidari joins (~jdwidari@173.38.117.75) |
| 05:10:49 | <hololeap> | i'm not sure i understand the problem. similar types (in the same "scope" of the problem you're trying to solve) are placed in the same module. this module may import other modules, creating a dependency structure |
| 05:11:45 | × | MarcelineVQ quits (~anja@198.254.199.42) (Ping timeout: 240 seconds) |
| 05:11:54 | × | nek0 quits (~nek0@mail.nek0.eu) (Remote host closed the connection) |
| 05:12:15 | × | Wuzzy quits (~Wuzzy@p5b0df671.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 05:12:22 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 05:13:02 | → | Cthalupa joins (~cthulhu@47.186.47.75) |
| 05:13:18 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 05:13:50 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 05:14:06 | → | MarcelineVQ joins (~anja@198.254.199.42) |
| 05:14:56 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 05:15:04 | → | elliott__ joins (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) |
| 05:15:53 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 05:16:41 | → | nek0 joins (~nek0@mail.nek0.eu) |
| 05:16:51 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 05:17:19 | <hololeap> | Squarism: what's an example of a typeclass you've made like this? |
| 05:17:25 | × | Cthalupa quits (~cthulhu@47.186.47.75) (Ping timeout: 240 seconds) |
| 05:17:51 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 265 seconds) |
| 05:19:09 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds) |
| 05:19:25 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 05:19:30 | → | Cthalupa joins (~cthulhu@47.186.47.75) |
| 05:20:19 | <edwardk> | i feel dumb. i spent like an hour writing code for a Ref# a that followed the general semantics of linear-base's Array# .. and was like hrmm, maybe i can make this polymorphic in the multiplicity right? so Ref# m a was born. then, i realized Ref# 'One a = a, ... and Ref# 'Many a = Ur a. Derp. |
| 05:20:56 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 05:21:18 | <Squarism> | hololeap, So maybe i create "ProcessStep a b" type. Then my old OO brains wants to group functions associated to that type. Maybe add some constraints etc. Sure i know i can just create a bunch of top level functions for it but the old OO brain wants to group them. |
| 05:22:16 | × | machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 240 seconds) |
| 05:22:43 | <hololeap> | Squarism: if ProcessStep has a bunch of associated functions, then it would make sense to put it in its own module. bam. it's been grouped. |
| 05:23:07 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Remote host closed the connection) |
| 05:23:07 | <ephemient> | https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#:~:text=format%20(archetype%2C%20string%2Dindex%2C%20first%2Dto%2Dcheck) in GCC, it isn't specific to printf, but is something that can apply to any printf-like function |
| 05:23:17 | <ephemient> | (still not dependent typing, but just clarifying) |
| 05:23:22 | <hololeap> | *it and its related functions in its own module |
| 05:23:31 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 05:25:06 | <hololeap> | and you can always use qualified imports to help keep your namespace from getting cluttered: ProcessStep.someFunc |
| 05:25:13 | <MarcelineVQ> | edwardk: I bet you feel awful silly |
| 05:25:20 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 05:25:21 | <edwardk> | yep |
| 05:25:33 | <MarcelineVQ> | Let this be a lesson to all of you |
| 05:25:38 | <Squarism> | Sure. Call it nonsensical, but I dig not creating a file per type. |
| 05:26:31 | <edwardk> | i was all excited by realizing when i wrote to one i could change its type... wow. ;) |
| 05:26:32 | <hololeap> | Squarism: it depends on the context of course. for instance Data.IntMap is all about IntMap, but it also has Key thrown in there |
| 05:26:44 | <hololeap> | because it's directly related |
| 05:26:46 | × | Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Remote host closed the connection) |
| 05:27:16 | <hololeap> | but there's this fun thing you can do called a directory heirarchy to keep your files organized... ;) |
| 05:27:24 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 05:27:27 | → | Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer) |
| 05:27:36 | <Squarism> | =D |
| 05:28:51 | <hololeap> | i've also been spending a lot of time with Elm lately, which basically forces you to use a bajillion modules... since, no typeclasses |
| 05:29:14 | → | conal joins (~conal@64.71.133.70) |
| 05:29:50 | <hololeap> | but sometimes it's good to separate oneself from the hammer so you can remember there are other tools |
| 05:30:27 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 05:30:47 | × | Orbstheorem quits (~roosember@hellendaal.orbstheorem.ch) (Ping timeout: 272 seconds) |
| 05:31:41 | × | vgtw quits (~vgtw@gateway/tor-sasl/vgtw) (Remote host closed the connection) |
| 05:31:45 | × | hekkaidekapus[ quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Remote host closed the connection) |
| 05:31:55 | → | vgtw joins (~vgtw@gateway/tor-sasl/vgtw) |
| 05:32:13 | → | hekkaidekapus[ joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 05:32:47 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds) |
| 05:32:52 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 05:35:19 | → | conal_ joins (~conal@66.115.157.88) |
| 05:35:30 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 05:36:13 | × | conal quits (~conal@64.71.133.70) (Ping timeout: 265 seconds) |
| 05:39:18 | → | rajivr joins (uid269651@gateway/web/irccloud.com/x-gtdozbconwgnsaqd) |
| 05:40:35 | → | Orbstheorem joins (~roosember@hellendaal.orbstheorem.ch) |
| 05:42:02 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 264 seconds) |
| 05:44:57 | × | Cthalupa quits (~cthulhu@47.186.47.75) (Ping timeout: 264 seconds) |
| 05:46:01 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Remote host closed the connection) |
| 05:46:22 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 05:46:33 | → | Cthalupa joins (~cthulhu@47.186.47.75) |
| 05:47:02 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 05:47:50 | → | desophos joins (~desophos@2601:249:1680:a570:64c9:1587:dfd:89ba) |
| 05:49:41 | × | hexo quits (~hexo@gateway/tor-sasl/hexo) (Remote host closed the connection) |
| 05:49:41 | × | srk quits (~sorki@gateway/tor-sasl/sorki) (Remote host closed the connection) |
| 05:49:58 | → | hexo joins (~hexo@gateway/tor-sasl/hexo) |
| 05:50:00 | → | srk joins (~sorki@gateway/tor-sasl/sorki) |
| 05:50:57 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 05:51:50 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 05:52:56 | × | DataComputist quits (~lumeng@50.43.26.251) (Ping timeout: 240 seconds) |
| 05:54:34 | <desophos> | hi, i just discovered the formatting tool brittany and i'm curious about why it inserts whitespace inside the brackets in the pattern `[x]`: https://paste.tomsmeding.com/GCPSUQDE should i not be using this pattern? is this an oversight in brittany? |
| 05:54:45 | → | DataComputist joins (~lumeng@50.43.26.251) |
| 05:55:14 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 05:56:13 | <desophos> | (the function is made up for the example, but i do match on these patterns in my own functions) |
| 05:58:45 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 05:59:08 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 05:59:28 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 06:00:56 | × | howdoi quits (uid224@gateway/web/irccloud.com/x-xlbatpgsylnmdmym) (Quit: Connection closed for inactivity) |
| 06:01:17 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 272 seconds) |
| 06:02:31 | × | pagnol quits (~user@n112120223083.netvigator.com) (Remote host closed the connection) |
| 06:02:57 | × | elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 264 seconds) |
| 06:03:06 | × | Saukk quits (~Saukk@83-148-239-3.dynamic.lounea.fi) (Remote host closed the connection) |
| 06:03:46 | × | cocytus quits (~cocytus@cpe-76-95-48-109.socal.res.rr.com) (Ping timeout: 265 seconds) |
| 06:04:27 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds) |
| 06:05:06 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 06:05:15 | <karasu1[m]> | Could someone help me use https://hackage.haskell.org/package/prettyprinter-1.7.0? |
| 06:05:31 | <karasu1[m]> | I just discovered pretty printers, but I have no idea how to use them or a tutorial on it |
| 06:05:59 | <karasu1[m]> | I want GHCI to print a record data type that derives `Show`, but not all on one line |
| 06:06:25 | <karasu1[m]> | If it's all on one line, it's too many lines (wrapped) and unreadable, so I had to format it manually in my text editor |
| 06:06:44 | → | contiver joins (~contiver@84-115-64-131.wifi.dynamic.surfer.at) |
| 06:07:47 | → | forgottenone joins (~forgotten@176.42.30.133) |
| 06:07:49 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 06:09:12 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 06:09:41 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 06:09:42 | <hololeap> | desophos: i think some consider that kind of indentation and spacing pretty |
| 06:10:03 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 265 seconds) |
| 06:10:14 | <hololeap> | karasu1[m]: you're looking for pretty-simple |
| 06:10:52 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 06:11:02 | <desophos> | well, i expected it to insert whitespace after the brackets, resulting in `[x] =` rather than `[x ] =` |
| 06:11:14 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 06:12:27 | <desophos> | i suppose it's a matter of taste; after all, the brackets on both lines are aligned |
| 06:14:50 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 06:15:52 | × | sveit quits (~sveit@2001:19f0:ac01:247:5400:ff:fe5c:689f) (Read error: Connection reset by peer) |
| 06:15:52 | × | simplegauss quits (~simplegau@2001:19f0:ac01:247:5400:ff:fe5c:689f) (Read error: Connection reset by peer) |
| 06:19:01 | × | contiver quits (~contiver@84-115-64-131.wifi.dynamic.surfer.at) (Ping timeout: 272 seconds) |
| 06:23:21 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:27:22 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 06:27:26 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 06:29:09 | × | carlomagno quits (~cararell@148.87.23.13) (Remote host closed the connection) |
| 06:30:37 | → | carlomagno joins (~cararell@148.87.23.13) |
| 06:32:17 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 06:32:51 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:2ddb:1faf:7144:5905) (Read error: Connection reset by peer) |
| 06:33:20 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:2ddb:1faf:7144:5905) |
| 06:34:06 | → | brettgilio_ joins (~brettgili@brettgilio.com) |
| 06:34:56 | × | brettgilio quits (~brettgili@brettgilio.com) (Ping timeout: 240 seconds) |
| 06:35:17 | × | plutoniix quits (~q@ppp-223-24-189-173.revip6.asianet.co.th) (Read error: Connection reset by peer) |
| 06:35:46 | × | rj quits (~x@gateway/tor-sasl/rj) (Remote host closed the connection) |
| 06:36:17 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 06:39:02 | × | desophos quits (~desophos@2601:249:1680:a570:64c9:1587:dfd:89ba) (Ping timeout: 264 seconds) |
| 06:40:43 | → | desophos joins (~desophos@c-24-14-63-128.hsd1.il.comcast.net) |
| 06:41:01 | → | danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) |
| 06:43:19 | <Axman6> | pretty-simple is definitely the answer |
| 06:45:02 | → | jedws joins (~jedws@101.184.202.248) |
| 06:45:02 | × | jedws quits (~jedws@101.184.202.248) (Client Quit) |
| 06:45:08 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 06:46:03 | → | cole joins (~user@098-148-021-111.res.spectrum.com) |
| 06:48:26 | × | saitamaplus quits (uid272474@gateway/web/irccloud.com/x-pufhyrnsdboiuaos) (Ping timeout: 240 seconds) |
| 06:48:49 | → | plutoniix joins (~q@184.82.194.171) |
| 06:49:09 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 06:49:25 | → | saitamaplus joins (uid272474@gateway/web/irccloud.com/x-smrbtdsrshobzxqj) |
| 06:50:10 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 06:50:38 | × | cole quits (~user@098-148-021-111.res.spectrum.com) (Ping timeout: 260 seconds) |
| 06:52:09 | × | cheater quits (~user@unaffiliated/cheater) (Ping timeout: 264 seconds) |
| 06:52:11 | × | hexfive quits (~hexfive@50.35.83.177) (Quit: i must go. my people need me.) |
| 06:54:16 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 06:58:19 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 06:59:08 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 07:02:23 | → | Lowl3v3l joins (~Lowl3v3l@dslb-002-203-233-121.002.203.pools.vodafone-ip.de) |
| 07:02:48 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 07:03:25 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 240 seconds) |
| 07:03:41 | × | DataComputist quits (~lumeng@50.43.26.251) (Quit: Leaving...) |
| 07:04:31 | → | cheater joins (~user@unaffiliated/cheater) |
| 07:06:18 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 07:06:59 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Read error: Connection reset by peer) |
| 07:07:54 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 07:08:45 | × | bitmapper quits (uid464869@gateway/web/irccloud.com/x-emuwabyciomfikoa) (Quit: Connection closed for inactivity) |
| 07:09:03 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 07:10:14 | × | benschza_ quits (~quassel@2604:1380:2000:cf00::1) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 07:10:21 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 07:11:45 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 07:12:13 | <dminuoso> | monochrom, ski: Mmm, perhaps smart constructors is an option here. |
| 07:12:35 | <dminuoso> | And regarding `data Tree a = Tip | Node a (Tree a) (Tree a) where height :: Tree a -> Int; height Tip = 0; height (Node _ l r) = 1 + max (height l) (height r)' - that is exactly what I'd want. |
| 07:13:05 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 240 seconds) |
| 07:13:50 | × | coeus quits (~coeus@p200300d0272d1700ee0909afd2db7a9e.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
| 07:15:54 | → | michalz joins (~user@185.246.204.79) |
| 07:16:02 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 07:16:39 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 272 seconds) |
| 07:16:55 | <karasu1[m]> | What is prettyprinter used for then btw? |
| 07:18:18 | <karasu1[m]> | I've heard prettyprinter was better maybe? |
| 07:18:20 | <karasu1[m]> | https://www.reddit.com/r/haskell/comments/8ilw75/there_are_too_many_prettyprinting_libraries/ |
| 07:18:24 | <karasu1[m]> | From the above reddit thread ^ |
| 07:18:46 | → | toorevitimirp joins (~tooreviti@117.182.183.159) |
| 07:20:05 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 07:20:13 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 07:21:16 | <dminuoso> | karasu1[m]: One example use case is generating warnings/error messages like GHC itself. |
| 07:22:20 | <karasu1[m]> | OK, so more for making stack traces, rather than caveman printing debugging purposes then? |
| 07:22:39 | <dminuoso> | Well, that's one single use case, but yeah its not really for "ad-hoc debugging" |
| 07:22:53 | → | mouseghost joins (~draco@87-206-9-185.dynamic.chello.pl) |
| 07:22:53 | × | mouseghost quits (~draco@87-206-9-185.dynamic.chello.pl) (Changing host) |
| 07:22:53 | → | mouseghost joins (~draco@wikipedia/desperek) |
| 07:23:21 | <dminuoso> | The core idea of `prettyprinter` is that you can create some sort of "document" that can be layouted several ways, and then perhaps rendered several ways |
| 07:23:51 | <karasu1[m]> | Like pandoc maybe? |
| 07:24:11 | <karasu1[m]> | I see.. |
| 07:24:30 | <dminuoso> | pandoc is a bit of a different breed, as that's a conversion tool |
| 07:25:27 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 07:25:53 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 07:25:54 | → | idhugo joins (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net) |
| 07:25:56 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 265 seconds) |
| 07:25:57 | <dminuoso> | Any time you want to provide structured output, where you want to sort of control how things are layouted (in a way that the content reacts appropriately the width of the display), control indention, and have things like soft linebreaks |
| 07:26:15 | <dminuoso> | (i.e. a soft linebreak is one that the layouter is *permitted* to turn into an actual linebreak or not, depending on available space) |
| 07:27:02 | <dminuoso> | Or maybe you have reactive/conditional layouting, where your output changes depending on indention or available space |
| 07:27:39 | <dminuoso> | It's still useful for debugging, mind you, since you can provide well structured output with this, that extends far beyond just "show this data" |
| 07:29:20 | <dminuoso> | prettyprinter is then powerful enough to not just output text data, but you could also render it into say markdown or even HTML, but in a way that this happens behind the scenes |
| 07:29:30 | <dminuoso> | if that's what you wanted |
| 07:30:08 | <dminuoso> | `pretty-show` otoh, confusingly also having the prefix "pretty", just takes deriving generated Show output, and adds linebreaks/indention to make it look nicer. |
| 07:30:16 | <dminuoso> | It's not a prettyprinter, it's just a prettier show. |
| 07:30:46 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 07:31:50 | → | coeus joins (~coeus@p200300d02716f600092ef689065f6814.dip0.t-ipconnect.de) |
| 07:34:21 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 07:34:32 | → | coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) |
| 07:34:37 | <karasu1[m]> | prettyprinter is for general purpose documents, and pretty-simple/pretty-show is for Haskell debugging, is chiefly correct right? |
| 07:34:39 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 07:34:50 | <karasu1[m]> | since you mentioned markdown or HTML for prettyprinter |
| 07:35:16 | <karasu1[m]> | oh but it can also give well structured output, just like pretty-simple/pretty-show? |
| 07:36:31 | <dminuoso> | Sure, it's just that you have to do this yourself. |
| 07:37:08 | <dminuoso> | karasu1[m]: And regarding "general purpose documents", Id say prettyprinter has no specific usecase. It's for when you manually want to control the output. |
| 07:37:09 | <karasu1[m]> | But it makes it easy to do it yourself, I see.. |
| 07:37:26 | <dminuoso> | Id rather compare `prettyprinter` to something better than a templating language. |
| 07:37:38 | <karasu1[m]> | Do people write webpages with prettyprinter? Like blogs and so on? |
| 07:37:53 | <dminuoso> | Not that I'm aware of, but you certainly could. |
| 07:38:36 | → | sord937 joins (~sord937@gateway/tor-sasl/sord937) |
| 07:38:56 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 07:39:27 | <karasu1[m]> | It still seems mysterious to me.. What task would a seasoned Haskell programmer think is a "great fit" for the prettyprinter library? |
| 07:39:48 | <dminuoso> | karasu1[m]: Generating error messages exactly like GHC does is the first thing that comes to mind. That's what I use it for anyway. |
| 07:40:06 | <dminuoso> | Or perhaps to output human readable structured logging/program output in general |
| 07:40:21 | <karasu1[m]> | OK, makes sense |
| 07:40:24 | → | iam joins (511495c8@200-149-20-81.sta.estpak.ee) |
| 07:40:41 | <dminuoso> | You could also use `prettyprinter` as a poor mans code generator tool. |
| 07:40:56 | <karasu1[m]> | Code generator? Like an assembler? |
| 07:40:57 | <dminuoso> | Say you have some abstract representation of a program, and want to turn it into pretty code. |
| 07:41:17 | <karasu1[m]> | Like an AST? |
| 07:41:23 | <dminuoso> | Right. Think along the lines of haskell-stylish |
| 07:41:42 | <dminuoso> | Or its called stylish-haskell I believe |
| 07:41:45 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 07:42:12 | <dminuoso> | (Say a code formatter) |
| 07:42:17 | <karasu1[m]> | oh yeah, the automatic haskell code prettifier. It would need to deal with the AST I believe (never made one myself) |
| 07:42:46 | <iam> | Hello! Do you know any libraries which can provide DSL for writing shell scripts with benefits of Haskell types and classes? Ideally I want it to compile haskell DSL directly to shell text files which can be run at almost any machine. Something like JS compilations with GHCJS but in smaller scale. |
| 07:42:56 | <karasu1[m]> | automatic linter may be a more correct term? IDK |
| 07:43:14 | × | poscat quits (~poscat@2408:8207:482a:5640::1) (Ping timeout: 264 seconds) |
| 07:43:29 | <dminuoso> | karasu1[m]: No, linting is about checking the structure, Im talking about taking an AST and turning it back into code in a pretty, perhaps tractable/configurable, way. |
| 07:43:43 | <dminuoso> | say |
| 07:44:06 | <dminuoso> | https://hackage.haskell.org/package/haskell-src-exts-1.23.1/docs/Language-Haskell-Exts-Pretty.html |
| 07:44:13 | <dminuoso> | This could have been implemented using `prettyprinter` |
| 07:44:38 | <dminuoso> | (In fact, this library uses `pretty`, which is a sort of predecessor to `prettyprinter`) |
| 07:44:51 | <dminuoso> | So we can pretend this library used `prettyprinter` for the purpose of this discussion. |
| 07:45:54 | <karasu1[m]> | This library uses `Pretty`? |
| 07:45:59 | <karasu1[m]> | Seems like its exporting it? |
| 07:46:16 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 07:46:19 | <karasu1[m]> | `module Language.Haskell.Exts.Pretty ( ....... Pretty, ....)` |
| 07:46:34 | <dminuoso> | The underlying library is called `pretty`, which is very similar to `prettyprinter` |
| 07:46:36 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 07:47:11 | <karasu1[m]> | `import qualified Text.PrettyPrint as P` ah this one maybe? |
| 07:47:13 | <karasu1[m]> | https://hackage.haskell.org/package/haskell-src-exts-1.23.1/docs/src/Language.Haskell.Exts.Pretty.html#Pretty |
| 07:47:19 | <dminuoso> | Right |
| 07:47:29 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 07:47:39 | <dminuoso> | karasu1[m]: To get a better idea, let's look at one of the most useful and commonly used primitives in `prettyprinter`: https://hackage.haskell.org/package/prettyprinter-1.7.0/docs/Prettyprinter.html#v:hang |
| 07:47:46 | → | cur8or joins (~cur8or@72canterbury.cybersmart.co.za) |
| 07:48:02 | <dminuoso> | Or perhaps https://hackage.haskell.org/package/prettyprinter-1.7.0/docs/Prettyprinter-Util.html#v:reflow |
| 07:49:37 | <karasu1[m]> | Hmm, makes sense |
| 07:50:13 | <karasu1[m]> | Seems very general purpose, but presumably there's more Haskell specific things too |
| 07:50:20 | <karasu1[m]> | And GHC specific I assume |
| 07:50:28 | × | giogiogio quits (5e89ad7c@94.137.173.124) (Quit: Connection closed) |
| 07:52:01 | <desophos> | is there an idiom for applying multiple functions to *the same* input and potentially combining the results? kind of like a reverse map. this is what i came up with but i was wondering if there's a standard way to do this: https://paste.tomsmeding.com/DH01oSBD |
| 07:53:25 | × | Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Read error: Connection reset by peer) |
| 07:53:36 | → | chele joins (~chele@ip5b40237d.dynamic.kabel-deutschland.de) |
| 07:56:09 | × | cur8or quits (~cur8or@72canterbury.cybersmart.co.za) (Ping timeout: 246 seconds) |
| 07:56:49 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 07:59:13 | <dminuoso> | desophos: Apart from the head/tail (use pattern matching), that looks fine to me. |
| 07:59:48 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 07:59:48 | <dminuoso> | Any other trick I can see is a lot more verbose than what you have written |
| 08:00:02 | <desophos> | ah, thanks for catching that |
| 08:01:12 | <desophos> | hmm, i think this is better: `foldl' combine (map ($ x) fs)` |
| 08:01:20 | <dminuoso> | desophos: The only related trick is considering whether `b` could be monoid |
| 08:01:53 | → | contiver joins (~contiver@84-115-65-6.wifi.dynamic.surfer.at) |
| 08:02:10 | → | cur8or joins (~cur8or@72canterbury.cybersmart.co.za) |
| 08:02:27 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 08:02:37 | <desophos> | my theory isn't great, what does that enable? |
| 08:03:21 | <dminuoso> | Im thinking of |
| 08:03:23 | <dminuoso> | % :t foldMapM |
| 08:03:23 | <yahb> | dminuoso: forall {t1 :: * -> *} {m :: * -> *} {a} {t2}. (Foldable t1, Monad m, Monoid a) => (t2 -> m a) -> t1 t2 -> m a |
| 08:03:29 | <dminuoso> | Note, this does not exist in prelude. |
| 08:04:37 | × | ralu quits (~ralu@static.211.245.203.116.clients.your-server.de) (Quit: Ping timeout (120 seconds)) |
| 08:04:43 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 08:04:53 | → | ralu joins (~ralu@static.211.245.203.116.clients.your-server.de) |
| 08:04:58 | <c_wraith> | :t \f xs -> foldMap f . sequenceA xs |
| 08:05:00 | <lambdabot> | (Monoid c, Traversable t) => (a1 -> c) -> t (a2 -> a1) -> a2 -> c |
| 08:05:18 | <dminuoso> | Or perhaps a sort of `foldMon :: (Foldable t, Monad m, Monoid n) -> t (m n) -> m n` |
| 08:05:24 | <c_wraith> | once again, if you're willing to defer to a Monoid instance |
| 08:05:26 | <dminuoso> | And then you'd use the Reader effect |
| 08:06:21 | <desophos> | hmm, interesting. i'm just using this for Bool at the moment, but it's good to know that Monoid provides this sort of functionality |
| 08:06:23 | <c_wraith> | Hmm, that's redundant |
| 08:06:40 | <dminuoso> | desophos: Well the monoid just encompasses the "combing" function (plus an identity) |
| 08:06:49 | <dminuoso> | If you dont have an identity, then we'd need a semigroup version |
| 08:07:02 | <dminuoso> | c_wraith: Ah I guess we're both on the same tree here |
| 08:07:10 | <dminuoso> | I was thinking of |
| 08:07:16 | <c_wraith> | :t \xs -> fold . sequence xs |
| 08:07:17 | <lambdabot> | (Monoid c, Traversable t) => t (a -> c) -> a -> c |
| 08:07:20 | <dminuoso> | Right |
| 08:07:25 | <dminuoso> | Was just about to type that. |
| 08:07:39 | <c_wraith> | You might want the foldMap variant sometimes. |
| 08:07:51 | <c_wraith> | if you need one of the many newtype wrappers |
| 08:08:04 | <dminuoso> | Either way, Id go for the version you have, it's way more clearer waht happens. |
| 08:08:17 | <dminuoso> | `fold . sequence xs` is being clever at the expense of the reader |
| 08:08:40 | <desophos> | and also requires a Monoid instance |
| 08:09:04 | <c_wraith> | clearly the solution is reflection :P |
| 08:09:10 | <c_wraith> | (this is not the solution, please don't) |
| 08:09:12 | <dminuoso> | desophos: Well, we can use NonEmpty + semigroup too! |
| 08:09:15 | <desophos> | but it seems like i need to go back to the typeclassopedia |
| 08:09:25 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 08:09:25 | <dminuoso> | desophos: But as you might have noticed, we've digressed into code golfing for fun. |
| 08:09:29 | → | Miroboru joins (~myrvoll@46.249.230.40) |
| 08:09:54 | <desophos> | haha, well i appreciate the info |
| 08:10:36 | <dminuoso> | c_wraith: Yeah, I think the `fold . sequence` is cute. My version had an explicit Reader, I forgot that we have that instance on ((->) a) as well. |
| 08:10:51 | <c_wraith> | fwiw, I don't think sequenceA on a list of functions is especially weird. It's just swapping the (a ->) and the [ around |
| 08:10:54 | <dminuoso> | (or `fold .: sequence` rather) |
| 08:11:22 | <dminuoso> | In that case.. |
| 08:11:24 | <dminuoso> | how about |
| 08:11:57 | <dminuoso> | % \h f xs -> foldl' f h . sequence xs |
| 08:11:58 | <yahb> | dminuoso: ; <interactive>:230:1: error:; * No instance for (Typeable c0) arising from a use of `print'; * In a stmt of an interactive GHCi command: print it |
| 08:12:00 | <dminuoso> | % :t \h f xs -> foldl' f h . sequence xs |
| 08:12:01 | <yahb> | dminuoso: forall {t :: * -> *} {c} {a1} {a2}. Traversable t => c -> (c -> a1 -> c) -> t (a2 -> a1) -> a2 -> c |
| 08:12:13 | <dminuoso> | desophos: No monoid here |
| 08:12:20 | → | eruditass joins (uid248673@gateway/web/irccloud.com/x-hyzngzzwawmxanqs) |
| 08:12:56 | <dminuoso> | And, if you catch [] by pattern matching |
| 08:12:58 | <dminuoso> | you could improve that |
| 08:13:05 | <dminuoso> | % :t \f xs -> foldl1' f . sequence xs |
| 08:13:06 | <yahb> | dminuoso: forall {c} {a}. (c -> c -> c) -> [a -> c] -> a -> c |
| 08:13:11 | <c_wraith> | actually, huh. reflection actually has... this. |
| 08:13:13 | <c_wraith> | foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r |
| 08:13:15 | <desophos> | hmm that looks good, i was looking at `sequence` but didn't quite figure it out |
| 08:13:34 | <dminuoso> | % :t sequence |
| 08:13:35 | <yahb> | dminuoso: forall {t :: * -> *} {m :: * -> *} {a}. (Traversable t, Monad m) => t (m a) -> m (t a) |
| 08:13:55 | <dminuoso> | Set t ~ [] |
| 08:13:57 | <desophos> | doesn't sequence only work on Monads? |
| 08:13:57 | <dminuoso> | Then you get |
| 08:14:03 | → | dhouthoo joins (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be) |
| 08:14:13 | <dminuoso> | desophos: ah that's a historical wart. sequence should be sequenceA |
| 08:14:33 | <desophos> | oh nice, i see! i didn't know that existed |
| 08:14:40 | <koz_> | desophos: It's one of those things. |
| 08:14:45 | <koz_> | We have a few of those, sadly. |
| 08:15:10 | → | mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com) |
| 08:15:11 | <desophos> | that's hard to avoid with a language as venerable as Haskell |
| 08:15:25 | <koz_> | Yeah, this. |
| 08:15:27 | <dminuoso> | desophos: Either way. set t ~ [], then you have `sequenceA :: Applicative f => [f a] -> f [a]` |
| 08:15:32 | koz_ | looks at String and sighs. |
| 08:15:46 | <c_wraith> | Ok, this is really actually funny. reflection has basically the function you want, except it is total. |
| 08:16:05 | <c_wraith> | (you pass in a default value instead of calling error) |
| 08:16:20 | <desophos> | wow, interesting |
| 08:16:21 | <dminuoso> | desophos: And it turns out, we have an Applicative instance for `((->) b)`, so it then becomes `sequenceA :: [b -> a] -> b -> [a]` |
| 08:16:50 | <desophos> | nice! |
| 08:17:11 | <koz_> | OK that is actually magical. |
| 08:17:20 | <koz_> | I shouldn't be surprised at this point in my Haskell life, but it's still magical. |
| 08:17:25 | <c_wraith> | but reflection is so ridiculously overpowered to do this. And probably not actually efficient. |
| 08:17:53 | <desophos> | why does reflection even have that? |
| 08:17:55 | <dminuoso> | foldMapBy f z g = reifyMonoid f z (foldMap (ReflectedMonoid #. g)) |
| 08:18:08 | × | cur8or quits (~cur8or@72canterbury.cybersmart.co.za) (Ping timeout: 265 seconds) |
| 08:18:08 | <dminuoso> | reify a k = unsafeCoerce (Magic k :: Magic a r) (const a) Proxy |
| 08:18:10 | <dminuoso> | What a lovely library |
| 08:18:17 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 08:18:26 | <desophos> | lol "Magic" |
| 08:18:39 | <dminuoso> | newtype Magic a r = Magic (forall (s :: *). Reifies s a => Proxy s -> r) |
| 08:18:41 | <dminuoso> | Good lord |
| 08:19:03 | <c_wraith> | The funny thing is that reflection was initially based on a clever trick for avoiding anything unsafe |
| 08:19:13 | <c_wraith> | but that was ridiculously slow |
| 08:19:20 | <c_wraith> | And unsafeCoerce is *fast* |
| 08:19:34 | <dminuoso> | By fast you mean it has no penalty? :> |
| 08:19:43 | <c_wraith> | yep! |
| 08:19:51 | <c_wraith> | the only cost is sanity points |
| 08:20:16 | <dminuoso> | I still have this project where Im tempted to use unsafeCoerce to implement a HMap with.. |
| 08:21:05 | × | contiver quits (~contiver@84-115-65-6.wifi.dynamic.surfer.at) (Ping timeout: 240 seconds) |
| 08:21:32 | <dminuoso> | Using type system proofs to know what kind of underlying type I have |
| 08:21:46 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 08:22:25 | → | whald joins (~trem@2a02:810a:8100:11a6:228c:3d0f:ba3a:4e06) |
| 08:23:03 | × | teej quits (uid154177@gateway/web/irccloud.com/x-zgnlyygkuwdxcyja) (Ping timeout: 272 seconds) |
| 08:23:10 | × | totoro2023 quits (~t@unaffiliated/totoro2021) (Read error: Connection reset by peer) |
| 08:23:28 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 08:23:52 | → | cur8or joins (~cur8or@72canterbury.cybersmart.co.za) |
| 08:24:29 | → | totoro2023 joins (~t@unaffiliated/totoro2021) |
| 08:24:46 | → | teej joins (uid154177@gateway/web/irccloud.com/x-dmrpztuemewvoove) |
| 08:24:59 | × | AWizzArd quits (~code@unaffiliated/awizzard) (Remote host closed the connection) |
| 08:25:06 | → | AWizzArd joins (~code@gehrels.uberspace.de) |
| 08:25:14 | <desophos> | for the record, this is what i went with. i think it's nice and straightforward: `combineWith combine fs x = foldl' combine y ys where (y : ys) = map ($ x) fs` |
| 08:25:58 | <dminuoso> | desophos: You can use foldl1' to avoid the pattern match here |
| 08:26:07 | <dminuoso> | Presumably you have a previous definition of combineWith that guards against an empty list |
| 08:26:39 | <desophos> | yes i do |
| 08:26:59 | <desophos> | i see, thanks for the tip |
| 08:27:36 | × | sim590 quits (~sim590@modemcable090.207-203-24.mc.videotron.ca) (Ping timeout: 240 seconds) |
| 08:27:50 | <desophos> | ah, beautiful :D |
| 08:29:35 | → | kenran joins (~kenran@i577BCDBF.versanet.de) |
| 08:31:13 | → | m0rphism1 joins (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) |
| 08:32:59 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 08:34:48 | × | toorevitimirp quits (~tooreviti@117.182.183.159) (Ping timeout: 256 seconds) |
| 08:34:53 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 08:37:20 | → | Yumasi joins (~guillaume@2a01:e0a:5cb:4430:a218:d301:729d:d5b3) |
| 08:38:05 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 08:39:16 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 08:41:55 | <whataday> | I know the effects fmap and bind work on Cont r a, but I don't understand callCC's effects |
| 08:42:34 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 08:42:44 | → | anuur joins (~anuur@129.205.124.188) |
| 08:42:57 | <whataday> | fmap (+2) $ cont (\k -> k 3) == cont (\k -> k 5) |
| 08:44:04 | → | kritzefitz joins (~kritzefit@p548c9398.dip0.t-ipconnect.de) |
| 08:44:08 | <anuur> | Hey |
| 08:44:19 | <whataday> | fmap :: (a->b) -> Cont (a->r)->r -> Cont (b->r)->r |
| 08:44:43 | <whataday> | but callCC's type is too confused |
| 08:45:01 | <whataday> | :t callCC |
| 08:45:04 | <lambdabot> | MonadCont m => ((a -> m b) -> m a) -> m a |
| 08:46:13 | <dminuoso> | whataday: Cont confuses everybody. :> |
| 08:46:44 | <whataday> | callCC confuses me |
| 08:47:01 | <koz_> | whataday: Do you have an urgent and undying need to use callCC in your codebase? |
| 08:47:13 | <dminuoso> | whataday: think of callCC as giving you goto capabilities in Haskell. |
| 08:47:14 | <koz_> | Or perhaps a longing for an understanding of it that won't let you sleep at night? |
| 08:47:34 | <whataday> | koz_ not yet, but it confused me a long time |
| 08:47:41 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:2ddb:1faf:7144:5905) (Remote host closed the connection) |
| 08:48:02 | <whataday> | koz_ , aha it's right! |
| 08:48:30 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 08:48:36 | <whataday> | the day before yesterday, it made me insomnia |
| 08:48:39 | <koz_> | whataday: I can safely say that you can fill it in as 'doing magic by magical means' and live in ignorance of how it works, and lose nothing. |
| 08:48:54 | <koz_> | You won't be any less a Haskell programmer if you never understand or use it. |
| 08:48:58 | <dminuoso> | whataday: https://wiki.haskell.org/MonadCont_under_the_hood |
| 08:49:04 | <dminuoso> | Has some explanations and examples |
| 08:49:28 | → | LKoen joins (~LKoen@136.169.9.109.rev.sfr.net) |
| 08:50:09 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 08:51:08 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 08:52:02 | → | shrimpfogstoneco joins (~shrimpfog@121-200-6-98.79c806.syd.nbn.aussiebb.net) |
| 08:52:05 | <dminuoso> | whataday: `callCC $ \abort -> ...` so here abort has type `a -> m b` (so it's a function that you can apply to a value, and then it will give you `m b` back), and in fact in the body you have to provide some `m b`. The idea is, that you can pass `abort` along, and anyone can use that as its continuation, essentially providing a short-circuit/escape hatch |
| 08:52:21 | → | pera joins (~pera@unaffiliated/pera) |
| 08:52:51 | → | giogiogio joins (5e89ad7c@94.137.173.124) |
| 08:53:11 | <dminuoso> | So `callCC` is sort of like setjmp, and calling `abort` in the above is the equivalent of `longjmp` |
| 08:53:14 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 08:53:20 | → | hekkaidekapus] joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 08:53:59 | <dminuoso> | That means something like `callCC $ \_ -> f` is the same as just `f` |
| 08:54:37 | <whataday> | looks at callCC type, why it return m a twice? |
| 08:54:57 | <dminuoso> | It doesn't |
| 08:55:06 | <dminuoso> | whataday: how many arguments does callCC take? |
| 08:55:21 | <whataday> | one? |
| 08:55:25 | × | shrimpfogstoneco quits (~shrimpfog@121-200-6-98.79c806.syd.nbn.aussiebb.net) (Client Quit) |
| 08:55:29 | <whataday> | :t callCC |
| 08:55:30 | <lambdabot> | MonadCont m => ((a -> m b) -> m a) -> m a |
| 08:55:40 | <dminuoso> | Alright. That one argument is a function, of type `((a -> m b) -> m a)` |
| 08:55:42 | <dminuoso> | Right? |
| 08:55:45 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 264 seconds) |
| 08:55:49 | <whataday> | yes |
| 08:55:58 | × | hekkaidekapus[ quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 268 seconds) |
| 08:56:01 | <dminuoso> | So `callCC f` where `f :: (a -> m b) -> m a` |
| 08:56:06 | <dminuoso> | That means: |
| 08:56:10 | <dminuoso> | callCC f :: m a |
| 08:56:12 | <dminuoso> | Right? |
| 08:56:13 | <whataday> | but that would let callCC f = f ? |
| 08:56:28 | <dminuoso> | I didn't say that! |
| 08:56:28 | <whataday> | yes callCC f:: m a |
| 08:56:36 | <dminuoso> | Let's just resume and we visit that statement later |
| 08:56:39 | <whataday> | callCC f = f x |
| 08:56:49 | <dminuoso> | I did not say that either |
| 08:56:52 | <whataday> | if x :: a->m b |
| 08:57:07 | <dminuoso> | 09:56:01 dminuoso | So `callCC f` where `f :: (a -> m b) -> m a` |
| 08:57:12 | <dminuoso> | Since f is a function, we can write it out as a lambda |
| 08:57:15 | <dminuoso> | So we have: |
| 08:57:49 | <dminuoso> | `callCC $ \e -> r` as a possible invocation, where `e :: a -> m b` and `r :: m a` |
| 08:57:51 | <dminuoso> | So far so good? |
| 08:58:29 | <iqubic> | I've never really understood callCC, so I'm going to follow this too. |
| 08:58:37 | <iqubic> | I know more than enough haskell to keep up. |
| 08:58:42 | <whataday> | shouldn't e be :: (a->m b)-> m a? |
| 08:58:49 | <dminuoso> | 09:57:07 dminuoso | 09:56:01 dminuoso | So `callCC f` where `f :: (a -> m b) -> m a` |
| 08:58:49 | × | rj quits (~x@gateway/tor-sasl/rj) (Remote host closed the connection) |
| 08:58:51 | <dminuoso> | Look here |
| 08:59:02 | <whataday> | aha, rigt |
| 08:59:03 | <whataday> | right |
| 08:59:07 | <dminuoso> | We said that the argument to callCC itself is of type `(a -> m b) -> M a` |
| 08:59:11 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 08:59:21 | <whataday> | yes |
| 08:59:33 | <dminuoso> | Since we turned it into a lambda, that lambdas argument is of type `a -> m b`, and the body is of type `m b` |
| 08:59:41 | <dminuoso> | Err, the body is of type `m a` |
| 08:59:44 | <dminuoso> | (Important distinction here) |
| 08:59:57 | <dminuoso> | Compare this with something like |
| 09:00:02 | × | meckse[m] quits (mecksematr@gateway/shell/matrix.org/x-zgyuvedomofcoisp) (Quit: Idle for 30+ days) |
| 09:00:10 | <dminuoso> | withFile :: (Handle -> IO a) -> IO a |
| 09:00:10 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 09:00:30 | <dminuoso> | Except, in case of callCC the argument of the inner lambda itself is a function too. |
| 09:01:18 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 09:01:43 | <whataday> | e :: a -> m b; ok, what's the next magic? |
| 09:01:46 | → | borne joins (~fritjof@200116b864893b0095eb740676c27273.dip.versatel-1u1.de) |
| 09:01:51 | <dminuoso> | whataday: So assume to invoke callCC always in the style of `callCC $ \e -> r`. This differs from a plain `r` in just one way |
| 09:02:04 | <dminuoso> | You inside that lambda you have access to a special e |
| 09:02:14 | <dminuoso> | So all that callCC does, is provide you with that `e`, nothing else! |
| 09:02:28 | <dminuoso> | Just like `withFile` provides you with a `Handle`, nothing else |
| 09:02:36 | <dminuoso> | (It has some internal logic, but we need not worry about that for now) |
| 09:02:52 | <whataday> | wait a sec, e :: a-> m b, but why it return m a? |
| 09:03:36 | × | conal_ quits (~conal@66.115.157.88) (Ping timeout: 240 seconds) |
| 09:03:58 | → | Graf_Blutwurst joins (~grafblutw@2001:171b:226e:adc0:d552:313d:8cb3:7b48) |
| 09:04:06 | × | kritzefitz quits (~kritzefit@p548c9398.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 09:04:32 | × | kenran quits (~kenran@i577BCDBF.versanet.de) (Read error: Connection reset by peer) |
| 09:04:56 | <whataday> | the whole callCC f :: m a; let us say g = callCC f, runCont g k, then what's the relationship between k and e? |
| 09:05:10 | <whataday> | k :: a-> r |
| 09:05:49 | <whataday> | callCC $\e -> ... e::a -> m b |
| 09:05:59 | <dminuoso> | whataday: Well, consider what this does in the first place: |
| 09:06:19 | <dminuoso> | Then we can arrive at a good intution |
| 09:08:30 | <dminuoso> | What is a value `f :: Cont r Int` exactly? |
| 09:08:33 | <whataday> | wait a sec , withFile :: (Handle -> IO a) -> IO a, but f :: (a->m b) -> m a |
| 09:08:39 | → | boxscape joins (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) |
| 09:08:43 | → | conal joins (~conal@66.115.157.88) |
| 09:08:52 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 09:08:54 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 09:09:00 | × | pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!) |
| 09:09:03 | <iqubic> | That is an important distiction between things like runCont and callCC. |
| 09:09:28 | <iqubic> | callCC lets those two types be different. |
| 09:09:30 | <dminuoso> | whataday: Here `f` is a continuation with final result r, and a sort of "intermediate" result `Int`, Right? |
| 09:09:38 | <dminuoso> | Oh |
| 09:09:43 | <dminuoso> | Let me rename the variables here to avoid confusion |
| 09:09:52 | <dminuoso> | Consider `x :: Cont r Int` |
| 09:09:56 | <whataday> | f :: Cont r Int = cont (\ar -> ar (x:: Int)) |
| 09:10:18 | <whataday> | and that x is identified constant value |
| 09:10:42 | → | kenran joins (~kenran@i577BCDBF.versanet.de) |
| 09:11:00 | <whataday> | f = cont (\k -> k 3) :: Cont r Int |
| 09:11:12 | <whataday> | k :: Int -> r |
| 09:11:13 | <dminuoso> | Right, so that means we sort of "locally resume with an Int" to, eventually, produce something of type `r` |
| 09:11:15 | <dminuoso> | Right? |
| 09:11:23 | <whataday> | yes |
| 09:12:22 | → | shad0w_ joins (~shad0w@160.202.36.86) |
| 09:12:55 | <whataday> | runCont is just unwrapped function from data type, no magic here |
| 09:13:10 | <whataday> | like cont lift function into data tyt |
| 09:13:12 | <whataday> | type |
| 09:13:51 | <dminuoso> | Okay |
| 09:14:48 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 09:15:29 | <whataday> | g = callCC (\e -> ...) :: m a; runCont g k; what's the relationship between k with e? |
| 09:15:38 | × | whald quits (~trem@2a02:810a:8100:11a6:228c:3d0f:ba3a:4e06) (Remote host closed the connection) |
| 09:16:19 | → | Boomerang joins (~Boomerang@2a05:f6c7:2179:0:815d:8deb:faba:89c5) |
| 09:16:31 | <whataday> | k :: a->r ; e :: a-> m b |
| 09:16:42 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 260 seconds) |
| 09:17:12 | → | kritzefitz joins (~kritzefit@2003:5b:203b:200::10:49) |
| 09:17:52 | <iqubic> | What's the type of g there? I don't think g can be passed in as an argument to runCont. |
| 09:18:32 | <whataday> | callCC (\e ->...) :: m a, right? |
| 09:18:34 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 09:18:41 | <whataday> | :t callCC |
| 09:18:42 | <lambdabot> | MonadCont m => ((a -> m b) -> m a) -> m a |
| 09:19:13 | <whataday> | so we can runCont on it, right? |
| 09:19:44 | <iqubic> | Yes we can. But only if m is Cont. |
| 09:20:04 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0.1) |
| 09:20:25 | <whataday> | yes, so let g = callCC (...) , ok? |
| 09:20:33 | <whataday> | then g :: Cont r a |
| 09:20:54 | <whataday> | context is ( -> r)->r here |
| 09:21:32 | <whataday> | runCont g :: (a->r)->r |
| 09:21:38 | <whataday> | k :: a->r |
| 09:21:45 | <whataday> | runCont g k :: r |
| 09:22:02 | <dminuoso> | whataday: Sorry, was on a call |
| 09:22:06 | <iqubic> | dminuoso: Can you help out here. I don't actually know the right answers here. |
| 09:22:28 | → | Franciman joins (~francesco@host-82-49-79-189.retail.telecomitalia.it) |
| 09:23:17 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 09:24:00 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 09:24:16 | <whataday> | what's confused me is g = callCC (\e -> ...) :: m a; runCont g k; what's the relationship between k with e? |
| 09:24:18 | <dminuoso> | Given `callCC $ \e -> r`, `e` itself is a sort of exception/escape hatch/goto, it aborts the *rest* of the computation |
| 09:24:32 | <dminuoso> | You can call it *anywhere* inside r, even if that's a deeply nested block |
| 09:24:55 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 09:24:55 | <dminuoso> | It doesn't matter where, which is why it has type `a -> m b`, in the sense that you can *use* it in any place, `b` is completely free |
| 09:25:02 | <dminuoso> | Say |
| 09:25:47 | <dminuoso> | callCC $ \e -> do { <someCode>; when condition (e 42); <more code> } |
| 09:26:19 | <iqubic> | So, if the condition is true, then the result of this is 42, right? |
| 09:26:20 | <dminuoso> | Consider for starters something like: |
| 09:26:42 | <whataday> | wait a sec, does callCC always need a continuation? |
| 09:26:47 | <iqubic> | And if the condition is true, the more code section should never be evaluated. |
| 09:26:54 | <iqubic> | :t callCC |
| 09:26:55 | <lambdabot> | MonadCont m => ((a -> m b) -> m a) -> m a |
| 09:26:57 | <dminuoso> | iqubic: Well, not the result, but you immediately abort and create the new suspended computation |
| 09:27:11 | <dminuoso> | Note that the entire return type of callCC is still `m a` here |
| 09:27:15 | <dminuoso> | And also note |
| 09:27:20 | <dminuoso> | That this function is of type `a -> m b` |
| 09:27:25 | × | xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Ping timeout: 268 seconds) |
| 09:27:28 | <whataday> | callCC's result is m a, so it won't produce a constant value, right? |
| 09:27:30 | <dminuoso> | the value you stuff in there, is what is being turned into a suspeded computation at the end |
| 09:27:34 | <shad0w_> | hi all. i think i am still about functional dependencies after encountering them in MonadReader and MonadWriter ? |
| 09:27:52 | → | xelxebar_ joins (~xelxebar@gateway/tor-sasl/xelxebar) |
| 09:27:54 | <dminuoso> | The point of the `m b` is that you can use it in any place |
| 09:27:55 | <shad0w_> | anywhere i can go to get more intuition about them ? |
| 09:28:13 | <dminuoso> | But the function still demands an `a`, because that's what the entire `callCC <stuff>` produces as an "intermediate result" |
| 09:28:17 | <shad0w_> | still confused* |
| 09:28:20 | <dminuoso> | whataday: Does that make sense? |
| 09:28:34 | <whataday> | dminuoso, (e 42) will produce what as callCC result? |
| 09:29:05 | <dminuoso> | whataday: `e 42` will abort the entire rest of the continuations *inside* the callCC, and transfer control back to the point where callCC was applied. |
| 09:29:08 | <dminuoso> | And then resume with 42. |
| 09:29:33 | <dminuoso> | If you like, you can think of `callCC` as a sort of `catch`, and `e` as a throw. |
| 09:29:36 | <whataday> | dminuoso, but 42 is not :: m a! |
| 09:29:40 | <whataday> | 42::Int |
| 09:29:46 | <dminuoso> | Set `a ~ Int~ |
| 09:29:48 | <dminuoso> | Set `a ~ Int` |
| 09:29:50 | <dminuoso> | So we have |
| 09:30:04 | <dminuoso> | `callCC :: ((Int -> M b) -> m Int) -> m Int` |
| 09:30:07 | <dminuoso> | err |
| 09:30:10 | <dminuoso> | `callCC :: ((Int -> m b) -> m Int) -> m Int` |
| 09:30:20 | <dminuoso> | Note the `m b` means, that you're free to write something like: |
| 09:30:45 | <whataday> | 42 isn't m Int |
| 09:30:50 | <dminuoso> | Yes, hold on |
| 09:31:01 | <dminuoso> | callCC $ \e -> do { a <- someThing; when a (e 42); pure 16 } |
| 09:31:04 | <dminuoso> | Note here |
| 09:31:06 | <dminuoso> | % :t when |
| 09:31:07 | <yahb> | dminuoso: forall {f :: * -> *}. Applicative f => Bool -> f () -> f () |
| 09:31:10 | <whataday> | cont $ \k -> k 42 :: m Int |
| 09:31:18 | <dminuoso> | When *requires* (!) the argument to be of type `m ()` here |
| 09:32:05 | <dminuoso> | whataday: this `m b` is just to satisfy the type system, it sort of says "you can use it anywhere, *regardless* of what the continuation in that spot demands as a result |
| 09:32:19 | <dminuoso> | But the value you stuff in there is specified in the argument, i.e. in the `a` of `a -> m b` |
| 09:32:24 | <dminuoso> | not the return type |
| 09:32:36 | <dminuoso> | the return type just says where you are allowed to use the `e` applied to 42. |
| 09:32:52 | ← | gremax parts (znc@torba.club) ("Textual IRC Client: www.textualapp.com") |
| 09:33:03 | <dminuoso> | and since `b` is completely polymorphic, it means you can use it *anywhere*. the reason you can use it anywhere, is because it instantly shortcircuits and never resumes there anyway |
| 09:33:18 | <dminuoso> | that is `e 42 :: m ()` is fine |
| 09:33:28 | <dminuoso> | it will never resume at that point anyway |
| 09:33:45 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 09:33:48 | <dminuoso> | it doesnt produce any intermediate result |
| 09:33:56 | <whataday> | but could it be normal? e k :: m b? |
| 09:33:58 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 09:34:10 | <dminuoso> | whataday: You could, perhaps, think of callCC as having the simpler type: |
| 09:34:23 | × | DirefulSalt quits (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt) (Remote host closed the connection) |
| 09:34:24 | <dminuoso> | callCC :: MonadCont m => ((a -> m ()) -> m a) -> m a |
| 09:34:30 | <whataday> | not return 42 as callCC result, but return a Cont as its type |
| 09:34:33 | <dminuoso> | This would be equivalent, just more annoying to use. |
| 09:34:49 | <dminuoso> | It's just way more comfortable to allow the return type of that `e` to be arbitrary |
| 09:34:56 | <dminuoso> | It's sort of the same reason why: |
| 09:34:58 | <dminuoso> | % :t throw |
| 09:34:59 | <yahb> | dminuoso: forall {e} {a}. Exception e => e -> a |
| 09:35:02 | <dminuoso> | Or |
| 09:35:05 | <dminuoso> | % :t throwIO |
| 09:35:06 | <yahb> | dminuoso: forall {e} {a}. Exception e => e -> IO a |
| 09:35:25 | <dminuoso> | Note how throwIO applied to an exception is of type `IO a`. You can use this as `IO Int` if you like |
| 09:35:30 | <dminuoso> | Its fine, this will not produce an Int anyway! |
| 09:35:36 | <dminuoso> | It's exactly the same reason here |
| 09:36:35 | <whataday> | 42 :: m () is ok in the type system? |
| 09:36:45 | <iqubic> | No. |
| 09:36:52 | <iqubic> | But that's not the type we have. |
| 09:36:59 | → | acidjnk_new joins (~acidjnk@p200300d0c739095955c97cbff9b24e5c.dip0.t-ipconnect.de) |
| 09:37:02 | <dminuoso> | whataday: Consider my example with throwIO perhaps |
| 09:37:05 | <iqubic> | We have "e 42 :: m ()" which is totally fine. |
| 09:37:08 | <dminuoso> | it's less complex and perhaps easier to grasp |
| 09:37:24 | <whataday> | look at callCC type, it always return m a |
| 09:37:28 | <dminuoso> | c_wraith: Yes! |
| 09:37:30 | <dminuoso> | err whataday |
| 09:37:34 | → | whald joins (~trem@2a02:810a:8100:11a6:6784:33d1:3a6b:a448) |
| 09:37:34 | <dminuoso> | whataday: Also note, that e *takes* an `a` |
| 09:37:55 | <iqubic> | e :: a -> m b |
| 09:37:58 | <whataday> | if 42 as result to callCC, then 42 has to be m a |
| 09:38:03 | <dminuoso> | So applying `e` to some value of type `a` instantly aborts the inner of callCC and resumes the entirety |
| 09:38:14 | <iqubic> | whataday: But 42 isn't the resutl |
| 09:38:21 | <iqubic> | *result |
| 09:38:22 | <dminuoso> | whataday: Let's switch to throwIO, because I think this is easier. |
| 09:38:26 | <dminuoso> | % :t throwIO |
| 09:38:27 | <yahb> | dminuoso: forall {e} {a}. Exception e => e -> IO a |
| 09:38:27 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds) |
| 09:38:35 | <dminuoso> | whataday: Do you see how throwIO is completely polymorphic in `a`? |
| 09:38:55 | <whataday> | sorry, I have no experience on throwIO... |
| 09:39:05 | <dminuoso> | whataday: It just throws a plain exception in IO |
| 09:40:05 | <whataday> | ok |
| 09:40:15 | <dminuoso> | The point is, if you write `throwIO someException :: IO Int`, then that's completely fine. This IO action will not actually produce an `Int`, because well an exception is thrown anyway |
| 09:40:21 | <dminuoso> | The value of being able to do this is as follows: |
| 09:41:16 | <dminuoso> | You can write `getInt = do { x <- getLine; case readMaybe x of Just int -> pure int; Nothing -> throwIO (userError "not a number") } |
| 09:41:29 | <dminuoso> | Note, that because of the case expression *both* branches must be of type `IO Int` |
| 09:41:35 | <whataday> | dminuoso, e 42 in callCC would return (\k -> k 42)? |
| 09:42:09 | <dminuoso> | whataday: Right, it'd sort of replace the *entirety* of `callCC $ \e -> ...` with a suspended computation, resuming with 42. |
| 09:42:21 | <whataday> | aha |
| 09:42:37 | <dminuoso> | whataday: The return type of `e` is completely free, because it just says it can be used *locally* anywhere, for the same reason that throwIO is polymorphic in a. |
| 09:42:43 | <dminuoso> | So if we said: |
| 09:43:44 | × | jonathanx quits (~jonathan@h-176-109.A357.priv.bahnhof.se) (Remote host closed the connection) |
| 09:43:46 | <dminuoso> | callCC $ \e -> do { x <- someNumber; when (even e) (e 42); pure 16 |
| 09:43:59 | <dminuoso> | Note that `when` *demands* its second argument to have a return type of () |
| 09:44:01 | <dminuoso> | % :t when |
| 09:44:01 | <yahb> | dminuoso: forall {f :: * -> *}. Applicative f => Bool -> f () -> f () |
| 09:44:05 | <dminuoso> | whataday: Do you see this? |
| 09:44:32 | <dminuoso> | Also we could have: |
| 09:45:12 | <dminuoso> | callCC $ \e -> do { x <- someNumber; str <- if (even e) then (e 42) else getString; ... } |
| 09:45:19 | <dminuoso> | Where getString is of some `m String` |
| 09:45:29 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 09:45:32 | <dminuoso> | Which would mean `e 42 :: m String` too (because of how if-then-else works) |
| 09:45:41 | <dminuoso> | Which is fine, because e 42 will never produce an intermediate result |
| 09:45:45 | <dminuoso> | It aborts the local computation |
| 09:45:57 | <dminuoso> | It's essentially an exception inside cont |
| 09:46:33 | → | jonathanx joins (~jonathan@h-176-109.A357.priv.bahnhof.se) |
| 09:46:49 | → | __monty__ joins (~toonn@unaffiliated/toonn) |
| 09:47:48 | <dminuoso> | In fact, we could write something like callCC in IO too (it'd be highly brittle and error prone) |
| 09:48:26 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) |
| 09:48:38 | <whataday> | e :: a -> m b, but where a come from? |
| 09:48:51 | <dminuoso> | whataday: That's your business |
| 09:49:05 | <dminuoso> | whataday: Note how the entirety of `callCC` returns an `m a` right? |
| 09:49:20 | <dminuoso> | That means, the entirety is some suspended computation of intermediate type a |
| 09:49:22 | <whataday> | yes |
| 09:49:26 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 09:49:35 | <dminuoso> | Inside the nested body of `callCC` its your job to come up with some `a` |
| 09:49:38 | × | borne quits (~fritjof@200116b864893b0095eb740676c27273.dip.versatel-1u1.de) (Quit: WeeChat 3.0) |
| 09:49:46 | → | borne joins (~fritjof@200116b864893b0095eb740676c27273.dip.versatel-1u1.de) |
| 09:49:50 | <whataday> | alright |
| 09:49:51 | <dminuoso> | `e` lets you abort the rest and say "this is that value of type `a`" |
| 09:50:03 | × | iam quits (511495c8@200-149-20-81.sta.estpak.ee) (Quit: Connection closed) |
| 09:50:13 | <dminuoso> | Like "stop here. dont go any further. dont proceed. here is the result" |
| 09:50:23 | <whataday> | Cont r a, a must be an identical constant value |
| 09:50:27 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 09:50:31 | <dminuoso> | "identical"? |
| 09:50:42 | <whataday> | identified? |
| 09:50:50 | <dminuoso> | what do you mean by "constant"? |
| 09:51:04 | <whataday> | 3 is constant |
| 09:51:06 | <whataday> | x isn't |
| 09:51:14 | <dminuoso> | Im not sure what you're getting at |
| 09:51:46 | <whataday> | cont (\k -> k 3) :: Cont r a is ok |
| 09:51:51 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 09:51:57 | <whataday> | cont (\k -> k x) isn't |
| 09:52:05 | <iqubic> | Actually, that's fine too. |
| 09:52:19 | <iqubic> | cont (\k -> k x) is totally fine. |
| 09:52:35 | <dminuoso> | shad0w_: The functional dependency on `class Monad m => MonadReader r m | m -> r ` says `r` is uniquely identified by `m` |
| 09:52:50 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 09:52:55 | <whataday> | iqubic then where x is from? |
| 09:53:02 | × | ubert quits (~Thunderbi@p200300ecdf25d969e6b318fffe838f33.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 09:53:03 | <whataday> | x is undefined |
| 09:53:19 | <dminuoso> | shad0w_: The impact of this is, you cannot write `instance MonadWriter M Int; instance MonadWriter M Float` |
| 09:53:26 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) (Ping timeout: 264 seconds) |
| 09:53:39 | <iqubic> | "let f k x = cont (\k -> k x)" is a totally fine and valid function to write. |
| 09:54:16 | <dminuoso> | shad0w_: Or in other words, a given type T with an `instance MonadWriter T E` has precisely one environment type E, and the compiler can infer `E` automatically from knowing T. |
| 09:54:36 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 09:54:47 | <whataday> | but x need to be concreted to be an instance of Cont r a |
| 09:55:20 | <iqubic> | whataday: I don't think so. |
| 09:55:26 | <iqubic> | % :t cont |
| 09:55:26 | <yahb> | iqubic: forall {a} {r}. ((a -> r) -> r) -> Cont r a |
| 09:55:38 | <iqubic> | % let f k x = cont (\k -> k x) |
| 09:55:39 | <yahb> | iqubic: |
| 09:55:44 | <iqubic> | % :t f |
| 09:55:45 | <yahb> | iqubic: forall {p} {a} {r}. p -> a -> Cont r a |
| 09:55:53 | <iqubic> | See, that's a totally valid function. |
| 09:57:01 | <dminuoso> | shad0w_: Oh, and I mistakingly flipped the arguments of MonadWriter there, that was my bad |
| 09:57:24 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 09:57:37 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 09:58:48 | <whataday> | I don't know how to describe |
| 09:59:12 | <idnar> | "View patterns are not supported in th-desugar. Use pattern guards instead." |
| 09:59:21 | <whataday> | cont (\k -> k 42) :: Cont r Int |
| 09:59:37 | × | jollygood2 quits (~bc8134e3@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout)) |
| 09:59:39 | <whataday> | cont (\k -> k x) :: ? |
| 09:59:53 | <whataday> | x is undefined |
| 09:59:56 | <idnar> | case leverage b q of |
| 09:59:56 | <idnar> | [] -> Nothing |
| 09:59:56 | <idnar> | ls@(_:_) -> Just (maximum ls) |
| 09:59:56 | <idnar> | where is the view pattern? |
| 10:00:05 | <iqubic> | whataday: cont (\k -> k x) :: Cont r a, where x :: a |
| 10:00:23 | <whataday> | yes, you can use a function to return Cont r a |
| 10:00:46 | <whataday> | but only when you call that function, and it then return a Cont r a value |
| 10:00:53 | <iqubic> | Yes. Correct. |
| 10:01:09 | × | deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 264 seconds) |
| 10:01:21 | <whataday> | but a Cont r a value, a is already defined in that value |
| 10:01:45 | <whataday> | concreted like constant 3 |
| 10:02:08 | <iqubic> | Where does the 'a' value for 'cont (\k -> k 3)' get defined? |
| 10:03:00 | <iqubic> | % let f x = cont (\k -> k x) |
| 10:03:00 | <yahb> | iqubic: |
| 10:03:01 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 10:03:25 | <lemmih> | % :t cont (\k -> k undefined) |
| 10:03:26 | <yahb> | lemmih: forall {r} {a}. Cont r a |
| 10:03:28 | <whataday> | class C(val x: Int); val t1 = C(3); val t2=C(5); that t1.x isn't t2.x |
| 10:03:35 | × | anuur quits (~anuur@129.205.124.188) (Quit: afk) |
| 10:03:41 | <iqubic> | Haskell doesn't have classes. |
| 10:03:49 | <whataday> | your function is like that class C |
| 10:04:06 | <whataday> | a Cont r a value like that instances of C |
| 10:04:40 | <iqubic> | I don't think you can compare haskell functions and C classes like that. They ware way too different. |
| 10:04:51 | <whataday> | haskell has class IIRC |
| 10:05:01 | <whataday> | even I never use it |
| 10:05:21 | × | airspace_ quits (~airspace@90.218.153.39) (Ping timeout: 264 seconds) |
| 10:05:27 | <iqubic> | type classes in Haskell are quite different from classes in other programming languages. You just cannot compare the two. |
| 10:05:28 | <whataday> | data type could trans to class |
| 10:05:30 | <lemmih> | whataday: Classes in Haskell are a completely different concept from classes in most object-oriented languages. |
| 10:06:01 | × | Neuromancer quits (~Neuromanc@unaffiliated/neuromancer) (Read error: Connection reset by peer) |
| 10:06:36 | <whataday> | I don't know hwo to describe |
| 10:07:08 | <whataday> | return 3 :: Cont r Int is ok |
| 10:07:25 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 10:07:28 | <whataday> | return x , ghci will ask where x is defined, right? |
| 10:08:02 | <lemmih> | With you so far. |
| 10:08:24 | <iqubic> | If x isn't currently defined, then it will fail. But that's the same as asking ghci to compute the value of "x + y" |
| 10:08:44 | <lemmih> | whataday: That has nothing to do with 'Cont', though. |
| 10:09:03 | <iqubic> | % x + y |
| 10:09:03 | <yahb> | iqubic: ; <interactive>:251:1: error:; * No instance for (Num (Maybe Int)) arising from a use of `+'; * In the expression: x + y; In an equation for `it': it = x + y |
| 10:09:20 | <iqubic> | > num1 + num2 |
| 10:09:22 | <lambdabot> | error: Variable not in scope: num1error: Variable not in scope: num2 |
| 10:09:42 | <iqubic> | Right. So, GHCI has no idea what num1 and num2 should be, so it fails. |
| 10:09:48 | <whataday> | what I tried to say is a concreted value k:: Cont r a; then a is already concreted in k |
| 10:10:08 | → | Neuromancer joins (~Neuromanc@unaffiliated/neuromancer) |
| 10:10:31 | <lemmih> | whataday: Could you explain what you mean by 'concrete'? What's the different between a concrete value and a non-concrete value? |
| 10:10:52 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 10:11:03 | <iqubic> | @define add x y = x + y |
| 10:11:04 | <lambdabot> | Defined. |
| 10:11:13 | <iqubic> | Are x and y concrete there or not? |
| 10:11:49 | → | viluon joins (uid453725@gateway/web/irccloud.com/x-lltmwurqyylsxzbx) |
| 10:12:50 | <whataday> | not |
| 10:12:59 | → | fendor joins (~fendor@178.165.131.69.wireless.dyn.drei.com) |
| 10:13:00 | <whataday> | I just mean defined or identified |
| 10:13:03 | <whataday> | constant |
| 10:13:36 | → | dhil joins (~dhil@80.208.56.181) |
| 10:13:49 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 10:14:09 | <iqubic> | lemmih: I think they're using concrete to mean "integer or string literal that has been hard coded into the program" |
| 10:15:07 | <lemmih> | whataday: So 'x' is not concrete in this example: f x = cont (\k -> k x) ? |
| 10:16:51 | <whataday> | f is a defined value , f 3 is a defined value, f x isn't |
| 10:16:56 | <whataday> | x isn't defined |
| 10:16:56 | × | pera quits (~pera@unaffiliated/pera) (Quit: leaving) |
| 10:17:11 | × | kenran quits (~kenran@i577BCDBF.versanet.de) (Quit: leaving) |
| 10:17:20 | <lemmih> | Can't we define it to be the first argument of the function 'f'? |
| 10:18:53 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 10:19:29 | → | thc202 joins (~thc202@unaffiliated/thc202) |
| 10:19:40 | <merijn> | What does "concrete value" even mean? |
| 10:19:49 | <merijn> | That seems like made up terminology |
| 10:20:17 | <whataday> | if x isn't defined, what you expect k will work on? |
| 10:20:30 | <whataday> | k is defined by passing parameter when call |
| 10:20:30 | <lemmih> | whataday: Okay, let's forget about 'x'. How about this code: cont (\k -> k undefined) ? Here 'undefined' does not have a value but it's still valid Haskell code. |
| 10:20:47 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 10:21:06 | <whataday> | sorry I should use defined value |
| 10:21:11 | <lemmih> | whataday: But 'k' is called in the function 'f' so 'x' will always have a value. |
| 10:21:33 | <Uniaika> | merijn: some people will use "concrete value" to mean "something that is not in a container". Like 3 would be a concrete value but [3] wouldn't be |
| 10:23:16 | <whataday> | f x = cont (\k -> k x); is f x a value? |
| 10:23:30 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 10:23:43 | <whataday> | f is a value, f 3 is a value, f "a" is a value |
| 10:23:50 | <whataday> | f x is a value? |
| 10:24:05 | <iqubic> | If x is defined in the current context, then yes. |
| 10:24:06 | <whataday> | x isn't defined, how f x is a value? |
| 10:24:14 | <lemmih> | whataday: 'f x' is a continuation. It's both a value and a function. |
| 10:24:26 | <whataday> | so u see, if x is defined |
| 10:24:51 | <whataday> | so Cont r a, if a is defined |
| 10:25:17 | <iqubic> | Cont r a is a type, and not a value. |
| 10:25:36 | <lemmih> | whataday: If 'x' wasn't defined then code wouldn't even be valid Haskell. |
| 10:25:54 | <merijn> | Uniaika: The problem with making up terms and not defining them is that nobody but you knows wtf you mean :) |
| 10:25:55 | <whataday> | cont $ \k -> k x is a value only if x is defined! |
| 10:26:12 | <merijn> | whataday: What do you mean by "is defined"? |
| 10:26:29 | <whataday> | x = 42, x is defined |
| 10:26:48 | × | giogiogio quits (5e89ad7c@94.137.173.124) (Quit: Connection closed) |
| 10:26:56 | <whataday> | yes, sorry for the term I made ip |
| 10:26:58 | → | perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 10:27:14 | <iqubic> | But when I write "f x = cont (\k -> k x)" then x will have a set value. 'x' take on whatever the first value passed to 'f' by the caller is. |
| 10:27:16 | <merijn> | whataday: I mean, if there is not variable named 'x' in scope then you example is s a compile error? |
| 10:27:19 | <lemmih> | whataday: I guess that is true but that has nothing to do with 'Cont'. In all Haskell code, you cannot reference anything that has not been defined. |
| 10:28:17 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 10:28:25 | <whataday> | just like I'd call Just Int as type notation for myself, Just 3 is a value has Maybe Int type, but Just Int made me know what its value look like |
| 10:29:07 | <merijn> | whataday: "Just Int" is also a compiler error? |
| 10:29:43 | <iqubic> | whataday: "Just Int" isn't a type. The type of "Just 3" is "Maybe Int" |
| 10:29:54 | <lemmih> | % Just @Int 3 -- Type variables to the rescue! |
| 10:29:55 | <yahb> | lemmih: Just 3 |
| 10:30:10 | <iqubic> | % Nothing @(Maybe Int) |
| 10:30:11 | <yahb> | iqubic: Nothing |
| 10:30:29 | <iqubic> | That's another valid value of the type Maybe Int. |
| 10:30:30 | <whataday> | yes like I said it just help me know its value look like |
| 10:30:33 | <merijn> | lemmih: I mean, that's definitely not helping lessen any confusion |
| 10:30:58 | <whataday> | I never said Just Int is valid |
| 10:31:14 | <whataday> | it isn't a value neither a type |
| 10:31:41 | <iqubic> | You literally said "just like I'd call Just Int as type notation..." |
| 10:32:05 | <whataday> | did u see I said term I made up before |
| 10:32:07 | <lemmih> | whataday: Coming up with new concepts and notations can sometimes be helpful but it does make it nearly impossible to communicate with other people. Richard Feynman gave up on his custom notation for trigonometry because no-one else could understand what he wrote. |
| 10:32:35 | <whataday> | there's no term type notation right? |
| 10:32:46 | <whataday> | I just made it up |
| 10:32:49 | <iqubic> | What is term type notation? |
| 10:32:53 | <iqubic> | What do you mean by that? |
| 10:32:54 | <whataday> | for myself |
| 10:33:14 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 10:33:52 | → | ubert joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) |
| 10:34:34 | × | ubert quits (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) (Remote host closed the connection) |
| 10:35:40 | <iqubic> | If you make up term and then try to use it conversation is going to confuse everyone, including yourself. |
| 10:36:03 | <iqubic> | *it is going to |
| 10:36:57 | <lemmih> | whataday: When you say 'type notation', my mind goes to how types are written in Haskell. If it has a different meaning to you then I'll probably be confused. |
| 10:39:28 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 10:40:53 | → | ubert joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) |
| 10:42:24 | <iqubic> | whataday: In the function "add x y = x + y" then "add :: Int -> Int -> Int" and "x :: Int" and "y :: Int". Both x and y are defined here. If they weren't defined, then Haskell would reject this function. |
| 10:43:10 | × | hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-lcvdymuwotphajrf) (Quit: Connection closed for inactivity) |
| 10:44:03 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 10:48:25 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 10:52:55 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 10:53:41 | × | xelxebar_ quits (~xelxebar@gateway/tor-sasl/xelxebar) (Remote host closed the connection) |
| 10:54:01 | → | xelxebar joins (~xelxebar@gateway/tor-sasl/xelxebar) |
| 10:54:27 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 10:57:12 | → | neiluj joins (~jco@91-167-203-101.subs.proxad.net) |
| 10:57:12 | × | neiluj quits (~jco@91-167-203-101.subs.proxad.net) (Changing host) |
| 10:57:12 | → | neiluj joins (~jco@unaffiliated/neiluj) |
| 10:58:00 | × | Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Quit: WeeChat 1.9.1) |
| 11:00:14 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 11:01:18 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 11:06:22 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 11:09:00 | × | mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 246 seconds) |
| 11:09:15 | <edwardk> | linear haskell is a nice head trip when it works |
| 11:13:48 | × | olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection) |
| 11:13:55 | → | idhugo_ joins (~idhugo@80-62-117-86-mobile.dk.customer.tdc.net) |
| 11:15:31 | <siraben> | edwardk: what sort of things are you doing with linear types? |
| 11:16:06 | <edwardk> | right now just getting linear array types for the things in prim. then going through and re-rolling a form of structs on top of it, then playing around a bit with transients |
| 11:16:29 | × | idhugo quits (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net) (Ping timeout: 265 seconds) |
| 11:16:42 | <edwardk> | maybe seeing how to improve ST s interop, since you can sort of locally borrow those arrays with a fresh 's' region |
| 11:17:09 | <siraben> | nice. I wonder how linear types interacts with C FFI, might be nice to have some typesafe resource handles |
| 11:17:15 | <edwardk> | using the muscle memory gathering exercise of supporting all the types in primitive as a starting point |
| 11:17:25 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 11:17:41 | <edwardk> | i was kicking around using it for managing external ffi resources for things like fontconfig/freetype/harfbuzz |
| 11:17:45 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 11:17:58 | <edwardk> | but t.b.h. foreignptr works pretty well for most of those |
| 11:18:27 | <edwardk> | there's also something fundamentally bugging me about the only real array primitives it offers having to hold non-linear values |
| 11:18:33 | <edwardk> | that can be fixed by rolling my own |
| 11:18:59 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:19:03 | <edwardk> | but when i go play with the idea there's something that has me trying to find a way to _not_ pass a whole array back in the return type. but then tokens for access feels a lot like ST s in the first place |
| 11:19:25 | <edwardk> | on the other other hand, passing around explicit State# s %1 -> ...'s everywhere might just work |
| 11:19:45 | <edwardk> | where each array gets its own 'access token' using an existential |
| 11:19:50 | <edwardk> | and so i ca bury it in a structure |
| 11:20:08 | <edwardk> | but only pass around the 0-width access tokens |
| 11:20:44 | <edwardk> | this is all 'hey i haven't given LinearTypes in haskell a serious tire kick in a long time, let's see how it goes' |
| 11:20:57 | → | dunj3 joins (~dunj3@p200300f61714a6925c87873f9ac9c753.dip0.t-ipconnect.de) |
| 11:21:03 | <edwardk> | not yet to the level of any serious inquiry |
| 11:21:31 | × | Boomerang quits (~Boomerang@2a05:f6c7:2179:0:815d:8deb:faba:89c5) (Ping timeout: 265 seconds) |
| 11:21:37 | <edwardk> | limitations like lack of pattern synonyms have bit me already. if 9.2 can get unlifted data types i get more usecases. |
| 11:21:56 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 11:22:49 | <iqubic> | What ascii compatible syntax has the community decided on for Linear Types. I know there were a few options floating around, and I'm unsure of what the final consensus was. |
| 11:22:55 | <iqubic> | *? |
| 11:24:03 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds) |
| 11:24:11 | <edwardk> | %1 |
| 11:24:35 | <edwardk> | x %1 -> y -- is an arrow that consumes one 'x' to consume one 'y' |
| 11:24:38 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:24:42 | <edwardk> | er rather |
| 11:25:06 | <edwardk> | if you want to consume the value that is the result of the arrow (y) you need to consume one input to the arrow |
| 11:25:23 | × | lestrrat quits (~lestrrat@139.28.218.148) (Ping timeout: 265 seconds) |
| 11:25:30 | <edwardk> | and 1 there can be swapped out for type a type variable with kind Multiplicity. (i think that part is still wonky) |
| 11:25:57 | <iqubic> | Oh, multiplicity is going to be a thing? Cool... |
| 11:26:13 | <edwardk> | multiplicity = 'One or 'Many right now |
| 11:26:20 | × | desophos quits (~desophos@c-24-14-63-128.hsd1.il.comcast.net) (Quit: Leaving) |
| 11:27:06 | <iqubic> | Will we be able to specify things like "this function will consume this parameter exactly twice?" |
| 11:27:09 | <edwardk> | i can't go all graded modal type theory and make a fixed size buffer of size 60 and give you a 'write pass' with 60 uses on your punch card |
| 11:27:14 | <edwardk> | no |
| 11:27:30 | <edwardk> | its linear or normal. but sometimes its worth quantifying over that |
| 11:28:46 | <iqubic> | It seems rather redundant when to write "%1" when it seems like a simple "%" would work to tag a given arrow as linear. |
| 11:29:02 | <edwardk> | you can put a variable over there to quantify though. |
| 11:29:10 | <iqubic> | How so? |
| 11:29:11 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0.1) |
| 11:29:33 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 11:29:39 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds) |
| 11:29:47 | <boxscape> | the idea is also to possibly use the % syntax for more modifiers in the future, unrelated to multiplicity |
| 11:30:17 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:30:17 | <edwardk> | well, when playing around with references earlier, i wound up writing a reference type that looked like Ref m a which was a reference with multiplicity m. Ref 'One a would hold a linear resource and could only be swapped. and Ref 'Many a would hold a normal data type, and so you could get/set it |
| 11:30:25 | <boxscape> | (see https://github.com/ghc-proposals/ghc-proposals/pull/370) |
| 11:30:37 | <iqubic> | Sorry if these are simple questions. I haven't really read the GHC user's guide to learn about these changes. I know what linear types are, but I have zero idea how they are implemented in GHC. |
| 11:30:49 | <edwardk> | now in this case it turned out to be dumb, because Ref 'One a ~ a |
| 11:30:55 | <edwardk> | and Ref 'Many a ~ Ur a |
| 11:31:12 | <edwardk> | iqubic: no worries, i started seriously playing with this a few hours ago |
| 11:31:13 | <iqubic> | Right. That makes sense. |
| 11:31:41 | <edwardk> | but you can envision that Ref m a % m -> a -- is a thing |
| 11:31:54 | × | Cthalupa quits (~cthulhu@47.186.47.75) (Ping timeout: 272 seconds) |
| 11:32:04 | <edwardk> | Ref 'Many a -> a -- gets a normal value your using a normal arrow because x %'Many -> y is x -> y |
| 11:32:20 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 11:32:24 | <edwardk> | Ref 'One a %'One -> a -- is a linear arrow |
| 11:32:38 | → | Cthalupa joins (~cthulhu@47.186.47.75) |
| 11:32:51 | <boxscape> | iqubic btw AFAIK you can also still use a ⊸ b if unicode syntax is enabled |
| 11:33:03 | <boxscape> | for linear arrows |
| 11:33:04 | <edwardk> | my dawning realization that 'of course they are the same' came when i lookat it and realized i could pass 'a' everywhere i was passing Ref 'One a |
| 11:33:05 | → | kuribas joins (~user@ptr-25vy0i859tq5jdi8x32.18120a2.ip6.access.telenet.be) |
| 11:33:22 | <iqubic> | boxscape: I don't have a good way to type that, so I'll stick with the '%' syntax. |
| 11:33:29 | <boxscape> | that's fair |
| 11:33:58 | <edwardk> | boxscape: i always feel so conflicted about typing ⊸ because editors are so bad at formatting it in fixed sized fonts |
| 11:34:09 | <boxscape> | yeah that makes sense |
| 11:34:41 | <edwardk> | also i keep waffling between grouping the %1-> with the arrow, or with the data type on the left in my head |
| 11:35:01 | <edwardk> | i'm slowly moving away from thinking of it as part of the arrow and just as a sort of annotation you put on argument things |
| 11:35:13 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 11:35:35 | <iqubic> | FWIW, I've got emacs set up to use a monospace font, so all glyphs are the same width for me, including that unicode one. |
| 11:35:57 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 11:35:58 | <edwardk> | my problem is in the font i use, its one char wide but overflows and looks ugly |
| 11:36:15 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:36:18 | × | raym quits (~ray@45.64.220.98) (Ping timeout: 265 seconds) |
| 11:36:22 | <boxscape> | the proposal about modifiers I linked above suggests `Int %Matchable %Many -> Bool` as possible future syntax - matchability is I think more clearly associated with the arrow |
| 11:37:28 | <iqubic> | I don't even know which font font that glyph is coming from, as I have a number of fallback fonts that emacs searches through to find the correct glyph. |
| 11:37:31 | <edwardk> | yeah |
| 11:37:49 | → | kam1 joins (~kam1@83.123.64.17) |
| 11:37:57 | <edwardk> | i still want %1 => linear constraints |
| 11:38:14 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 265 seconds) |
| 11:38:29 | <iqubic> | What semantics would that imply? I don't even know how to interpert that. |
| 11:38:43 | <edwardk> | it is a constraint you must use once |
| 11:39:19 | <edwardk> | consider something like (?foo :: Int) which i can get the compiler to plumb around like a poor man's Reader Int argument |
| 11:39:37 | <edwardk> | but when I move from Int to Int %1-> i lose the equivalent in => |
| 11:39:51 | <iqubic> | Right. That makes sense. |
| 11:40:04 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 11:40:10 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 265 seconds) |
| 11:40:29 | <boxscape> | edwardk did you play with the linear implicit parameters ghc had from 5.04 to 6.4? (I didn't) |
| 11:40:39 | <edwardk> | yes they sucked |
| 11:40:43 | <boxscape> | I see :) |
| 11:40:43 | hc_ | is now known as hc |
| 11:40:52 | <edwardk> | broke eta-reduction =) |
| 11:40:57 | <boxscape> | sounds interesting |
| 11:41:21 | <edwardk> | i had one semi legitimate use iirc |
| 11:41:29 | <iqubic> | How do you break eta-reduction? |
| 11:42:01 | <edwardk> | sorry, it was beta |
| 11:42:08 | <iqubic> | converting "\x -> abs x" into "abs" shouldn't be too hard... right? |
| 11:42:35 | → | mananamenos joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net) |
| 11:42:48 | <edwardk> | consider (f x) -- i have to split and pass my linear implicit parameter to both branch, but if i do the reduction and f is id, i wouldn't split |
| 11:43:02 | <iqubic> | Are you sure you mean beta? https://wiki.haskell.org/Beta_reduction |
| 11:43:11 | <edwardk> | because the beta reduced form would be x |
| 11:43:22 | <edwardk> | id x = (\y -> y) x = x |
| 11:43:29 | <iqubic> | Right. I agree. |
| 11:44:07 | <edwardk> | but with linear implicit params the former would get you to split the linear implicit parameter and feed one to f, and the other to x in the former case, while the other would just get your unsplit parameter |
| 11:44:29 | <iqubic> | Does Haskell have implicit params? |
| 11:44:42 | <edwardk> | haskell has implicit params, it used to have 'linear implicit params' |
| 11:45:02 | <edwardk> | which could be used to say sneak a RNG seed around in your source code so that every use site got a distinct one |
| 11:45:12 | <edwardk> | by splitting at every fork where both the left and right wanted it |
| 11:46:00 | <iqubic> | Yeah that makes sense. |
| 11:46:02 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 11:47:06 | <iqubic> | So, linear types exist in Haskell now. Does this mean we need to rewrite large chunks of the Prelude to make a Linear-Prelude? |
| 11:47:07 | <edwardk> | my recollection is that as i joined the community in 2006 or so this was that a portion of the community was being paid buy the guy who built shop.com to work on happs a web front end in haskell and they refactored it like crazy to use that feature... and happstack was forked off to salvage the former design when someone got disgusted and quit. (i apologize for any gross mischaracterization of lemmih's, shapr's, etc.'s positions) |
| 11:47:10 | → | raym joins (~ray@182.66.189.165) |
| 11:47:22 | <edwardk> | there is a linear-base package that shipped from tweag with 9.0 |
| 11:47:42 | <edwardk> | basically you have to really work to use linearity right now |
| 11:47:47 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:47:56 | × | raym quits (~ray@182.66.189.165) (Read error: Connection reset by peer) |
| 11:48:11 | <boxscape> | % let ?foo = 5 in (?foo + 6 :: (?foo :: Int) => Int) -- a simple example of the (non-linear) implicit parameters ghc still has |
| 11:48:12 | <yahb> | boxscape: 11 |
| 11:48:26 | <edwardk> | yeah |
| 11:48:43 | <edwardk> | i use them quite a bit more seriously than that |
| 11:49:19 | → | danvet_ joins (~danvet@212-51-149-181.fiber7.init7.net) |
| 11:49:37 | <iqubic> | Ah. Right. I recall reading about that on OCharles's 24 Days of Haskell Extentsions series a while ago: https://ocharles.org.uk/blog/posts/2014-12-11-implicit-params.html |
| 11:49:41 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) |
| 11:50:01 | <edwardk> | e.g. when working on a little toy rendering pipeline, i started with using a little bit of this to make it easier to plumb in some runtime settings without reader clutter. https://github.com/ekmett/codex/blob/master/engine/src/Engine/Shader/Include.hs#L69 |
| 11:50:17 | <edwardk> | then it grew to pass caches around https://github.com/ekmett/codex/blob/master/engine/src/Engine/Shader/Include.hs#L140 |
| 11:50:34 | <edwardk> | tools for watching directories for changes https://github.com/ekmett/codex/blob/master/engine/src/Engine/Shader/Include.hs#L152 |
| 11:50:45 | <iqubic> | What is this supposed to render? Is it just a generic set of OpenGL bindings or what? |
| 11:51:10 | <edwardk> | and finally to make an outer loop https://github.com/ekmett/codex/blob/master/engine/src/Engine.hs#L48 |
| 11:51:17 | <edwardk> | well, lets look at that top level call |
| 11:51:29 | <edwardk> | type GivenSetupInfo = (GivenShaderDir, GivenIncludeCache, GivenWindow); type GivenFrameInfo = (GivenInput, GivenEvents) |
| 11:51:38 | <edwardk> | withEngine :: MonadUnliftIO m => (GivenSetupInfo => ((GivenFrameInfo => m a) -> m ()) -> m ()) -> m () |
| 11:51:41 | <edwardk> | is a bit of a mouthful |
| 11:51:53 | <edwardk> | but swap m out for IO |
| 11:51:58 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 11:52:00 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 11:52:14 | <edwardk> | and we get (GivenSetupInfo => ((GivenFrameInfo => IO a) -> IO ()) -> IO ()) -> IO () -- which is like two trips through Cont |
| 11:52:19 | <edwardk> | still nuts to read |
| 11:52:24 | <edwardk> | but lets see it used |
| 11:52:41 | <iqubic> | Yeah, that's crazy. |
| 11:52:41 | <edwardk> | https://github.com/ekmett/codex/blob/master/engine/example.hs |
| 11:52:51 | <edwardk> | you start in IO. i don't take you out of your monad. |
| 11:53:04 | → | raym joins (~ray@45.64.220.142) |
| 11:53:39 | <iqubic> | That's a surprisingly simple invocation for such a complicated looking function |
| 11:53:42 | <edwardk> | in the function you pass me, you have full access to the OpenGL window, knowledge of where shaders are located and a fancy include cache, so i can make shaders automatically recompile behind your back |
| 11:54:03 | <edwardk> | and i give YOU a function you call back after you set up all your fonts, textures, etc. and other resources |
| 11:54:25 | <edwardk> | and i'll call your function with 'what has changed'. you get the input keystrokes, etc. also as implicit parameters |
| 11:54:36 | <edwardk> | and any functions you call? they don't pay for what they don't use |
| 11:54:38 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) (Ping timeout: 264 seconds) |
| 11:54:59 | <iqubic> | So basically, once the user has set up all the fonts, textures, and other stuff, they can call drive? |
| 11:55:01 | <merijn> | edwardk: Do you have a blogpost/whatever explaining this stuff? |
| 11:55:02 | <edwardk> | if they don't need the shader directory ? the opengl window? the include cache? the current keystroke data? it doesn't get passed there! |
| 11:55:07 | <merijn> | Sounds neat |
| 11:55:09 | <iqubic> | That's really really cool. |
| 11:55:10 | <edwardk> | merijn: nah, just a couple rants in here |
| 11:55:16 | <edwardk> | yeah |
| 11:55:20 | <edwardk> | and after drive they clean up |
| 11:55:28 | <merijn> | edwardk: Copy paste them from the logs to a blog so I can read them? ;) |
| 11:55:30 | <edwardk> | drive handles the window interactions, etc. |
| 11:55:39 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 11:55:43 | <edwardk> | you have a scrollback buffer ;) |
| 11:55:43 | <iqubic> | Right. I love this concept. |
| 11:56:03 | <edwardk> | iqubic: this works for basically anything you could write as ReaderT e IO |
| 11:56:18 | <edwardk> | the 'readert' pattern that snoyman and bitonic pushed on the community a while back |
| 11:56:36 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 11:56:47 | <edwardk> | if you have IO at the bottom of your stack, that covers ReaderT e obviously, but ReaderT (IORef s) IO -- is just a more efficient StateT s IO |
| 11:56:59 | <edwardk> | and here the 'state' parameter isn't passed to any code that isn't using it |
| 11:57:05 | <bitonic> | i didn't do much pushing, but i do like it :) |
| 11:57:07 | <iqubic> | Yeah. But I assume using a Reader instead of implicit params makes the code harder to read. |
| 11:57:07 | <edwardk> | no putting it into tuples and taking it right out |
| 11:57:29 | <bitonic> | the main reason why i like it is that i use a function from `async` every other line |
| 11:57:34 | <iqubic> | Also, using implicit params makes sure that only the parts you are actually using get passed along. |
| 11:57:36 | <edwardk> | well, the key here is the semantics are subtly off if you ever would use 'local' |
| 11:57:42 | <edwardk> | lets see why |
| 11:57:55 | <iqubic> | I think I can see where this is going, but I'll let you explain. |
| 11:58:00 | <edwardk> | because say you have a constraint like GivenFoo = (?foo:: Foo) |
| 11:58:23 | <iqubic> | Isn't that just a type synonym, and not a constraint? |
| 11:58:25 | <edwardk> | Foo -> (Foo -> a) is different than GivenFoo => GivenFoo => a |
| 11:58:44 | <dminuoso> | edwardk: I guess one major benefit is that this is very compositional in the environment. With ReaderT you're essentially tied to one humongous environment (or you have to explicitly `local`, but that's very annoying if you need a part of a product type here, and another part of a product type there. |
| 11:58:45 | <edwardk> | the former i can readily pass two different Foos |
| 11:59:03 | <boxscape> | iqubic the kind of (?foo :: Foo) is Constraint |
| 11:59:13 | <iqubic> | I see that now. |
| 11:59:37 | <edwardk> | dminuoso: yeah, using the megalithic reader pattern folks use, you have to pattern match to get out your parts by hand, or pass too much down into any individual function. so to get it to optimize relies fundamentally on case-of-case analysis |
| 11:59:45 | <edwardk> | that can sometimes work when you aren't terribly polymorphic |
| 11:59:50 | <edwardk> | but if you fall into the lens like pattern of using |
| 12:00:08 | <edwardk> | (MonadReader e m, HasFoo e, HasBar e, HasBaz e) => ... |
| 12:00:17 | <iqubic> | lenses and implicit params don't seem like they'd go well together. |
| 12:00:22 | <edwardk> | then it just isn't going to happen most of the time in anything polymorphic |
| 12:00:38 | <edwardk> | i mention this because its how we teach folks to use the mtl. |
| 12:00:55 | <edwardk> | write all your code on (MonadReader e m, MonadState s m, HasFoo e, HasBar s) => |
| 12:01:01 | <edwardk> | and build up constraints rather than locking in a monad |
| 12:01:07 | <iqubic> | mtl is good. But mtl is also hard to use. |
| 12:01:09 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 246 seconds) |
| 12:01:11 | <edwardk> | but basically that becomes a poor performing interpreter |
| 12:01:49 | <boxscape> | Since we were talking about linear constraints, is there a reasonable interpretation of something like `Applicative f %1 => ...`? |
| 12:01:50 | <iqubic> | Yeah, the tagless final approach of mtl certainly has its drawbacks. |
| 12:02:27 | <dminuoso> | edwardk: The thing with `(MonadReader e m, HasFoo e, HasBar e, HasBaz e) => ...` though is that you can't prevent a user from using `ask', and suddenly they use stuff not mention in the classy lens constraints. |
| 12:02:29 | → | geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) |
| 12:02:31 | <edwardk> | the implicit param story above gives the expressiveness of reader/writer/state + IO a needed (by using IORef for the values you can emulate state, and you can emulate writer with state) |
| 12:03:29 | <edwardk> | dminuoso: they can always ask, and then use local to restore it later, or worse, in a state monad they can 'get' and then 'set' later destroying your carefully managed environment you stuffed into a map thats tracking active file handles... |
| 12:03:55 | <boxscape> | it seems like you might get some of that compositionality if we had row types you could use with Reader |
| 12:04:10 | <edwardk> | you've discovered the effect system game |
| 12:04:20 | <iqubic> | I'd love proper row types in Haskell. |
| 12:04:30 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-zrcmjtwsmmlqlmrj) |
| 12:05:04 | <edwardk> | anyhow i like that pattern, its quirky, nobody seems to use it but me. i've talked to like 2 other people who have something based on it |
| 12:05:14 | <lortabac> | I would like to see an implicit-parameters extension that only allows overriding parameters through some equivalent of 'local' |
| 12:05:31 | <edwardk> | and it directly correlates to 'how i make code run fast in scala' which is embarrassing to me. |
| 12:05:36 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 12:05:43 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Remote host closed the connection) |
| 12:06:06 | <iqubic> | You use Scala too? Is that for work? |
| 12:06:10 | <edwardk> | iqubic: anyways consider a parser. you might think you could use the implicit param trick above, but it doesn't work |
| 12:06:25 | × | codedmart quits (~codedmart@149.28.9.205) (Ping timeout: 240 seconds) |
| 12:06:28 | <edwardk> | because what if your parser is passing aroun the string its parsing in the implicit param and you call another parser? |
| 12:06:36 | <edwardk> | you get cross contamination between the constraints |
| 12:06:40 | <iqubic> | Parsers are a great domain here. |
| 12:06:43 | <edwardk> | so to fix THAT i use reflection. |
| 12:06:59 | <edwardk> | https://github.com/ekmett/codex/tree/master/parsnip is my fastest parsing library |
| 12:07:06 | × | danvet_ quits (~danvet@212-51-149-181.fiber7.init7.net) (Ping timeout: 246 seconds) |
| 12:07:14 | <edwardk> | and it uses reflection to pass around the input data |
| 12:07:19 | × | LKoen quits (~LKoen@136.169.9.109.rev.sfr.net) (Remote host closed the connection) |
| 12:07:19 | × | plutoniix quits (~q@184.82.194.171) (Quit: Leaving) |
| 12:07:28 | <edwardk> | rather, it uses a single Addr# as the state of the parser |
| 12:07:45 | <edwardk> | by comparison zeptoparsec seems positively bloated ;) |
| 12:08:16 | <edwardk> | https://github.com/ekmett/codex/blob/master/parsnip/src/Text/Parsnip/Internal/Parser.hs#L115 |
| 12:08:21 | <iqubic> | I think you mean "megaparsec". But yes, I understand your point. |
| 12:08:40 | <edwardk> | no zeptoparsec is a smaller than attoparsec parser inside attoparsec used for parsing short bytestrings |
| 12:09:08 | <edwardk> | and prior to parsnip it was the simplest parser i knew |
| 12:09:31 | <edwardk> | in parsnip i take your bytestring, copy it to a null terminated c string, and just use an Addr# indexing into that c string |
| 12:09:47 | × | davros quits (~davros@host86-185-99-39.range86-185.btcentralplus.com) (Remote host closed the connection) |
| 12:09:54 | <iqubic> | What do the "#" mean in the Addr and State type names? I know those are allowed by the MagicHash extension, but I don't know what they actually do. |
| 12:10:05 | → | danza joins (~francesco@151.74.103.107) |
| 12:10:19 | <edwardk> | MagicHash just makes # a legal part of an identifier |
| 12:10:21 | <edwardk> | it does nothing |
| 12:10:32 | <iqubic> | Ah. I see. |
| 12:10:33 | <edwardk> | now we tend to name identifiers with # that we don't want users touching |
| 12:10:47 | <iqubic> | Thank you for telling me. |
| 12:10:52 | <edwardk> | because they have to explicitly turn on the dangerous looking 'here be dragons' MagicHash extension |
| 12:11:05 | <liyang> | “i take your bytestring,” ← good basis for a “There Will be Blood” reference. |
| 12:11:32 | <edwardk> | Now, haskell has types that aren't 'lifted'. e.g there is Int# which is an honest to goodness integer not a promise to compute one when forced. |
| 12:11:41 | <edwardk> | and internally the data constructor for Int looks like |
| 12:11:46 | <boxscape> | interestingly MagicHash only allows # at the end of identifiers, which I guess is so that you can still use it in operators, as well |
| 12:11:47 | <edwardk> | data Int = I# Int# |
| 12:12:08 | <edwardk> | its a constructor named I# (here be dragons!) holding a value that is a real machine int. |
| 12:12:19 | × | Graf_Blutwurst quits (~grafblutw@2001:171b:226e:adc0:d552:313d:8cb3:7b48) (Ping timeout: 272 seconds) |
| 12:12:38 | → | LKoen joins (~LKoen@136.169.9.109.rev.sfr.net) |
| 12:12:39 | <edwardk> | and GHC.Prim exports operations like +# that take Int#'s and return Int#'s |
| 12:12:57 | <iqubic> | I wouldn't touch that with a ten foot pole. I'm still new to this world of low level computations |
| 12:12:57 | <edwardk> | then the implementation of + for Int looks like |
| 12:12:59 | → | codedmart joins (~codedmart@149.28.9.205) |
| 12:13:09 | <edwardk> | I# i + I# j = I# (i +# j) |
| 12:13:34 | <iqubic> | That scares me. |
| 12:13:51 | <edwardk> | the I# wrapper takes things from the world of unlifted things to the parts of haskell you know and love where _|_ works like normal, everything is lazy, etc. |
| 12:14:04 | → | Graf_Blutwurst joins (~grafblutw@adsl-178-38-234-220.adslplus.ch) |
| 12:14:12 | <edwardk> | data IORef a = IORef (MutVar# RealWorld a) |
| 12:14:24 | <edwardk> | MutVar# is an object that lives on the heap that holds a pointer to another object on the heap |
| 12:14:34 | <iqubic> | Makes sense. |
| 12:15:08 | <edwardk> | that way unpacking an IORef in a constructor using ! gives you a pointer to the shared heap objet that knows where the target is. |
| 12:16:53 | <edwardk> | then if you had a data type like data Foo = Foo !(IORef Foo) !(IORef Foo) -- it works like you'd expect. even if you unpack there, you just get the pointers to the shared heap object. if i pass you two copies o the same ioref they don't get inlined as separate pointers into some constructor and play badly with your surface langage, instead you get two pointers to the same heap obejct, and modifying the ioref affects what each would see, |
| 12:16:53 | <edwardk> | exactly like you'd expect in haskell, but surprising a c++ programmer! |
| 12:17:00 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 12:17:53 | <edwardk> | MutVar# s a, lives behind STRef and IORef, MVar# lives behind MVar, Array# is used behind Array, Vector, Data.Primitive.Array, etc... |
| 12:18:33 | → | davros joins (~davros@host86-185-99-39.range86-185.btcentralplus.com) |
| 12:18:34 | <edwardk> | ByteArray# holds binary data in a slab of memory on the heap and is used behind a bunch of the unboxed vector types. |
| 12:18:48 | <edwardk> | there are lots of these kinds of types |
| 12:19:13 | <edwardk> | the documentation for GHC.Prim is a tour through a nightmarish landscape of 'wtf is this undocumented crap' until you get used to it |
| 12:19:46 | <iqubic> | I might go looking through GHC.Prim's documentation somday. |
| 12:19:51 | <iqubic> | *someday |
| 12:19:57 | <iqubic> | *some day |
| 12:20:08 | <liyang> | *any day |
| 12:20:18 | <liyang> | *today |
| 12:20:20 | <iqubic> | Typing is hard. |
| 12:20:45 | <edwardk> | anyways the parsnip code above uses reflection to package up the original bytestring and information about the cstring copy in a space efficient way, giving you efficient access to how many bytes along you are, the original bytestring if you want to slice it up to quickly return an interval in O(1), etc. |
| 12:20:48 | <boxscape> | that's why we have type theory |
| 12:21:06 | <edwardk> | and the region parameter from reflection fixes the implicit param problem i mentioned |
| 12:21:16 | <edwardk> | because a parser in a parser will have a different type parameter |
| 12:21:22 | <edwardk> | and it can't confuse those two strings |
| 12:21:25 | <edwardk> | problem solved |
| 12:21:33 | → | jedws joins (~jedws@101.184.202.248) |
| 12:21:44 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 12:21:47 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 260 seconds) |
| 12:21:59 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 12:22:03 | <iqubic> | Yeah. I'm looking at the code, and it's a really elegant solution to a problem I only just learned about 30ish minutes ago. |
| 12:22:05 | <edwardk> | internally it is as fast as Addr# -> State# s -> (# State# s, Addr#, (# a | (##) #) #) |
| 12:22:26 | × | conal quits (~conal@66.115.157.88) (Ping timeout: 260 seconds) |
| 12:22:40 | × | berberman_ quits (~berberman@unaffiliated/berberman) (Max SendQ exceeded) |
| 12:22:54 | <iqubic> | Parsing is always hard. |
| 12:23:13 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 12:23:52 | <edwardk> | which is 'the function is given a naked c pointer, and an imaginary token that doesn't have any representation whatsoever that is used for sequencing effects. and gives back a new magic tag, the address it parsed to, and either an answer or the fact that it failed, which looks a lot like a maybe but is secretly represented by a machine tag thatis just a number and an 'a' that is either real or a pointer a placeholder object |
| 12:24:11 | <edwardk> | ptr -> (ptr, int, a) -- fully unboxed |
| 12:24:57 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 246 seconds) |
| 12:25:08 | <edwardk> | the int tells me if i failed, if i succeed i pick up from here with a, if i fail i revert to the ptr that was the arg and try the alternative, etc. |
| 12:25:30 | <edwardk> | none of the code in the monad, applicative, etc. ever dereferences the ptr |
| 12:25:48 | <edwardk> | its just the little combinator that goes to check to see what the current character is that needs to know the cstring is safe |
| 12:25:58 | → | conal joins (~conal@66.115.157.88) |
| 12:26:07 | <iqubic> | I once tried making my own parser, and was all of the following: A) really buggy, B) hard to use and C) A mess of spaghetti code. |
| 12:26:22 | <edwardk> | https://github.com/ekmett/codex/blob/master/parsnip/src/Text/Parsnip/Char8.hs#L51 |
| 12:26:25 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 12:28:04 | <iqubic> | Is line 52 just checking for a Null Terminator? |
| 12:28:30 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 260 seconds) |
| 12:28:41 | <edwardk> | 52 is checking if you asked if the next char is '\0', which will always fail to parse |
| 12:28:50 | <edwardk> | because this is a parser that has to work over a null terminated string |
| 12:28:54 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 12:28:56 | <edwardk> | 'inside' that string there will be no nulls |
| 12:29:00 | <edwardk> | a null is eof |
| 12:29:20 | <iqubic> | Ah. Of course. |
| 12:29:22 | <edwardk> | e.g. i'm using this to parse shaders. if you see a null in the middle of your shader file you're hurting |
| 12:30:12 | <edwardk> | actually to be clear, i'm not fully parsing shaders with this |
| 12:30:23 | <edwardk> | i'm 'approximately' parsing them, just enough to find #include directives |
| 12:30:31 | <edwardk> | so i can learn what includes you use, what what those use |
| 12:30:44 | <edwardk> | that way when any of those files change i can invalidate the shader |
| 12:31:46 | <edwardk> | the opengl standard doesn't actually give me that ability to reflect on which includes you used. just the ability to populate a funny little cache that you can use. it'd be like saying you should load every header you might consider using and then i'll pick and choose, but not tell you what i used... |
| 12:31:51 | <edwardk> | dumb !@(#*ing spec |
| 12:32:22 | <edwardk> | so i wrote a little parser that looks for includes, and stuffs the data into a map to help me track what includes what transitively |
| 12:32:33 | <edwardk> | that is that include cache i talked about earlier |
| 12:32:38 | <edwardk> | so i can share work across shaders |
| 12:33:21 | <edwardk> | then if you are compiling on a remotely modern gpu i can populate just the headers you need and use the "real" opengl shader compiler that can support headers |
| 12:33:38 | <edwardk> | and if not? i'll fake it well enough to get the code i had to compile |
| 12:33:55 | <edwardk> | that was my application at the time |
| 12:34:32 | <iqubic> | OpenGL's specs are such a wild thing to look at. |
| 12:34:34 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 260 seconds) |
| 12:34:56 | <edwardk> | what i liked about the parser was how few parts actually needed access to the original bytestring |
| 12:34:57 | <edwardk> | https://github.com/ekmett/codex/blob/master/engine/src/Engine/Shader/Include.hs#L180 |
| 12:35:29 | <edwardk> | just the stuff that has a KnownBase s => .. constraint |
| 12:35:45 | <edwardk> | which is only a few functions at a high level are being passed the bytestring-like argument |
| 12:35:59 | <edwardk> | everyone else is just in that super-tight rep i mentioned above |
| 12:36:04 | <edwardk> | doing exactly what they need to and no more |
| 12:36:25 | <edwardk> | i'd like to go back and revisit this approach using the stuff the nick wu presented at icfp last year |
| 12:36:32 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 12:36:32 | × | oish quits (~charlie@228.25.169.217.in-addr.arpa) (Client Quit) |
| 12:36:50 | <iqubic> | Sorry, but I have to go now. |
| 12:36:53 | <iqubic> | I'm sorry. |
| 12:36:58 | <edwardk> | nick showed how to use typed template haskell as code gen for a nice parser library that analyzed everything it could, THEN compiled |
| 12:37:01 | <edwardk> | no worries |
| 12:37:05 | <edwardk> | nice chatting iqubic |
| 12:37:17 | <edwardk> | been using this as a distraction from writing code in another window |
| 12:37:24 | <hc> | heh |
| 12:37:29 | <hc> | what are you currently writing? |
| 12:37:44 | <edwardk> | https://github.com/ekmett/linear-primitive |
| 12:38:17 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 12:38:26 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Ping timeout: 264 seconds) |
| 12:38:58 | <edwardk> | and i keep trying to figure out a 'token' passing version of a bunch of arrays using linear haskell that doesn't pass around as much stuff, but sadly winds up feeling a bit more like ST s |
| 12:39:34 | → | p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) |
| 12:40:08 | <iqubic> | edwardk: Are you going to be contributing to GHC any time soon? |
| 12:40:28 | <edwardk> | i generally try to take ghc as 'god given' and see what libraries can be written using it |
| 12:40:35 | <hc> | =) |
| 12:40:37 | <edwardk> | it provides a division of labor that has helped me keep my sanity |
| 12:40:48 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 12:40:52 | <hc> | edwardk: thanks for the link by the way. Have to read up on linear types, I'm a bit rusty |
| 12:40:59 | <iqubic> | And with that last question, I will be going on my way. |
| 12:41:11 | <edwardk> | hc they just became borderline usable in 9.0. |
| 12:41:20 | <edwardk> | they'll probably be fully usable in 9.2 |
| 12:41:28 | <edwardk> | that is my hope anyways |
| 12:42:01 | <edwardk> | if 9.2 includes those and strict data types? (not strictdata, but things in the equivalent of today's TYPE 'UnliftedRep i'll be super happy |
| 12:42:21 | <edwardk> | because we just got properly sized small Int16# primitives, allowing us to get densely packed data structures |
| 12:42:46 | <hc> | Nice. I last used haskell when ghc 7.something was stable. I miss these days when I wrote haskell code... |
| 12:42:47 | <edwardk> | so haskell has been rapidly morphing into much of what i _want_ in coda, faster than i've been getting my own compiler done |
| 12:43:00 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 12:43:04 | <edwardk> | which is a super happy problem for me, tbh |
| 12:43:10 | <hc> | hehe |
| 12:45:26 | <davros> | edwardk you're making a language? |
| 12:46:00 | <dminuoso> | % askFor :: MonadReader r m => ((?ask :: r) => a) -> m a; askFor a = do r <- ask; let ?ask = r in return a |
| 12:46:00 | <edwardk> | its been a slow-burn research project, mostly forking off side-projects that become useful libraries for some time |
| 12:46:00 | <yahb> | dminuoso: |
| 12:46:03 | <dminuoso> | We should ship this in mtl. |
| 12:46:18 | × | LKoen quits (~LKoen@136.169.9.109.rev.sfr.net) (Read error: Connection reset by peer) |
| 12:46:22 | <davros> | ok i see it on github |
| 12:46:23 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 265 seconds) |
| 12:46:55 | <edwardk> | the talk i gave on cadenza covers a bit of one of the more recent compilation tricks i tried |
| 12:47:10 | <hc> | got a link? |
| 12:47:32 | <davros> | "ways t apply SPMD-on-SIMD evaluation" .. fancy parallel code gen? |
| 12:47:33 | <edwardk> | the monadic warsaw workshop on guanxi covers a large part the surrounding motivations before diving in deep on logic programing |
| 12:47:57 | <edwardk> | https://www.youtube.com/watch?v=25RmUl88jSw |
| 12:48:00 | <edwardk> | is the cadenza talk |
| 12:48:04 | → | LKoen joins (~LKoen@136.169.9.109.rev.sfr.net) |
| 12:48:04 | <hc> | thanks! |
| 12:48:17 | × | jedws quits (~jedws@101.184.202.248) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 12:48:31 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:b666:c4b7:6001:ca20:56eb) |
| 12:48:36 | → | daytone joins (~daytona@90.200.185.163) |
| 12:48:50 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 12:49:09 | <edwardk> | https://www.youtube.com/watch?v=D7rlJWc3474&list=PLcAu_kKy-krxDD1WwRX_9rc0knAFK3nHs&index=41 is the 4 series on guanxi |
| 12:49:12 | <edwardk> | er 4 part |
| 12:49:20 | <davros> | "speed * cores * width" .. reminds me all the way back to the xbox 360, it was cores X SIMD X loop-unrolls (pipeline depth) |
| 12:49:27 | → | jedws joins (~jedws@101.184.202.248) |
| 12:49:39 | <edwardk> | the first talk in the series has slides, the other 3 parts get progressively more esoteric diving into my way of thinking about logic programming |
| 12:49:58 | <edwardk> | davros: yeah |
| 12:50:29 | × | idhugo_ quits (~idhugo@80-62-117-86-mobile.dk.customer.tdc.net) (Remote host closed the connection) |
| 12:50:41 | × | Tene quits (~tene@poipu/supporter/slacker/tene) (Ping timeout: 246 seconds) |
| 12:50:53 | → | idhugo_ joins (~idhugo@80-62-117-86-mobile.dk.customer.tdc.net) |
| 12:50:55 | × | pja quits (~phil@2a02:8010:6098:0:f2de:f1ff:fe2c:3d9) (Quit: WeeChat 2.8) |
| 12:50:59 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) |
| 12:51:00 | <edwardk> | the intel spmd program compiler is basically a shader compiler for a cpu, it is pretty influential on my thinking there |
| 12:51:09 | → | Boomerang joins (~Boomerang@2a05:f6c7:2179:0:815d:8deb:faba:89c5) |
| 12:51:39 | <edwardk> | https://www.reddit.com/r/haskell/comments/6kw3sj/yow_lambdajam_2017_edward_kmett_transients_spmd/ is a talk where i was going to give a talk about transients but changed topics at the last minute to talk about spmd eval. |
| 12:52:16 | <davros> | i haven't actually touched haskell in a long time.. this being #haskell i should ask: How far is (or isn't) haskell getting these days with this? (the fact you're doing this experiment suggests to me maybe not as far as it could) |
| 12:52:38 | <edwardk> | with 'this' being what part of that? |
| 12:52:40 | × | ByronJohnson quits (~bairyn@unaffiliated/bob0) (Ping timeout: 258 seconds) |
| 12:52:44 | × | cur8or quits (~cur8or@72canterbury.cybersmart.co.za) (Quit: Textual IRC Client: www.textualapp.com) |
| 12:52:48 | <davros> | leveraging multicore & SIMD |
| 12:53:04 | <davros> | writing parallel code easily. |
| 12:53:06 | <edwardk> | there was an intel haskell research compiler that used SIMD heavily. |
| 12:53:27 | <edwardk> | we have primops for working with things like Int32x8#'s |
| 12:53:28 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 12:53:38 | × | geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 265 seconds) |
| 12:53:40 | <merijn> | davros: ghc-prim has a bunch of SIMD primitives, but those are only for the LLVM backend I think? |
| 12:53:44 | <edwardk> | and can turn that into _much_ of what is needed for vectorization |
| 12:53:54 | <merijn> | davros: That was carter's baby for a while |
| 12:53:55 | <edwardk> | if, like, merijn said, you limit yourself to llvm |
| 12:54:05 | <merijn> | davros: See also #numerical-haskell :) |
| 12:54:14 | <edwardk> | the problem is there's some technical wibbles about how to support shuffles correctly |
| 12:54:26 | <merijn> | I see "a bunch" I think it has everything :p |
| 12:54:28 | <edwardk> | and everyone who cared about the project kinda left |
| 12:54:31 | <merijn> | s/see/say |
| 12:54:49 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 12:55:08 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 12:55:17 | <carter> | I may have more head space this year. New job is gonna be good for my head space |
| 12:55:50 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:c97:1fb5:a86c:10a1) (Ping timeout: 264 seconds) |
| 12:55:59 | <davros> | could you make a haskell to Graphcore compiler .. |
| 12:56:10 | <merijn> | carter: Man, now you've got me thinking about that tweet from years ago again... |
| 12:56:11 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 12:56:12 | <carter> | There’s some subtle issues around how to actually give shuffles type safe interface |
| 12:56:22 | <edwardk> | anyhow, the reason i was playing witha whole compiler for it, was i didn't (and still don't) know how to compile the _kind_ of simd i want without intrusive annotations on the surface language. |
| 12:56:23 | <carter> | merijn: which tweet ? |
| 12:56:25 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 12:56:39 | <edwardk> | (and i don't really know how to do it even with those, but it gets me closer.) |
| 12:57:03 | <edwardk> | davros: so im still chasing shadows on that front |
| 12:57:57 | × | jedws quits (~jedws@101.184.202.248) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 12:57:58 | <davros> | i seem to remember 'lambdacube' doing quite well at mixing 'main program' with 'bits of shader code' (if i'm remembering it right), i guess that could go across to compute-shaderes (which in turn could be done on a cpu if you really wanted) |
| 12:58:15 | <edwardk> | that isn't the kind of use of simd i want |
| 12:58:28 | <edwardk> | nor is futhark, nor accelerate, nor... |
| 12:58:33 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 272 seconds) |
| 13:00:06 | <edwardk> | ok, i'm sabotaging myself by staying up this late. the hf board meeting is in 3 hours and i'll be lucky to be conscious then, and then i'm working with someone all afternoon, so i'm not sure when i'm supposed to sleep |
| 13:00:14 | <edwardk> | i'm going to try to get some sleep |
| 13:00:18 | <edwardk> | later folks |
| 13:00:33 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 13:00:39 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 13:02:09 | <edwardk> | davros: i think the question i'm interested in is how would you run a _lazy_ code efficiently on a gpu, or on a wide simd unit, not just some random stream processing edsl or edsl for describing c badly in haskell. |
| 13:02:31 | → | Tario joins (~Tario@201.192.165.173) |
| 13:02:35 | → | Tene joins (~tene@poipu/supporter/slacker/tene) |
| 13:02:37 | <edwardk> | efficiently is key. i can do it badly |
| 13:02:54 | <edwardk> | i can come up with ways that work pretty well for an ml-like language even |
| 13:03:33 | <edwardk> | ok, enough michigan goodbytes, really g'night this time =) |
| 13:03:39 | → | ByronJohnson joins (~bairyn@unaffiliated/bob0) |
| 13:03:39 | <edwardk> | er goodbyes |
| 13:04:53 | × | raym quits (~ray@45.64.220.142) (Quit: leaving) |
| 13:06:16 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 13:07:37 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 13:08:06 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 13:09:19 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 13:09:39 | → | cur8or joins (~cur8or@2c0f:fbe1:3:17:162:fc74:7149:2542) |
| 13:10:46 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 256 seconds) |
| 13:11:01 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 13:13:36 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 13:13:56 | × | thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds) |
| 13:14:29 | <carter> | davros: one technical challenge for good simd apis is you need a way to enforce certain args are known at compile time. In a way that is kinda like c++ const expr |
| 13:15:53 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 13:16:24 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds) |
| 13:16:45 | <dminuoso> | carter: Amusing side note, c++ const expr has compile time mutability (that is a given const expr might evaluate differently in two spots) if you want it badly enough. |
| 13:16:59 | <dminuoso> | standard conforming. |
| 13:17:00 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 13:17:00 | <carter> | Wattttt |
| 13:17:28 | → | jrm joins (~jrm@freebsd/developer/jrm) |
| 13:17:30 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 13:17:53 | <dminuoso> | https://b.atch.se/posts/non-constant-constant-expressions/ |
| 13:18:04 | <carter> | I also suspect the right approach would be handy for macros/ meta programming |
| 13:20:01 | → | thc202 joins (~thc202@unaffiliated/thc202) |
| 13:20:14 | <carter> | dminuoso: I mean a compile time time counter sounds useful :) |
| 13:21:41 | <dminuoso> | carter: Heh. If I understand the stack of tricks correctly, you can only cause f() to evaluate differently on the first invocation. More research into whether a counter can be implemented is needed. |
| 13:22:05 | <carter> | Heh. |
| 13:22:20 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 13:22:22 | <carter> | Also good morning |
| 13:23:03 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 246 seconds) |
| 13:24:27 | → | Tario joins (~Tario@201.192.165.173) |
| 13:28:36 | → | carlomagno1 joins (~cararell@148.87.23.8) |
| 13:28:53 | → | lambdah-sadvipra joins (~user@189.6.240.228) |
| 13:28:54 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 13:31:45 | × | carlomagno quits (~cararell@148.87.23.13) (Ping timeout: 240 seconds) |
| 13:33:10 | → | dcoutts joins (~duncan@85.186.125.91.dyn.plus.net) |
| 13:33:22 | × | geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds) |
| 13:33:36 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds) |
| 13:38:07 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 13:38:27 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 13:40:59 | → | dunj4 joins (~dunj3@p200300f61714a66854ef98154aeab501.dip0.t-ipconnect.de) |
| 13:41:30 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 13:41:49 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 13:42:30 | → | tsrt^ joins (tsrt@ip98-184-89-2.mc.at.cox.net) |
| 13:43:11 | × | cur8or quits (~cur8or@2c0f:fbe1:3:17:162:fc74:7149:2542) (Ping timeout: 268 seconds) |
| 13:43:27 | × | dunj3 quits (~dunj3@p200300f61714a6925c87873f9ac9c753.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 13:44:57 | → | new_haskeller joins (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) |
| 13:45:33 | dunj4 | is now known as dunj3 |
| 13:46:33 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 13:47:09 | × | tensorpudding quits (~michael@unaffiliated/tensorpudding) (Remote host closed the connection) |
| 13:48:23 | <new_haskeller> | So I have this simple program in VS Code IDE with "an" extension enabled (not sure which): ```compress lst = c' lst |
| 13:48:24 | <new_haskeller> | where |
| 13:48:24 | <new_haskeller> | c' (x:xs@(y:ys)) |
| 13:48:25 | <new_haskeller> | | x==y = c' XS |
| 13:48:25 | <new_haskeller> | | otherwise = x : c' XS |
| 13:48:26 | <new_haskeller> | c' xs = XS``` |
| 13:48:35 | → | bitmapper joins (uid464869@gateway/web/irccloud.com/x-wcndcgrnyuvjynus) |
| 13:48:58 | → | alx741 joins (~alx741@186.178.109.49) |
| 13:49:42 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 260 seconds) |
| 13:50:37 | <new_haskeller> | the debug window show ```Eta reduce |
| 13:50:38 | <new_haskeller> | Found: |
| 13:50:38 | <new_haskeller> | compress lst = c' lst |
| 13:50:39 | <new_haskeller> | Why not: |
| 13:50:39 | <new_haskeller> | compress = c' |
| 13:50:40 | <new_haskeller> | ``` however when I remove "let" I get an error message ```Parse error: module header, import declaration |
| 13:50:40 | <new_haskeller> | or top-level declaration expected.``` |
| 13:51:19 | → | maroloccio joins (~marolocci@pousada3ja.mma.com.br) |
| 13:51:27 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 13:51:34 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 13:52:53 | <tomsmeding> | new_haskeller: in the future you might want to use a paste site for larger code fragments :) |
| 13:53:01 | <lyxia> | @where paste |
| 13:53:01 | <lambdabot> | Help us help you: please paste full code, input and/or output at eg https://paste.tomsmeding.com |
| 13:53:36 | <lyxia> | new_haskeller: can you paste your file there ^ |
| 13:53:38 | <tomsmeding> | new_haskeller: what exactly are you trying to change that gives that error? |
| 13:54:04 | <tomsmeding> | if you apply the exact change that hlint suggests (that suggestion comes from hlint, FYI), it should work fine |
| 13:54:12 | <lyxia> | (the one that is reported to have an error) |
| 13:54:19 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 13:55:56 | <tomsmeding> | @where+ paste Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 13:55:56 | <lambdabot> | It is forever etched in my memory. |
| 13:56:06 | tomsmeding | dislikes shortening 'e.g.' to 'eg' :p |
| 13:56:26 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Ping timeout: 264 seconds) |
| 13:56:58 | → | geekosaur22 joins (82650c7a@130.101.12.122) |
| 13:57:19 | <dminuoso> | GHC shortens nota bene to NB. |
| 13:57:26 | <dminuoso> | Does that frustrate you? |
| 13:57:53 | <geekosaur22> | that's stolen from some other programming language |
| 13:58:00 | <geekosaur22> | I forget which now |
| 13:58:08 | <Franciman> | it's called italian |
| 13:58:28 | <tomsmeding> | not Latin? |
| 13:58:44 | <Franciman> | no i think that is italian |
| 13:58:46 | <geekosaur22> | I know the original version, thanks. I mean some programming language uses "NB." as its comment indicator |
| 13:58:47 | <tomsmeding> | dminuoso: less, for some reason |
| 13:59:54 | <tomsmeding> | J, apparently: https://en.wikipedia.org/wiki/J_(programming_language)#Examples |
| 14:00:22 | <geekosaur22> | that would make sense |
| 14:00:22 | × | new_haskeller quits (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) (Ping timeout: 240 seconds) |
| 14:00:22 | × | geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds) |
| 14:00:24 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:00:25 | <Franciman> | tomsmeding, you were right |
| 14:00:28 | <Franciman> | it is latin |
| 14:00:29 | <Franciman> | sad |
| 14:00:33 | geekosaur22 | is now known as geekosaur |
| 14:01:34 | <tomsmeding> | dminuoso: nota bene has precedent for being abbreviated as NB: https://en.wikipedia.org/wiki/Nota_bene |
| 14:02:13 | → | new_haskeller joins (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) |
| 14:02:43 | → | minoru_shiraeesh joins (~shiraeesh@109.166.59.19) |
| 14:02:53 | <Franciman> | unfortunately barbarians exist |
| 14:02:59 | <Franciman> | and we need to accept their lack of culture |
| 14:03:15 | <tomsmeding> | for more fun: look at the "see also:" line at the top of https://en.wiktionary.org/wiki/NB |
| 14:04:16 | <Franciman> | do you pronounce it nota bini? |
| 14:04:26 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 14:04:33 | <Franciman> | some pronounce it nebraska |
| 14:04:49 | × | leat quits (~leat@128-71-254-160.broadband.corbina.ru) (Quit: WeeChat 3.0) |
| 14:05:05 | <Franciman> | maybe GHC does not short nota bene, but nebraska |
| 14:05:36 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 240 seconds) |
| 14:05:37 | <tomsmeding> | me being Dutch I say 'nota baynay' modulo vowel lengths |
| 14:06:09 | <Franciman> | neat |
| 14:06:28 | <tomsmeding> | wel I guess the last 'ay' is reduced to a schwa |
| 14:07:03 | × | ubert quits (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) (Remote host closed the connection) |
| 14:07:14 | → | ubert joins (~Thunderbi@2a02:8109:9880:303c:e6b3:18ff:fe83:8f33) |
| 14:07:16 | × | motherfsck quits (~motherfsc@unaffiliated/motherfsck) (Ping timeout: 240 seconds) |
| 14:09:49 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:11:35 | × | viluon quits (uid453725@gateway/web/irccloud.com/x-lltmwurqyylsxzbx) (Quit: Connection closed for inactivity) |
| 14:12:24 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 14:12:28 | × | maroloccio quits (~marolocci@pousada3ja.mma.com.br) (Quit: WeeChat 2.3) |
| 14:13:28 | <new_haskeller> | sorry ... here it is https://paste.tomsmeding.com/iaXzsGjy |
| 14:14:32 | <tomsmeding> | new_haskeller: right, that does indeed give an error; it's a different error than you posted though |
| 14:15:38 | <tomsmeding> | new_haskeller: the error I get is 'Ambiguous type variable ...'; do you get that too, or something else? |
| 14:15:55 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 14:16:19 | → | motherfsck joins (~motherfsc@unaffiliated/motherfsck) |
| 14:17:10 | <tomsmeding> | new_haskeller: in case you're wondering why hlint would suggest a change that results in non-compiling code: hlint is a linter, and does not fully type-check your code; it just does some pattern-matching on your code to find patterns that it thinks can be done differently. The compiler, on the other hand, does a full, in-depth analysis of your code and sees lots of things that hlint doesn't. |
| 14:17:49 | <tomsmeding> | if you also get that 'Ambiguous type variable ...' error, the reason is the Monomorphism Restriction :D |
| 14:17:54 | → | geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) |
| 14:18:40 | <tomsmeding> | that error goes away if you add a type signature to 'compress', like 'compress :: Eq a => [a] -> [a]' |
| 14:19:13 | <tomsmeding> | in general it's a good idea (though in a number of cases not strictly required) to put type signatures on top-level definitions |
| 14:19:38 | → | cocytus joins (~cocytus@cpe-76-95-48-109.socal.res.rr.com) |
| 14:20:19 | <new_haskeller> | thanks! |
| 14:20:36 | × | loller_ quits (uid358106@gateway/web/irccloud.com/x-thbrxkemfqgbwuky) (Quit: Connection closed for inactivity) |
| 14:21:00 | × | hololeap quits (~hololeap@unaffiliated/hololeap) (Ping timeout: 272 seconds) |
| 14:21:24 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:26:13 | → | poscat joins (~poscat@123.116.67.131) |
| 14:28:02 | × | new_haskeller quits (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) (Ping timeout: 240 seconds) |
| 14:29:32 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 14:29:59 | × | da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:b666:c4b7:6001:ca20:56eb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 14:36:54 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:36:57 | → | kaletaa joins (~kaletaa@188.34.177.83) |
| 14:38:06 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 14:38:29 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 14:38:51 | × | kam1 quits (~kam1@83.123.64.17) (Read error: Connection reset by peer) |
| 14:39:09 | → | kam1 joins (~kam1@83.123.64.17) |
| 14:42:32 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds) |
| 14:44:31 | × | xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Remote host closed the connection) |
| 14:44:55 | → | xelxebar joins (~xelxebar@gateway/tor-sasl/xelxebar) |
| 14:46:37 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:47:46 | → | pie_ joins (~pie_bnc]@unaffiliated/pie-/x-0787662) |
| 14:47:47 | → | vancz_ joins (~vancz@unaffiliated/vancz) |
| 14:49:18 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:b666:c4b7:6001:ca20:56eb) |
| 14:52:41 | × | geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed) |
| 14:52:49 | → | pavonia joins (~user@unaffiliated/siracusa) |
| 14:53:25 | × | ubert quits (~Thunderbi@2a02:8109:9880:303c:e6b3:18ff:fe83:8f33) (Remote host closed the connection) |
| 14:53:26 | × | thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds) |
| 14:53:34 | × | mananamenos quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Read error: Connection reset by peer) |
| 14:53:36 | → | ubert joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) |
| 14:53:51 | → | thc202 joins (~thc202@unaffiliated/thc202) |
| 14:54:16 | → | viluon joins (uid453725@gateway/web/irccloud.com/x-lpdtucvssqtteyqr) |
| 14:54:25 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 14:55:21 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 14:58:08 | × | alx741 quits (~alx741@186.178.109.49) (Quit: alx741) |
| 14:59:18 | × | astronavt quits (~astronavt@unaffiliated/astronavt) (Quit: ...) |
| 15:00:42 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 15:05:57 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 15:06:36 | → | Tops2 joins (~Tobias@dyndsl-095-033-018-103.ewe-ip-backbone.de) |
| 15:06:47 | → | elliott__ joins (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) |
| 15:08:45 | × | idhugo_ quits (~idhugo@80-62-117-86-mobile.dk.customer.tdc.net) (Ping timeout: 246 seconds) |
| 15:09:29 | → | Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net) |
| 15:10:25 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 265 seconds) |
| 15:10:46 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 15:12:49 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 15:12:50 | × | geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 265 seconds) |
| 15:14:12 | → | new_haskeller joins (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) |
| 15:16:04 | → | deviantfero joins (~deviantfe@190.150.27.58) |
| 15:17:18 | <ezzieyguywuf> | is leksah "done" or "dead (but trying to be revived)"? |
| 15:17:23 | <ezzieyguywuf> | i see some recent activity on github |
| 15:17:44 | <ezzieyguywuf> | but, e.g. one of it's dependencies, binary-shared, hasn't been touched in a long time |
| 15:17:44 | <merijn> | ezzieyguywuf: "yes" :p |
| 15:17:54 | <ezzieyguywuf> | merijn: lol. |
| 15:18:06 | <merijn> | I'm not sure leksah was ever alive (in terms of actually being used), tbh |
| 15:18:13 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 256 seconds) |
| 15:19:02 | × | mouseghost quits (~draco@wikipedia/desperek) (Quit: mew wew) |
| 15:19:41 | <ezzieyguywuf> | well, we don't have a leksah package in gentoo |
| 15:19:46 | <ezzieyguywuf> | but we DO have the old binary-shared |
| 15:19:51 | <ezzieyguywuf> | trying to decide whether to get rid of binary-shared |
| 15:20:01 | <ezzieyguywuf> | (or we removed leksah but I just don't know where it used to be) |
| 15:20:53 | <ezzieyguywuf> | nvm we used to have it |
| 15:20:54 | <ezzieyguywuf> | and dropped it |
| 15:22:19 | → | new_hask_ joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 15:22:54 | × | andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Remote host closed the connection) |
| 15:23:24 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 15:23:30 | → | andreas303 joins (~andreas@gateway/tor-sasl/andreas303) |
| 15:26:07 | → | mizu_no_oto joins (~textual@cpe-66-66-222-11.rochester.res.rr.com) |
| 15:26:49 | <ezzieyguywuf> | binary-search: here's an example of one that just seems "done" |
| 15:27:05 | <ezzieyguywuf> | last release 2016, but xlsx (which seems actively developed) still uses it |
| 15:28:10 | × | kuribas quits (~user@ptr-25vy0i859tq5jdi8x32.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 15:29:37 | × | da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:b666:c4b7:6001:ca20:56eb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 15:30:21 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 15:30:23 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 15:30:37 | × | sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
| 15:30:43 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 15:31:56 | × | dhil quits (~dhil@80.208.56.181) (Read error: Connection reset by peer) |
| 15:31:57 | → | agrajag`1 joins (~agrajag`@178.239.168.171) |
| 15:32:32 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 15:32:34 | → | kuribas joins (~user@ptr-25vy0i859tq5jdi8x32.18120a2.ip6.access.telenet.be) |
| 15:32:43 | → | ubert1 joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) |
| 15:33:07 | × | ubert quits (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) (Ping timeout: 260 seconds) |
| 15:33:07 | ubert1 | is now known as ubert |
| 15:33:19 | → | Jd007 joins (~Jd007@162.156.11.151) |
| 15:34:15 | × | shad0w_ quits (~shad0w@160.202.36.86) (Quit: Leaving) |
| 15:35:57 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 264 seconds) |
| 15:37:26 | × | acidjnk_new quits (~acidjnk@p200300d0c739095955c97cbff9b24e5c.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 15:38:05 | × | mizu_no_oto quits (~textual@cpe-66-66-222-11.rochester.res.rr.com) (Quit: Computer has gone to sleep.) |
| 15:38:07 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 15:38:28 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 15:43:25 | × | fissureman_ quits (~quassel@c-73-163-84-25.hsd1.dc.comcast.net) (Ping timeout: 240 seconds) |
| 15:44:18 | × | kam1 quits (~kam1@83.123.64.17) (Remote host closed the connection) |
| 15:44:53 | → | kam1 joins (~kam1@83.123.64.17) |
| 15:46:50 | → | rayyan joins (~rayyan@180.248.201.145) |
| 15:47:03 | → | Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) |
| 15:50:54 | × | rayyan quits (~rayyan@180.248.201.145) (Client Quit) |
| 15:53:08 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 15:55:25 | × | clog quits (~nef@bespin.org) (Ping timeout: 240 seconds) |
| 15:55:54 | → | mizu_no_oto joins (~textual@cpe-66-66-222-11.rochester.res.rr.com) |
| 15:56:01 | × | mizu_no_oto quits (~textual@cpe-66-66-222-11.rochester.res.rr.com) (Remote host closed the connection) |
| 15:58:11 | → | VeeBoi joins (8077ca99@natp-128-119-202-153.wireless.umass.edu) |
| 15:58:12 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Ping timeout: 260 seconds) |
| 15:59:40 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 16:00:04 | × | Hanma[m] quits (hanmamatri@gateway/shell/matrix.org/x-dungldpayxckhnuj) (Quit: Idle for 30+ days) |
| 16:00:51 | × | VeeBoi quits (8077ca99@natp-128-119-202-153.wireless.umass.edu) (Quit: Connection closed) |
| 16:01:26 | → | VeeBoi joins (8077ca99@natp-128-119-202-153.wireless.umass.edu) |
| 16:01:51 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 16:02:02 | × | kritzefitz quits (~kritzefit@2003:5b:203b:200::10:49) (Remote host closed the connection) |
| 16:04:12 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 16:04:29 | × | VeeBoi quits (8077ca99@natp-128-119-202-153.wireless.umass.edu) (Client Quit) |
| 16:05:02 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 260 seconds) |
| 16:05:46 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 16:06:05 | × | jdwidari quits (~jdwidari@173.38.117.75) (Quit: WeeChat 3.0.1) |
| 16:06:33 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 264 seconds) |
| 16:09:17 | × | xff0x quits (~xff0x@2001:1a81:53b4:e300:4f5:8344:c7ce:bd4a) (Ping timeout: 260 seconds) |
| 16:09:58 | → | xff0x joins (~xff0x@2001:1a81:53b4:e300:6089:d7b1:637f:ab27) |
| 16:12:40 | → | Rudd0 joins (~Rudd0@185.189.115.108) |
| 16:13:11 | → | vicfred joins (~vicfred@unaffiliated/vicfred) |
| 16:15:48 | × | new_haskeller quits (ae72a197@cpe00fc8d386d93-cm00fc8d386d90.cpe.net.cable.rogers.com) (Quit: Ping timeout (120 seconds)) |
| 16:17:13 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 16:17:34 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 16:18:17 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 16:19:13 | → | ezrakilty joins (~ezrakilty@97-113-55-149.tukw.qwest.net) |
| 16:20:11 | → | o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) |
| 16:21:49 | × | benjamingr__ quits (uid23465@gateway/web/irccloud.com/x-xgcckaxpiczvgpzv) (Quit: Connection closed for inactivity) |
| 16:22:15 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds) |
| 16:23:32 | × | LKoen quits (~LKoen@136.169.9.109.rev.sfr.net) (Remote host closed the connection) |
| 16:23:53 | → | mouseghost joins (~draco@wikipedia/desperek) |
| 16:25:31 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 16:26:13 | → | tzlil joins (~tzlil@unaffiliated/tzlil) |
| 16:30:44 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 16:31:45 | × | tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 264 seconds) |
| 16:31:58 | → | idhugo_ joins (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net) |
| 16:32:50 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 16:35:09 | → | alx741 joins (~alx741@186.178.109.49) |
| 16:35:24 | × | Graf_Blutwurst quits (~grafblutw@adsl-178-38-234-220.adslplus.ch) (Quit: WeeChat 3.0) |
| 16:36:15 | × | dunj3 quits (~dunj3@p200300f61714a66854ef98154aeab501.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 16:38:06 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 16:38:15 | × | p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Remote host closed the connection) |
| 16:38:28 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 16:38:56 | × | kam1 quits (~kam1@83.123.64.17) (Read error: Connection reset by peer) |
| 16:39:13 | → | kam1 joins (~kam1@83.123.64.17) |
| 16:39:24 | → | ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 16:39:59 | → | LKoen joins (~LKoen@136.169.9.109.rev.sfr.net) |
| 16:42:16 | × | whald quits (~trem@2a02:810a:8100:11a6:6784:33d1:3a6b:a448) (Remote host closed the connection) |
| 16:44:01 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Ping timeout: 268 seconds) |
| 16:45:43 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 16:47:35 | → | nomeata joins (~jojo@dslb-002-203-232-155.002.203.pools.vodafone-ip.de) |
| 16:48:27 | × | fendor quits (~fendor@178.165.131.69.wireless.dyn.drei.com) (Remote host closed the connection) |
| 16:49:49 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Remote host closed the connection) |
| 16:50:25 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds) |
| 16:52:50 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 16:53:07 | × | deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 260 seconds) |
| 16:53:55 | → | deviantfero joins (~deviantfe@190.150.27.58) |
| 16:54:33 | × | nomeata quits (~jojo@dslb-002-203-232-155.002.203.pools.vodafone-ip.de) (Quit: Client exiting) |
| 16:55:36 | × | tachylyte quits (~tachylyte@host86-132-250-227.range86-132.btcentralplus.com) (Ping timeout: 240 seconds) |
| 16:56:10 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 16:57:21 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 16:57:26 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds) |
| 16:57:43 | → | tachylyte joins (~tachylyte@host86-142-90-26.range86-142.btcentralplus.com) |
| 16:59:09 | × | ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Read error: Connection reset by peer) |
| 17:00:03 | × | srk quits (~sorki@gateway/tor-sasl/sorki) (Remote host closed the connection) |
| 17:00:03 | × | hexo quits (~hexo@gateway/tor-sasl/hexo) (Remote host closed the connection) |
| 17:00:21 | → | srk joins (~sorki@gateway/tor-sasl/sorki) |
| 17:00:27 | → | hexo joins (~hexo@gateway/tor-sasl/hexo) |
| 17:00:40 | → | ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 17:00:47 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 17:01:14 | → | mirrorbird joins (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f) |
| 17:01:47 | × | Yumasi quits (~guillaume@2a01:e0a:5cb:4430:a218:d301:729d:d5b3) (Ping timeout: 265 seconds) |
| 17:01:48 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 17:02:29 | → | Tario joins (~Tario@201.192.165.173) |
| 17:03:46 | → | ixaxaar joins (~ixaxaar@49.207.197.94) |
| 17:06:49 | × | ezrakilty quits (~ezrakilty@97-113-55-149.tukw.qwest.net) (Remote host closed the connection) |
| 17:09:06 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 17:09:50 | → | slack1256 joins (~slack1256@45.4.2.52) |
| 17:09:55 | → | geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) |
| 17:13:29 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 17:13:49 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
| 17:16:42 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Ping timeout: 268 seconds) |
| 17:16:50 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 17:19:03 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 17:20:55 | × | slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 265 seconds) |
| 17:20:56 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 17:21:28 | × | ubert quits (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233) (Remote host closed the connection) |
| 17:21:39 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 17:22:01 | → | dyeplexer joins (~lol@unaffiliated/terpin) |
| 17:23:03 | → | cur8or joins (~cur8or@196.41.98.130) |
| 17:25:47 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 260 seconds) |
| 17:26:25 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 268 seconds) |
| 17:26:35 | × | ephemera_ quits (~E@122.34.1.187) (Quit: ephemera_) |
| 17:28:26 | × | borne quits (~fritjof@200116b864893b0095eb740676c27273.dip.versatel-1u1.de) (Ping timeout: 240 seconds) |
| 17:28:42 | → | ephemera_ joins (~E@122.34.1.187) |
| 17:29:03 | → | lambdah-` joins (~user@200.175.79.29.static.gvt.net.br) |
| 17:30:23 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 17:30:27 | × | lambdah-sadvipra quits (~user@189.6.240.228) (Ping timeout: 260 seconds) |
| 17:30:55 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 17:32:19 | → | Wuzzy joins (~Wuzzy@p5b0df671.dip0.t-ipconnect.de) |
| 17:32:25 | → | sim590 joins (~sim590@modemcable090.207-203-24.mc.videotron.ca) |
| 17:33:06 | × | danza quits (~francesco@151.74.103.107) (Quit: Leaving) |
| 17:33:26 | <maerwald> | merijn: I tried once |
| 17:34:37 | <maerwald> | the only interesting thing was the yi support |
| 17:34:45 | × | idhugo_ quits (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net) (Ping timeout: 264 seconds) |
| 17:34:48 | × | boxscape quits (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) (Ping timeout: 272 seconds) |
| 17:34:57 | <maerwald> | but it didn't build |
| 17:35:27 | <maerwald> | could have been something |
| 17:35:33 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 17:35:57 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 264 seconds) |
| 17:37:10 | × | Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Quit: WeeChat 1.9.1) |
| 17:37:19 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 17:38:03 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 17:38:07 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 17:38:28 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 17:39:25 | → | pgib joins (~textual@lmms/pgib) |
| 17:39:52 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Client Quit) |
| 17:40:05 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 17:42:45 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 246 seconds) |
| 17:43:27 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 17:44:07 | × | dyeplexer quits (~lol@unaffiliated/terpin) (Ping timeout: 265 seconds) |
| 17:44:56 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 17:47:15 | Ailrk | is now known as ailrk |
| 17:50:06 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 246 seconds) |
| 17:50:11 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Remote host closed the connection) |
| 17:51:38 | → | epicte7us joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 17:52:19 | → | iqubic` joins (~user@c-67-171-38-72.hsd1.wa.comcast.net) |
| 17:52:44 | × | rajivr quits (uid269651@gateway/web/irccloud.com/x-gtdozbconwgnsaqd) (Quit: Connection closed for inactivity) |
| 17:54:02 | × | iqubic quits (~user@2601:602:9500:4870:4339:c0b6:b79f:872d) (Ping timeout: 264 seconds) |
| 17:55:09 | × | ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 264 seconds) |
| 17:55:21 | × | deviantfero quits (~deviantfe@190.150.27.58) (Read error: Connection reset by peer) |
| 17:55:54 | × | new_hask_ quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Remote host closed the connection) |
| 17:56:10 | → | fendor joins (~fendor@178.165.131.69.wireless.dyn.drei.com) |
| 17:56:15 | → | deviantfero joins (~deviantfe@190.150.27.58) |
| 17:56:30 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 17:56:31 | → | hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-ycsqvqpavvannwrp) |
| 17:58:01 | × | elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 256 seconds) |
| 18:01:17 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Ping timeout: 260 seconds) |
| 18:02:01 | × | coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 18:02:48 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 18:05:05 | × | pgib quits (~textual@lmms/pgib) (Ping timeout: 240 seconds) |
| 18:07:15 | × | ephemera_ quits (~E@122.34.1.187) (Quit: ephemera_) |
| 18:09:23 | × | conal quits (~conal@66.115.157.88) (Quit: Computer has gone to sleep.) |
| 18:09:55 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 18:10:18 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 18:11:04 | → | conal joins (~conal@66.115.157.88) |
| 18:11:43 | → | seneca joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 18:11:45 | → | ephemera_ joins (~E@122.34.1.187) |
| 18:13:38 | → | boxscape joins (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) |
| 18:14:36 | × | epicte7us quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 246 seconds) |
| 18:16:01 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 18:16:08 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 18:16:50 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 18:17:55 | × | kam1 quits (~kam1@83.123.64.17) (Remote host closed the connection) |
| 18:18:44 | → | kam1 joins (~kam1@83.123.64.17) |
| 18:19:49 | × | forell quits (~forell@unaffiliated/forell) (Quit: ZNC - https://znc.in) |
| 18:20:24 | → | forell joins (~forell@unaffiliated/forell) |
| 18:21:42 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds) |
| 18:23:27 | × | jess quits (jess@freenode/staff/jess) (Quit: updates) |
| 18:24:06 | → | pgib joins (~textual@lmms/pgib) |
| 18:24:10 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 18:24:18 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 18:24:20 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 18:25:21 | → | ADG1089__ joins (~aditya@122.163.133.103) |
| 18:25:41 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 265 seconds) |
| 18:26:37 | → | smerdyakov9 joins (~dan@5.146.194.90) |
| 18:26:38 | × | smerdyakov quits (~dan@5.146.194.90) (Read error: Connection reset by peer) |
| 18:27:08 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 18:27:15 | × | danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds) |
| 18:27:51 | × | cur8or quits (~cur8or@196.41.98.130) (Ping timeout: 260 seconds) |
| 18:27:56 | × | ephemera_ quits (~E@122.34.1.187) (Quit: ephemera_) |
| 18:28:12 | × | rdivyanshu quits (uid322626@gateway/web/irccloud.com/x-nffqoepzevgmqfup) (Quit: Connection closed for inactivity) |
| 18:30:08 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Quit: WeeChat 3.0) |
| 18:30:14 | → | ephemera_ joins (~E@122.34.1.187) |
| 18:31:50 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Ping timeout: 264 seconds) |
| 18:32:49 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 18:33:41 | × | kam1 quits (~kam1@83.123.64.17) (Remote host closed the connection) |
| 18:34:00 | → | kam1 joins (~kam1@83.123.64.17) |
| 18:34:38 | × | kam1 quits (~kam1@83.123.64.17) (Remote host closed the connection) |
| 18:34:54 | → | elliott__ joins (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) |
| 18:35:33 | × | kuribas quits (~user@ptr-25vy0i859tq5jdi8x32.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 18:36:50 | → | kam1 joins (~kam1@83.123.64.17) |
| 18:37:08 | → | slack1256 joins (~slack1256@45.4.2.52) |
| 18:40:02 | × | darjeeling_ quits (~darjeelin@122.245.120.7) (Ping timeout: 272 seconds) |
| 18:40:09 | × | elliott_ quits (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 264 seconds) |
| 18:40:47 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 18:44:45 | → | son0p joins (~son0p@181.136.122.143) |
| 18:45:18 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 18:45:59 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 18:47:05 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 18:49:50 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Ping timeout: 264 seconds) |
| 18:52:08 | × | boxscape quits (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) (Quit: Connection closed) |
| 18:52:30 | → | darjeeling_ joins (~darjeelin@122.245.216.187) |
| 18:55:32 | × | ephemera_ quits (~E@122.34.1.187) (Quit: ephemera_) |
| 18:56:47 | × | oish quits (~charlie@228.25.169.217.in-addr.arpa) (Ping timeout: 260 seconds) |
| 18:57:37 | → | ephemera_ joins (~E@122.34.1.187) |
| 18:58:46 | → | hololeap joins (~hololeap@unaffiliated/hololeap) |
| 18:58:56 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 19:00:03 | × | geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 260 seconds) |
| 19:00:18 | → | CrazyPython joins (~crazypyth@2600:1700:722:1a30:60fb:c52f:5d96:c857) |
| 19:01:36 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 240 seconds) |
| 19:03:15 | × | ADG1089__ quits (~aditya@122.163.133.103) (Quit: Konversation terminated!) |
| 19:03:28 | → | tremon joins (~aschuring@217-63-61-89.cable.dynamic.v4.ziggo.nl) |
| 19:03:39 | → | Tordek joins (tordek@gateway/shell/blinkenshell.org/x-pjwrhjxtnnhxkhtb) |
| 19:03:41 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 19:03:43 | <Tordek> | hi |
| 19:03:49 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Quit: Leaving) |
| 19:03:54 | <juri_> | hio. |
| 19:04:14 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 264 seconds) |
| 19:05:42 | × | geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds) |
| 19:06:48 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 19:07:12 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 19:07:54 | → | mananamenos joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net) |
| 19:08:21 | × | jonathanx quits (~jonathan@h-176-109.A357.priv.bahnhof.se) (Remote host closed the connection) |
| 19:09:06 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 19:09:42 | → | jonathanx joins (~jonathan@h-176-109.A357.priv.bahnhof.se) |
| 19:12:38 | → | frozenErebus joins (~frozenEre@94.128.219.166) |
| 19:14:51 | × | son0p quits (~son0p@181.136.122.143) (Ping timeout: 272 seconds) |
| 19:15:14 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 19:15:27 | × | elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 260 seconds) |
| 19:15:59 | → | sveit joins (~sveit@45.77.0.246) |
| 19:16:09 | × | slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 264 seconds) |
| 19:16:29 | → | simplegauss joins (~simplegau@45.77.0.246) |
| 19:18:24 | <Tordek> | I want to build an emulator; I have an idea in mind but I don't know if it makes sense as I'm envisioning it... basically, I'd like to write this-ish: https://dpaste.org/0mFw |
| 19:21:08 | <Tordek> | that is, I'd have a "bus" which communicates several devices (a processor and ram, for example) by performing a `tick`, where a `tick` is what drives the execution: the processor puts some value on the address lines, then calls tick, and the other devices listen to ticks and put their results on the bus... |
| 19:25:25 | × | kam1 quits (~kam1@83.123.64.17) (Remote host closed the connection) |
| 19:25:35 | × | CrazyPython quits (~crazypyth@2600:1700:722:1a30:60fb:c52f:5d96:c857) (Remote host closed the connection) |
| 19:25:41 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 19:26:00 | → | kam1 joins (~kam1@83.123.64.17) |
| 19:28:22 | <swarmcollective> | Tordek, do you expect these devices to execute on their own threads? |
| 19:29:45 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 19:30:03 | × | ixaxaar quits (~ixaxaar@49.207.197.94) (Ping timeout: 272 seconds) |
| 19:30:06 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 19:31:40 | <Tordek> | swarmcollective: not threads; whenever you call tick on the bus each device should "move forward" as it were |
| 19:31:56 | × | xff0x quits (~xff0x@2001:1a81:53b4:e300:6089:d7b1:637f:ab27) (Ping timeout: 240 seconds) |
| 19:32:22 | <swarmcollective> | That certainly simplifies things. |
| 19:32:31 | <Tordek> | so, mentally my model is just a list of states that all might be read by/written to each device |
| 19:32:48 | <swarmcollective> | Consider having each device work off the same function signature, then you can build a list of them. |
| 19:32:55 | → | bergbrunnen joins (~ocean@ip4d152808.dynamic.kabel-deutschland.de) |
| 19:32:56 | <swarmcollective> | Map over the list. |
| 19:34:14 | → | xff0x joins (xff0x@gateway/vpn/mullvad/xff0x) |
| 19:34:44 | bergbrunnen | |
| 19:34:45 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds) |
| 19:34:57 | × | bergbrunnen quits (~ocean@ip4d152808.dynamic.kabel-deutschland.de) (Quit: leaving) |
| 19:35:04 | <Tordek> | swarmcollective: but each device can read from and write to the list on each tick |
| 19:35:23 | <Tordek> | (and, yes, bus collision where two devices attempt to write at once is a possibility) |
| 19:36:40 | <Tordek> | (also some operations take multiple ticks) |
| 19:38:06 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 19:38:16 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Remote host closed the connection) |
| 19:38:28 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 19:39:46 | → | sh9 joins (~sh9@softbank060116136158.bbtec.net) |
| 19:41:25 | × | xff0x quits (xff0x@gateway/vpn/mullvad/xff0x) (Ping timeout: 240 seconds) |
| 19:42:10 | <swarmcollective> | Tordek, have you defined your state types (bus, ram, processor, etc..)? |
| 19:42:39 | <Tordek> | I think it could work as an implicit state function, like... ram be a function that takes ramstate+"current bus tick" and returns ramstate+busAction; such that each tick applies each device to the current state then performs some flattening with currentState + [stateActions] |
| 19:43:26 | → | xff0x joins (~xff0x@2001:1a81:53b4:e300:9b30:953c:3e9a:9639) |
| 19:43:46 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 19:45:18 | <Tordek> | i.e., the type'd be something like InfiniteFunction = busState -> busAction, InfiniteFunction |
| 19:45:54 | <Tordek> | well, Device = busState -> (busAction, Device) |
| 19:46:22 | × | sh9 quits (~sh9@softbank060116136158.bbtec.net) (Quit: WeeChat 2.8) |
| 19:48:58 | → | mananamenos_ joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net) |
| 19:49:28 | <swarmcollective> | If I were approaching this, I would define each device with their own state, then a function `doRamTick :: busState -> busState` and `doUsbTick :: busState -> busState` and then I can define `machine :: [(BusState -> BusState)]` |
| 19:49:31 | <swarmcollective> | Something like that. |
| 19:49:36 | × | mananamenos quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Ping timeout: 240 seconds) |
| 19:49:48 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 19:49:58 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 19:50:26 | <Tordek> | https://dpaste.org/57bF pseudocode of my interpretation |
| 19:51:14 | → | mananamenos__ joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net) |
| 19:52:04 | <Tordek> | I'm thinking busAction rather than busState because what I'm trying to model is specifically the possibility of collision (e.g., two devices might attempt to write at the same time) |
| 19:52:26 | → | ADG1089__ joins (~aditya@122.163.133.103) |
| 19:53:36 | × | mananamenos_ quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Ping timeout: 240 seconds) |
| 19:55:58 | <swarmcollective> | If they are not running concurrently, then you'd need to simulate concurrency, in order to simulate collision, or am I missing something? |
| 19:56:02 | × | Ishutin quits (~ishutin@178-164-208-197.pool.digikabel.hu) (Ping timeout: 272 seconds) |
| 19:56:14 | → | Ishutin joins (~ishutin@178-164-208-197.pool.digikabel.hu) |
| 19:56:28 | <Tordek> | right, a machine is a collection of devices connected to a bus |
| 19:56:52 | <geekosaur> | concurrency here is multiple actions on the same tick, as I understand it |
| 19:57:05 | <Tordek> | on each tick, you'd send every device the current state, gather a list of busactions, apply that list on the state |
| 19:57:16 | <Tordek> | and that's the state of the new tick |
| 19:57:39 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 19:57:39 | × | hekkaidekapus] quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 268 seconds) |
| 19:57:39 | → | jpds_ joins (~jpds@gateway/tor-sasl/jpds) |
| 19:57:51 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 19:57:53 | <swarmcollective> | So, collision resolution would happen based on device priority. |
| 19:58:01 | × | m4lvin quits (~m4lvin@w4eg.de) (Quit: m4lvin) |
| 19:58:23 | → | m4lvin joins (~m4lvin@w4eg.de) |
| 19:59:14 | <Tordek> | that's the fun part; since this is meant to model real life electronics.... weird stuff happens |
| 20:00:05 | <Tordek> | so, the collision might result in a weird state, like "if you pressed a button at the same time as RAM was being written, you write trash to ram" |
| 20:00:07 | <geekosaur> | modeling real electronics also leads to fun like, you mentioned things that take multiple ticks. what happens when an address or datum on the bus changes in the meantime? |
| 20:01:23 | <swarmcollective> | Is your goal to create an unstable "machine" so that others can try strategies to resolve the issues? |
| 20:01:29 | <Tordek> | geekosaur: ticks are my boundaries, so if the value changes after I read it I don't mind |
| 20:01:52 | <geekosaur> | that doesn't model real electronics :) |
| 20:01:54 | → | hekkaidekapus] joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 20:02:15 | <geekosaur> | Bad Things Happen if you change an asserted address on tick 2 of a 3-tick activity |
| 20:02:16 | <Tordek> | geekosaur: that's what clock cycles are for |
| 20:02:26 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 264 seconds) |
| 20:02:32 | <Tordek> | ah, well... yes |
| 20:02:39 | <Tordek> | but it's a risk I'm willing to take :P |
| 20:03:17 | <Tordek> | swarmcollective: I just want to model a cycle-accurate emulator because I need hobbies |
| 20:05:13 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 20:05:15 | × | petersen quits (~petersen@redhat/juhp) (Ping timeout: 265 seconds) |
| 20:05:25 | × | minoru_shiraeesh quits (~shiraeesh@109.166.59.19) (Ping timeout: 240 seconds) |
| 20:05:35 | → | minoru_shiraeesh joins (~shiraeesh@109.166.59.203) |
| 20:06:22 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 20:06:29 | <swarmcollective> | hobbies = good |
| 20:07:13 | → | petersen joins (~petersen@redhat/juhp) |
| 20:08:21 | × | lambdah-` quits (~user@200.175.79.29.static.gvt.net.br) (Ping timeout: 246 seconds) |
| 20:08:58 | × | Ishutin quits (~ishutin@178-164-208-197.pool.digikabel.hu) (Ping timeout: 256 seconds) |
| 20:08:58 | × | kam1 quits (~kam1@83.123.64.17) (Ping timeout: 256 seconds) |
| 20:08:59 | → | lambdah-` joins (~user@189.6.240.228) |
| 20:09:42 | → | Ishutin joins (~ishutin@178-164-208-197.pool.digikabel.hu) |
| 20:10:30 | <Tordek> | in fact, what I wanted really was a sort of "Bus monad" I guess |
| 20:11:07 | <Tordek> | so I can do, like... `busState <- tick; read; busState <- tick` |
| 20:11:21 | <Tordek> | so a function that takes several ticks just... specifies them |
| 20:12:55 | <swarmcollective> | I'd like to see something like that multi-threaded. :D An IORef for the bus and a Chan for the tick? (IDK, just spit-balling) |
| 20:13:50 | <swarmcollective> | Each thread operating at its own "frequency" based on the hypothetical speed of the device. |
| 20:15:18 | → | acidjnk_new joins (~acidjnk@p200300d0c7390959695ee7c38f7fb1b4.dip0.t-ipconnect.de) |
| 20:16:36 | → | isovector joins (~isovector@172.103.216.166.cable.tpia.cipherkey.com) |
| 20:18:47 | <Tordek> | https://dpaste.org/fGP6 this is more what I'm thinking, if it makes sense |
| 20:19:29 | × | mananamenos__ quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Quit: Leaving) |
| 20:19:55 | → | sz0 joins (uid110435@gateway/web/irccloud.com/x-ihvnvkqpmcfzhlan) |
| 20:23:36 | × | fendor quits (~fendor@178.165.131.69.wireless.dyn.drei.com) (Remote host closed the connection) |
| 20:24:22 | → | coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) |
| 20:24:39 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Remote host closed the connection) |
| 20:26:09 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 20:27:09 | × | ADG1089__ quits (~aditya@122.163.133.103) (Quit: Konversation terminated!) |
| 20:28:19 | <isovector> | ocharles: do you still like using GDP for authorization? would you recommend it in 2021? |
| 20:28:39 | → | fendor joins (~fendor@178.165.131.69.wireless.dyn.drei.com) |
| 20:29:00 | × | frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 246 seconds) |
| 20:38:06 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 20:38:28 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) |
| 20:43:36 | <Tordek> | does my example up there make sense? how could I implement it properly? |
| 20:45:08 | <isovector> | is there any way to give arguments to pattern synonyms? |
| 20:45:23 | <isovector> | in order to parameterize the arguments to a view pattern that they call? |
| 20:45:49 | <dolio> | Don't think so. |
| 20:46:06 | <dolio> | It'd be an interesting feature, though. |
| 20:46:21 | → | geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) |
| 20:47:31 | <dolio> | It could easily get pretty complicated to specify, depending on how much of the possible desugarings you wanted to support. |
| 20:47:57 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: Lost terminal) |
| 20:48:13 | <isovector> | dang |
| 20:48:16 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds) |
| 20:48:55 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 20:49:10 | <dolio> | It would be nice to even be able to do something simple like `Is x <- ((x ==) -> True)`, though. |
| 20:50:43 | <isovector> | yeah, that's almost exactly what i want |
| 20:51:19 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 20:51:42 | <isovector> | guess i could write a TH splice if i cared strongly enough |
| 20:51:44 | <isovector> | which i don't |
| 20:55:40 | → | borne joins (~fritjof@200116b864893b0095eb740676c27273.dip.versatel-1u1.de) |
| 20:57:20 | → | elliott_ joins (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) |
| 20:58:16 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds) |
| 21:01:19 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 21:01:49 | × | dhouthoo quits (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be) (Quit: WeeChat 3.0) |
| 21:03:11 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 21:03:32 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 21:04:21 | × | coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 21:04:41 | → | coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) |
| 21:06:02 | × | geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed) |
| 21:06:19 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 21:08:23 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds) |
| 21:08:45 | × | ericsagn1 quits (~ericsagne@2405:6580:0:5100:f37e:89b0:6afc:b223) (Ping timeout: 272 seconds) |
| 21:10:47 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 21:16:09 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 21:17:25 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 21:17:34 | <ddellacosta> | how does one interface with apple core libraries, in particular Core Audio? |
| 21:19:15 | → | newtoeverything joins (4174230f@65-116-35-15.dia.static.qwest.net) |
| 21:19:53 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 21:20:01 | <ddellacosta> | this looks pretty dead https://hackage.haskell.org/package/macos-corelibs |
| 21:20:39 | → | ericsagn1 joins (~ericsagne@2405:6580:0:5100:39c8:7a81:4ef5:3dca) |
| 21:20:56 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Remote host closed the connection) |
| 21:21:36 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 21:22:16 | × | tsaka__ quits (~torstein@athedsl-258913.home.otenet.gr) (Ping timeout: 240 seconds) |
| 21:22:33 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds) |
| 21:23:55 | → | inkbottle joins (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) |
| 21:24:17 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds) |
| 21:24:36 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-98-217.w86-212.abo.wanadoo.fr) (Ping timeout: 240 seconds) |
| 21:24:36 | × | andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Ping timeout: 268 seconds) |
| 21:25:03 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 21:25:31 | → | mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) |
| 21:25:56 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Ping timeout: 240 seconds) |
| 21:26:41 | → | andreas303 joins (~andreas@gateway/tor-sasl/andreas303) |
| 21:28:15 | × | newtoeverything quits (4174230f@65-116-35-15.dia.static.qwest.net) (Quit: Connection closed) |
| 21:28:28 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) (Remote host closed the connection) |
| 21:28:37 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:140a:f0bd:8004:4ab3) |
| 21:29:01 | × | danso quits (~dan@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Ping timeout: 272 seconds) |
| 21:30:02 | × | Boomerang quits (~Boomerang@2a05:f6c7:2179:0:815d:8deb:faba:89c5) (Ping timeout: 265 seconds) |
| 21:30:05 | × | mouseghost quits (~draco@wikipedia/desperek) (Quit: mew wew) |
| 21:30:23 | → | bitmagie joins (~Thunderbi@200116b80635570028f424ad0dac631a.dip.versatel-1u1.de) |
| 21:30:39 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 21:31:03 | × | forgottenone quits (~forgotten@176.42.30.133) (Quit: Konversation terminated!) |
| 21:32:14 | <ddellacosta> | looks like I may be able to do what I need with hmid http://hackage.haskell.org/package/hmidi |
| 21:32:19 | <ddellacosta> | *hmidi |
| 21:35:25 | ← | isovector parts (~isovector@172.103.216.166.cable.tpia.cipherkey.com) ("WeeChat 2.9") |
| 21:36:23 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving) |
| 21:36:32 | × | jathan quits (~jathan@69.61.93.38) (Quit: WeeChat 2.3) |
| 21:38:08 | × | Franciman quits (~francesco@host-82-49-79-189.retail.telecomitalia.it) (Quit: Leaving) |
| 21:38:53 | × | __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving) |
| 21:40:49 | × | coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 21:41:35 | <absence> | anyone know if haskell-language-server 0.9.0 will get builds for ghc 8.10.4, or is that for a future version? |
| 21:42:45 | × | lambdah-` quits (~user@189.6.240.228) (Ping timeout: 240 seconds) |
| 21:42:53 | → | danso joins (~dan@d67-193-121-2.home3.cgocable.net) |
| 21:43:02 | × | whitten quits (c75a9d0b@199.90.157.11) (Quit: Connection closed) |
| 21:43:32 | → | lambdah-` joins (~user@200.175.79.29.static.gvt.net.br) |
| 21:45:11 | × | deviantfero quits (~deviantfe@190.150.27.58) (Remote host closed the connection) |
| 21:45:15 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Ping timeout: 260 seconds) |
| 21:45:35 | → | deviantfero joins (~deviantfe@190.150.27.58) |
| 21:52:04 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 21:53:19 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection) |
| 21:55:30 | × | geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed) |
| 21:57:02 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Ping timeout: 264 seconds) |
| 21:57:43 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 22:00:22 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 22:02:36 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 22:04:48 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 22:05:32 | → | jess joins (jess@freenode/staff/jess) |
| 22:07:41 | → | hendursaga joins (~weechat@gateway/tor-sasl/hendursaga) |
| 22:10:19 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection) |
| 22:11:46 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 22:12:23 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 22:12:42 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 22:13:18 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 22:15:49 | → | shatriff joins (~vitaliish@176-52-216-242.irishtelecom.com) |
| 22:16:27 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds) |
| 22:17:05 | → | usr25 joins (~usr25@unaffiliated/usr25) |
| 22:18:10 | × | juri_ quits (~juri@178.63.35.222) (Ping timeout: 256 seconds) |
| 22:18:24 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 22:18:33 | × | shatriff_ quits (~vitaliish@176-52-216-242.irishtelecom.com) (Ping timeout: 264 seconds) |
| 22:20:30 | × | Narinas quits (~Narinas@189.223.179.61.dsl.dyn.telnor.net) (Read error: Connection reset by peer) |
| 22:20:40 | → | Narinas joins (~Narinas@189.223.179.61.dsl.dyn.telnor.net) |
| 22:20:45 | × | tremon quits (~aschuring@217-63-61-89.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in) |
| 22:20:50 | → | slack1256 joins (~slack1256@45.4.2.52) |
| 22:21:59 | × | jneira quits (501ca940@gateway/web/cgi-irc/kiwiirc.com/ip.80.28.169.64) (Quit: Ping timeout (120 seconds)) |
| 22:27:02 | × | acidjnk_new quits (~acidjnk@p200300d0c7390959695ee7c38f7fb1b4.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
| 22:27:09 | × | fendor quits (~fendor@178.165.131.69.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
| 22:28:01 | × | mirrorbird quits (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f) (Quit: Leaving) |
| 22:28:45 | × | deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 240 seconds) |
| 22:28:52 | <slack1256> | Is there a package that implements the "Levenshtein Distance" for `text`? I only find such packages for String. |
| 22:31:23 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 22:31:59 | × | bitmagie quits (~Thunderbi@200116b80635570028f424ad0dac631a.dip.versatel-1u1.de) (Quit: bitmagie) |
| 22:32:53 | × | ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection) |
| 22:33:27 | × | inkbottle quits (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 22:33:47 | → | inkbottle joins (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) |
| 22:34:14 | → | ukari joins (~ukari@unaffiliated/ukari) |
| 22:36:02 | × | mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Remote host closed the connection) |
| 22:36:34 | → | hololeap_ joins (~hololeap@unaffiliated/hololeap) |
| 22:37:30 | × | alx741 quits (~alx741@186.178.109.49) (Quit: alx741) |
| 22:38:16 | → | mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) |
| 22:38:51 | × | hololeap quits (~hololeap@unaffiliated/hololeap) (Ping timeout: 246 seconds) |
| 22:39:45 | × | inkbottle quits (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 22:40:08 | → | inkbottle joins (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) |
| 22:40:18 | × | neiluj quits (~jco@unaffiliated/neiluj) (Quit: leaving) |
| 22:40:53 | × | Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Ping timeout: 265 seconds) |
| 22:41:21 | × | oish quits (~charlie@228.25.169.217.in-addr.arpa) (Ping timeout: 264 seconds) |
| 22:44:44 | × | michalz quits (~user@185.246.204.79) (Remote host closed the connection) |
| 22:44:56 | hololeap_ | is now known as hololeap |
| 22:44:59 | → | juri_ joins (~juri@178.63.35.222) |
| 22:46:45 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds) |
| 22:50:11 | × | st8less quits (~st8less@inet-167-224-197-181.isp.ozarksgo.net) (Ping timeout: 272 seconds) |
| 22:51:55 | → | jneira joins (501ca940@gateway/web/cgi-irc/kiwiirc.com/ip.80.28.169.64) |
| 22:52:36 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 22:55:45 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 22:56:06 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 22:57:24 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds) |
| 22:58:13 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 23:03:02 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 264 seconds) |
| 23:03:24 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 23:06:51 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Remote host closed the connection) |
| 23:07:09 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 23:08:12 | <Tordek> | swarmcollective: I'm just realizing what I want are probably continuations |
| 23:08:21 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds) |
| 23:09:33 | × | nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds) |
| 23:10:50 | → | benjamingr__ joins (uid23465@gateway/web/irccloud.com/x-nerzixrwmblsiubf) |
| 23:11:47 | <Axman6> | slack1256: any reason not to just use distance = String.distance `on` toString? |
| 23:11:49 | × | troydm quits (~troydm@unaffiliated/troydm) (Ping timeout: 265 seconds) |
| 23:12:28 | <Axman6> | IIRC it's a lazy algorithm so that should be relatively efficient |
| 23:12:47 | × | Moyst quits (~moyst@212-149-213-144.bb.dnainternet.fi) (Ping timeout: 265 seconds) |
| 23:12:51 | <slack1256> | Let me read about `toString`. |
| 23:13:00 | × | xsperry quits (~as@unaffiliated/xsperry) (Remote host closed the connection) |
| 23:13:14 | → | Moyst_ joins (~moyst@212-149-213-144.bb.dnainternet.fi) |
| 23:13:19 | × | Lowl3v3l quits (~Lowl3v3l@dslb-002-203-233-121.002.203.pools.vodafone-ip.de) (Quit: Leaving.) |
| 23:13:20 | <ephemient> | :t T.toString |
| 23:13:21 | <lambdabot> | error: Not in scope: ‘T.toString’ |
| 23:13:24 | <Axman6> | whatever the unpacking of Text to String is |
| 23:13:28 | <ephemient> | :t Data.Text.toString |
| 23:13:29 | <lambdabot> | error: |
| 23:13:29 | <lambdabot> | Not in scope: ‘Data.Text.toString’ |
| 23:13:29 | <lambdabot> | Perhaps you meant ‘Data.Text.strip’ (imported from Data.Text) |
| 23:13:33 | <Axman6> | @hoogle Text -> String |
| 23:13:34 | <lambdabot> | Data.Text unpack :: Text -> String |
| 23:13:34 | <lambdabot> | Data.Text.Internal showText :: Text -> String |
| 23:13:34 | <lambdabot> | Data.Text.Internal.Lazy showStructure :: Text -> String |
| 23:13:55 | <ephemient> | hmm seems a little unfortunate that it's not named to match fromString |
| 23:14:08 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 23:14:09 | <ephemient> | but I guess it does match pack, so 🤷 |
| 23:14:21 | <Axman6> | @hoogle String -> Text |
| 23:14:22 | <lambdabot> | Data.Text pack :: String -> Text |
| 23:14:22 | <lambdabot> | Data.Text.Lazy pack :: String -> Text |
| 23:14:22 | <lambdabot> | System.Console.CmdArgs.Text Line :: String -> Text |
| 23:14:34 | <ephemient> | % :i IsString |
| 23:14:35 | <yahb> | ephemient: type IsString :: * -> Constraint; class IsString a where; fromString :: String -> a; {-# MINIMAL fromString #-}; -- Defined in `Data.String'; instance IsString BSL.ByteString -- Defined in `Data.ByteString.Lazy.Internal'; instance IsString BS.ByteString -- Defined in `Data.ByteString.Internal'; instance forall a. (a ~ Char) => IsString [a] -- Defined in `Data.String'; instance forall a. IsString a |
| 23:14:57 | <ephemient> | ^ that fromString is what I had in mind |
| 23:15:52 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 23:15:57 | <Axman6> | well text predates IsString by quite a long time |
| 23:16:13 | <slack1256> | Oh, so `fromString` is the `toString` function you said? |
| 23:16:19 | <ephemient> | no, it's the opposite |
| 23:16:33 | <Axman6> | unpack is what I was after |
| 23:16:45 | <Axman6> | :t \f -> f `on` T.unpack |
| 23:16:46 | <lambdabot> | (String -> String -> c) -> T.Text -> T.Text -> c |
| 23:16:54 | <slack1256> | Yeah, as `text` doesn't ship `toString`. |
| 23:16:58 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood) |
| 23:17:05 | <Axman6> | yes is has unpack |
| 23:17:21 | × | DavidEichmann quits (~david@234.109.45.217.dyn.plus.net) (Ping timeout: 246 seconds) |
| 23:17:44 | <slack1256> | Yeah, I think this will work out. Thanks Axman6. |
| 23:18:12 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 23:18:36 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 23:19:34 | → | ddellaco_ joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 23:20:00 | <Axman6> | If you haven;t worked with Text before, you should spend 5 minutes reading the docs for it |
| 23:20:09 | → | st8less joins (~st8less@2603:a060:11fd:0:6f68:b6d0:815a:3e1f) |
| 23:20:10 | × | mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Quit: mputz) |
| 23:20:12 | × | Wamanuz quits (~wamanuz@78-70-34-81-no84.tbcn.telia.com) (Remote host closed the connection) |
| 23:20:16 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds) |
| 23:20:39 | → | Wamanuz joins (~wamanuz@78-70-34-81-no84.tbcn.telia.com) |
| 23:21:30 | <slack1256> | I know how to use Text, but I wanted to see if a "string distance package" existed that targeted `text` directly. But if this is subject to fusion it can work well. |
| 23:21:41 | <ephemient> | :t let ed [] ys = length ys; ed xs [] = length xs; ed (x:xs) (y:ys) | x == y = ed xs ys | otherwise = 1 + minimum [ed (x:xs) ys, ed xs ys, ed xs (y:ys)] in ed `on` T.unpack -- don't actually use this |
| 23:21:43 | <lambdabot> | T.Text -> T.Text -> Int |
| 23:23:45 | × | ddellaco_ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds) |
| 23:24:33 | × | daytone quits (~daytona@90.200.185.163) (Ping timeout: 264 seconds) |
| 23:25:53 | → | neiluj joins (~jco@91-167-203-101.subs.proxad.net) |
| 23:26:11 | × | neiluj quits (~jco@91-167-203-101.subs.proxad.net) (Changing host) |
| 23:26:11 | → | neiluj joins (~jco@unaffiliated/neiluj) |
| 23:26:43 | <slack1256> | What is the community opinion on putting "bang patterns" on places you haven't profiled but you think could throw off the demand analyser? |
| 23:27:32 | <monochrom> | I don't think there is a community opinion. |
| 23:27:54 | <slack1256> | Mmm community wisdom? |
| 23:28:01 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Remote host closed the connection) |
| 23:28:04 | <monochrom> | neither |
| 23:28:19 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 23:28:32 | <monochrom> | The community deeply respects your freedom. |
| 23:28:44 | × | chele quits (~chele@ip5b40237d.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
| 23:28:49 | <slack1256> | I don't want freedom ;_; |
| 23:29:44 | <ephemient> | you could try profiling |
| 23:29:54 | <monochrom> | OK, when freedom is irrelevant, I deeply respect empirical proof, I deeply disrespect opinions. |
| 23:30:51 | <monochrom> | I mean, add your bang pattern, then read the Core, then profile; and remove your bang pattern, then read the Core, then profile. Compare. Who needs opinion? |
| 23:32:12 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Remote host closed the connection) |
| 23:32:39 | → | new_haskeller joins (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) |
| 23:33:45 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 23:34:09 | × | m0rphism1 quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 264 seconds) |
| 23:35:23 | × | DTZUZU quits (~DTZUZU@205.ip-149-56-132.net) (Read error: Connection reset by peer) |
| 23:36:09 | → | DTZUZU joins (~DTZUZU@205.ip-149-56-132.net) |
| 23:36:15 | × | hiroaki quits (~hiroaki@ip4d166d67.dynamic.kabel-deutschland.de) (Ping timeout: 246 seconds) |
| 23:36:46 | → | alx741 joins (~alx741@186.178.109.49) |
| 23:38:07 | × | star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood) |
| 23:38:27 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds) |
| 23:39:09 | → | nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net) |
| 23:39:10 | × | new_haskeller quits (~new_haske@2607:fea8:be1f:ddc0:c8eb:6c3:dd7a:7957) (Quit: Leaving...) |
| 23:39:24 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 23:43:25 | × | LKoen quits (~LKoen@136.169.9.109.rev.sfr.net) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”) |
| 23:44:29 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 23:45:57 | <nshepperd> | add bang patterns in the right places and not the wrong places |
| 23:50:38 | <monochrom> | :) |
| 23:50:45 | × | verement quits (~anonymous@cpe-76-167-229-223.san.res.rr.com) (Ping timeout: 240 seconds) |
| 23:51:04 | → | verement joins (~anonymous@cpe-76-167-229-223.san.res.rr.com) |
| 23:51:10 | <Axman6> | a.k.a everywhere, and then turn on Strict |
| 23:51:24 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 23:52:19 | <monochrom> | a bit of joking is nice, but overdoing it becomes mean. |
| 23:55:50 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Read error: Connection reset by peer) |
| 23:55:56 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 23:56:23 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 23:58:40 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
All times are in UTC on 2021-02-17.