Newest at the top
2024-11-09 17:44:24 +0100 | <Leary> | If I have a type of kind `forall k -> k -> Type`, is there no way to flip the order of the arguments, even in a type synonym? |
2024-11-09 17:43:00 +0100 | hueso | (~root@user/hueso) hueso |
2024-11-09 17:42:52 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-11-09 17:40:17 +0100 | hueso | (~root@user/hueso) (Ping timeout: 248 seconds) |
2024-11-09 17:40:09 +0100 | <haskellbridge> | <Bowuigi> If x modulo p is 0, then x is divisible by p and thus x is not prime. This function is a prime sieve |
2024-11-09 17:38:52 +0100 | alexherbo2 | (~alexherbo@2a02-8440-330e-b682-1c3b-0fef-d1b9-b690.rev.sfr.net) (Remote host closed the connection) |
2024-11-09 17:38:07 +0100 | ash3en | (~Thunderbi@146.70.124.222) ash3en |
2024-11-09 17:38:06 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-11-09 17:37:42 +0100 | <haskellbridge> | <Bowuigi> The commas to the right of the bar work as an AND (AKA &&) |
2024-11-09 17:37:07 +0100 | <haskellbridge> | <Bowuigi> The list comprehension that generates the argument sieve is called on is "[x | x <− xs, mod x p > 0]", this means "give me all the x" ("[ x |") ", such that x is in xs, " ("x <- xs") "and x modulo p is greater than 0" (", mod x p > 0") |
2024-11-09 17:35:09 +0100 | hueso | (~root@user/hueso) hueso |
2024-11-09 17:34:58 +0100 | hueso | (~root@user/hueso) (Quit: No Ping reply in 180 seconds.) |
2024-11-09 17:33:51 +0100 | <haskellbridge> | <Bowuigi> horm After pattern matching, sieve proceeds to construct a list using : (AKA Cons). The first element being p and the rest being a recursive call |
2024-11-09 17:31:24 +0100 | <c_wraith> | So now there are clean interfaces to the functionality they had to do the ugly way |
2024-11-09 17:31:04 +0100 | <c_wraith> | I think a lot of the debian shootout entries have become more haskell-like because we've packaged up the primitive things they did into libraries |
2024-11-09 17:30:56 +0100 | <haskellbridge> | <Bowuigi> Anyway, back to the sieve function |
2024-11-09 17:29:47 +0100 | <c_wraith> | And now that you can add intrinsics in libraries, it's possible to *actually* put asm in your haskell library! |
2024-11-09 17:29:39 +0100 | <haskellbridge> | <Bowuigi> Also compilers can't (yet) fix the data structures you are using (so they can't make you use arrays automagically) but it can eliminate entire passes on your data (see: how GHC optimizes merge sort) |
2024-11-09 17:28:46 +0100 | <geekosaur> | that has taken some time to happen though; look at historiucal versions of the debian shootout entries, some of which now can be found in ghc's test suite |
2024-11-09 17:28:22 +0100 | housemate | (~housemate@146.70.66.228) housemate |
2024-11-09 17:27:43 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-11-09 17:27:16 +0100 | <haskellbridge> | <Bowuigi> In particular, heavily optimized Haskell looks like actual Haskell and not like assembly, see: Kovacs's flatparse |
2024-11-09 17:26:54 +0100 | <c_wraith> | If people had to actually understand how evaluation works, there would be so many fewer people writing bad code then complaining about space leaks |
2024-11-09 17:26:14 +0100 | <haskellbridge> | <Bowuigi> Yes, pure functional languages have controlled environments that are way more amenable to optimization |
2024-11-09 17:26:10 +0100 | <c_wraith> | Sometimes. And I wish they didn't. People should write the code they mean, instead of random garbage that sometimes the compiler fixes for them. |
2024-11-09 17:25:41 +0100 | <horm> | Do the optimizations happen more automatically in langs like haskell, though, where it recognizes what you're doing and just fixes it for you? |
2024-11-09 17:25:38 +0100 | hueso | (~root@user/hueso) hueso |
2024-11-09 17:25:26 +0100 | <c_wraith> | So [a] is now officially `List a', if you have the right things imported. |
2024-11-09 17:25:06 +0100 | <haskellbridge> | <Bowuigi> Advanced imperative optimizations are also dark magic and both can be understood with quite a bit of knowledge of the area. You have some simple/shared stuff like inlining as well |
2024-11-09 17:24:48 +0100 | <c_wraith> | geekosaur: Yeah, there's a bunch of stuff going on with removing type/constructor puns to make dependent types easier |
2024-11-09 17:24:47 +0100 | hueso | (~root@user/hueso) (Read error: Connection reset by peer) |
2024-11-09 17:24:12 +0100 | <haskellbridge> | <Bowuigi> Functional optimization can be best described as "dark magic casted by researchers and enthusiasts", you do have functional arrays tho |
2024-11-09 17:24:10 +0100 | <geekosaur> | or already have but it's optional? |
2024-11-09 17:24:03 +0100 | <geekosaur> | also I think tuples are about to change anyway, at least at type level |
2024-11-09 17:23:56 +0100 | <c_wraith> | It's not like there aren't arrays |
2024-11-09 17:23:41 +0100 | <c_wraith> | yes. Don't use lists for those things. |
2024-11-09 17:23:17 +0100 | <horm> | one thing i don't get yet for functionals is how people make stuff perform well enough for the basic shit: linked lists get hard to get good results from for some ops, right? |
2024-11-09 17:23:00 +0100 | <haskellbridge> | <Bowuigi> You tend to lose readability except on the ()/Unit casd |
2024-11-09 17:22:52 +0100 | <horm> | i will learn me a haskell for great good someday |
2024-11-09 17:22:50 +0100 | alexherbo2 | (~alexherbo@2a02-8440-330e-b682-1c3b-0fef-d1b9-b690.rev.sfr.net) alexherbo2 |
2024-11-09 17:22:46 +0100 | <horm> | that's all i need to hear |
2024-11-09 17:22:35 +0100 | <haskellbridge> | <Bowuigi> I see what you mean, some of those cases are separated in other languages |
2024-11-09 17:22:30 +0100 | alexherbo2 | (~alexherbo@2a02-8440-330e-b682-1c3b-0fef-d1b9-b690.rev.sfr.net) (Remote host closed the connection) |
2024-11-09 17:22:29 +0100 | <geekosaur> | welcome back to ALGOL 60\ |
2024-11-09 17:22:20 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-11-09 17:22:18 +0100 | <horm> | words, too |
2024-11-09 17:22:13 +0100 | <horm> | DO AWAY WITH SIGILS AND USE WORSD? |
2024-11-09 17:22:09 +0100 | <horm> | or yknow |
2024-11-09 17:22:03 +0100 | <horm> | like -> already |
2024-11-09 17:21:59 +0100 | <horm> | they can make metasigils, i'll allow that |