Logs: freenode/#haskell
| 2020-10-26 21:28:26 | → | SolarAquarion joins (SolarAquar@gateway/shell/panicbnc/x-xwqkdmiwktlgsvny) |
| 2020-10-26 21:29:14 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-10-26 21:29:24 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 2020-10-26 21:29:57 | <dminuoso> | tomsmeding: In the particular example of FlexibleInstances, the cause is just with FlexibleInstances, you allow for multiple matching instances |
| 2020-10-26 21:31:07 | <dminuoso> | \(IY\) is strictly more specific than \(IX\). That is, \(IY\) is a substitution instance of \(IX\) but not vice versa. |
| 2020-10-26 21:31:25 | <justsomeguy> | tomsmeding: For example, you could move your cursor to “flip”, press Control-K, and then it would be replaced by “(\f x y -> f y x)”. Or, for more complicated functions that need a name binding, it could replace it with “(let flip f x y = f y x in flip)" I got the idea from Pharo Smalltalk, which lets you do this for class methods, unwinding indirection of the entire inheritance chain in-place. |
| 2020-10-26 21:32:03 | <tomsmeding> | justsomeguy: I _think_ it doesn't exist yet, but you can suggest it as a plugin for HLS :) |
| 2020-10-26 21:32:38 | <justsomeguy> | tomsmeding: I may do that; But first I'll probably try to write a crummy proof of concept in vimscript. |
| 2020-10-26 21:33:04 | <tomsmeding> | parsing haskell in vimscript? my condolences :p |
| 2020-10-26 21:34:02 | <justsomeguy> | lol, maybe that's too hard. I was thinking more along the lines of "grep and paste". |
| 2020-10-26 21:34:15 | <aldessa> | dsal Would that be RandomGen g => StateT g (StateT s Writer a) a? Like a transformer stack with a lot of lifting |
| 2020-10-26 21:35:09 | <aldessa> | StateT s Writer* |
| 2020-10-26 21:35:19 | <dminuoso> | tomsmeding: So, without FlexibleInstances, you wouldn't even have that problem because there can't be two simultaenously matching instances. |
| 2020-10-26 21:35:21 | <dsal> | Transformers gotta lift. But I tend to use MonadLogger + Reader. State sometimes is fine, but it's hard to weave through some things. Depends on your needs. |
| 2020-10-26 21:35:33 | <dminuoso> | (Because any instance is already as general as possible by demanding all type parameters to be tpye variables) |
| 2020-10-26 21:35:39 | <tomsmeding> | yes makes sense dminuoso |
| 2020-10-26 21:36:46 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-10-26 21:37:12 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Ping timeout: 260 seconds) |
| 2020-10-26 21:37:30 | × | p8m quits (p8m@gateway/vpn/protonvpn/p8m) (Ping timeout: 260 seconds) |
| 2020-10-26 21:39:36 | × | oisdk quits (~oisdk@2001:bb6:3329:d100:844c:cd9a:b52a:ea47) (Quit: oisdk) |
| 2020-10-26 21:40:16 | <aldessa> | dsal Is it possible to avoid the lifting? I was thinking as two alternatives Polysemy or writing my own monad transformer? |
| 2020-10-26 21:40:34 | <noname234234> | I will ask you guys a question. I may have used some monad concept before even having aware of what I did. I still don't know what a monad is but here the story: I have wrote a high-order function in some imperative language that takes a function and calls it on a list inside the method body. so after a month had passed and I had to change the |
| 2020-10-26 21:40:34 | <noname234234> | behavior of the existing code, but I figured out that I don't need to change the method body at all, just I have written a function overload where I `wrap` the parameter function, lets say I have just did a null check and then call the function and return its value from the lambda function. its something like `C#: methodOverload(Func<bool> a) => |
| 2020-10-26 21:40:35 | <noname234234> | originalMethod( () => { doSomethingElse(); return a(); })` |
| 2020-10-26 21:40:51 | <dminuoso> | aldessa: You can wrap some primitives to work with your particular monad stack |
| 2020-10-26 21:41:17 | <aldessa> | dminuoso, sorry what do you mean? |
| 2020-10-26 21:41:28 | <noname234234> | so does that have any relation to monads at all? |
| 2020-10-26 21:41:45 | × | chaosmasttter quits (~chaosmast@p200300c4a73c460118080c3b2ced1444.dip0.t-ipconnect.de) (Quit: WeeChat 2.9) |
| 2020-10-26 21:41:48 | <dminuoso> | aldessa: Instead of `genWord32 :: RandomGen g => g -> (Word32, g)` you could write `myGenWord32 :: App Word32` |
| 2020-10-26 21:41:58 | <dminuoso> | And then use that primitive instead. That moves the lifting into a single place. |
| 2020-10-26 21:43:05 | × | elliott_ quits (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 240 seconds) |
| 2020-10-26 21:45:24 | <aldessa> | dminuoso do you mean like a wrapper function that is lift original/ lift . lift $ original? |
| 2020-10-26 21:45:31 | × | dme2 quits (uid339896@gateway/web/irccloud.com/x-vjhdofmrdwokotvk) (Quit: Connection closed for inactivity) |
| 2020-10-26 21:46:20 | <dsal> | aldessa: you generally put the lifting in your lib somewhere |
| 2020-10-26 21:47:25 | × | Katarushisu quits (~Katarushi@cpc149712-finc20-2-0-cust535.4-2.cable.virginm.net) (Ping timeout: 240 seconds) |
| 2020-10-26 21:47:25 | → | Katarushisu1 joins (~Katarushi@cpc149712-finc20-2-0-cust535.4-2.cable.virginm.net) |
| 2020-10-26 21:47:26 | Katarushisu1 | is now known as Katarushisu |
| 2020-10-26 21:47:58 | × | britva quits (~britva@2a02:aa13:7240:2980:b0bb:4de0:a28f:1dc2) (Quit: This computer has gone to sleep) |
| 2020-10-26 21:49:53 | <gnumonic> | This is maybe a stupid question but: If I'm writing a simple (interpreted) DSL that parses user expressions to haskell functions at runtime, is that an EDSL or some other kind? The terminology is kind of confusing |
| 2020-10-26 21:50:06 | × | acarrico quits (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) (Ping timeout: 260 seconds) |
| 2020-10-26 21:50:37 | <aldessa> | gnumonic does it have an external parser? |
| 2020-10-26 21:50:37 | → | ystael joins (~ystael@209.6.50.55) |
| 2020-10-26 21:50:50 | × | seanvert` quits (~user@177.84.244.242) (Remote host closed the connection) |
| 2020-10-26 21:51:27 | <gnumonic> | I don't think so? I'm not exactly sure what external means there. It uses parsec to parse expressions directly into haskell functions. |
| 2020-10-26 21:51:32 | × | irc_user quits (uid423822@gateway/web/irccloud.com/x-yxcjlirterftraqc) (Quit: Connection closed for inactivity) |
| 2020-10-26 21:52:06 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 2020-10-26 21:52:38 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2020-10-26 21:53:25 | <gnumonic> | But it just runs in a main loop (more or less) where I run the parser over a line of user input and then execute the expression. Some resources make it seem like an eDSL has to be a library, so if this happens at runtime in a binary then it's not that? |
| 2020-10-26 21:53:47 | <gnumonic> | I guess it doesn't really matter but I want to get the terminology right |
| 2020-10-26 21:54:02 | <aldessa> | gnumonic, I'd say it is not an embedded DSL if you don't write the language in haskell source files |
| 2020-10-26 21:54:06 | → | unknown1 joins (~unknown@195.206.169.184) |
| 2020-10-26 21:54:21 | <aldessa> | like I'd consider Earley an eDSL but it calls itself a DSL https://hackage.haskell.org/package/Earley |
| 2020-10-26 21:54:56 | <noname234234> | I have a question. I use python interpreter on daily basis a lot. I was wondering could I use GHCi for simple tasks like file reading/parsing but though haskell doesn't allow impurity so can't I just read file contents and if it succeeds store it in a immutable string? |
| 2020-10-26 21:55:24 | <tomsmeding> | gnumonic: Accelerate is an EDSL: https://github.com/AccelerateHS/accelerate-examples/blob/master/examples/quicksort/QuickSort.hs |
| 2020-10-26 21:55:31 | <aldessa> | I would also consider this an EDSL https://gitlab.com/sheaf/fir |
| 2020-10-26 21:55:44 | <sm[m]> | noname234234: certainly |
| 2020-10-26 21:55:48 | <sm[m]> | s <- readFile "foo" |
| 2020-10-26 21:55:55 | <tomsmeding> | (scatter/fill/awhile... come from Data.Array.Accelerate) |
| 2020-10-26 21:56:48 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-10-26 21:56:48 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-10-26 21:56:49 | <tomsmeding> | whereas Futhark is a DSL: https://github.com/nqpz/futracer/blob/master/futracerlib/render.fut |
| 2020-10-26 21:57:03 | <aldessa> | noname234234, you can but the underlying string will be wrapped in an IO type |
| 2020-10-26 21:57:07 | <tomsmeding> | both are array processing languages, both have a compiler implemented in Haskell, both compile to both CPU and GPU code |
| 2020-10-26 21:57:15 | × | britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Client Quit) |
| 2020-10-26 21:57:22 | <tomsmeding> | but the one is embedded in Haskell, and the other is not :) |
| 2020-10-26 21:57:27 | <noname234234> | wow lol I didn't imagine this would be this much easier sm[m] |
| 2020-10-26 21:57:27 | <nf> | is there a GHC extension that would make `const 42 return` output 42 instead of an error? |
| 2020-10-26 21:57:28 | <gnumonic> | Ok, so the difference is that an eDSL is one such that the source is Haskell. It's just a DSL if it compiles to haskell functions, but is written in some other language then? So I guess you could consider parsec itself to be a kind of eDSL |
| 2020-10-26 21:57:47 | <tomsmeding> | parsec is definitely an EDSL |
| 2020-10-26 21:57:52 | <noname234234> | I think from now on haskell would play a large role in my daily work |
| 2020-10-26 21:57:55 | <sm[m]> | why, noname234234 ? Haskell Is Easy (tm) :) |
| 2020-10-26 21:57:58 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2020-10-26 21:58:05 | <gnumonic> | That makes sense, thanks. |
| 2020-10-26 21:58:11 | <noname234234> | I was using python in a full functional manner anyways, so |
| 2020-10-26 21:58:17 | → | wroathe joins (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) |
| 2020-10-26 21:58:21 | × | kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection) |
| 2020-10-26 21:58:28 | <tomsmeding> | gnumonic: also: in an EDSL in haskell, an important property is that you can do metaprogramming using Haskell itself |
| 2020-10-26 21:58:52 | <noname234234> | I think you would all say `you can't use python full functional` eh anyways I said that because I just redefine all variables everytime when I do changes on them xD |
| 2020-10-26 21:59:05 | <tomsmeding> | e.g. with parsec, you can use haskell's tools to build complex combinations of parser combinators that you don't have to write out by hand |
| 2020-10-26 21:59:35 | <tomsmeding> | but when you say "compiles to haskell functions", what exactly do you mean? is it a transpiler to haskell? |
| 2020-10-26 22:00:18 | <tomsmeding> | or is it a haskell library that parses your DSL, and makes the resulting functions available somehow to haskell code? |
| 2020-10-26 22:00:31 | → | Rudd0 joins (~Rudd0@185.189.115.98) |
| 2020-10-26 22:01:03 | → | elliott_ joins (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net) |
| 2020-10-26 22:01:25 | <tomsmeding> | the first I'd call a language that compiles to haskell, the second an ? |
| 2020-10-26 22:01:36 | <tomsmeding> | like you call lua :p |
| 2020-10-26 22:01:45 | <tomsmeding> | wikipedia also uses 'embedded' there, but in a different way |
| 2020-10-26 22:02:16 | → | polyrain joins (~polyrain@2001:8003:e501:6901:15fa:5e4:342f:f38b) |
| 2020-10-26 22:02:29 | → | DataComputist joins (~lumeng@static-50-43-26-251.bvtn.or.frontiernet.net) |
| 2020-10-26 22:03:43 | × | aldessa quits (~Hugh@host-92-21-7-179.as13285.net) (Quit: Leaving) |
| 2020-10-26 22:03:48 | <hyperisco> | am I hosed if I am trying to decode Dhall to a recursive type? |
| 2020-10-26 22:03:59 | → | Tops2 joins (~Tobias@dyndsl-095-033-095-051.ewe-ip-backbone.de) |
| 2020-10-26 22:04:17 | <hyperisco> | I am guessing so because the Expr for that type would not be bounded |
| 2020-10-26 22:05:00 | → | Tops21 joins (~Tobias@dyndsl-095-033-095-051.ewe-ip-backbone.de) |
| 2020-10-26 22:05:32 | × | conal quits (~conal@2600:380:4427:fc40:197b:568a:a0da:5bcb) (Quit: Computer has gone to sleep.) |
| 2020-10-26 22:06:00 | → | Tops22 joins (~Tobias@dyndsl-095-033-095-051.ewe-ip-backbone.de) |
| 2020-10-26 22:08:16 | <gnumonic> | It's really just a simple scripting language I guess. I compile the haskell in which it is written to a binary, the binary parses user input into haskell functions and their arguments and then runs them. Not really more complicated than a calculator I guess. It could be an eDSL (i.e. I could make the parser just generate haskell source) but I want to distribute a binary for people who don't want to deal with ghc :p |
| 2020-10-26 22:08:24 | × | Tops2 quits (~Tobias@dyndsl-095-033-095-051.ewe-ip-backbone.de) (Ping timeout: 258 seconds) |
| 2020-10-26 22:08:26 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-10-26 22:09:00 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-10-26 22:09:08 | × | polyrain quits (~polyrain@2001:8003:e501:6901:15fa:5e4:342f:f38b) (Quit: Textual IRC Client: www.textualapp.com) |
All times are in UTC.