Logs: freenode/#haskell
| 2020-10-21 19:33:34 | <hyperisco> | doesn't have to go through a shell |
| 2020-10-21 19:37:35 | <hololeap> | % import Control.Monad.Logic |
| 2020-10-21 19:37:36 | <yahb> | hololeap: ; <no location info>: error:; Could not find module `Control.Monad.Logic'; Perhaps you meant; Control.Monad.Co (from kan-extensions-5.2); Control.Monad.Cont (from mtl-2.2.2); Control.Monad.Fail (from base-4.14.0.0) |
| 2020-10-21 19:38:03 | <[exa]> | no prolog today |
| 2020-10-21 19:38:21 | <monochrom> | yahb probably doesn't have logict installed |
| 2020-10-21 19:38:36 | <Chousuke> | monochrom: I guess I'm more a fan of the simple and stupid approach of just treating everything as bytes. for HTTP, the header is a type hint, but you still can't trust that the data is anything other than a stream of bytes. |
| 2020-10-21 19:38:52 | <monochrom> | "become a galaxy-level patron so you can instruct yahb to install one more package!" |
| 2020-10-21 19:39:05 | <geekosaur> | but you have to have some idea of what parser to use to validate it, at minimum |
| 2020-10-21 19:39:17 | <Chousuke> | yeah |
| 2020-10-21 19:39:29 | <Chousuke> | I'm not sure that that's useful on the filesystem level though |
| 2020-10-21 19:39:46 | <geekosaur> | it's useful at the level of apps getting data from the filesystem |
| 2020-10-21 19:39:50 | <monochrom> | You are right that a receiver still has to parse, and to expect parse error. But the receiver also expects to not bother trying other parsers. |
| 2020-10-21 19:40:24 | <monochrom> | If you say "text/html" I'm not going to try gunzip it. |
| 2020-10-21 19:40:47 | <geekosaur> | unless the compression header says to |
| 2020-10-21 19:40:50 | <monochrom> | even if the bytes scream "I'm gzip" |
| 2020-10-21 19:40:59 | <monochrom> | Yeah, that. |
| 2020-10-21 19:41:38 | <monochrom> | If you say "text/html" I'm not going to run objdump on it, even if the bytes scream "ELF" |
| 2020-10-21 19:41:50 | <hololeap> | i'm confused as to how you use ListT |
| 2020-10-21 19:41:57 | <hololeap> | *LogicT |
| 2020-10-21 19:42:17 | <[exa]> | hololeap: any short example / confusing snippet? |
| 2020-10-21 19:42:18 | <monochrom> | For the most part you can use it like you use a list monad. |
| 2020-10-21 19:42:25 | <hololeap> | i know it has some kind of similarities to ListT, but i don't see how |
| 2020-10-21 19:42:49 | <monochrom> | There is just one addition command to learn if you want the search to be BFS instead of DFS. |
| 2020-10-21 19:43:12 | <monochrom> | Perhaps start with Logic instead of LogicT? |
| 2020-10-21 19:43:58 | <hololeap> | i've played around with Logic a bit, but simply constructing a `Logic a` value is weird |
| 2020-10-21 19:44:35 | × | Franciman quits (~francesco@host-82-54-10-114.retail.telecomitalia.it) (Quit: Leaving) |
| 2020-10-21 19:44:46 | <[exa]> | hololeap: how weird? (can't you construct `Logic a` using just `pure` ? |
| 2020-10-21 19:44:58 | hackage | ukrainian-phonetics-basic 0.1.0.0 - A library to work with the basic Ukrainian phonetics and syllable segmentation. https://hackage.haskell.org/package/ukrainian-phonetics-basic-0.1.0.0 (OleksandrZhabenko) |
| 2020-10-21 19:44:58 | <Chousuke> | monochrom: the other side of the coin is that if the metadata claims the file to be something and it looks like something else, it might get opened by an application you didn't expect which has a long history of causing problems. So I guess file extensions aren't completely awful for deciding the application to open, as long as they're visible to the user. |
| 2020-10-21 19:45:45 | <hololeap> | odds = pure 1 `mplus` (odds >>= \i -> if i >= 100 then mzero else pure (i+2)) |
| 2020-10-21 19:46:01 | <hololeap> | is this roughly equivalent to [1,3..100]? |
| 2020-10-21 19:46:07 | <Chousuke> | come to think of it, hashbangs are basically file metadata to decide the opening program. :P |
| 2020-10-21 19:46:50 | × | knupfer quits (~Thunderbi@i59F7FF96.versanet.de) (Quit: knupfer) |
| 2020-10-21 19:46:54 | → | knupfer1 joins (~Thunderbi@200116b82c30ba0001bfef634072ae05.dip.versatel-1u1.de) |
| 2020-10-21 19:47:25 | <[exa]> | monochrom, Chousuke: btw sorry to jump into discussion, but the golden rule says that if the user/operator/etc is unable to instruct the programs to use correct data access methods, so he will fail at maintaining the metadata...unless the metadata becomes inseparable part of data, as it once had already, with file magic numbers |
| 2020-10-21 19:47:27 | <geekosaur> | to decide the interpreter, to be specific (and the dynamic loader is treated as an interpreter) |
| 2020-10-21 19:47:43 | <monochrom> | You can instantiate that to [] and get: odds = [1] ++ (odds >>= \i -> if i>=100 then [] else [i+2]) |
| 2020-10-21 19:49:18 | knupfer1 | is now known as knupfer |
| 2020-10-21 19:49:43 | <hololeap> | ok, but i'm trying to construct something similar to [1,3..100], except i want it to be `Logic Int` |
| 2020-10-21 19:49:54 | <[exa]> | (that said, I'd welcome if all file formats would have extensible magic, just like #!) |
| 2020-10-21 19:50:00 | <Chousuke> | geekosaur: yeah. and if you're putting +x on any random file and running it, I don't think you can expect to stay secure. :P |
| 2020-10-21 19:50:04 | <hololeap> | `observeAll odds` doesn't terminate |
| 2020-10-21 19:50:08 | <monochrom> | Just add "odds :: Logic Int" |
| 2020-10-21 19:51:18 | <geekosaur> | because if you try to observe all of it, it just keeps going through values after it hits the limit (empty list doesn't mean "stop", any more than it does for the list comprehension example) |
| 2020-10-21 19:51:24 | <monochrom> | Probably the [] instantiation won't either. |
| 2020-10-21 19:51:28 | → | chaosmasttter joins (~chaosmast@p200300c4a70942015d50de0935368812.dip0.t-ipconnect.de) |
| 2020-10-21 19:51:40 | <geekosaur> | Chousuke, yet it's common for scripts to work that way |
| 2020-10-21 19:51:47 | <monochrom> | > let odds = pure 1 `mplus` (odds >>= \i -> if i >= 100 then mzero else pure (i+2)) in odds :: [Int] |
| 2020-10-21 19:51:50 | <lambdabot> | [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53... |
| 2020-10-21 19:51:54 | <hololeap> | your right, it doesn't |
| 2020-10-21 19:51:58 | <monochrom> | actually need a smaller test |
| 2020-10-21 19:52:02 | <monochrom> | > let odds = pure 1 `mplus` (odds >>= \i -> if i >= 10 then mzero else pure (i+2)) in odds :: [Int] |
| 2020-10-21 19:52:05 | <lambdabot> | [1,3,5,7,9,11*Exception: <<loop>> |
| 2020-10-21 19:52:23 | <monochrom> | Not a good program in the first place IMO |
| 2020-10-21 19:52:30 | <geekosaur> | huh, I expected a timeout, not <<loop>> |
| 2020-10-21 19:52:53 | <monochrom> | You don't do left recursion like that (odds = odds >>= ...) |
| 2020-10-21 19:53:14 | <geekosaur> | oh, hm, I guess it does do that, yeh |
| 2020-10-21 19:53:56 | <hololeap> | so, does a Logic computation by default not terminate, but requires observeMany to terminate it? |
| 2020-10-21 19:54:14 | <geekosaur> | it's just the way this one was constructed |
| 2020-10-21 19:54:16 | <Chousuke> | geekosaur: it is. I read most scripts before I run them, though of course I have to trust some things. Generally whatever is installed from OS package management is auto-trusted. |
| 2020-10-21 19:54:34 | <monochrom> | I would rather code up a forward constraint propagation algorithm for learning logict. |
| 2020-10-21 19:54:58 | <Chousuke> | geekosaur: I am very uncomfortable every time I have to use pip or gem or whatnot for whatever purpose. |
| 2020-10-21 19:55:11 | <hololeap> | well, how would i write a `Logic Int` computation that would evaluate to [1,3,5,7,9] when used with observeAll? |
| 2020-10-21 19:55:12 | × | shafox quits (~shafox@106.51.234.111) (Remote host closed the connection) |
| 2020-10-21 19:55:45 | × | errst quits (~tirej@unaffiliated/tirej) (Quit: Lost terminal) |
| 2020-10-21 19:56:36 | <monochrom> | odds i | i < 100 = pure i <|> odds (i+2) |
| 2020-10-21 19:56:50 | <monochrom> | | otherwise = empty |
| 2020-10-21 19:56:54 | → | Athas joins (athas@2a01:7c8:aaac:1cf:9a0:fad3:fdf2:2ed) |
| 2020-10-21 19:57:03 | × | ech quits (~user@gateway/tor-sasl/ech) (Ping timeout: 240 seconds) |
| 2020-10-21 19:57:11 | <monochrom> | change to mplus/mzero if Logic doesn't support Applicative |
| 2020-10-21 19:58:26 | <monochrom> | May the odds be ever in your favour. |
| 2020-10-21 19:58:30 | <hololeap> | hold on, i thought mzero/empty wouldn't stop the computation |
| 2020-10-21 19:58:50 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-zkmqxnjkmjnikczm) |
| 2020-10-21 19:59:30 | <hololeap> | oh, i see. it never calls `odds` on the second branch. in my original example it calls it no matter what. |
| 2020-10-21 19:59:54 | → | ZarTek joins (znc@static.138.236.76.144.clients.your-server.de) |
| 2020-10-21 19:59:57 | hackage | ordinal 0.3.0.0 - Convert numbers to words in different languages. https://hackage.haskell.org/package/ordinal-0.3.0.0 (wvanonsem90) |
| 2020-10-21 20:00:00 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2020-10-21 20:00:17 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Ping timeout: 260 seconds) |
| 2020-10-21 20:00:37 | → | rprije joins (~rprije@110-175-117-18.tpgi.com.au) |
| 2020-10-21 20:01:23 | <monochrom> | Oddly enough, "odds = pure 1 <|> fmap (+ 2) odds" is much more well defined that adding "if i>=100 then empty" |
| 2020-10-21 20:01:25 | × | supercoven_ quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Ping timeout: 240 seconds) |
| 2020-10-21 20:02:08 | <hololeap> | ok, i see now. it looks like i was over-complicating things, although i still don't have an intuition for this. the type signature `forall r. (a -> r -> r) -> r -> r` is not intuitive to me |
| 2020-10-21 20:02:09 | × | conal quits (~conal@ip-66-115-176-174.creativelink.net) (Quit: Computer has gone to sleep.) |
| 2020-10-21 20:02:18 | → | tabaqui joins (~tabaqui@2604:a880:800:c1::21b:3001) |
| 2020-10-21 20:02:19 | <hololeap> | monochrom: how is it more well defined? |
| 2020-10-21 20:03:07 | <tabaqui> | Allright, I'm using simple recusion to implement my dsl |
| 2020-10-21 20:03:15 | <tabaqui> | Now I have another issue |
| 2020-10-21 20:03:24 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 2020-10-21 20:03:46 | <tabaqui> | type family VarType (a :: Symbol) :: * |
| 2020-10-21 20:03:50 | <monochrom> | The different between "an infinite 'loop' that actually is productive in giving you an infinite list" and "an infinite loop that doesn't accomplish anything" |
| 2020-10-21 20:04:11 | <tabaqui> | f :: Sing a -> VarType a |
| 2020-10-21 20:04:29 | <tabaqui> | How can I write any function with such signature? |
| 2020-10-21 20:04:48 | <hololeap> | monochrom: oh, i see what you mean |
| 2020-10-21 20:05:04 | → | ech joins (~user@gateway/tor-sasl/ech) |
| 2020-10-21 20:05:07 | → | z0 joins (~z0@bl15-167-204.dsl.telepac.pt) |
| 2020-10-21 20:05:13 | <monochrom> | If you're going to do an infinite "x0 ++ x1 ++ x2 ++ x3 ++ ...", you would rather each xi be a non-empty list, so that the whole thing is an infinite list, rather than... |
| 2020-10-21 20:05:16 | <tabaqui> | I've tried to compare singletons with %==, but Haskell doesn't accept it as a proof |
| 2020-10-21 20:05:30 | z0 | is now known as Guest46583 |
| 2020-10-21 20:05:53 | <monochrom> | rather than from x50 onwards it's all xi=[] so the list should end but the computer doesn't know and chases gooses. |
| 2020-10-21 20:06:10 | → | Franciman joins (~francesco@host-82-54-10-114.retail.telecomitalia.it) |
All times are in UTC.