<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:00 saussure joined
00:01 infinity0_ joined
00:01 infinity0 joined
00:02 takle joined
00:02 TabAtkins joined
00:02 zpconn__________ joined
00:03 dan_f joined
00:03 mkurkov_ joined
00:04 infinity0 joined
00:04 jleon joined
00:04 acarrico joined
00:05 <mb013619_> is there an nvim-hs related channel that anyone is aware of?
00:07 infinity0 joined
00:07 Zoddo joined
00:08 rickygee joined
00:08 mmalone joined
00:10 infinity0 joined
00:12 tromp joined
00:12 infinity0 joined
00:13 jedws joined
00:15 mb013619 joined
00:15 infinity0 joined
00:16 uglyfigurine joined
00:17 exferenceBot joined
00:17 hexagoxel joined
00:17 P1RATEZ joined
00:18 primal joined
00:18 saussure joined
00:19 dfeuer joined
00:20 renzhi joined
00:22 contrarivariant joined
00:23 takle joined
00:23 rkazak joined
00:24 mmalone joined
00:24 drewbert joined
00:25 filterfish joined
00:27 TheFuzzball joined
00:28 <codedmart> I suck with lens. If I have a responseBody `"{\"message\":\"Body should be a JSON object\"}"` when using http-client. What is my best option to access `message`. Just return a `Maybe Text`?
00:28 pera joined
00:29 rickygee joined
00:29 AfC joined
00:29 plutoniix joined
00:29 conal joined
00:30 castlelore joined
00:30 castlelore joined
00:30 jedws joined
00:31 Philonous joined
00:31 nighty-- joined
00:31 plutoniix joined
00:31 gestone joined
00:32 exarkun left
00:32 <Gurkenglas> codedmart, I'm not sure I understood the question. http://hackage.haskell.org/package/lens-aeson-1.0.1/docs/Data-Aeson-Lens.html#v:key gives you that Maybe Text. If you want to crash if there's no message key, http://hackage.haskell.org/package/lens-4.15.2/docs/Control-Lens-Fold.html#v:-94--63--33- gives you the corresponding Text.
00:34 <codedmart> Gurkenglas: Hmm... I am trying to use that but even using the example in ghci `"{\"a\": 100, \"b\": 200}" ^? key "a"` I get an error `Could not deduce (Data.String.IsString (Maybe A.Value))`
00:35 juanpaucar joined
00:35 dschoepe joined
00:36 spacekitteh[m] joined
00:36 saussure joined
00:37 <Gurkenglas> You usually want to paste the whole error to lpaste or the like in such cases, but my first guess would be that you haven't enabled OverloadedStrings?
00:38 dni joined
00:38 <codedmart> Gurkenglas: Yeah was getting that: https://gist.github.com/codedmart/377b16e921b6bb34083558eb64063a01
00:38 Bare joined
00:38 <codedmart> I do have OverloadedStrings set.
00:40 aarvar joined
00:40 <Gurkenglas> If I encountered this error, I would proceed to spam type signature annotations in hopes that the error changes once one of my annotations surprises the compiler.
00:41 juanpaucar joined
00:41 louispan joined
00:41 sleffy joined
00:41 <Gurkenglas> I've heard that there's IDEs today that show you the types deduced for each term, so that you can be surprised by the compiler's annotations instead.
00:43 halogenandtoast joined
00:43 jleon joined
00:43 takle joined
00:47 <codedmart> Gurkenglas: Thanks!
00:47 <* hackage> riak 1.1.2.0 - A Haskell client for the Riak decentralized data store https://hackage.haskell.org/package/riak-1.1.2.0 (lambda_foo)
00:48 <Gurkenglas> Don't leave me hanging like that, what was the problem?
00:48 jleon joined
00:48 {emptyset} joined
00:48 acw joined
00:49 conal joined
00:49 DrMentats joined
00:49 DrMentats left
00:49 rickygee joined
00:51 drewbert_ joined
00:52 fosskers joined
00:52 TheFuzzball joined
00:52 <actualHuman_462> Anybody know of some package implementing a Free Monad interpreter that's somewhere between 'FizzBuzz' and 'avionics controll system for cruise missile' on the complexity scale?
00:53 <monochrom> Consider free-game.
00:53 indi_ joined
00:54 <monochrom> Read its oldest versions to see the basic idea. The current version adds too many features, becoming obfuscating.
00:54 saussure joined
00:55 cpennington joined
00:57 <actualHuman_462> Thank you, this seems like a solid example
00:59 pwnz0r joined
01:00 jgertm joined
01:01 dni joined
01:02 <dihuteno> if I'm working in the repl inside a stack project and I realised that I forgot to add a depedency to my project (because import X gives a module not found error) is there a way I can load it into the repl session without exiting and starting again?
01:03 mkoenig joined
01:04 takle joined
01:05 <actualHuman_462> +/-
01:06 chrisdotcode joined
01:07 koserge joined
01:07 <actualHuman_462> As I understand it, stack just wraps ghci when it boots it up, so I don't think you can go through the full 'find my package on stackage and D/L it for me' set of steps - but if you already have the module locally, like it's a part of your project, you should be able to slap it into your .cabal file and use :module to re-load your project. It's probably a whole lot easier to just :quit, edit the file and re-run stack ghci tho
01:08 juanpaucar joined
01:08 anuxivm left
01:09 <actualHuman_462> I have yet to run into a scenario in which it wasn't easier to just exit and re-load anyway.
01:10 rickygee joined
01:11 louispan joined
01:12 pera joined
01:12 LHoT10820 joined
01:12 vaibhavsagar joined
01:14 MP2E joined
01:16 jedws joined
01:19 TheInfosphere joined
01:20 <dihuteno> actualHuman_462: just had a few variables and functions that I didn't want to have to reset, I guess I should just be putting them in a .hs file and loading that
01:20 brynedwardz joined
01:20 <dihuteno> :module didn't work unfortunately so quitting seems to be the way to go
01:21 cdg joined
01:24 castlelore joined
01:24 beekill95 joined
01:25 Swizec joined
01:25 lambdamu_ joined
01:25 takle joined
01:27 <thang1> Anyone know of haskell stuff in portland besides Galois?
01:29 tommd joined
01:30 Scip joined
01:30 rickygee joined
01:32 darjeeli1 joined
01:35 juanpaucar joined
01:36 hamishmack joined
01:37 seantparsons joined
01:39 joco42 joined
01:39 lambda-11235 joined
01:39 <* hackage> postgrest-ws 0.3.2.0 - PostgREST extension to map LISTEN/NOTIFY messages to Websockets https://hackage.haskell.org/package/postgrest-ws-0.3.2.0 (diogob)
01:41 ianandrich joined
01:42 uglyfigurine joined
01:43 systadmin joined
01:43 sword865 joined
01:45 ChaiTRex joined
01:46 texasmynsted joined
01:46 takle joined
01:48 Koterpillar joined
01:49 lavalike joined
01:50 saussure joined
01:50 flatmap1_ joined
01:51 {emptyset} joined
01:51 <halogenandtoast> I'm trying out stack's docker integration. So far it seems amazing, is there anything I should be aware of or watch out for?
01:51 rickygee joined
01:53 lambdaTom joined
01:53 kmels joined
01:54 <TheInfosphere> Hey all! I'm trying to build a cross compiler from darwin to the raspberry pi and I'm almost done, but when I try to configure the makefile, configure can't find libffi
01:55 gestone joined
01:55 <TheInfosphere> pkg-config can find it, and other things that depend on it find it no problem. I'm not sure this is the right place to ask, but I hope someone can at least point me in the right direction
01:57 andyhuzhill joined
01:57 juanpaucar joined
02:00 hucksy_ joined
02:00 gws joined
02:00 texasmynsted joined
02:01 <Lokathor> so
02:01 <Lokathor> using List as a Monad is fine, but ListT is some sort of not fine thing?
02:02 sellout- joined
02:02 andyhuzhill1 joined
02:02 Goplat joined
02:02 conal joined
02:02 juhp joined
02:02 <c_wraith> Lokathor: ListT is fine *sometimes*.
02:03 <c_wraith> Lokathor: which is why [] is fine, and [] is not considered fine for arbitrary use
02:03 <c_wraith> err, and ListT is not considered...
02:03 <Lokathor> computeVerticies :: (Int, Int) -> (Int, Int) -> [(GLfloat,GLfloat)]
02:03 <Lokathor> computeVerticies (rows,cols) (cellWidth,cellHeight) = do
02:04 <c_wraith> Lokathor: like, ListT is fine if it's only used with Reader, Writer, or State
02:04 <Lokathor> i'm just using this to build a long list
02:04 mkoenig joined
02:06 <c_wraith> Lokathor: by analogy.. ST is fine as a monad. STT would have... issues.
02:06 <Rotaerk> here's a "ListT done right": https://hackage.haskell.org/package/pipes-4.3.2/docs/Pipes-Tutorial.html#g:6
02:06 <c_wraith> Lokathor: validity of something as a monad does not mean it's also valid as a monad transformer.
02:06 <Lokathor> STT would be the most unboxed of all types
02:07 <Lokathor> the most deeply mutable possible structure
02:07 takle joined
02:07 <dolio> ListT is okay with Reader, but not State and (in general) Writer.
02:07 saussure joined
02:08 zzz joined
02:08 <c_wraith> Oh, right. I used it with Writer that was restricted to "add 1 to the accumulator", which is sufficiently restricted that it works.
02:08 <Lokathor> I also heard that Writer is a bit of a stinker of a Monad :P
02:08 <c_wraith> it's commutative, and all
02:08 <c_wraith> Writer is fine conceptually. The implementation has a problem
02:09 <c_wraith> dolio: that's where it works, right? ListT m is a monad when m is a commutative monad?
02:10 <dolio> Yeah.
02:10 <c_wraith> so ListT Maybe also totally works. :)
02:10 duckqlz joined
02:10 QRealm joined
02:11 gugah joined
02:12 sleffy joined
02:12 rickygee joined
02:12 <c_wraith> Lokathor: if you're curious, a commutative monad is one where do { x <- m ; y <- n ; f x y } is equivalent to do { y <- n ; x <- m ; f x y} for all f, x, and y
02:13 <Lokathor> ah, well, i guess that makes sense
02:14 <c_wraith> Uh, f, m, and n, u mean
02:14 <c_wraith> *I
02:17 saussure joined
02:17 <Koterpillar> halogenandtoast: you can't cache ~/.stack
02:18 <Koterpillar> halogenandtoast: so even if you build yourself a nice Docker image with packages you depend on, it's useless for a cold start on another machine
02:18 gestone joined
02:18 systemfault joined
02:19 hybrid joined
02:20 <halogenandtoast> Koterpillar: hmm, I think I want to simply avoid issues like "setup: Missing dependencies on foreign libraries:"
02:21 <halogenandtoast> That sucks that ~/.stack can't be cached.
02:21 <Koterpillar> halogenandtoast: foreign libraries are fine
02:22 <Koterpillar> I'm curious whether Stack (or perhaps Nix) can move their respective stores from a POSIX filesystem to either S3 or IPFS
02:22 <halogenandtoast> Koterpillar: would you happen to know how I can add Mysql as a service for my image? Would I just make a docker compose image (or whatever replaced docker compose).
02:23 <halogenandtoast> And will stack integrate with docker compose in any way?
02:23 <Koterpillar> Why would you want the service in the image? You can add the library, and it'll help building, but a service won't run
02:23 <thang1> Just out of curiosity... What sort of thing would you guys write/use to convert integers into roman numerals in the most generic and powerful way possible? I was thinking of a parser but apparently they don't handle subtraction rules very well? (eg 4 = IV, not IIII)
02:23 <Koterpillar> Your end result from stack docker is still a binary. If you want, put it into another Docker image, and compose that with a MySQL one.
02:24 <halogenandtoast> Hmm okay.
02:25 <halogenandtoast> Koterpillar: thanks for the info, I'll have to mess with this a bit.
02:26 ebsen joined
02:27 louispan joined
02:28 baldrick joined
02:28 takle joined
02:29 xanadu joined
02:30 rkazak joined
02:30 tripped joined
02:32 cpup joined
02:32 rickygee joined
02:35 saussure joined
02:36 <EvanR> thang1: the roman numerals hackage package
02:36 pavonia joined
02:36 sync__ joined
02:38 anodium joined
02:38 <thang1> oooh, interesting. I'm not sure it's as powerful as I want it to be, but it looks better than most conversions
02:40 <thang1> He uses unicode in his haskell. Interesting :p
02:41 <halogenandtoast> Koterpillar: to answer your previous question, I actually understand very little about Docker. I just want to simplify installation for my non Haskell coworkers.
02:42 <halogenandtoast> I also want to make it deployable, it's quite possible I'm using the wrong terminology
02:42 <halogenandtoast> or attempting to do the completely wrong thing
02:43 <thang1> Damnit, the roman numerals package only works correctly for numbers 1..4000 and just spams M for numbers larger
02:43 <halogenandtoast> Which is pretty typical for me.
02:43 <Koterpillar> halogenandtoast: which of these are you expecting your coworkers not to have: GHC; foreign libraries you depend on; MySQL server; Docker?
02:44 <halogenandtoast> GHC and foreign libraries
02:44 <Koterpillar> then you don't need the compose bit for MySQL
02:45 <Koterpillar> you need a statically linked binary _or_ a container with all the libraries
02:45 <halogenandtoast> hmm, I went down this path because of how I interpreted this error message: "mirin: ConnectionError {errFunction = "connect", errNumber = 2002, errMessage = "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"}"
02:45 <Koterpillar> stack docker will only help with the first; plain docker with the second
02:45 <halogenandtoast> when running stack exec mirin.
02:45 <Koterpillar> ok, so you are expecting your users to run a local MySQL server?
02:46 <halogenandtoast> either way is probably fine.
02:46 <halogenandtoast> So basically I don't yet care, I may in the future, but I know everyone has a local mysql instance.
02:46 <halogenandtoast> If I run the app on a production server, it will probably use an Amazon instance for the database
02:46 <halogenandtoast> instead of locally
02:47 SpikeMaster joined
02:47 <Koterpillar> so _this_ bit docker compose can help address
02:48 mcnster joined
02:48 saurabhnanda joined
02:48 exferenceBot joined
02:49 takle joined
02:49 <halogenandtoast> Koterpillar: okay I'll look into it, have to run for lunch now. Thanks for the pointers.
02:49 flatmap13 joined
02:50 darlan joined
02:50 flatmap13 joined
02:52 CyberShadow left
02:52 filterfish joined
02:52 jleon joined
02:53 saussure joined
02:53 mjora7 joined
02:53 rickygee joined
02:53 hexagoxel joined
02:53 tromp joined
02:53 carlomagno joined
02:54 m00n joined
02:55 jleon joined
02:56 {emptyset} joined
02:56 MrWoohoo joined
02:58 DrMentats joined
02:58 indi_ joined
02:58 indi_ joined
02:58 halogenandtoast joined
02:58 SpikeMaster left
02:58 cyborg-one joined
02:59 indi_ joined
02:59 indi_ joined
03:00 CoderPuppy joined
03:00 indi_ joined
03:02 saussure joined
03:04 DrMentats left
03:05 flatmap13 joined
03:10 takle joined
03:10 zzz joined
03:10 juanpaucar joined
03:12 flatmap1_ joined
03:12 felixsch1 joined
03:14 rickygee joined
03:14 nurupo joined
03:15 drewbert joined
03:15 Costar joined
03:19 sleffy joined
03:21 saussure joined
03:21 indi_ joined
03:23 louispan joined
03:23 <* hackage> genvalidity-time 0.0.0.2 - GenValidity support for time https://hackage.haskell.org/package/genvalidity-time-0.0.0.2 (Norfair)
03:24 ertesx joined
03:24 lgas joined
03:25 jbalint joined
03:26 jbalint joined
03:26 vtomole joined
03:28 indi_ joined
03:30 indi_ joined
03:30 takle joined
03:31 uglyfigurine joined
03:34 rickygee joined
03:35 mbuf joined
03:35 mjora7 joined
03:36 rcschm joined
03:37 Sh4rPEYE joined
03:37 gestone joined
03:38 saussure joined
03:40 joco42 joined
03:40 vaibhavsagar joined
03:42 eklavya joined
03:42 lambdaXtom joined
03:44 t joined
03:45 saurabhnanda joined
03:48 tromp joined
03:48 saussure joined
03:48 <* hackage> amazonka-s3-streaming 0.2.0.2 - Provides conduits to upload data to S3 using the Multipart API https://hackage.haskell.org/package/amazonka-s3-streaming-0.2.0.2 (AlexMason)
03:48 lambdaTom joined
03:52 takle joined
03:53 jgertm joined
03:55 rickygee joined
03:55 coot____ joined
03:58 barcabuona joined
03:58 saussure joined
03:59 j2j joined
03:59 indi_ joined
04:01 Scip joined
04:03 cpup joined
04:04 CoderPuppy joined
04:05 jmcarthur joined
04:05 halogenandtoast joined
04:09 worch joined
04:12 ddere joined
04:12 cpup joined
04:12 CoderPuppy joined
04:12 takle joined
04:15 juanpaucar joined
04:15 vlatkoB joined
04:16 rickygee joined
04:16 saussure joined
04:19 Sornaensis joined
04:20 Koterpillar joined
04:22 <mjora7> How do I run a stack project in a repl? When I use `stack repl` and then try to load my entry file `:load app/Main.hs`, I get a bunch of errors that modules could not be loaded
04:22 connrs joined
04:28 yamad joined
04:28 indi_ joined
04:28 <TheInfosphere> Hey all! I'm trying to build a cross compiler from darwin to the raspberry pi and I'm almost done, but when I run ./configure, configure can't find libffi, despite LDFLAGS and CFLAGS being set correctly
04:28 flatmap13 joined
04:29 <wedens> what library can I use if I need to extract some data from XSD schema?
04:29 <TheInfosphere> that is, when I run ./configure in the directory with the ghc source
04:31 connrs joined
04:33 hanna joined
04:33 eklavya_ joined
04:33 takle joined
04:34 saussure joined
04:35 indi_ joined
04:36 rickygee joined
04:37 juhp joined
04:38 Nycatelos joined
04:38 <ninedotnine> when will i ever learn... https://github.com/ninedotnine/util/commit/b16bcbb1ee782558527f4873d3a1fbbd27948881
04:38 jimmyrcom_ joined
04:40 Koterpillar joined
04:41 <halogenandtoast> ninedotnine: the correct answer is never.
04:41 <ninedotnine> :^(
04:41 <halogenandtoast> I think I would have made the same mistake.
04:42 Big_G joined
04:42 <halogenandtoast> Any good resources for learning the Free Monad gently?
04:42 <thang1> I think everyone makes the same mistake lol
04:43 <thang1> filter is an ambigious name in the worst way.
04:43 jedws joined
04:43 <mjora7> I get this error: `Couldn't match type ‘[Char]’
04:43 <mjora7> with ‘text-1.2.2.1:Data.Text.Internal.Lazy.Text’`, how do I convert a String to that long type?
04:43 <thang1> If you have to remember "coffee filters hold all the coffee" to remember how filter works, you named it the wrong thing
04:43 <halogenandtoast> You just need a text type right?
04:43 <halogenandtoast> pack probably
04:44 louispan joined
04:44 <halogenandtoast> I might be confusing ByteString one moment
04:44 <mjora7> halogenandtoast: Where do I find that?
04:44 <thang1> mjora7: somewhere you have a string conversion error
04:44 <halogenandtoast> mjora7: there's a pack in Data.Text, I usually import qualified Data.Text as T and use T.pack
04:45 <thang1> Haskell has String (which is [Char]), ByteString, a lazy ByteString, Text, and a lazy Text
04:45 <halogenandtoast> if you need lazy pack it's in Data.Text.Lazy
04:45 <thang1> theres' also IsString, text-icu for more unicode stuff, utf8-string library, and a ListLike package for a common interface to all strings, yadda yadda
04:46 <mjora7> I try `import Data.Text` in ghci and get "could not find module Data.Text"
04:46 <halogenandtoast> add text to your cabal
04:46 davr0s joined
04:46 <mjora7> Ok this is going above my head hahah
04:46 <thang1> You need to download it from hackage in your cabal file. It's confusing, to be honest. This is probably my least favorite part of haskell
04:46 <halogenandtoast> what function are you trying to use that gives you that error?
04:47 <halogenandtoast> mjora7: ^^
04:47 <mjora7> Ugh everything Haskell goes above my head, how high is the entry level for this language hahah.
04:47 <halogenandtoast> mjora7: depends on where you are coming from.
04:47 <jle`> mjora7: btw, the type itself isn't that long, it's just Text
04:47 <mjora7> halogenandtoast: Just trying to do something with the Scotty framework, the html function
04:47 <jle`> it's just shown qualified
04:47 <halogenandtoast> mjora7 I have a solution for you
04:47 <halogenandtoast> add {-# LANGUAGE OverloadedStrings #-}
04:48 <halogenandtoast> to the top of your file
04:48 <lpaste> heath pasted “HelloWorldB.hs” at http://lpaste.net/355803
04:48 <mjora7> halogenandtoast: Actually already have that
04:48 <thang1> mjora7: dealing with frameworks and html and all that are generally not super great ideas for beginners. Haskell is really weird with that, you really have to start super slow and easy and work your way up or it's just too much to remeber all of the legacy crap you have to deal with
04:49 <heath> mjora7: check this out: http://lpaste.net/355803 stack will download the dependencies for you automatically if you write your app similar to this
04:49 <heath> s/app/script
04:49 <halogenandtoast> mjora7: if you have source code at the ready, I'd be happy to look (as would be others I assume)
04:49 <mjora7> thang1: Would you have any other suggestions of what I should do? If it was JavaScript I'd make a simple server, C I'd reimplement some command-line tools,
04:50 <halogenandtoast> mjora7: For me to learn Haskell I wrote a few simple games (ones without random numbers).
04:50 <mjora7> thang1: I just keep going through this Haskell textbook and wonder when I'm going to be able to write a program that does anything. Halfway through and I can't even do console input! Kind of ridiculous IMO. I'm aware that it's a bit more complex in Haskell than in other languages.
04:50 <halogenandtoast> mjora7: the sad part is this
04:50 <thang1> With C-family languages, you already know all of the standard ways of thinking about how it works. With Haskell you're learning a new way of thinking; the language itself is somewhat orthogonal to that goal
04:50 <halogenandtoast> Most things are simple
04:51 <halogenandtoast> so simple in fact that they go back around to being complicated
04:51 <thang1> mjora7: which textbook are you using? Just curious
04:51 <mjora7> Learn You a Haskell
04:51 <halogenandtoast> eh
04:51 <halogenandtoast> That was my least favorite Haskell book.
04:51 saussure joined
04:52 <thang1> oooh... Yeah, we really need to get rid of that book and all of the other outdated and inferior learning materials off of the r/haskell sidebar. It's ridiculous that they're still there at this point
04:52 <halogenandtoast> mjora7: can you paste your code somewhere?
04:52 <mjora7> Have to run at the moment, I will be back a little bit later and paste it though!
04:52 <mjora7> Talk to you guys soon.
04:52 <thang1> Anywya, mjora7, your problem is that you're [Char] or String somewhere and you're trying to shove that type into html which only works with Text
04:53 <thang1> OverloadedStrings allows literal "text" to be converted much more easily, but hand converting a bunch of stuff is often still required. Try surrounding the variable with ( :: Text) and seeing what that does
04:53 <halogenandtoast> thang1: My guess is there is a function somewhere explicitely returning String
04:54 <halogenandtoast> but can't tell without seeing the code of course.
04:54 takle joined
04:54 <thang1> That's what I'm thinking. Now, my question is this... We have IsString and some pretty good "universal string" stuff in Libraries... How difficult would it be to just go through the entire prelude and use these universal things that automagick strings into their different representations as needed?
04:56 jleon joined
04:56 <halogenandtoast> I wish I could answer that question.
04:56 <thang1> Also, the amount of libraries out there that only use Text or only use ByteString or (worse) only use String just feels ridiculous. It feels dumb to have to hold the library's hand so often because nobody uses universal strings in the libraries and people often use the wrong string in their user code and it's just a fairly dumb situation all around that feels greatly worsened by a dogmatic and nigh
04:56 <thang1> fanatically-religious holding onto backwards compatibility
04:56 worch joined
04:57 rickygee joined
04:57 <thang1> I thought we learned from the mistakes of C++ :p
04:58 <c_wraith> you shouldn't conflate bytestring with the other two. It really is fundamentally different.
04:59 <thang1> ninedotnine: using fromJust, let bindings in do, and using String. Impressive.
04:59 <c_wraith> 2/3 of those are perfectly fine
04:59 <thang1> c_wraith: absolutely. I'm fine with ByteString not being mixed around in there; that one feels much more of a PEBKAC error to me
05:00 <c_wraith> And the other 1/3 is ok on occasion
05:00 sea left
05:01 <thang1> I just wish we wouldn't have to pull out a whiteboard, slides, and some thesis papers everytime someone wants to write something even vaguely non-trivial involving strings/text of any kind. Plus, constantly converting willy nilly and forcing stuff through feels like I'm defeating the entire purpose of types
05:01 saussure joined
05:01 <c_wraith> That's not defeating the purpose of types, that's using types for their intended purpose.
05:02 alx741 joined
05:03 caumeslasal joined
05:04 <thang1> But if you don't care what the string is or how it works, shouldn't that be something you don't have to deal with? Explicit conversions only seem useful if they're used to make explicit something that should be made explicit. Strings and text are horrifically complicated for good reason, but "20 years of backwards compatibility and nonsense make it so I have to litter conversion everywhere" seems completely
05:04 <thang1> separate from the real reason strings are complicated.
05:04 saurabhnanda joined
05:04 <thang1> Like, if string libraries are complicated because they force you to handle encoding, edge cases, etc., and do things right then that's totally fine. If they're complicated because you have to do arbritrary/meaningless conversions then that's stupid.
05:05 <c_wraith> The thing is, all those "meaningless" conversions change semantics.
05:05 baldrick1 joined
05:05 <c_wraith> That's.. pretty far from meaningless.
05:05 <thang1> what semantics are being changed?
05:06 <c_wraith> In what conversion?
05:06 acw joined
05:06 <thang1> "I need to use this function A from library A and the library writer decided they were only going to use Text so now I can't use it with function B from library B where the writer used String because they didn't want to depend on Text"
05:07 <c_wraith> Which Text?
05:07 <thang1> Oh, that's what you're getting at. Strict vs Lazy?
05:07 <c_wraith> That's one of the things.
05:08 <thang1> What are some of the other ones?
05:09 dec0n joined
05:09 saurabhnanda joined
05:09 fvdiublhb joined
05:09 <c_wraith> In general, Text handles unicode more correctly than String. It implements all the unicode things that depend on multiple codepoints.
05:10 <c_wraith> casefolding, for instance
05:10 carlosda1 joined
05:13 orzo joined
05:13 <c_wraith> String provides a really handy way to play with [] in a friendly setting. Admittedly, it has the least reason to exist. I've argued (and still believe) that the entire design of the Show class was poisoned by its existence. But it's also too tightly tied into everything now to just throw out. And overall, it's really not bad for small-scale uses in practice.
05:14 <c_wraith> This isn't like the AMP, which broke everything for a real gain. A breaking change to remove String would break a lot more with fewer benefits.
05:14 <thang1> Right, and I get that. I still think Haskell would be far better off if people just gave up on String and [Char] and never used that nonsense ever again. That being said, it should be pretty "easy" to default to "just make things work and if I ever care about performance later, I'll figure it out"
05:15 takle joined
05:15 <EvanR> thang1: sounds sort of like the belief that there is a number type that "just works" for most use cases
05:16 <thang1> There kind of is, though? You don't have nearly the amount of pain working with number types than you do with string types in Haskell
05:17 <EvanR> theres like 15 number types to choose from
05:17 <EvanR> and 3 or 4 string types
05:17 meandi_2 joined
05:17 ertes joined
05:17 <thang1> and I've seen number types outside of Integer, Int, and Double like three times so far?
05:17 rickygee joined
05:18 <phadej> depends, I don't count ByteString as a string type
05:18 <EvanR> the similarity i see is that even if you rename Text to String and have that be the go-to, people still cant really succeed without understanding unicode
05:18 <phadej> it's "binary"
05:18 <thang1> You can use Num a, Fractional a, etc., to make your functions behave "correctly" for pretty much every number type out there just fine
05:18 <EvanR> as long as you understand the types involved yeah
05:18 <c_wraith> thang1: why can't you use the right classes to do the same with string types, then? I mean, the classes exist.
05:19 <EvanR> which i gather is the gripe, from reading one page of history
05:19 oaao joined
05:19 saussure joined
05:19 <halogenandtoast> c_wraith: the argument is "I can, but what about those guys over there"
05:19 <thang1> And almost all libraries are built that way from the start, so when using a library I can't remebmer any time I had to "pointlessly" convert a number type from one to another in order to get something to work.
05:19 <EvanR> how do you design an api to let people succeed without really understand what they are working with
05:20 <c_wraith> thang1: then you've never used any low-level native bindings.
05:20 <c_wraith> thang1: because I assure you, manual conversions to GLInt are all over the place
05:20 <EvanR> thang1: you regularly have to convert number types...
05:20 <thang1> (small exception: If I write code with a type that's needlessly specific for no reason, I occasionally have to use FromInteger)
05:20 <c_wraith> or, well, GLFloat
05:20 <EvanR> and i dont see it as pointless
05:21 <EvanR> and i beware needlessly polymorphic number code
05:21 <thang1> I wrote "pointless" in quotes because I don't see it as pointless either, but that from a pure beginner perspective it may appear pointless.
05:21 <EvanR> all the more reason to have it so people learn how unpointless it is
05:22 <EvanR> i kind of didnt really understand string technology until haskell
05:22 <EvanR> where the string type was not "bytes + encoding tag"
05:22 <EvanR> blew my mind
05:22 <thang1> Right, but smashing a beginner over the head with String vs [Char] vs Lazy/Strict ByteText and Lazy/Strict Text isn't very conductive.
05:22 <Koterpillar> I depend on a non-Haskell file in a quasi quoter: thingy = [hereFile|src/somewhere.txt|]. How do I include somewhere.txt in the Cabal file so that the source is recompiled if somewhere.txt changes?
05:22 <halogenandtoast> thang1: String and [Char] are exactly the same thing though.
05:22 <EvanR> ByteText
05:22 <EvanR> now were cooking with gas
05:22 <thang1> They are, but they're not to beginners.
05:22 <c_wraith> Koterpillar: the hereFile quasiquoter should add the dependency inside the compiler by itself
05:23 <c_wraith> Koterpillar: if it doesn't, file a bug or use a different one.
05:23 <Koterpillar> c_wraith: do I have to do anything in the cabal file?
05:23 <phadej> IMHO it was quite nice that String = [Char] as a beginner
05:23 <thang1> Just like beginners aren't going to know when to use bytetext vs Text vs String or when to use Strict vs Lazy or why one should avoid needlessly polymorphic numeric code
05:23 <halogenandtoast> phadej: agreed
05:23 <c_wraith> Koterpillar: only if you plan on using cabal sdist
05:23 <phadej> though I cared about "let's play with haskell" not about "let's build a high performance webapp"
05:23 <halogenandtoast> thang1: I feel like I'm a beginner
05:23 <Koterpillar> c_wraith: OK, thanks
05:23 <halogenandtoast> I'm fine with it
05:24 <halogenandtoast> I couldn't tell you when I should use Strict vs Lazy
05:24 <EvanR> are you ranting about the strict vs lazy dichotomy of data structures in general?
05:24 <halogenandtoast> I just learned how to convert and deal with it
05:24 <thang1> At least with most numbers, you can avoid pretty much all complexity with them until you understand things. The more common something is in haskell, it seems the more broadly it works with "numbers"
05:24 <halogenandtoast> ByteString is perhaps a little poorly named
05:24 <c_wraith> Koterpillar: yeah, the quasiQuoter should use https://hackage.haskell.org/package/template-haskell-2.11.1.0/docs/Language-Haskell-TH-Syntax.html#v:addDependentFile
05:25 <EvanR> well "string" in math, it makes sense
05:25 <halogenandtoast> but once I learned that it was a string in the "conventional" sense I dealt with that as well.
05:25 <thang1> EvanR: nah, I understand why it's there and really appreciate the fact that haskell supports those things. It just gets in the way of doing things a lot if you don't internalize all that stuff first
05:25 <halogenandtoast> *wasn't
05:25 <EvanR> string in programming is supposed to mean text, which its not
05:25 <c_wraith> Koterpillar: doing that means that the compiler knows about the dependency and can handle it correctly.
05:25 <Koterpillar> nice!
05:25 tromp joined
05:25 <c_wraith> Koterpillar: so.. if it doesn't, file a bug report telling them about that. :)
05:26 <EvanR> i want to know what ByteText is
05:26 <halogenandtoast> a typo
05:26 <EvanR> the question remains
05:26 <phadej> EvanR: "In computer programming, a string is traditionally a sequence of characters, "
05:26 <EvanR> haha
05:26 <thang1> yeah, it's a typo :p
05:26 <Koterpillar> c_wraith: I didn't observe any breakage, I was trying to guard against that
05:26 <phadej> text is not exactly that
05:26 <EvanR> its not?
05:26 <EvanR> conceptually
05:26 <Koterpillar> *against it being not recognized
05:27 <c_wraith> Koterpillar: if you want to use cabal sdist at any point, list the file in the extra-source-files section of the cabal file, so that cabal knows to include it in the source distribution
05:27 <thang1> I guess my overall point is that in Haskell, you can remain hugely ignorant of numbers and still get quite a bit done in casual and normal usage.
05:27 <EvanR> i have not had that experience
05:27 <phadej> thang1: so you can with String?
05:27 <thang1> However, with strings, it feels like there's absolutely pretty much zero way to get that same experience with String/[Char]
05:27 <EvanR> when 1 + 0.1 is not 1.1, i would flip a table unless i understood what was going on
05:28 <EvanR> i felt the opposite [Char] was simple
05:28 <thang1> EvanR: 1 + 0.1 is 1.1 in ghci?
05:29 <nshepperd> in programming, text used to be a sequence of character, and then the unicode people ruined it all by making us support foreign languages
05:29 <EvanR> i can never remember the one like that that gives weird results
05:29 <EvanR> > 1.1 + 0.1
05:29 <lambdabot> 1.2000000000000002
05:29 ^bschafer1 joined
05:30 <c_wraith> nshepperd: didn't those ascii guys ruin it first? making you have to care about how characters were represented?
05:30 <verement> > 29.99 + 4.71
05:30 <lambdabot> 34.699999999999996
05:30 <thang1> [Char] is simple, using it in things tends to be overly complicated to me. The second you want to use a library you're playing bingo lottery with whether or not it'll support [Char] or if you have to do some conversion you don't (yet) understand/care about
05:30 |sync| joined
05:30 <halogenandtoast> > 0.36 + 0.4
05:30 <lambdabot> 0.76
05:30 <halogenandtoast> err
05:30 <jle`> yeah 7 bytes way too much to represent a character
05:30 <halogenandtoast> > 0.36 + 0.04
05:30 <lambdabot> 0.39999999999999997
05:30 <jle`> we only need logBase 2 26 bytes
05:30 <jle`> > logBase 2 26
05:31 <EvanR> thang1: yeah, so its really about a fungibility thing, how popular it is, not that it exists
05:31 Swizec joined
05:31 <lambdabot> 4.700439718141093
05:31 <jle`> 5 bytes or bust
05:31 <nshepperd> yeah maybe. i've never written an \STX in an essay
05:31 <Koterpillar> c_wraith: Unknown fields: extra-source-files
05:31 <EvanR> jle`: 7 bits?
05:31 <jle`> um
05:31 <jle`> yes s/bytes/bits everything
05:31 <thang1> lol
05:32 <c_wraith> Koterpillar: are you putting it in the right section? https://www.haskell.org/cabal/users-guide/developing-packages.html
05:32 mjora7 joined
05:32 <halogenandtoast> I'd take 7 bytes
05:32 <c_wraith> Koterpillar: it's part of the package description, not the library or executable sections
05:32 <EvanR> utf-9
05:32 <Koterpillar> c_wraith: well, those files do belong to a library…
05:33 <Koterpillar> but yes, I should have consulted the docs
05:34 <halogenandtoast> Anyways, I'm perfectly fine with a variable length encoding, as long as I never have to implement it myself.
05:34 primal_ joined
05:34 mivael_ joined
05:34 <EvanR> lazily nontheless
05:35 <halogenandtoast> how should I know?
05:35 <halogenandtoast> :p
05:35 <nshepperd> the problem isn't just encodings, it's that to even know what a 'character' is you need to know about combining code points, and rtl indicators and all that other fun stuff and how it interacts
05:36 Itkovian joined
05:36 takle joined
05:36 <EvanR> well, javascript strings work and almost nobody using js understands unicode
05:37 <EvanR> but youre right its complicated if youre making a program to specifically use unicode features
05:37 <EvanR> or lib
05:37 saussure joined
05:37 rickygee joined
05:37 <thang1> On the other hand, Swift's String API is famously very difficult for beginners because it forces you to understand what you're doing
05:37 juanpaucar joined
05:38 osa1 joined
05:38 osa1 joined
05:38 <thang1> But, it's not difficult because you have to do a bunch of seemingly arbritrary conversions
05:38 <nshepperd> the normal solution is to avoid doing anything with characters and mostly just pass strings through unchanged from a to b
05:38 <EvanR> the percieved difficulty of an API for a beginner, interesting
05:39 Kuros` joined
05:39 <thang1> EvanR: I do find that sort of thing interesting, actually. It's one of the things that I really find fascinating as someone who likes to design/think-about learning materials and the most optimal designs/defaults for things
05:39 <EvanR> if its easy for a beginner to succeed with it, i want that api too please
05:39 <EvanR> but thats a big if
05:40 <EvanR> if you can easily create a acceptable trainwreck...
05:40 Sh4rPEYE joined
05:40 <EvanR> probably doing the world a disservice
05:40 joco42 joined
05:41 skrnnm joined
05:43 <thang1> It's pretty difficult to design something that is very convenient, consistent with intuitions, yet also allows/enforces a high level of correctness.
05:43 <EvanR> can i get some clarification on atomically inside of unsafePerformIO. the docs say "its impossible. and any attempt to do so will cause a runtime error"
05:44 <mjora7> Hi, so is there a better way to accomplish this? https://gist.github.com/aryaforghani/63492a9ac248aa24a576f8a136278a6b#file-main-hs
05:44 <thang1> I think excellent error messages, sane choice of defaults, consistent library design, are all incredibly important
05:44 <nshepperd> the difference between being easy for beginners, and being easy for beginners to do the right thing
05:44 primal joined
05:44 <EvanR> yet this is not happening for me, it does something (seems to be right), and no error is throw
05:44 <mjora7> Seems pretty complicated to just convert and integer to lazy text that can be given to the html function
05:45 <EvanR> (html . L.fromStrict . T.pack . show . getAge) birthYear ;)
05:45 <thang1> nshepperd: right. And I think the situation now where beginners end up getting frustrated and blindingly throw conversions at the wall until it works is unhelpful and even harmful. It doesn't encourage doing the right thing, it encourages the notion that you do "weird crap to strings to make the program compile" rather than understand the underlying reasons for why things are how they are.
05:46 <EvanR> (html . L.fromStrict . T.pack . show . getAge) <$> param "birthYear"
05:46 <thang1> It also doesn't help that libraries themselves don't always consistently use the "right string-type" for things
05:47 saussure joined
05:47 <nshepperd> i'm never sure what is the right canonical function for doing UTF-8 encoding/decoding between Text and ByteString
05:47 <EvanR> javascript has one string type and one number type, which of these is the one thats problematic
05:47 <thang1> I like this article/essay on Swift's string API: https://www.mikeash.com/pyblog/friday-qa-2015-11-06-why-is-swifts-string-api-so-hard.html
05:47 <EvanR> you get NaN guesses
05:48 <EvanR> this is the first im hearing about Swift having a "hard" string type
05:48 <EvanR> i want the blog post explaining why its considered hard
05:49 <mjora7> EvanR: Ok haha. So it's just inherently ugly. Am I doing those imports property? Any way to accomplish it with a single import?
05:49 <mjora7> EvanR: The Data.Text ones in particular.
05:49 <thang1> EvanR: it explains the API is "hard" in the first paragraph
05:50 <EvanR> mjora7: for common sequences of conversions like above, you can factor out pieces of the . chain... like L.fromStrict . T.pack . show
05:50 <EvanR> and reuse it
05:50 <thang1> The tl;dr is that Swift's string API doesn't assume much. If you work with string in C++ it's just "hurr durr I'm an array of bytes; hopefully you can figure it out from there"
05:50 <EvanR> thang1: it says "its hard" but i dont get why
05:51 <thang1> But swift's api enforces dealing with unicode correctly
05:51 andyhuzhill joined
05:51 mivael_ joined
05:52 <thang1> and you can't just pretend unicode is an array of bytes and just slice around arbritrary array positions and manipulate them willy nilly. The practice of array[index] being magically sized for you depending on your data type breaks horrifically with unicode due to differing widths and swift's string type enforces that knowledge
05:52 saurabhn_ joined
05:53 <EvanR> reading the last section which explains swift, it seems horrible
05:53 <EvanR> as far as strings go
05:53 <nshepperd> EvanR: maybe the atomically thing was changed in recent ghc?
05:53 <thang1> The flag unicode symbol, to quote from the article, is represented as two code points in unicode: You pick from 26 regional indicator symbols and smash them together to get your symbol. Two code points, four UTF-16 code units, eight UTF-8 bytes for one symbol
05:53 <EvanR> its exposing literally all details
05:54 primal_ joined
05:54 <thang1> If you just convert that into an array of whatever, it's going to break any code that tries to manipulate that array "dumbly" on a generic string of unicode
05:54 <nshepperd> instead of throw an error on unsafePerformIO it's telling me "Control.Concurrent.STM.atomically was nested" when I try using atomically inside unsafePerformIO inside atomically
05:54 <EvanR> the default is to treat text as a sequence of grapheme clusters o_O
05:54 <EvanR> nshepperd: right i get that too, nesting STM is invalid. but simply having atomically inside an unsafePerformIO
05:55 <EvanR> is what i thought the doc is talking about
05:55 <thang1> Eh, honestly, I feel that's the right choice. Unicode /is/ a sequence of grapheme clusters
05:55 <EvanR> o_O
05:55 <cocreature> angerman: I’m now considering calling g++ in Setup.hs to compile an executable and run it. Good luck, cross compiling that :P
05:55 <EvanR> unicode data is a sequence of code points
05:55 systadmin joined
05:56 <angerman> cocreature: I think we agreed that llvm-hs is not really a cross compilation target :)
05:56 <angerman> cocreature: however sad that might be.
05:56 <thang1> Right, but that's an implementation detail. It's like saying "arrays of characters are ones and zeros", well sure... but that's not really the point of characters now is it
05:56 <mjora7> EvanR: In that code I pasted... How can I stuff a console log in one of those routes? I'm not exactly sure where to put it. I don't get how "blocks" work in Haskell in that context.
05:56 <angerman> cocreature: in principle though, if we compile the Setup.hs on the build system, and use that for the setup, it might work.
05:57 takle joined
05:57 <EvanR> thang1: ... you look at the unicode specs... it will give you picture after picture of arrays of "unicode characters"
05:57 <angerman> cocreature: if however the Setup, would need to pass --target or --host flags down to subprocess it calls, this would compilicate things tremendously.
05:57 <thang1> Unicode is made up out of grapheme clusters. These grapheme clusters are created by code points but you wouldn't ever manipulate code points or do things with code points or think about code points just like you talk about Char::'a' not a string of 1s and 0s
05:57 <cocreature> I think that won’t be necessary here
05:57 <EvanR> you can transform them in different ways
05:58 <angerman> cocreature: maybe you can get away with autotools and configure? In that case you'd get the --target/--host/--build magic (prefixed tools) for free. You *would* have to deal with autotools though :D
05:58 <EvanR> and can also do normalizations, but thats not the one true object
05:58 <cocreature> angerman: I’m willing to go quite far to avoid autotools :)
05:58 <cocreature> angerman: Setup.hs might be horrible but at least I can write haskell code
05:58 <angerman> cocreature: if only there was an alternative.
05:58 ErinvanderVeen joined
05:58 <EvanR> thang1: thats just wrong
05:59 <nshepperd> what about things that aren't grapheme clusters?
05:59 Durbley joined
05:59 <EvanR> contrary, you would only be dealing with grapheme clusters if you were making a unicode text processing application
05:59 <nshepperd> like WORD JOINER or an RTL indicator?
05:59 Swizec joined
06:00 MarcelineVQ joined
06:01 <cocreature> angerman: I’ve seen a surprising number of opensource projects migrate from autotools to meson recently but I haven’t checked whether that’s actually an improvement
06:01 xtreak joined
06:01 eklavya joined
06:02 danvet_ joined
06:02 <thang1> my bad, I thought grapheme clusters were defined differently
06:03 dni joined
06:03 <angerman> cocreature: so cmake with python
06:04 primal joined
06:04 <thang1> ughh, unicode y u do dis ಠ_ಠ
06:05 saussure joined
06:06 jerbome joined
06:08 baldrick1 joined
06:08 pera joined
06:09 <nshepperd> EvanR: seems like a bug. either in the docs or in ghc
06:09 <nshepperd> the behaviour is the same in 7.10, at least
06:09 hurkan joined
06:10 primal_ joined
06:11 a3f_ joined
06:12 aphorisme joined
06:12 <thang1> https://stackoverflow.com/questions/43618487/why-are-emoji-characters-like-treated-so-strangely-in-swift-strings How tf are you even supposed to handle this sorta thing
06:13 BlueRavenGT joined
06:14 lambdaXtom joined
06:15 primal joined
06:15 <nshepperd> thang1: good lord
06:17 <nshepperd> do the unicode people really have nothing better to do then add frivolous emoji stuff to the standard to make life difficult
06:17 <thang1> Right? What a messed up piece of garbage. Now, to be fair, this is a Unicode 9.0 emoji being handled in a string library that doesn't support unicode 9.0, so it's doing what it can
06:18 takle joined
06:18 <thang1> nshepperd: to be fair, being able to combine multiple things together in an extended format is essential for a lot of complex languages such as chinese. The fact that unicode is also being used for emoji is beside the point
06:20 <EvanR> nshepperd: well at least theres a second opinion on the incongruity, yes im still on 7.10
06:20 Come2die joined
06:20 <wedens> is there some minimal library I can use for string interpolation with Text?
06:20 Mortomes|Work joined
06:20 <thang1> EvanR: why are you on 7.10 still? If you don't mind me asking
06:21 quchen joined
06:21 <EvanR> im scared of reinstalling my whole OS to upgrade
06:21 <EvanR> its been so long i dont really understand how ghc is installed on osx
06:21 <thang1> \> 2017
06:21 <thang1> \> not using stack
06:21 <thang1> do you even haskell, bro? /s
06:21 <EvanR> \> ?
06:22 <thang1> escaping meme text so lambdabot won't try to run it
06:22 <EvanR> no ive never used stack, but ive seen plenty of people have trouble with it
06:22 plutoniix joined
06:23 guiben joined
06:23 saussure joined
06:23 <thang1> Really? I had a tiny bit of trouble with it at first but it was way easier than cabal for me and I never had such a seamless experience with cabal as I did with stack. Although the last time I seriously used cabal was back when "cabal hell" was a common oath you swore at your teddy bear with
06:24 plutoniix joined
06:24 primal_ joined
06:25 <quchen> You’d rather upgrade your OS than to try X?
06:25 <quchen> You’re very brave.
06:25 <EvanR> would rather not
06:25 eacameron joined
06:26 plutoniix joined
06:26 fakenerd joined
06:27 <thang1> EvanR: still, you can use stack without messing up your system ghc installation. Maybe give it a shot and see how you like it?
06:27 <EvanR> hmm.
06:27 <EvanR> maybe some day
06:27 <EvanR> right now my ghc is working fine
06:28 <thang1> It'll take about 5 minutes, just so you know :p
06:28 <EvanR> i doubt it
06:29 <thang1> Well it depends on your download speed but it literally does take me <5 minutes to nuke stack, wipe everything, reinstall stack, and redownload ghc + 7-10 packages for text editor and compile/build everything
06:29 <EvanR> o_O
06:29 <lambdaXtom> Not using stack's like not using a VCS... Not the best of choices you ever made
06:29 <thang1> (by everything I mean the packages like "hlint", etc., not my entire codebase)
06:29 takuan joined
06:29 jhrcek joined
06:30 <EvanR> compiling and building the dependency universe will not take 5 minutes on this macbook air
06:30 <EvanR> and when i have no reason to do it
06:30 Coldblackice joined
06:30 <thang1> You download a ghc binary, you don't have to build ghc. Unless you were referring to a different dependency universe?
06:30 <EvanR> im past the point of getting enjoyment out of reconfiguring my computer
06:30 <EvanR> all the libraries i need
06:31 <EvanR> or that are needed by those libraries
06:31 <nshepperd> what about all the cool ghc 8.0 features
06:31 <EvanR> i dont need them yet
06:31 saurabhnanda joined
06:31 henriksod joined
06:32 <EvanR> Often they simply give up on important questions like "what exactly is a character?" <-- in and out of unicode context... i still dont really know what a character is
06:32 <EvanR> in that blog post
06:32 saussure joined
06:33 <EvanR> theres probably a categorical explanation that avoids answer that
06:33 <EvanR> answering
06:33 <nshepperd> if you want to know what a character really is, you must first learn every language in the world
06:33 <EvanR> well i read through the unicode sections on all the scripts
06:34 <EvanR> still no mathematical definition of a character
06:34 <thang1> https://github.com/Kopachris/pybrainfuck -- amazing
06:34 primal joined
06:35 <EvanR> also why is voynich manuscript not in unicode
06:35 <thang1> brainfuck interpreted by python interpreted by c. Even extensible :p
06:35 caumeslasal joined
06:36 <thang1> EvanR: probably because the unicode committee is corrupt and bought out by Big Emoji
06:36 oaao joined
06:36 bennofs joined
06:37 <EvanR> python brainfuck are totally off topic, C is mostly off topic
06:37 <EvanR> mainly i hate brainfuck
06:37 Bassetts joined
06:38 <quchen> Hate untyped lambda calculus! It’s much closer to Haskell.
06:39 takle joined
06:39 Itkovian joined
06:39 <EvanR> ok i will
06:40 <EvanR> esolangs never seem to have a type system... i think we need to change that
06:41 yoneda joined
06:41 <thang1> Introducing: Typed Brainfuck calculus
06:41 rickygee joined
06:42 <quchen> EvanR: Quite the contrary! Writing everything in Haskell’s type system is an esolang, and it has types.
06:42 juanpaucar joined
06:42 <thang1> This is an interesting article about unicode: https://unspecified.wordpress.com/2012/04/19/the-importance-of-language-level-abstract-unicode-strings/
06:43 andyhuzhill joined
06:43 Koterpillar joined
06:43 darjeeli1 joined
06:44 <EvanR> right... i just looked at apple docs "NSString is conceptually a sequence of UTF-16 units"
06:44 <Maxdamantus> > In a language that properly abstracts over Unicode strings, the above string should have a length of 9. Programmers should only be exposed to encoding details when they explicitly ask for it.
06:44 <lambdabot> <hint>:1:59: error: parse error on input ‘,’
06:44 primal_ joined
06:44 <Maxdamantus> err .. that seems contradictory to me.
06:45 <EvanR> "but the underlying storage shouldnt be a concern"... so it has an implementation detail as its abstract model
06:45 <Maxdamantus> Programmers should only be exposed to encoding details when they ask for it .. that's why the language interpreted the string and gave the arbitrary answer "9"
06:45 <thang1> How is 9 an arbritrary answer?
06:46 <EvanR> > length "Hello, 世界"
06:46 <lambdabot> 9
06:46 <thang1> there are 9 symbols in the string
06:46 <EvanR> k
06:46 <Maxdamantus> Is it based on codepoints, or characters?
06:46 <EvanR> there are 9 characters
06:46 <EvanR> not symbols
06:46 <Maxdamantus> > length "á"
06:46 <lambdabot> 2
06:46 <halogenandtoast> Is there a way to make stack generate a Dockerfile?
06:46 <thang1> > length 'a'
06:46 <lambdabot> error:
06:46 <lambdabot> • Couldn't match expected type ‘[a0]’ with actual type ‘Char’
06:46 <lambdabot> • In the first argument of ‘length’, namely ‘'a'’
06:46 <EvanR> > length "á"
06:46 <lambdabot> 1
06:46 <EvanR> heh
06:47 <thang1> > length "a"
06:47 <lambdabot> 1
06:47 <Maxdamantus> Unfortunately Haskell does it incorrectly too, where it applies an unjustified importance to codepoints.
06:47 <thang1> Maxdamantus: how'd you get 2 for yours?
06:47 <EvanR> its characters
06:47 <EvanR> youre talking about grapheme clusters
06:47 <thang1> Oh you have a invisible space?
06:47 <Maxdamantus> The point of Go's strings is that it more-or-less avoids giving pointless things importance.
06:47 sternmull joined
06:47 <thang1> > length "𐒁̸"
06:48 <EvanR> the central thing unicode gives you is characters
06:48 <lambdabot> 2
06:48 <Maxdamantus> Java/JavaScript/Qt make an even more arbitrary thing seem important: UTF-16 code units
06:48 <halogenandtoast> Are we still talking about Strings?
06:48 <Maxdamantus> thang1: there's no invisible space.
06:48 <thang1> Haskell does it acceptably. 𐒁̸ is made up of "Osmanya letter" + "combining long solidus overlay"
06:48 <EvanR> thang1: its two characters, non precomposed a with a combining mark
06:48 <Maxdamantus> thang1: the string I wrote consists of the codepoints U+61 and U+301
06:49 CacoS joined
06:49 <thang1> ah, got it. I meant combining mark, I just expressed myself inaccurately by saying invisible space
06:49 CacoS joined
06:49 <EvanR> giving grapheme clusters importance would be mixing application level stuff in and make it a pain in the ass to work with the data
06:50 CacoS joined
06:50 <Maxdamantus> Generally, you shouldn't have to be concerned about code points or code units or grapheme clusters or any of that, unless you're writing or interacting with some sort of font renderer or text layout engine.
06:50 saussure joined
06:50 <EvanR> it would be like putting colors in the string
06:50 dni joined
06:51 <EvanR> Maxdamantus: twitter would disagree
06:51 aphorisme joined
06:51 <EvanR> 140 characters
06:51 <thang1> Also apparently unicode allows arbritrary length combining character sequences...
06:51 <Maxdamantus> Yeah, and I don't know how it counts the characters.
06:51 <thang1> So counting by CCS would allow for tons of exploits where counting by code points is "sane" (twitter counts by code point; same as Haskell)
06:52 <Maxdamantus> I wouldn't argue what I said absolutely.
06:52 <Maxdamantus> That's why I said "generally".
06:52 <EvanR> thang1: correct https://twitter.com/crashtxt
06:52 <thang1> code point is the "character" 𐒁̸ is two code points because it's a character + cross-mark character overlay
06:52 <EvanR> Maxdamantus: the same as most languages with unicode support, by characters
06:52 <EvanR> swift is this odd ball exception apparently
06:53 <hanna> How can I avoid having to duplicate my `build-depends` in between my executable and my test suite?
06:53 andyhuzhill joined
06:53 mohsen_ joined
06:53 <thang1> I was a fan of 𐒁̸ being length 1 but I think I' coming around to the idea of it being length 2. The arguments are fairly compelling in this regard; mainly that arbritrary length CCS is allowed by unicode and that people intuitively usually type the character + / to get 𐒁̸ anyway so they're used to thinking of it as two "characters"
06:53 <Maxdamantus> EvanR: so is that a non-combining code point followed by a sequence of combining code points?
06:54 <thang1> 汉 however this should be 1 character, which it is with counting by code points
06:54 <EvanR> Maxdamantus: it really is the fundamental count in unicode, were not better off vaguifying the text data to have no decernable features, removing meaning from words we already have and leaving it on the floor a steaming pile
06:54 <EvanR> Maxdamantus: that?
06:54 <Maxdamantus> If so, that means you can write arbitrarily large characters/Twitter messages
06:55 primal joined
06:55 <thang1> Maxdamantus: twitter will rack up character count if you write arbritrairly large CCS sequences
06:55 <EvanR> hundred forty characters, as in the most basic array of utf32 units
06:55 <Maxdamantus> > length "á́́́́́́́́́́́"
06:55 <lambdabot> 13
06:55 <EvanR> you cant go over
06:55 <thang1> because you're using multiple code points in that CCS sequence
06:55 <Maxdamantus> > length "á́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́"
06:55 <lambdabot> 63
06:56 <nshepperd> you can't write arbitrarily long twitter messages precisely because it counts "characters" instead of grapheme clusters
06:56 <halogenandtoast> what have you done?
06:56 zcourts_ joined
06:56 <Maxdamantus> So characters as in code points?
06:56 <EvanR> when i hear code point i think of a number
06:57 <Maxdamantus> "character" has lots of contradictory meanings in this context, need something concrete.
06:57 <EvanR> U+1234
06:57 <Maxdamantus> Well, "code point" is a technical term used in the context of unicode.
06:57 <halogenandtoast> http://i.imgur.com/Una0ZoH.png
06:57 Kreest__ joined
06:57 <EvanR> yeah its a number
06:57 <nshepperd> well, I haven't read the unicode spec but it sounds like it defines "character" as something like a code point, yes
06:57 mjora7 joined
06:57 <thang1> Code point is the technical term that most closely represents what people intuitively think of as a "character"
06:57 tomphp joined
06:57 <Maxdamantus> thang1: but it really doesn't, as I've already demonstrated.
06:57 <hanna> I wonder to what degree information you can squeeze into a tweet depends on the language; since it seems like languages with higher (non-ASCII) codepoints are at a disadvantage
06:57 <hanna> CJK most notably
06:57 dan_f joined
06:58 <Maxdamantus> thang1: noone would call "á" two "characters"
06:58 <EvanR> theres a code point for each unicode character
06:58 <thang1> 汉 == 1 character. 𐒁̸ = 2 character (𐒁 + ◌̸)
06:58 <hanna> But CJK also conveys more information per coded character
06:58 ertes-w joined
06:58 <EvanR> Maxdamantus: its two characters, a and a combining character
06:58 <nshepperd> but anyway, if you want to count grapheme clusters, you can do that
06:58 <EvanR> people do call it a grapheme cluster
06:58 <nshepperd> type GraphemeCluster = Text
06:58 <Maxdamantus> EvanR: this is a completely nonsensical meaning of "character"
06:59 <nshepperd> segment :: Text -> [GraphemeCluster] -- now everyone is happy
06:59 <Maxdamantus> EvanR: you should be saying "code point", because the fact that there are two things there is a representational matter.
06:59 jleon joined
06:59 <EvanR> Maxdamantus: unicode's use of the word character is nonsensical
06:59 <EvanR> right
06:59 <Maxdamantus> EvanR: if you applied two out of the four unicode normalisations to that particular string you'd end up with a single code point.
06:59 <EvanR> list of Text, now you have a unicode processing app, which you probably didnt want
06:59 takle joined
07:00 <EvanR> Maxdamantus: which you wouldnt do in most cases
07:00 <hanna> to me a character is defined by an arbitrarily long sequence of codepoints (and a codepoint may consist of multiple bytes to begin with)
07:00 <Maxdamantus> Note though that that's only because there is a code point dedicated to that cluster.
07:00 saussure joined
07:00 <EvanR> right so why
07:00 <EvanR> hanna: it is not defined that way in unicode
07:00 twomix joined
07:00 <thang1> > length "á́́́"
07:00 <EvanR> and a codepoint does not consist of any number of bytes, its an integer
07:00 <lambdabot> 5
07:00 <thang1> Weird... I copied your 63 length thing and ended up with 5 :p
07:01 <thang1> > head "á́́́"
07:01 <lambdabot> 'a'
07:01 <thang1> > tail "á́́́"
07:01 <EvanR> i selection and copying behavior will differ among unicode programs
07:01 <lambdabot> "\769\769\769\769"
07:01 <EvanR> i copied 77 characters out of there with iterm
07:01 <pharaun> > length "á́"
07:01 <lambdabot> 2
07:01 <hanna> To me á́ is a single character consisting of 5 codepoints, and any number of implementation-specific bytes
07:01 <thang1> I used tmux ¯\_(ツ)_/¯
07:01 lonokhov joined
07:01 <EvanR> hanna: its a grapheme cluster
07:01 <pharaun> tmux+irssi+urxvt here -> 2
07:02 rickygee joined
07:02 <thang1> > length á́
07:02 <lambdabot> <hint>:1:9: error: lexical error at character '\769'
07:02 <thang1> whoops
07:02 <thang1> > length "á́" -- brain fart
07:02 <lambdabot> 2
07:02 <EvanR> ask lambdabot enough times it becomes true
07:02 <thang1> hanna: here's where unicode is going to mess with you
07:03 <thang1> This particular one is length 2 because it's a + combining-'
07:03 <thang1> > length "á"
07:03 <EvanR> the way its displayed has not much to do with the abstract unicode string data
07:03 <lambdabot> 1
07:03 <EvanR> theres many ways to display it
07:04 <EvanR> you dont even need combining characters to get to this point, see ligatures
07:04 <thang1> this one is 1 because I literally typed out the pure á into the terminal and so there's no combining character. á and your á are different "characters" in unicode and so have different amounts of code points
07:04 <hanna> You may say that, but if something displays a´ instead of á I'm filing a bug report
07:04 jleon joined
07:04 <hanna> “Unicode spec doesn't define how to display it!” is not an excuse
07:04 <EvanR> hanna: sure, thats how thailand used to feel
07:04 <pharaun> > "á" == "á"
07:04 <lambdabot> True
07:05 <EvanR> hanna: it does define how to display it, but says "you dont have to support literally everything"
07:05 juanpaucar joined
07:05 <thang1> To me, this is where unicode really sucks, that á and "a + accent-overlay" are completely different really feels leaky and arbritrary
07:05 <Maxdamantus> Even the unicode glossary gives 4 possible meanings of "character"
07:05 <hanna> I don't think they needed to write that into the spec for it to be true
07:05 primal_ joined
07:05 <pharaun> thang1: isn't some of that historical (re han unification)
07:05 <hanna> They might as well have standardized that it's impossible to support literally everything
07:05 <EvanR> Maxdamantus: right, its not strictly defined. in programming though, its pretty common to be talking about the elements of the string type
07:05 <EvanR> of a particular string
07:06 <EvanR> > "á́" !! 0
07:06 <lambdabot> '\225'
07:06 koserge joined
07:06 <EvanR> > "á́" !! 1
07:06 <thang1> pharaun: some of it is historical. See µ the greek letter vs µ the SI micro symbol
07:06 <lambdabot> '\769'
07:06 <thang1> Some of it is cultural (eg the Han unification).
07:06 <Maxdamantus> Well, in Haskell I'd call those Chars
07:06 <Maxdamantus> and in Java and C I'd call them chars
07:06 <EvanR> i also call them characters
07:06 <pharaun> thang1: oh
07:07 Yuras joined
07:07 <EvanR> one of them is literally "combining character"
07:07 <EvanR> let the controversy continue!
07:07 <thang1> Also, many japanese encodings reject the Han unification and consider the "equivalent" symbols to be different. Thus, any application which wants to be sensitive towards japanese users has to allow for a way to expose the encoding and break the abstraction so that you can use the japanese way for things
07:07 <thang1> Which is why Ruby (a heavily used language in Japan) does things that way
07:07 Wizek_ joined
07:07 Swizec joined
07:08 <halogenandtoast> Ruby isn't used that heavily in Japan, it did originate here though!
07:08 <thang1> If unicode would just suck it up and encode asian text the way asians wanted it encoded, we wouldn't have this problem. The whole thing reeks of "white people knowing better" syndrome
07:08 <EvanR> arm chair reengineering of all unicode
07:08 <EvanR> you know what we need, a commitee!
07:08 <halogenandtoast> thang1: s/white people/monolingual people/
07:08 <quchen> Yes! Let’s put politics into this, that’s always a good idea.
07:09 <Lokathor> @pl \first second -> concat $ map (\(a,b) -> [a,b]) $ zip first second
07:09 <lambdabot> (join .) . zipWith ((. return) . (:))
07:09 <thang1> halogenandtoast: I suppose it would be more accurate to say that ruby's originating in japan is the reason its unicode representation is so "japanese friendly", thanks
07:09 saussure joined
07:09 <EvanR> ruby's unicode representation is non existent
07:09 <halogenandtoast> thang1: No problem. I'm an every day Rubyist working here in Tokyo.
07:09 <halogenandtoast> Wishing I was doing Haskell
07:09 <EvanR> its a byte string + encoding tag
07:09 <EvanR> and the encoding tag is often wrong and you need to force fix it
07:10 <thang1> And it's that way because of cultural reasons, because of how Japanese culturally resents the entire Han unification nonsense
07:10 <EvanR> its like that in many dynamic languages because "string = char array = byte array"
07:10 <halogenandtoast> On that note, if anyone ever runs across any good Haskell opportunities here in Tokyo, feel free to let me know.
07:10 <* hackage> random-bytestring 0.1.0 - Efficient generation of random bytestrings https://hackage.haskell.org/package/random-bytestring-0.1.0 (larsk)
07:10 <thang1> (well, I'm pretty sure the Chinese culture isn't super big on it either but I haven't talked to any chinese programmers)
07:10 <halogenandtoast> lol @ hackage
07:10 <halogenandtoast> perfect timing
07:11 <thang1> haha, nice
07:11 <thang1> 3 line readme, no documentation, flawless library
07:11 <* hackage> ridley 0.3.1.1 - Quick metrics to grow you app strong. https://hackage.haskell.org/package/ridley-0.3.1.1 (AlfredoDiNapoli)
07:11 <nshepperd> whether two related characters are "the same" seems like a question with no easy answer imo
07:11 <thang1> "make you app grow strong for great good"
07:12 <halogenandtoast> thang1: If there is one thing I've learned about the Haskell community it's that documentation is not a forte.
07:12 <nshepperd> lotta languages have inherited alphabets from each other
07:12 <EvanR> russian A and latin A, totally different
07:12 <thang1> nshepperd: that's why we have normalization strategies!
07:12 <EvanR> im western, i know
07:12 <halogenandtoast> Either your a Haskell genius and can infer everything from the types
07:12 <halogenandtoast> or you don't use the library
07:12 <halogenandtoast> *you're
07:12 <nshepperd> and by the way, if you have identical looking characters that are considered to be different you get lovely security bugs too :D
07:13 <EvanR> yeah
07:13 <halogenandtoast> nshepperd: like I and l in a lot fonts.
07:13 <quchen> nshepperd: Doesn’t the OSX file system do something like that?
07:13 <EvanR> i dont envy unicode engineers and the security issues it could introduce
07:13 <nshepperd> halogenandtoast: yup. *shudder*
07:13 mstruebing joined
07:13 <thang1> Oh OSX is worse
07:13 <EvanR> halogenandtoast: I1l|
07:13 <* hackage> ridley-extras 0.1.0.0 - Handy metrics that doesn't belong to ridley. https://hackage.haskell.org/package/ridley-extras-0.1.0.0 (AlfredoDiNapoli)
07:13 <halogenandtoast> nshepperd: granted, that could be considered a font problem
07:13 <thang1> OSX's file system... oh god
07:14 <thang1> OSX is occasionally case sensitive, occasionally case insensitive, depending on where the file/folder is
07:14 <halogenandtoast> Or more specifically a font face problem.
07:14 <thang1> It also internally uses its own type of unicode representation that is neither unicode-8 or any other unicode and it forcibly converts all text into that unicode representation
07:14 <cocreature> quchen: hey, have you thought about adding some support for specifying precedences and getting automatic parentheses to prettyprinter? it seems like I can’t be the only one who wants that in combination with pretty printing
07:14 <nshepperd> halogenandtoast: programming fonts often add prominent serifs to make the differences evident
07:15 eyen joined
07:15 <Maxdamantus> > let lеt = lеt in let lеt = lеt in lеt
07:15 paolino joined
07:15 primal joined
07:15 <lambdabot> mueval-core: Time limit exceeded
07:15 <pharaun> gah osx
07:15 <EvanR> AАΑ𝖠Ꭺᗅ
07:15 <quchen> cocreature: For that to work every value would have to carry its precedence
07:15 <hanna> Following the advice of Cabal (which says to split your executable between a library component and a program component so you can have your tests depend on the library as well), I gave it a shot, using https://github.com/vimus/vimus/blob/master/vimus.cabal as an example
07:15 ventonegro joined
07:15 <halogenandtoast> nshepperd: indeed.
07:15 <hanna> But I'm running into the issue where the `executable` fails to build unless I copy/paste the entire `build-depends` list to it as well
07:15 <hanna> What is going wrong?
07:16 <Maxdamantus> > let lеt = lеt in let whеre where whеre = whеre
07:16 <lambdabot> <hint>:1:28: error: parse error on input ‘where’
07:16 vlatkoB_ joined
07:16 Hafydd joined
07:16 <thang1> obligatory Linus rant on HFS+: https://plus.google.com/+JunioCHamano/posts/1Bpaj3e3Rru
07:16 <Maxdamantus> Eh, nvm
07:16 <quchen> cocreature: But yes, I would like to have that as well! :-)
07:16 <cocreature> quchen: couldn’t you have separate type that carries precedences and manages parentheses and then some sort of embed function that allows you to use that inside of Doc
07:16 <thang1> Gold quote: "people who think unicode equivalency comparisons are a good idea in a filesystem shouldn't be allowed to play in that space. Give them some paste, and let them sit in a corner eating it."
07:17 <EvanR> no more linus quotes in here plz
07:17 <EvanR> i heard he doesnt use haskell
07:17 <thang1> You have any idea how hard it was for me to find one that was PG? c'mon, let me have it this once
07:19 freusque joined
07:19 ragepandemic joined
07:20 <Athas> hanna: you need to add dependencies for all the libraries that you are using directly in the .hs file for the executable.
07:20 <thang1> Apple uses some form of UCS2 encoding and then picks NFD normalization and forces it on all of the data on the file system. ಠ_ಠ
07:20 takle joined
07:20 <Maxdamantus> It's not UCS2 .. it's UTF-16
07:21 <quchen> cocreature: »inside of Doc« means using it as an annotation
07:21 <hanna> Athas: my Main.hs only has “import MyLibrary”
07:21 <hanna> (and a few things from base)
07:21 <quchen> cocreature: But maybe there are a couple of convenience functions that could be used to make things very easy to use
07:21 <EvanR> at this point youd think UTF-16 was = unicode, all these frameworks and languages treat text UTF-16 unit array
07:22 <EvanR> including haskell!
07:22 <thang1> I think UCS2 is almost identical to UTF-16...
07:22 <EvanR> (but its not advertised as much)
07:22 <cocreature> quchen: I’ll play around and see if I can come up with a nice API
07:22 rickygee joined
07:22 <Maxdamantus> Well, UCS2 doesn't say anything special about units like 0xd800
07:22 <thang1> EvanR: which is funny, because every time I think unicode I think Utf-8 because I see Utf-8 explicitly mentioned far more often than utf-16 (which is often called unicode)
07:22 <EvanR> thang1: no, which will propagate the confusion
07:22 <* hackage> ridley-extras 0.1.0.1, ridley 0.3.1.2 (AlfredoDiNapoli): https://qbin.io/tmmj2wo
07:23 verement joined
07:23 <thang1> Ahh okay got it, it is indeed UTF-16, but it is normlalized with NFD
07:24 <Maxdamantus> afaik NFD is something that can change across releases of unicode.
07:24 <EvanR> ucs-2 is an old character set which doesnt cover all of unicode
07:24 <EvanR> its from decades ago
07:24 <thang1> wait, wtf. It's normalized with a form "very nearly the same as NFD"
07:24 <hanna> Athas: hmm, seems like it only works if you put the library into a different subdirectory
07:24 <hanna> i.e. “src”
07:25 <thang1> EvanR: I know. I thought it had used UCS2 because HFS+ came out a long time ago
07:25 <hanna> that's slightly annoying
07:25 primal_ joined
07:25 <thang1> It's been around since OS8.1
07:25 <* hackage> servant 0.11, servant-client 0.11, servant-server 0.11 (phadej): https://qbin.io/nhw1xy64w
07:25 <Maxdamantus> So what happens if someone writes codepoints that are unknown by the OS' current version of unicode?
07:26 tromp joined
07:26 <wz1000> thang1: My favourite part about that rant is terry davis showing up.
07:26 <EvanR> gotta ask #macosx
07:26 <Maxdamantus> Does it reject that filename because it doesn't know which ones might be combining code points in the future that might be part of a sequence with an NFD form?
07:26 <EvanR> but this question does tie into, sort of the FilePath proposal
07:26 thunderrd joined
07:27 <* hackage> servant-docs 0.10.0.1, servant-foreign 0.10.1 (phadej): https://qbin.io/y92pucyo3
07:27 saussure joined
07:27 govg joined
07:28 eatman joined
07:28 <EvanR> abstract filepath proposal
07:29 <Maxdamantus> Anyway, I feel fairly strongly that these issues shouldn't be fundamentally embedded into something like an OS or filesystem.
07:29 CyberShadow joined
07:29 <Maxdamantus> Because any solution other than "just write bytes" is one that claims to correctly solve a really hard problem.
07:29 <Maxdamantus> and I'm pretty sure they never solve that really hard problem.
07:29 baldrick joined
07:30 <mjora7> Ok I just ran a super simple echo test with a Haskell server and a Node server and the Haskell one returns a response in 0.22 seconds and the express one in 0.60, three times as fast! Nice.
07:30 filterfish joined
07:30 bvad joined
07:31 thunderrd joined
07:31 <EvanR> mjora7: to answer your question from earlier, you can write a function debug :: Show a => a -> a, which can be inserted into any chain, and whatever goes through it can be printed to stderr. using Debug.Trace tools
07:31 <quchen> »Echo« is not a very practical benchmark.
07:31 <mjora7> quchen: Yeah not at all haha
07:31 <mjora7> EvanR: Thanks
07:32 jleon joined
07:33 zcourts joined
07:34 locallycompact joined
07:34 merijn joined
07:35 primal joined
07:35 <EvanR> Maxdamantus: ntfs, hfs engineering teams had zero chance of "not designing" something like the way it is now into the filesystem
07:35 <EvanR> because the hardest thing to do in corporate world is be like "problem solved, we just dont do anything"
07:35 <EvanR> they look at you like youre nuts
07:37 xtreak joined
07:37 <Maxdamantus> Well, I suspect they probably would if they could start everything from scratch.
07:37 connrs joined
07:37 <* hackage> schematic 0.1.1.0 - JSON-biased spec and validation tool https://hackage.haskell.org/package/schematic-0.1.1.0 (dredozubov)
07:37 <EvanR> sure
07:37 ccomb joined
07:37 jleon joined
07:37 <thang1> The real reason HFS+ is case insensitive is apparently microsoft officecompatibility :p
07:38 <* Maxdamantus> wonders how case insensitivity works in those filesystems too.
07:38 <EvanR> case insensitive, case preserving
07:38 <merijn> I once tried to run OSX on case sensitive HFS...terrible idea...
07:38 <Maxdamantus> Does it remember what locale a particular filesystem is in?
07:38 <merijn> OSX works fine, but all the major vendors (Blizzard, Adobe, etc.) break
07:38 <Maxdamantus> or does it just use the locale of the user that happens to be interacting with the filesystem at the time?
07:39 <EvanR> whats upper and whats lower isnt locale specific
07:39 <Maxdamantus> Sure it is .. what's the lower-case form of 'I'?
07:39 <EvanR> its in unicode
07:39 <EvanR> i
07:39 <ahihi> thang1: source for that? I thought it was just inherited from HFS
07:39 <merijn> EvanR: Wrong
07:39 <Maxdamantus> Are you sure it's not 'ı'?
07:39 <merijn> EvanR: Turkey it's undotted i
07:39 <EvanR> it doesnt change your case
07:40 <EvanR> its just considers them to be upper and lower case versions of each other
07:40 <merijn> We nearly had OSX with ZFS :(
07:40 <thang1> ahihi: admittedly my source is a user anecdote from hackernews. "I asked the people who designed the filesystem why they did this and they replied with microsoft office"
07:40 <Maxdamantus> So 'i' == 'I' and 'I' == 'ı'?
07:40 <EvanR> probably
07:40 <Maxdamantus> Does that mean 'ı' == 'i' due to transitivity?
07:40 <EvanR> probably not
07:41 <quchen> > toUpper 'ı' == toUpper 'i'
07:41 <lambdabot> True
07:41 takle joined
07:41 thunderrd_ joined
07:41 <EvanR> brilliant
07:41 <EvanR> case insensitivity will make it so easy to use the computer
07:41 joco42 joined
07:42 <Maxdamantus> 'ı' = 'I' = 'i' = 'İ'
07:42 <merijn> At least they specified an encoding...
07:42 <quchen> UTF-15!
07:42 <thang1> Also, ß.toUpper() = SS. SS.toLower() = ss. ss.toUpper() = SS
07:42 <merijn> Unlike the other *nix insanity of "it's all bytes, because no one wants non-ASCII!"
07:42 rickygee joined
07:43 <merijn> thang1: Which is why you should use Text.toUpper instead of toUpper ;)
07:43 <EvanR> i prefer just bytes
07:43 <EvanR> on disk
07:43 <thang1> I particularly enjoy *nix sanity with filesystems
07:43 ErinvanderVeen joined
07:43 <thang1> *nix has the philosophy of "whatever string of bytes you use to name this thing, I don't care baby, just do you; I ain't gonna touch it, that's your job, I'm just the kernel making sure you don't blow stuff up"
07:43 davr0s joined
07:43 <quchen> merijn: Let’s not discuss what upper-case »ß« should be or there will be blood ;-)
07:44 jleon joined
07:44 <EvanR> > toUpper 'ß'
07:44 <lambdabot> '\223'
07:44 primal_ joined
07:44 <thang1> merijn: my toUpper was pseudocode to get the point across :p
07:44 <EvanR> > text . (:[]) $ toUpper 'ß'
07:44 <lambdabot> ß
07:44 LeCamarade joined
07:45 <thang1> ಠ_ಠ
07:45 etehtsea joined
07:45 saussure joined
07:45 <Maxdamantus> > text . (:[]) $ toLower 'ẞ'
07:45 <lambdabot> ß
07:45 <EvanR> there will ße ßlood
07:45 acidjnk22 joined
07:45 <thang1> > toLower 'ß'
07:45 <lambdabot> '\223'
07:45 <halogenandtoast> merijn: isn't toUpper from Data.Text?
07:46 <EvanR> Data.Char
07:46 <thang1> What is "text . (:[])" doing, anyway?
07:46 <EvanR> > (:[]) 4
07:46 <lambdabot> [4]
07:46 <Maxdamantus> :t (:[])
07:46 <lambdabot> a -> [a]
07:46 <quchen> Robot monkey is pure for lists.
07:46 <thang1> > Text.toUpper 'ß'
07:46 <lambdabot> error:
07:46 <lambdabot> Not in scope: ‘Text.toUpper’
07:46 <lambdabot> No module named ‘Text’ is imported.
07:46 <EvanR> the globbler operator
07:46 <thang1> > T.toUpper 'ß'
07:46 <lambdabot> error:
07:46 <lambdabot> Not in scope: ‘T.toUpper’
07:46 <lambdabot> No module named ‘T’ is imported.
07:46 <thang1> I give up
07:46 torstein joined
07:47 <Maxdamantus> :t (.)
07:47 <lambdabot> (b -> c) -> (a -> b) -> a -> c
07:47 <thang1> EvanR: thanks, the point free was messing with my brain
07:47 nickolay_ joined
07:47 <thang1> I'm not highly evolved enough yet
07:47 <EvanR> :t (text .) `asAppliedTo` (:[])
07:47 <lambdabot> (Char -> String) -> Char -> Doc
07:48 <EvanR> er no
07:48 <EvanR> :t (text . (:[]))
07:48 <lambdabot> Char -> Doc
07:48 mohsen_ joined
07:48 <merijn> halogenandtoast: There's a toUpper from Data.Text and one from Data.Char
07:49 raichoo joined
07:49 <merijn> > Data.Text.toUpper . Data.Text.pack $ "ß"
07:49 <lambdabot> error:
07:49 <lambdabot> Not in scope: ‘Data.Text.toUpper’
07:49 <lambdabot> Perhaps you meant ‘Data.Char.toUpper’ (imported from Data.Char)
07:49 <merijn> @let import qualified Data.Text as T
07:49 <lambdabot> Defined.
07:49 <halogenandtoast> merijn: yes, the one from Data.Text would do the wrong thing
07:49 <merijn> > T.toUpper . T.pack $ "ß"
07:49 <lambdabot> "SS"
07:49 <EvanR> neat
07:49 dec0n joined
07:49 m0rphism joined
07:50 <merijn> halogenandtoast: It does the right thing for ligatures at least
07:50 <merijn> Unlike Data.Char.toUpper
07:50 <Maxdamantus> Why not "ẞ"?
07:50 <halogenandtoast> sure but I would assume toUpper and toLower to be, oh crap, what's the word...
07:50 <halogenandtoast> homoiconic?
07:50 <EvanR> inverses
07:50 <halogenandtoast> is that the term?
07:50 <EvanR> but theyre not
07:50 <EvanR> inverse functions
07:50 <halogenandtoast> nope not that word
07:50 <merijn> > Data.Char.toUpper 'ffl'
07:50 <lambdabot> '\64260'
07:51 <merijn> eh
07:51 <EvanR> thats what youre trying to say
07:51 <merijn> > text . pure $ Data.Char.toUpper 'ffl'
07:51 <lambdabot>
07:51 <thang1> opposites, EvanR?
07:51 <EvanR> inverse functions
07:51 <halogenandtoast> Yeah I guess inverses
07:51 bvad joined
07:51 <merijn> > T.toUpper . T.pack $ "ffl"
07:51 <Maxdamantus> Haskell needs a `setLocale` function that changes the behaviour of `toLower`
07:51 <lambdabot> "FFL"
07:51 <merijn> halogenandtoast: Definitely not in case of unicode
07:51 <merijn> halogenandtoast: toUpper and toLower cannot sanely be inverses
07:52 <EvanR> i.e. toUpper . toLower = id and toLower . toUpper = id, i.e. not
07:52 <halogenandtoast> And this is why we should get rid of all characters not in American English.
07:52 <merijn> Maxdamantus: I you want correctness for unicode, use text-icu
07:52 <halogenandtoast> ^^ I don't mean that of course
07:52 <thang1> Assimilate or be Exterminate
07:53 <merijn> I can't even write my name correctly as nickname here because of the stupid assumption of "all text is ascii"
07:53 <EvanR> plenty of characters in american english not in ascii
07:53 <Maxdamantus> merijn: yeah, I'm sure there are things that let you do something sensible, was just joking about making something that modifies the behaviour of a function.
07:53 <merijn> Computers in general have broken a lot of Dutch
07:54 <merijn> > length "Merijn" -- see, you can do it right if you want!
07:54 <lambdabot> 5
07:54 <merijn> actually, no
07:54 <merijn> still wrong
07:54 <EvanR> aaaa haha
07:54 <merijn> > length "ij" --hmm
07:54 <Maxdamantus> do{ setLocale "tr"; putStrLn $ map toUpper "i" }
07:54 thc202 joined
07:54 <lambdabot> 1
07:54 <merijn> wait, what
07:55 <merijn> > length ['M', 'e', 'r', 'ij', 'n']
07:55 <lambdabot> 5
07:55 primal joined
07:55 <merijn> Not sure whether that should be right or wrong, actually
07:55 <Itkovian> merijn http://www.fileformat.info/info/unicode/char/0133/index.htm ?
07:55 <thang1> looks right to me
07:56 <EvanR> merijn: ij is two letters, you want kerning to make them look like a ligature...
07:56 <EvanR> yet theres an ij character in unicode
07:56 <thang1> oh right, hmm. ¯\_(ツ)_/¯
07:56 <merijn> EvanR: eh, keep your American cultural imperialism to yourself please :p
07:56 <thang1> > length "¯\_(ツ)_/¯"
07:56 <lambdabot> <hint>:1:11: error:
07:56 <lambdabot> lexical error in string/character literal at character '_'
07:56 <merijn> ij is *sometimes* two letters
07:56 <quchen> merijn: length is correct there.
07:57 <EvanR> im western threfore im an authority on westernisms
07:57 <thang1> ಠ_ಠ
07:57 mattyw joined
07:57 <merijn> quchen: Yeah, I just had a moment of stupid where I forgot the length of my name due to being tired...
07:57 <quchen> Length doesn’t know about names or chars. It returns the number of elements of a list (foldbale).
07:57 <mbrock> I want to optimize the function "read :: IntMap Word8 -> (Int, Int) -> ByteString" which reads a byte range from an IntMap memory, defaulting nonexistent keys to 0... Maybe an IntMap.split followed by repeated applications of IntMap.minViewWithKey will do the trick...
07:58 <phadej> quchen: that same happens with Data.Text.length too
07:58 <merijn> EvanR: That's the kinda stupidity that leads to phones capitalising IJsselmeer as Ijsselmeer
07:58 _sars_ joined
07:58 <EvanR> you need Char -> Int for size of character!
07:58 <thang1> anyway now that I've successfully derailed #haskell for like 4 hours, I'm gonna head to bed because I /definitely/ got no homework done and need to be productive and wake up tomorrow
07:58 <phadej> quchen: though someone might argue it should return the grapheme count
07:58 <phadej> quchen: not codepoint
07:58 <Itkovian> merijn: depends on the crossword puzzle you are solving ...
07:58 <merijn> Itkovian: Yeah, you'd think there'd be a standards union for puzzle makers to finally decide one way or the other
07:59 <EvanR> phadej: should be a separate incantation, sum . map graphemeCount
07:59 <phadej> EvanR: yeah, but that's the debate; what should be the default, codepoint or grapheme count? :)
07:59 <merijn> In completely unrelated news...whooo, I got my stuff merged into criterion and it looks like it might actually be released and usable by the world at large soon-ish :)
07:59 <EvanR> phadej: character plz
07:59 <merijn> EvanR: Ambiguous
08:00 <phadej> EvanR: what is characater?
08:00 tommd joined
08:00 <quchen> merijn: What was that again? Your cleanup benchmark runners?
08:00 <EvanR> the element of the string
08:00 <phadej> character /= codepoint, character /= grapheme
08:00 <thang1> character is one, character is all
08:00 <thang1> look inside, become one with the character inside you
08:00 <merijn> quchen: cleanups and the ability to have per run/per batch environments
08:00 zzz joined
08:00 cpup joined
08:01 <phadej> merijn: thanks for fixing the build so quickly btw
08:01 <merijn> quchen: Also, I quickly snuck in an executable that can generate those fancy HTML reports from the JSON output so that you can actually generate reports afterwards
08:01 <merijn> phadej: I was supposed to wait for Travis, check for errors and then get it merged, but then Ryan merged it before my meeting finished and I had a look :p
08:02 <phadej> :)
08:02 <quchen> *Continuous* integration
08:02 takle joined
08:02 <quchen> Waiting for Travis is quantized integration.
08:02 <EvanR> needs more smooth integration
08:02 <merijn> Ideally I get around to extending the executable to do grouping/filtering/merging of JSON reports at some point in the future (as that's something I really need), but I think that'd take a while to implement
08:02 <merijn> Unless I can find a sucker to do it for me :p
08:03 <merijn> I should farm out my yak shaving to people in -beginners looking for projects...
08:03 rickygee joined
08:03 <EvanR> #haskell-yak-shavers
08:03 saussure joined
08:03 Koterpillar joined
08:04 <thang1> Find intern, hire intern for "real world experience", "resume building" and "unlimited snacks in coding room", have them write shitty and unmaintainable haskell code, bam profit
08:04 <phadej> continuous integration: continously waiting for travis to complete (5 pr's atm :()
08:05 <nshepperd> phadej: code point seems more reasonable since you can construct count of larger things by segmenting. graphemeClusters :: Text -> [Text]; cf. words and lines
08:05 <nshepperd> but i dunno, who even uses Text.length and for what anyway
08:05 <merijn> phadej: Solution: Have so many projects you can work on others while you wait for Travis to finish ;)
08:05 primal joined
08:05 <merijn> thang1: There isn't even funding to pay for me, let alone interns...
08:05 <EvanR> yes, the way it is is more fundamental and you can get grapheme clusters on top of that
08:05 <merijn> thang1: I suppose I could s/interns/students, but they don't know Haskell
08:05 <thang1> That's why you pay them in free snacks and resume building
08:06 <EvanR> nshepperd: but the ij thing would not have been caught by this, since its a single letter
08:06 <EvanR> no unicode thing i know of would return 2 for that
08:06 <nshepperd> and also all the normal unicode algorithms are defined as iteration over a sequence of code points, i assume?
08:06 <EvanR> yes
08:06 Puggy joined
08:06 <phadej> nshepperd: but codepoint count isn't stable under normalisation!
08:06 <merijn> EvanR: The problem is, that in, say US locale it should be treated as a ligature of 2 letters, but in a Dutch locale it should be treated as 1
08:07 <phadej> (disclaimer: I really play devil's advocate here, don't take me seriously on Unicode issues)
08:07 <EvanR> the complaints from earlier make it sound like they would also be ok with havin length return the number of words in a string
08:07 <EvanR> because you can
08:07 <phadej> merijn: in fact I do that already, I work on "work" and "oss" projects
08:07 <nshepperd> phadej: yeah but who cares
08:07 <EvanR> but no because thats yet more application specific functionality
08:07 <phadej> nshepperd: well, Finnish people (e.g. me) do
08:08 <nshepperd> you care that code point count changes under normalisation?
08:08 <merijn> phadej: Could be worse than Travis builds
08:08 <phadej> because we have those fancy characters, needing two codepoints
08:08 <phadej> /possibly/
08:08 psukys joined
08:08 <merijn> I have a library that's stuck on "finishing benchmarks so I can brag/compare", except some of these benchmarks take hours to run >.>
08:08 <nshepperd> if you're going to apply a normalisation function, don't you expect things to change, so where is the problem?
08:08 uglyfigurine joined
08:09 juanpaucar joined
08:09 etehtsea joined
08:09 <phadej> nshepperd: the problem is that I don't want to apply normalisation function just to check length
08:09 <EvanR> use a different kind of length...
08:09 shookees joined
08:10 <EvanR> thats like the case insensitive INI file question from yesterday (?)
08:10 <phadej> and e.g. none of used libraries in Haskell have a type for say: "NFC normalised UTF16"
08:10 indi_ joined
08:10 <nshepperd> I don't see why would applying a normalisation function ever help with checking length?
08:11 <nshepperd> if you want to count grapheme clusters, use the graphemeClusters function lol
08:11 ragepandemic joined
08:12 k0001 joined
08:12 marr joined
08:12 <nshepperd> talking about UTF-16 seems like a type error, also
08:12 <nshepperd> you shouldn't care about the physical representation
08:13 <phadej> yes and no, it has memory implications
08:13 <phadej> memory usage
08:13 <phadej> if i don't care about physical representation String = [Char] is good enough
08:13 shookees joined
08:13 saussure joined
08:13 <nshepperd> well, that is reasonable concern but seems orthogonal to the api design in general
08:14 <nshepperd> it's a sequence of code points regardless of how you store it
08:14 <phadej> One could store it as a sequence of graphemes too
08:16 <phadej> and IMHO grapheme is more natural abstraction that codepoint (which is implementation detail)
08:16 biglama joined
08:16 <nshepperd> but all the unicode algorithms and stuff are defined in terms of code points
08:17 <thang1> The biggest problem with grapheme is that it includes an arbritrary length amount of CCSes (combining code things) so you can make a 100 TB sized twitter post if you counted by grapheme (if I remember the definition of grapheme correctly)
08:17 <EvanR> the api would be drastically different if you were holding a sequene of graphemes
08:17 <EvanR> a sequence of grapheme clusters
08:18 toby1851 joined
08:18 <EvanR> when you request an element of the sequence you get... dun dun dun, a unicode string instead
08:18 <EvanR> of a chracter
08:18 <EvanR> which is what we started with and have
08:19 tobiasBora joined
08:19 <nshepperd> it can be viewed as a sequence of graphemes, sure, which is why you should have a 'graphemeClusters :: Text -> [Text]' function
08:19 <nshepperd> just like we have functions to segmenting into words and lines
08:20 <halogenandtoast> Does anyone have a good example of a Dockerfile for a stack application?
08:20 psukys joined
08:20 primal joined
08:22 prophile joined
08:22 JagaJaga joined
08:22 toby1851 joined
08:23 baldrick joined
08:23 takle joined
08:23 rickygee joined
08:24 mattyw joined
08:24 shangxiao joined
08:25 slomo joined
08:25 slomo joined
08:27 <nshepperd> EvanR: python does that, heh. it's strings all the way down
08:28 nullifidian joined
08:28 <nshepperd> 'a'[0][0][0][0] = 'a'
08:30 Levex joined
08:31 primal joined
08:32 <nshepperd_> I don't think code points are an implementation detail either
08:32 TheFuzzball joined
08:32 <wz1000> The way haskell does it is pretty unintuitive too
08:32 augur joined
08:32 <nshepperd_> Except for the silly surrogate pair "code points" which were a mistake and don't count :)
08:32 <wz1000> > mapM_ putStrLn $ subsequences "aé"
08:32 <lambdabot> <IO ()>
08:33 <* hackage> servant-cassava 0.9 - Servant CSV content-type for cassava https://hackage.haskell.org/package/servant-cassava-0.9 (phadej)
08:33 <wz1000> > subsequences "aé"
08:33 <lambdabot> ["","a","e","ae","\769","a\769","e\769","ae\769"]
08:34 <wz1000> Only 4 of those are what I'd consider to be valid subsequences
08:34 eklavya joined
08:35 <wz1000> Also, why doesn't lambdabot have a freemonad implementation for safe IO actions?
08:35 jleon joined
08:36 <merijn> wz1000: Patches welcome ;)
08:36 TheFuzzball joined
08:36 <merijn> wz1000: More seriously, lambdabot is just loading existing code, how would you automatically convert existing IO actions into a safe free-monad implementation?
08:37 <merijn> wz1000: i.e. how does putStrLn changes it's implementation magically?
08:37 <quchen> You can just alias it
08:37 <wz1000> Don't have the base versions of the IO actions in scope
08:37 <quchen> I know someone who exchanged the Prelude :-)
08:37 <merijn> quchen: Sure, but then someone has to write all the aliases
08:37 <quchen> (To make putStrLn different)
08:37 <_sars_> Using servant-swagger, I am trying to do this, http://lpaste.net/355806 but it is not working. How can I get it done using lenses/prisms that swagger provides?
08:37 <merijn> See my initial "patches welcome" ;)
08:38 i-amd3 left
08:38 ErinvanderVeen joined
08:40 jleon joined
08:41 <phadej> _sars_: like https://github.com/GetShopTV/swagger2/blob/73c4c7775e6dbe3f88ab69142d113dd6548a6d01/examples/hackage.hs#L25-L36
08:41 <phadej> _sars_: your example has only one property only
08:41 lep-delete joined
08:41 Koterpillar joined
08:41 primal joined
08:41 augur joined
08:42 Jesin joined
08:43 <nshepperd_> How much would be able to do with this anyway? PutStrLn maybe, and some random number stuff? I suppose you could do the whole "fake temporary filesystem" thing for writeFile and so on
08:43 xtreak joined
08:44 rickygee joined
08:44 takle joined
08:44 pookleblinky joined
08:45 <merijn> Time to repeat my previous poll: Suppose I have a bunch of Folds/Traversals and I wanna dump them all in a module intended for qualified imports (i.e. shadowing Prelude), what's a good module name? Foo.Traversals? Foo.Prelude? Foo.Folds? Something else?
08:46 xtreak joined
08:46 <merijn> nshepperd_: Well, that's basically how Haskell IO worked before monadic IO, so...
08:46 primal_ joined
08:47 jleon joined
08:50 <wz1000> merijn: Wasn't it something like main :: [Request] -> [Response]
08:50 <cocreature> merijn: I would probably go for the Prelude approach
08:50 govg joined
08:50 <merijn> cocreature: I was thinking of that, based on Pipes, etc. but OTOH I'm only really shadowing folds/mapM, not anything else
08:51 hamishmack joined
08:51 jleon joined
08:51 primal joined
08:52 <cocreature> merijn: I don’t think naming it Traversals or Folds is really helping. especially if both would make sense I would constantly forget which one it is. Prelude on the other hand is easier to remember (for me).
08:54 twanvl joined
08:55 <Philonous> Why not export them from the main module?
08:56 <merijn> Philonous: Because they clash with Prelude
08:56 <Philonous> So? Can always be imported qualified
08:56 jleon joined
08:56 <cocreature> Philonous: but then you can not just import the things that don’t clash without explicit import lists
08:56 <merijn> Philonous: I dislike having to import qualified, additionally the folds are really more "neat utilities", rather than core functionality
08:56 primal_ joined
08:57 <Philonous> Importing unqualified and without explicit import list is bad anyway
08:57 jaspervdj joined
08:57 <cocreature> you can take unqualified import lists from my cold dead hands
08:58 <cocreature> (please don’t)
08:58 zero_byte joined
08:58 bollu joined
08:58 saussure joined
08:59 whald joined
08:59 Kreest_ joined
08:59 <merijn> Which is not really a constructive or helpful comment, so I'm not quite sure how it's supposed to add to the conversation :)
09:00 LKoen joined
09:00 mfukar joined
09:00 <Philonous> Personally I try to import qualified anyway and I dislike having to import additional modules of which I can't remember the name in any case.
09:00 <bollu> cocreature: ping
09:01 rickygee joined
09:01 gestone joined
09:01 <merijn> Philonous: Well, that can be trivially solved by simply re-exporting the main module from the other one
09:01 tomphp joined
09:01 <Philonous> merijn, I was about to suggest that.
09:01 <whald> hi! can s.o. suggest me a mirror for https://www.haskell.org/ghc/download ?
09:01 <merijn> Philonous: In fact, that's what I already do in another case
09:01 <merijn> whald: Google is indexing outdated urls
09:01 <cocreature> whald: https://downloads.haskell.org/~ghc/
09:01 <merijn> whald: You want https://www.haskell.org/ghc/download.html
09:02 bollu joined
09:02 im0nde joined
09:02 <cocreature> bollu: pong but I’m sort of busy atm so leaving a comment on github is probably a better idea
09:02 <cocreature> unless it’s only a short question and not some discussion
09:02 <whald> merijn, maybe google hopes that URL comes back, otherwise a 404 instead of 500 HTTP error might help?
09:02 <whald> cocreature, thanks!
09:02 <ertes-w> wz1000: [Response] -> [Request]
09:03 jleon joined
09:03 <ertes-w> main "sends" requests and "receives" responses
09:03 <bollu> cocreature: what's a .td file? :)
09:03 <cocreature> bollu: http://llvm.org/docs/TableGen/
09:03 <whald> merijn, ah, thanks, too! :)
09:03 <bollu> cocreature: cool!
09:03 <bollu> cocreature: thnks
09:03 <bollu> thanks*
09:03 Bhootrk_ joined
09:04 <merijn> Philonous: Althought the downside is that I currently have a non-throwing module and another that wraps that API to throw exceptions, so then you'd either have to Prelude module twice to mimic that or restrict people to either one or the other
09:04 <Philonous> merijn, That's probably the best of both worlds.
09:04 <cocreature> bollu: I’m not sure if that’s cool but it’s how LLVM specifies intrinsics so we’ll have to read that file
09:04 <bollu> cocreature: yep, will do
09:04 <wz1000> ertes-w: ah
09:04 <bollu> cocreature: I love LLVM tooling, that's what I meant by "cool" :)
09:05 takle joined
09:05 <merijn> Philonous: So I think not re-exporting is more flexible, especially if I add more stuff later, because then you can just do "import qualified Foo as F; import qualified Foo.Prelude as F" and replace the first with "import qualified Foo.Throw as F" to use the throwing API instead
09:06 bjz joined
09:06 fotonzade joined
09:06 Bhootrk_ joined
09:06 mattyw joined
09:06 primal joined
09:07 <merijn> Actually, while I'm polling opinions: foldFoo and foldMFoo or fooFold and fooFoldM? I dislike the capital M looking like part of the type in 'foldMFoo', but I don't really like the others
09:07 <* hackage> hnormalise 0.2.0.0 - Log message normalisation tool producing structured JSON messages https://hackage.haskell.org/package/hnormalise-0.2.0.0 (AndyGeorges)
09:07 jleon joined
09:08 <Philonous> merijn, Do you have multiple? Otherwise why not fold and foldM ?
09:08 <mbrock> hmm, how do I efficiently either (1) convert a `Vector Word8' to a `ByteString', or (2) build a ByteString by allocating a zeroed buffer and then mutating some indexes?
09:08 saussure joined
09:08 cretiq joined
09:08 oish joined
09:08 <mbrock> (the Vector is Unboxed)
09:08 <merijn> Philonous: This is a slightly different fold, intended to be used with Tekmo's foldl package
09:08 unK_ joined
09:09 Koterpillar joined
09:09 <merijn> Philonous: Else I'd just use fold/foldM, yeah
09:09 <Philonous> merijn, OK, I prefer foldMFoo
09:09 <merijn> mbrock: ByteString has an unsafe Ptr Word8 interface
09:09 <Axman6> mbrock: hmm, I feel I've written this code before, it's painfully convoluted
09:10 <Axman6> merijn: I prefer foldFooM because it's consistent with the rest of the ecosystem
09:10 <Axman6> mbrock: if you have a Storable.Vector you would have an easier job
09:10 <merijn> Axman6: Is it? I don't recall seeing examples like that?
09:10 locallycompact joined
09:11 <cocreature> bollu: let’s see if you still love it once you get to the part in the docs for TableGen where you realize that there are no docs on how to write a backend for TableGen
09:11 <Axman6> hmm, I'm sure I've seen examples
09:11 <bollu> cocreature: xD
09:12 <Axman6> merijn: anyway, a M suffix is pretty common, and stands out more than hiding it in the middle of the word
09:12 <mbrock> Axman6: ah, yeah, just found a StackOverflow thing with Vector.Storable's `unsafeToForeignPtr' and ByteString's `packCStringLen'
09:12 jleon joined
09:12 <merijn> While I'm at it, I have another one
09:12 <Axman6> seeing foldFoo and foldFooM I pretty much immediately know what the relationship between them is, without seeing the types. foldFoo and foldMFoo looks like they work on different types
09:12 zcourts joined
09:13 juanpaucar joined
09:13 <Axman6> adding an M is similar to adding a ', it has a conventional meaning
09:15 <merijn> So, I have a channel type with explicit in/out types and I'm not really solidly convinced what the types should be (let's take 'Fold a b' as short hand for the actual folding functions/operations: 1) "Chan Out a -> Fold a b -> IO b", 2) "Chan In a -> Fold a b -> IO b", or 3) "Chan In a -> Fold a b -> IO (IO b)" (rationale to follow)
09:16 <merijn> 1) has the advantage of being straightforward to use, but, it means the "Out" point is visible to other functions, that can end up accessing it interleaved with fold, meaning some elements might get "lost" from the fold
09:17 jleon joined
09:17 primal_ joined
09:17 <merijn> 2) Prevents this by creating a new "Out" end internally, so it's guaranteed the fold gets all elements. However, this is tricky if you wanna be threaded, since there's no way to ensure someone is listening before you start writing when you create the Out channel inside the thread running the fold
09:18 <* hackage> profiteur 0.4.3.0 - Treemap visualiser for GHC prof files https://hackage.haskell.org/package/profiteur-0.4.3.0 (JasperVanDerJeugt)
09:19 <merijn> 3) Again stops elements from "leaking", but having "IO (IO b)" it clearly separates "creating the new listening channel" from the "actually executing the fold", so it's more convenient to use with other threads (simply fork the thread *after* the listener is created), but the type is more confusing
09:19 mgu joined
09:19 <_sars_> phadej: I am getting some weird result after doing that, http://lpaste.net/355807
09:19 <merijn> Does anyone have any opinions on what the "best" type would be?
09:19 <mbrock> now I'm wondering how to follow this answer but using some unsafe magic to avoid the IO monad... https://stackoverflow.com/questions/22508826/converting-vector-to-bytestring-in-haskell
09:20 <merijn> mbrock: Why are you trying to avoid the IO monad?
09:20 <mbrock> I'm optimizing a pure function
09:20 <Axman6> it should be a pure operation really
09:21 <merijn> Rather you than me ;)
09:21 jleon joined
09:21 <merijn> Alternatively, does anyone know a better place to poll for API opinions? :p
09:21 <mbrock> well, at least it's a profiled bottleneck :)
09:21 <mbrock> Axman6: I guess I'll try a simple unsafePerformIO
09:22 <mbrock> (famous last words, right?)
09:22 <Axman6> the comments about platform specificness of Int may be something you need to think about
09:22 <merijn> mbrock: At least it's not accursedUnutterablePerformIO :)
09:22 ecthiender joined
09:22 <mbrock> ah yeah, in my case it's actually a `Vector Word8' so I think it's fine
09:23 <Axman6> mbrock: it should be fine to use unsafePerformIO here, in face I'm kind of surprised you'd need to use IO at all, it should be an operation on values only, no IO necessary
09:23 <merijn> mbrock: How are you getting the Vector Word8?
09:24 <mbrock> merijn: via Vector.create and the Mutable API
09:25 <Axman6> using Data.Vector.Stroable.unsafeToForeignPtr you should be able to make a ByteString easily
09:25 <merijn> I was thinking you could maybe go via a GHC Array# or Addr#, but bytestring still use IO for those I see
09:25 takle joined
09:26 jleon joined
09:26 saussure joined
09:26 <Axman6> it's annoying the constructors for ByteString aren't exposed
09:26 sphinxo joined
09:26 <Axman6> because a ByteString is just a wrapper around ForeignPtr
09:27 <Axman6> which you can easily get from Data.Vector.Stroable.unsafeToForeignPtr
09:27 primal joined
09:27 vydd joined
09:27 juanpaucar joined
09:27 <jophish> Axman6: there is a package which will allow you to get the constructor with TH
09:27 <jophish> trying to remember it now
09:27 <Axman6> ew
09:28 <* Axman6> -> gone
09:28 andyhuzhill1 joined
09:29 xtreak joined
09:29 mmn80 joined
09:30 <Athas> Is there an easy way to use Template Haskell to compute some arbitrary value at compile-time, and make it available at run-time?
09:30 <Athas> My use case is that I'm writing a compiler, and it would be useful to pre-parser/typecheck the standard library and embed it in the compiler executable.
09:30 <jophish> Axman6: true-name
09:30 <jophish> I think is the package
09:30 jleon joined
09:31 <Athas> I can embed the library source code with the file-embed package, which is OK, but it means it is parsed and type-checked whenever the compiler runs.
09:31 <* angerman> 'll be around if someone has questions re TH + CC
09:31 <jophish> https://github.com/liyang/true-name/blob/master/sanity.hs
09:31 <jophish> angerman: how are you planning on making it work?
09:31 <quchen> Athas: This might help a bit, https://github.com/quchen/articles/blob/master/useful_techniques.md#poor-mans-supercompiler
09:31 <angerman> jophish: no spoilers :)
09:32 <jophish> :)
09:32 <angerman> jophish: however, see https://www.irccloud.com/pastebin/iuaW4a2s/ :D
09:32 <merijn> Athas: I would say that should be easy on two conditions
09:33 <merijn> Athas: 1) the result of pre-checking is a data-structure and 2) the data structure has a Lift instance
09:33 <Athas> Where is Lift defined?
09:33 <Athas> It's a pretty simple structure (just a bunch of Data.Maps; no functions), so it *should* be serialisable or whatnot.
09:34 <merijn> Athas: Template Haskell, but, since I'm guessing this is research stuff so you don't give a shit about backwards compat: GHC 8 has a DeriveLift extension :)
09:34 <merijn> So you should be able to just standalone derive any missing instance for simple datatypes
09:34 <Athas> I do actually give a shit, since I have ~users! But since I use stack they will just get whichever GHC I tell them to get.
09:35 <merijn> I should probably update validated-literals for GHC8...
09:35 <Athas> Hm. And adding such instances for container-defined types won't cause issues?
09:35 <angerman> jophish: which reminds me, I still need to improve the post for tomorrow :)
09:35 <Athas> This sounds doable. Thank you.
09:35 <merijn> Athas: You might need to CPP around if they get added later
09:35 saussure joined
09:36 <angerman> quchen: "You'll notice this compiles slowly, but runs very fast" ... yea! :D
09:36 <jophish> Athas: instead of baking the standard libray into the binary, I'd be tempted to implement some serialised IR, and just precompile the standard library once
09:37 <Athas> merijn: CPP? Never! I'll just narrow the GHC version requirements.
09:37 <jophish> this may not be appropriate for your language however
09:37 eklavya joined
09:37 <Athas> jophish: that creates file system dependencies.
09:37 primal_ joined
09:37 <Athas> I want to avoid having the user worry about installation locations and include paths, at least for the built-in standard library.
09:37 romank joined
09:38 <Athas> This language is totally unsuitable for separate/incremental compilation anyway, so this exercise is mostly so I can have a fairly large "prelude" without paying too much in type-checking costs for small programs.
09:38 Kreest joined
09:39 <sphinxo> Athas: dodgy solution: create something similar to happy or alex, that runs at the same time, that is imported
09:40 <sphinxo> you'd have to have a 2 stage build process, the later including the standard library
09:40 yellowj joined
09:40 <reactormonk[m]> How can I tell stack build to use all my cores globally?
09:41 <Athas> sphinxo: I don't think cabal supports that.l
09:41 Xion_ joined
09:41 <sphinxo> Have 2 separate modules? probably quite innefficient
09:42 <sphinxo> Second is first + standard lib
09:42 cretiq joined
09:42 joco42 joined
09:42 romank_ joined
09:42 eklavya joined
09:43 xtreak joined
09:44 acidjnk22 joined
09:45 FreeBirdLjj joined
09:45 saussure joined
09:46 Rotaerk joined
09:46 <Athas> sphinxo: still, how would you do that with Cabal?
09:46 <Athas> I don't think it supports preprocessors that are part of the same package.
09:46 <Athas> Besides, isn't happy/alex hardwired into Cabal?
09:46 takle joined
09:46 <merijn> Athas: No, you need to manually install them
09:46 <merijn> Athas: Oh, you mean as preprocessors?
09:47 <merijn> Athas: You can write custom ones if you switch to Custom build
09:47 primal joined
09:47 <* hackage> uri-bytestring-aeson 0.1.0.1 - Aeson instances for URI Bytestring https://hackage.haskell.org/package/uri-bytestring-aeson-0.1.0.1 (reactormonk)
09:47 <merijn> Athas: Did that for c2hsc at some point: https://github.com/merijn/SNet2.0/blob/master/Setup.hs
09:47 <reactormonk[m]> I've fixed my library mentioned in https://github.com/fpco/stackage/issues/2532 - do I need to do anything besides uploading it to hackage?
09:47 mmhat joined
09:48 <Athas> Urgh. I think I'll go with the Template Haskell approach. It seems simpler and cleaner.
09:48 <Athas> (Never thought I'd say that.)
09:48 <* hackage> wave 0.1.5 - Work with WAVE and RF64 files https://hackage.haskell.org/package/wave-0.1.5 (mrkkrp)
09:48 <Saizan> Athas: you can add code for handling more preprocessors in the Setup file, iirc
09:48 <merijn> reactormonk[m]: Comment on that issue and ask?
09:48 chrissound joined
09:48 kutio1 joined
09:49 Levex joined
09:50 juanpaucar joined
09:52 Kreest_ joined
09:53 primal joined
09:54 beerdrop joined
09:56 davr0s joined
09:57 <wz1000> Is there a pretty way to build Aeson objects instead of using trillions of A.Object $ H.fromList [...]?
09:58 primal_ joined
09:58 <Philonous> wz1000, object [ "key1" .= value1, "key2" .= value2 ... ]
09:59 <wz1000> Ah, nice
10:00 cordawyn joined
10:00 govg joined
10:02 <mbrock> yay, my program runs 16x faster :)
10:02 <mbrock> sometimes optimizing is fun...
10:03 <mbrock> got some big speedups just from using Map.fromAscList instead of Map.fromList
10:04 <quchen> angerman: TH uses something similar to GHCi, so you get similar speeds
10:04 Gurkenglas joined
10:05 <angerman> quchen: yes :-) I just liked that line :)
10:05 cyborg-one joined
10:05 cschneid_ joined
10:06 toblorone joined
10:06 primal joined
10:07 <angerman> alright. some time to chill, and then going to finish the "Cross Compiling Template Haskell" post :)
10:07 takle joined
10:08 gawen joined
10:10 rickygee joined
10:13 ThomasLocke joined
10:13 indi_ joined
10:14 primal_ joined
10:15 eklavya joined
10:15 ziocroc joined
10:17 TheFuzzball joined
10:18 <* hackage> servant-multipart 0.10.0.1 - multipart/form-data (e.g file upload) support for servant https://hackage.haskell.org/package/servant-multipart-0.10.0.1 (phadej)
10:19 <* hackage> servant-mock 0.8.2 - Derive a mock server for free from your servant API types https://hackage.haskell.org/package/servant-mock-0.8.2 (phadej)
10:21 ErinvanderVeen joined
10:22 <phadej> _sars_: you try it with `ListResult UTCTime` or something like that?
10:22 <phadej> _sars_: sorry, I have no idea
10:23 <_sars_> phadej: It works now.
10:23 primal joined
10:24 yqt joined
10:25 lopex joined
10:25 <* hackage> pang-a-lambda 0.2.0.0 - A super-pang clone https://hackage.haskell.org/package/pang-a-lambda-0.2.0.0 (keera_studios_ci)
10:27 tromp joined
10:28 obihann joined
10:28 gcross joined
10:28 takle joined
10:29 uglyfigurine joined
10:29 <phadej> _sars_: great
10:29 <phadej> _sars_: what you did?
10:29 saussure joined
10:30 jinblack joined
10:31 rickygee joined
10:31 petermw joined
10:32 jimmyrcom_ joined
10:32 lars___ joined
10:33 rcat joined
10:34 primal_ joined
10:36 augur joined
10:36 ErinvanderVeen joined
10:37 romank joined
10:38 petermw joined
10:38 aglorei joined
10:42 muzzle joined
10:42 ertes joined
10:43 muzzle left
10:44 primal joined
10:44 AnonymousVN-TN joined
10:44 <AnonymousVN-TN> hello
10:44 cloudhead joined
10:45 <_sars_> phadej: I think it happned becuse I was using the same name (in named schema) for all the types that was using this instance, and UTCTime happend to be one of them..
10:46 <_sars_> phadej: I am using the swagger-ui to view the result, so when the references have same name, they seem to overlap eachother..
10:47 <hanna> When using the FFI, is there any easier to get the contents of a DEFINED_CONSTANT into my haskell code other than wrapping it inside a pure function that returns this value?
10:48 saussure joined
10:48 fendor joined
10:48 <phadej> _sars_: there is an issue about that, nobody just got to it: https://github.com/GetShopTV/swagger2/issues/94
10:49 takle joined
10:49 <phadej> _sars_: i.e. known problem, and we have "a plan", but it doesn't cause enough pain yet
10:50 sampuka joined
10:50 <_sars_> phadej: I see...
10:50 <hanna> “In particular, there is no support for accessing pre-processor symbols from Haskell, which includes #defined constants.” aaw
10:51 rickygee joined
10:52 tomphp joined
10:52 sullyj3 joined
10:53 <* hackage> postmaster 0.3.2 - Postmaster ESMTP Server https://hackage.haskell.org/package/postmaster-0.3.2 (PeterSimons)
10:53 meoblast001 joined
10:54 juanpaucar joined
10:54 primal_ joined
10:54 <sullyj3> hey everyone! Couple of questions - first a style one: given import Data.Traversable (for), which do you prefer of:
10:54 <sullyj3> for [1..5] $ \x -> print x >> getLine
10:54 <sullyj3> for [1..5] $ (>> getLine) . print
10:54 <sullyj3> import Control.Arrow ((>>>))
10:54 <sullyj3> for [1..5] $ print >>> (>> getLine)
10:55 <sullyj3> or is there something nicer?
10:55 <Philonous> for [1..5] $ \x -> print x >> getLine -- That's the only one I can read without having to stop and think what's going on
10:56 <bollu> Philonous++
10:56 <quchen> bollu++
10:56 <Akii> +1 from me as well
10:56 <cocreature> quchen++
10:56 <bollu> xD
10:56 <Akii> (c-c-c-combo breaker)
10:56 <sullyj3> Yeah, you're right, it's definitely clearer. I just have an ick reaction to lambdas for some reason
10:57 <cocreature> lambdas are great :)
10:57 <Xion_> print =<< getLine ?
10:57 meoblast001 joined
10:57 <bollu> sullyj3: run your entire codebase through @pl then? :P
10:57 <Philonous> sullyj3, Then you might be in the wrong channel :P
10:57 <quchen> And lambdas are not more expensive than pointfree style.
10:57 <cocreature> Xion_: that’s not the same as \x -> print x >> getLine
10:57 saussure joined
10:57 <sullyj3> I know they're not more expensive, I just think they're uglier
10:58 <Xion_> cocreature: Oh, print x AND then get another line
10:58 <sullyj3> Xion_: yep
10:58 <Philonous> sullyj3, Btw. that line is still OK, but if it got any longer I'd use do notation instead of >>
10:59 <Xion_> for [1..5] $ \x -> do { print x; line <- getLine; return line } -- *hides*
10:59 mattyw joined
10:59 <sullyj3> Philonous, yeah, definitely would for anything longer
11:00 xtreak joined
11:00 anodium joined
11:01 <lpaste> merijn pasted “API design question: folds over Channel” at http://lpaste.net/8469104504694898688
11:04 primal joined
11:05 <hanna> sullyj3: there's also for [1..5] $ \x -> do print x; getLine
11:05 <hanna> oops, Xion_ already mentioned it (essentially)
11:07 darlan joined
11:07 <merijn> Any comments on my API design issue?
11:08 nbro joined
11:08 ragepandemic joined
11:09 <sullyj3> second question, is there a nice, one or two standard library function replacement for the following function?
11:09 <sullyj3> map_part :: (a -> a) -> (a -> Bool) -> [a] -> [a]
11:09 <sullyj3> map_part f discrim xs = let partitioned = partition discrim xs in
11:09 <sullyj3> (map f $ fst partitioned) ++ (snd partitioned)
11:09 inad922 joined
11:09 <mniip> does it have to move the unmodified elements to the back?
11:10 takle joined
11:10 <sullyj3> yep
11:10 _paul0 joined
11:10 <* hackage> servant-swagger 1.1.3 - Generate Swagger specification for your servant API. https://hackage.haskell.org/package/servant-swagger-1.1.3 (phadej)
11:10 <hanna> map (\x -> if discrim x then f x else x)
11:10 <mniip> then no, I'm afraid that's too specific
11:10 <hanna> that also preserves the order
11:10 <hanna> which I'm sure you can combine using if' and friends
11:10 <mniip> you might have some luck with hanna's code and probably sortOn @Bool
11:11 <cocreature> hanna: "over (filtered discrim) f" :)
11:11 <hanna> oh right, lenses :p
11:11 <sullyj3> come to think of it, preserving order is probable better
11:11 <* hanna> has actually been laying off the lenses
11:11 <mniip> :t sortOn
11:11 <lambdabot> Ord b => (a -> b) -> [a] -> [a]
11:11 <sullyj3> bollu: what was that @pl thing you mentioned earlier?
11:11 <mniip> > sortOn even [3,7,4,1,2,6,3]
11:11 <lambdabot> [3,7,1,3,4,2,6]
11:11 buglebudabey joined
11:12 rickygee joined
11:12 <sullyj3> mniip: ooooh
11:12 <hanna> also while we're on the topic of style, I would write your map_part like this
11:12 <bollu> @pl \f g x -> f (g (x))
11:12 <lambdabot> (.)
11:12 <sullyj3> cool
11:12 <bollu> @pl for [1..5] $ \x -> print x >> getLine
11:12 <lambdabot> for [1..5] ((>> getLine) . print)
11:12 <hanna> map_part f g xs = map f ys ++ ns where (ys, ns) = partition g xs
11:12 <sullyj3> bollu: ooh, handy!
11:12 <bollu> sullyj3: :)
11:12 <hanna> (with the where on a separate line)
11:12 <mniip> just one catch
11:12 oisdk joined
11:13 <mniip> depending on the implementation of Data.List.sort it might be nlogn or even quadratic
11:13 anmin joined
11:14 <sullyj3> isn't n log n the minimum for comparison sorting anyway?
11:14 primal_ joined
11:14 <merijn> Yes
11:14 <Xion_> hanna: Yeah, I was just going for extra verbosity :)
11:14 cretiq joined
11:15 <hexagoxel> merijn: is there a point in the `Chan In a` existing before running this?
11:15 <mniip> sullyj3, you could write a radix sort of sorts
11:15 <merijn> hexagoxel: "Chan In a" *always* exists first
11:15 <sullyj3> :t over
11:15 <lambdabot> ASetter s t a b -> (a -> b) -> s -> t
11:15 <mniip> which would be linear for Bool
11:15 <merijn> hexagoxel: "Chan Out a" is tied to a specific "Chan In a"
11:15 saussure joined
11:15 Orion3k joined
11:15 <hexagoxel> merijn: like, would it make sense to have it `Fold a b -> IO (Chan In a, IO b)`
11:16 <hexagoxel> which still has the confusing double-IO, but the semantics seem more intuitive.
11:16 beerdrop joined
11:17 <sullyj3> hanna: I like that one. is ys and ns a common idiom for the outcomes of a predicate?
11:17 <merijn> hexagoxel: Well, one of the main ideas is that you can have a "Chan In Event" where your application publishes events and users can dynamically hook into that to start listening for events
11:17 muzzle joined
11:17 <hanna> I don't know, I came up with it on the fly
11:17 <muzzle> hi
11:17 <sullyj3> Very creative :)
11:17 <muzzle> is there a way to profile a single function only?
11:17 Sh4rPEYE joined
11:17 <hanna> sullyj3: but using pattern matches to deconstruct the tuples is way more idiomatic than using ‘fst’ and ‘snd’
11:17 <merijn> @hackage criterion -- muzzle
11:17 <lambdabot> http://hackage.haskell.org/package/criterion -- muzzle
11:17 <hexagoxel> merijn: ah, right. won't work with that.
11:17 <sullyj3> yeah, it's pretty
11:18 <merijn> hexagoxel: Which seems to useful to disallow
11:18 <hanna> it would also be more idiomatic to write something like map f (fst xs) ++ snd xs instead of (map f $ fst xs) ++ (snd xs)
11:18 <merijn> hexagoxel: The 2nd one I think is simplest/most intuitive, but makes it really hard, if not impossible to implement something simple like "spawn N workers listening before writing"
11:18 skeuomorf joined
11:19 fendor joined
11:19 <hexagoxel> merijn: but in that case, you have no control over when writing starts anyway?
11:19 <muzzle> merijn criterion allows me to do benchmarks, but that alone doesn't really help me in pinpointing, which part of some code makes my function slow?
11:20 augur joined
11:20 <merijn> muzzle: ah...I dunno what people are currently using for that
11:20 jaspervdj joined
11:20 <sbrg> muzzle: there is no point in profiling only a single function because that won't give you information about how it performs relative to the rest of your code, no?
11:20 <hexagoxel> merijn: or: if you control when writing starts via some other means, why not pass in the `Chan In a` as a signal to start writing?
11:20 tomphp joined
11:21 <merijn> hexagoxel: Well, my point is that 2) makes a usecase of "ch <- newChan; replicateM_ 10 (forkIO $ foldChan ch); startWriting ch" hard to do right, since you can't ensure the threads have created the "Chan Out" before you start writing
11:21 <sbrg> muzzle: however, there is the `weigh` package, which can give you some approximate memory usage, and as previously mentioned, `criterion` for benchmarking
11:21 <merijn> hexagoxel: That doesn't work, because you'd still have a race
11:22 <muzzle> sbrg, I don't really care about the rest of my code, I specifically want to know what makes one function slow. The background is that I have a fairly long and large initialization function that I don't want to pollute my profiling-report
11:22 benoliver999 joined
11:22 <merijn> hexagoxel: I wrote this thing to solve a space-leak with Chan, but the result means that writes before listeners exist are dropped on the floor
11:22 tomphp joined
11:22 <merijn> hexagoxel: So you have to be sure listeners are created before you start writing
11:23 <mniip> hey edwardk
11:23 <merijn> hexagoxel: The problem with the "create listener and immediately fold" approach of (2) means that the listeners can't signal they've finished creating a listener
11:23 tomphp joined
11:23 <merijn> hexagoxel: Because they'll already be executing the fold
11:23 <hexagoxel> merijn: i completely agree with the analysis of the three options that you have.
11:23 <edwardk> sup
11:23 <sbrg> muzzle: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#inserting-cost-centres-by-hand perhaps this is what you need?
11:24 <sullyj3> what about this related one, guys? how would you write this:
11:24 <sullyj3> mapWhile f pred xs = (map f . takeWhile pred) xs ++ dropWhile pred xs
11:24 primal joined
11:24 <sullyj3> wait..
11:24 <mniip> edwardk, remember our earlier discussion about LR parsers in haskell
11:24 <mniip> the thing with unlabelled recursion
11:24 <sullyj3> @pl mapWhile f pred xs = (map f . takeWhile pred) xs ++ dropWhile pred xs
11:24 <lambdabot> mapWhile = (`ap` dropWhile) . (liftM2 (++) .) . (. takeWhile) . (.) . map
11:24 <edwardk> vaguely
11:24 <sullyj3> ew
11:24 <merijn> hexagoxel: (3) has all the power and flexibility, but is a bit confusingly typed. (1) has all the power and flexibility and is easy to use, but also allows messing up...(2) just seems unworkable
11:24 <muzzle> sbrg I don't really want to insert more cost centres
11:24 <muzzle> sbrg I want to have all the ones that I'm not interested in gone
11:24 mattyw joined
11:25 <merijn> muzzle: Well, there's one thing you could do if you're willing to dive into a rabbit hole
11:25 <edwardk> was this sort of the issue with using observable sharing, vs. combinators vs. the frisbee approach of managing it with an external edsl?
11:25 <sbrg> muzzle: yes, I was thinking that you'd not use -fprof-auto and instead annotate the cost centers manually for only the things you are interested in
11:25 <mniip> edwardk, so I took a closer look at what would such an LR parser require, and how it would cope with infinite number of incomparable nonterminals
11:25 <sbrg> sullyj3: there's `span` that could make it prettier
11:25 <sullyj3> :t span
11:25 <sbrg> > span (< 5) [1..10]
11:25 <lambdabot> (a -> Bool) -> [a] -> ([a], [a])
11:25 <lambdabot> ([1,2,3,4],[5,6,7,8,9,10])
11:25 <merijn> muzzle: Modern GHC should be able to generate DWARF symbols. Then you could run your code through Intel VTune Amplifier and use that profiling and DWARF to relate it back to source locations
11:26 ragepandemic joined
11:26 <merijn> muzzle: Of course that requires a VTune license
11:26 <mniip> edwardk, if you have incomparable nonterminals the only way you can apply reduce rules is by tracking their locations in the "tree"
11:26 <sullyj3> sbrg: cool!
11:26 <mniip> and that
11:26 <mniip> is an LL parser
11:27 <merijn> edwardk: As expert Haskeller and general knowledgable dude, can you spare a sec to give some feedback on my API design conundrum? http://lpaste.net/8469104504694898688
11:27 toby_ joined
11:27 <merijn> hexagoxel: Alternatively I was thinking of augmenting (2) by adding some sort of "done" callback, but really that just makes it's type even more confusing than (3)
11:28 <edwardk> mniip: you can make a monad that does the CFG style chart parsing like the Jean-Philippe Bernardy-Koen Claessen paper, and then observe under >>='s so even in the presence of an infinite context dependent grammar you can recover parsability by exploiting the finiteness of the file you are parsing and some guarantees about consumption in the parser to ensure
11:28 <edwardk> progress
11:28 <mniip> well
11:28 <mniip> that requires observable sharing
11:28 <edwardk> its similar to your note above about tracking by position in the tree, you track by position in the input
11:28 <mniip> i.e the nonterminals being equatable
11:28 <edwardk> sure
11:28 <mniip> of some sort
11:28 zcourts joined
11:29 <mniip> and, well, yeah, there isn't much problem with an infinite amount of nonterminals as long as you can enumerate them in some fashion
11:29 <edwardk> ok, if you want everything incomparable then yeah, you're stuck because you can never reduce to get an LR parse
11:29 sternmull joined
11:29 <mniip> (practically you'd want a tree or a Free Reader)
11:31 takle joined
11:31 SenpaiSilver joined
11:31 <edwardk> merijn: Chan In a -> Fold a b -> IO (IO b) feels a little like the 'subscription' model a lot of IObservable APIs offer, except batched up til the end
11:31 koserge joined
11:32 <merijn> edwardk: Well, that's quite what it's intended to allow, yes
11:32 rickygee joined
11:32 <merijn> s/quite/kinda
11:32 <merijn> brainfart
11:32 phaji joined
11:32 netheranthem joined
11:32 <edwardk> e.g. there i usually do something like: newtype Observable a = Observable { subscribe :: Observer a -> Task Subscription }
11:33 <edwardk> where Observer is a contravariant functor that takes messages from your observable until you cancel :: Subscription -> Task ()
11:33 jleon joined
11:33 shookees joined
11:33 saussure joined
11:33 <edwardk> Task here being a monad for fork/join work-stealing stuff
11:34 primal_ joined
11:34 <edwardk> e.g. to get exactly the Observable API from C# you'd have data Observer a = Observer { (!) :: a -> Task (), handle :: SomeException -> Task (), complete :: Task () }
11:34 <mniip> edwardk, by the way, are you involved with SoH this year?
11:35 <merijn> Alternatively, I suppose I could expose a "safe" and "unsafe" API, one working directly on "Chan Out" with the type of (1) and a safe module working on "Chan In" directly
11:35 <sullyj3> what happens if I..
11:35 <sullyj3> > [1..]
11:35 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
11:35 JoshS joined
11:35 <sullyj3> fair enough
11:35 <mniip> sullyj3, don't worry, it's been idiot-tested for years ;)
11:35 <sullyj3> haha I'm sure
11:36 eklavya joined
11:36 <merijn> Althought that kinda split makes the API surfce kinda big, since I already have 2 versions of the API and adding other axes will just give me a combinatorial explosion...
11:36 <edwardk> jasper and niki are running it this year, this'll be the first year in the last decade or so when i _don't_ mentor someone for it i think. one student reached out to me
11:36 eklavya joined
11:36 <edwardk> but i don't recall it coming up beyond that
11:37 <* hackage> servant-swagger-ui 0.2.3.2.2.8 - Servant swagger ui https://hackage.haskell.org/package/servant-swagger-ui-0.2.3.2.2.8 (phadej)
11:37 beerdrop joined
11:39 jleon joined
11:40 eklavya_ joined
11:40 cretiq joined
11:40 fakenerd joined
11:41 Gurkenglas joined
11:41 <hexagoxel> merijn: sorry, i don't really have anything to add. every solution seems to have its tradeoffs. In FRP this would be easy, though.
11:41 dni joined
11:42 <merijn> hexagoxel: Well, I didn't think there would be a clean solution, I was more looking for "I would personally prefer API X" so I have some idea what other people would prefer
11:43 joco42 joined
11:43 saussure joined
11:43 <* mniip> prods jaspervdj then
11:43 dni joined
11:43 LAZAR_ joined
11:43 tromp joined
11:44 ragepandemic joined
11:44 primal joined
11:44 <hexagoxel> i'd probably go with 3) then. some mental/documentation overhead seems better than multiple variants.
11:44 <LAZAR_> How would you parse a json object with arbitraty and unknown fields in Aeson like "dependencies":{"12factor-config":"^1.0.0","lodash":"^3.6.0","node-env-file":"^0.1.7" }
11:44 <* hackage> ansi-terminal 0.6.3 - Simple ANSI terminal support, with Windows compatibility https://hackage.haskell.org/package/ansi-terminal-0.6.3 (RomanCheplyaka)
11:45 <merijn> hexagoxel: I'll probably just publish this as a candidate first and ask for more feedback then before settling on a final API :)
11:47 Levex joined
11:47 Soft joined
11:48 <amx> LAZAR_: depends on what you want to do, try one of these: https://artyom.me/aeson#unknown-field-names https://hackage.haskell.org/package/aeson-1.2.0.0/docs/Data-Aeson.html#g:3
11:48 brent80_plow joined
11:48 Boomerang joined
11:48 marens joined
11:48 marens joined
11:49 Clint joined
11:49 Clint joined
11:50 c0smo joined
11:50 <LAZAR_> amx: thanks that will help... i did not know what to search for... tried unstructured json
11:50 baroncharlus joined
11:50 ThomasLocke joined
11:50 Solarion joined
11:51 adarqui joined
11:51 toblorone_ joined
11:51 xxpor joined
11:52 takle joined
11:52 LeCamarade joined
11:52 davr0s joined
11:52 rickygee joined
11:53 hiptobecubic joined
11:53 Purlox joined
11:53 drewbert joined
11:54 primal_ joined
11:54 huza joined
11:56 xtreak joined
11:57 lambdaTom joined
11:58 asm_ joined
11:58 govg joined
11:58 juanpaucar joined
11:58 takle joined
12:01 saussure joined
12:01 shafox joined
12:03 sajith joined
12:03 WhereIsMySpoon joined
12:04 <WhereIsMySpoon> Hey, is there a way to write this as a list comprehension? https://gist.github.com/Jarob22/9f17abf82aa1b722a6209f25f18d06d7
12:04 primal joined
12:05 Levex joined
12:05 <Cale> No, but the guards are pretty spurious
12:05 <Cale> isPalindrome xs = reverse xs == xs
12:06 <Cale> also, Ord isn't required here, only Eq
12:06 <* angerman> is still around should there be questions re TH + CC.
12:06 ErinvanderVeen joined
12:06 silver joined
12:07 <WhereIsMySpoon> Cale: why spurious?
12:08 <WhereIsMySpoon> Cale: why Eq and not Ord
12:08 <WhereIsMySpoon> i thought arrays were ord
12:09 <Unode> WhereIsMySpoon: Ord implies that you need to order them somehow to compare. Eq means you can compare each entity regardless of how they order in the relation to each other.
12:09 <WhereIsMySpoon> i see, ok
12:09 halogenandtoast joined
12:10 <wz1000> (Ord a) signfies that you can perform comparisions on things of type a. You don't need any comparisions to write isPalindrome.
12:10 nighty-- joined
12:10 <WhereIsMySpoon> true
12:10 <angerman> WhereIsMySpoon, Cale, well we can do: f = \x -> all id [x == y | (x,y) <- zip x (reverse x)], no?
12:10 oisdk joined
12:10 <Boomerang> > let pal = ((==) <*> reverse) . map toLower in pal "God saw I was dog"
12:10 <lambdabot> True
12:10 vydd left
12:11 Achylles joined
12:11 <wz1000> and = all id
12:11 <wz1000> :t and
12:11 <lambdabot> Foldable t => t Bool -> Bool
12:11 <angerman> wz1000: ahh right. That's the one :)
12:12 <WhereIsMySpoon> angerman: ive spent less than a day doing haskell
12:12 <WhereIsMySpoon> i have no idea what that code you just put there means :D
12:13 <angerman> you asked for a list comprehension :)
12:13 rickygee joined
12:13 <wz1000> isPalindrome xs = and [ x == y | (x,y) <- zip xs (reverse xs) ]
12:13 <wz1000> That better?
12:14 <wz1000> > zip [1,2,3] [3,2,1]
12:14 <lambdabot> [(1,3),(2,2),(3,1)]
12:14 primal_ joined
12:14 <wz1000> > zip [1,2,3,2,1] [1,2,3,2,1]
12:14 <lambdabot> [(1,1),(2,2),(3,3),(2,2),(1,1)]
12:15 anieuwland joined
12:15 <Boomerang> You could also use zipWith (==)
12:16 <WhereIsMySpoon> wz1000: nope
12:17 <WhereIsMySpoon> angerman: I thought list comprehensions were like myFunc :: <type info>; myFunc [] = er
12:17 indi_ joined
12:17 <WhereIsMySpoon> error “empty list”;
12:17 <WhereIsMySpoon> and so on
12:17 Kreest joined
12:17 im0nde joined
12:18 <wz1000> No, list comprehensions are things of the form [ expr{a,b..} | a <- list1, b <- list2 ..]
12:18 <Xion_> > isPalindrome xs = all . zipWith (==) $ xs (reverse xs)
12:18 <lambdabot> <hint>:1:17: error:
12:18 <lambdabot> parse error on input ‘=’
12:18 <lambdabot> Perhaps you need a 'let' in a 'do' block?
12:18 <WhereIsMySpoon> wz1000: hm, ok
12:18 <WhereIsMySpoon> wz1000: whats what I just put called then
12:19 <wz1000> > [ x + y | x <- [1,2,3], y <- [5,6,7] ]
12:19 <lambdabot> [6,7,8,7,8,9,8,9,10]
12:19 saussure joined
12:19 <mniip> WhereIsMySpoon, a pattern match?
12:19 <mniip> on lists?
12:19 <mniip> list destruction?
12:19 <WhereIsMySpoon> I thought the one with | was pattern matching
12:19 <mniip> that's guards
12:19 <angerman> that's pattern GUARDS.
12:19 <wz1000> No, | is used for guards
12:19 <WhereIsMySpoon> ok
12:19 <WhereIsMySpoon> cool, thank you
12:19 <angerman> the naming is not that fortunate :)
12:20 <WhereIsMySpoon> can you generally write functions in any of those 3 ways?
12:20 <Cale> angerman: pattern guards are a special kind of guards
12:20 vydd joined
12:20 <angerman> hmm ok maybe better to say "it can be confusing at first".
12:20 Shatnerz0 joined
12:20 huza joined
12:20 <mniip> uhh
12:20 <angerman> Cale: true.
12:20 mgu_ joined
12:21 <mniip> I might be misremembering, but aren't they actually called pattern guards?
12:21 <mniip> because they guard patterns?
12:21 <mniip> func pattern | guard
12:21 nbro left
12:21 <WhereIsMySpoon> oh and there was one other
12:21 <Cale> Pattern guards are things like f m (x:xs) | Just y <- lookup x m = ...
12:21 <angerman> we also have them in multiWayIfs
12:22 <* mniip> gets the report
12:22 <WhereIsMySpoon> let ys = <somefunc> xs in; case ys of; <condition> -> result
12:22 <WhereIsMySpoon> whats that one called
12:22 <mniip> ok
12:22 <mniip> you are correct
12:22 <Cale> That's called... putting semicolons in syntactically invalid locations :)
12:22 <anieuwland> Hi! Compiling with haskell-gi (for gtk bindings) is very slow. Does anyone know how to speed it up?
12:23 <WhereIsMySpoon> imagine there’s newlines where there are semicolons :P
12:23 <mniip> a "guard" is either a "pattern guard" or a binding or a "boolean guard"
12:23 <WhereIsMySpoon> im still not up with how onelining haskell works
12:23 <Cale> But it's otherwise a let expression containing a case expression.
12:23 <WhereIsMySpoon> is there a name for that one, Cale ?
12:23 <mniip> 'case' expressions?
12:23 <mniip> and let-bindings
12:24 primal joined
12:24 <WhereIsMySpoon> oki doki
12:24 <WhereIsMySpoon> is there some rules or advice when to use one of these patterns over the others?
12:24 dsh joined
12:24 <WhereIsMySpoon> just whatever reads best and is the most concise?
12:25 <quchen> Yup
12:25 <mniip> "reads best"
12:25 <mniip> moreso than "most concise"
12:25 <WhereIsMySpoon> yes im aware thats subjective
12:25 <WhereIsMySpoon> ok
12:26 <quchen> All pattern matching is desugared to »case« anyway, so you likely end up with the same code in each case
12:26 <mniip> fix$(0:).scanl(+)1
12:26 <mniip> is concise
12:26 <WhereIsMySpoon> o.O
12:26 <quchen> No, that’s short.
12:26 <WhereIsMySpoon> wtf is that :P
12:26 <quchen> Concise is not necessarily short.
12:26 <quchen> And short is not necessarily concise.
12:26 <WhereIsMySpoon> true
12:27 Boomerang joined
12:27 <quchen> »sum . filter even . map (^2) . enumFrom 1« is concise.
12:27 tromp joined
12:27 <codedmart> Gurkenglas: Sorry I didn't respond. It actually was a stupid error. I didn't realize I installed aeson-lens and not lens-aeson.
12:27 <mniip> it is also nonterminating
12:27 <mniip> er
12:27 <mniip> nevermind
12:27 <hamishmack> anieuwland: Turning off the haskell-gi overloading feature makes a really big difference, not just to the compile time of haskell-gi but also any module that imports any haskell-gi module
12:27 <quchen> s/enumFrom/enumFromTo/
12:27 <mniip> yeah
12:28 <quchen> mniip: You’re right for unbounded types.
12:28 dni joined
12:28 <quchen> Nevermind, it’s a type error in any case.
12:28 <hamishmack> anieuwland: If you are using cabal new-build use something like https://github.com/leksah/leksah/blob/master/cabal.project#L12
12:28 <quchen> > enumFromTo 1 10 -- That one.
12:28 <anieuwland> hamishmack: That's great! I guess you mean OverloadedLabels? How do I do that?
12:28 <mniip> well, alright
12:28 <lambdabot> [1,2,3,4,5,6,7,8,9,10]
12:28 <WhereIsMySpoon> how do I rewrite my isPalindrome to use pattern matching
12:28 saussure joined
12:28 <anieuwland> hamishmack: thanks for the link I'll look at it
12:28 <hamishmack> anieuwland: For stack use something like https://github.com/leksah/leksah/blob/master/stack.yaml#L40
12:29 <mniip> WhereIsMySpoon, I'm not sure that's the best idea
12:29 <anieuwland> hamishmack: Ahh great, yes I use stack
12:29 <WhereIsMySpoon> mniip: maybe not but id like to know if its possible and how to do it
12:29 <mniip> you would have to figure out how you want to do it first
12:29 HoierM_ joined
12:29 <WhereIsMySpoon> i dont know how :P
12:29 <anieuwland> thanks hamishmack!
12:29 <WhereIsMySpoon> tahts why im asking
12:29 <anieuwland> hamishmack++
12:29 <quchen> Your code says »if xs == reverse xs then True else False«, that’s the same as just writing »xs == reverse xs«.
12:29 seanparsons joined
12:30 <mniip> WhereIsMySpoon, no, you've asked "how to write it using pattern matching"
12:30 <mniip> that is different
12:30 <WhereIsMySpoon> …huh
12:31 <mniip> hm
12:31 <mniip> I'm sounding confusing
12:31 <quchen> I don’t think you can write isPalindrome using pattern matching in a useful way.
12:31 zcourts joined
12:31 <mniip> WhereIsMySpoon, you have to come up with a way to check a string for palindromeness if you're working with individual characters
12:31 <WhereIsMySpoon> mniip: any array
12:31 TheFuzzball joined
12:32 <WhereIsMySpoon> well..of basic types i guess
12:32 <mniip> no arrays
12:32 <WhereIsMySpoon> no, its any array of types that are of type Eq
12:32 <mniip> you're conflating lists and arrays
12:32 <WhereIsMySpoon> that no was to myself sorry
12:32 <mniip> ther's bad
12:32 Sindriava joined
12:32 <WhereIsMySpoon> er
12:32 <mniip> that's bad*
12:33 <WhereIsMySpoon> enlighten me :)
12:33 <mniip> lists are built from cons cells
12:33 <mniip> a list is either an "empty list", or an element concatenated to the rest of the list
12:33 rickygee joined
12:34 <mniip> that means that in a single operation you can only split the list into its "head" and "tail" or conclude that it's empty
12:34 <WhereIsMySpoon> right
12:34 primal_ joined
12:34 <mniip> also in a single operation you can prepend an element to a list
12:34 <mniip> arrays on the other hand can be freely indexed
12:35 <WhereIsMySpoon> so can lists?
12:35 <mniip> not in a single operation
12:35 <WhereIsMySpoon> [1,2,3]!!1 == 2
12:35 <mniip> !! is a recursive function
12:35 <WhereIsMySpoon> ah ok
12:35 <mniip> that takes time proportional to the index
12:35 <WhereIsMySpoon> true
12:35 <WhereIsMySpoon> ok
12:36 <WhereIsMySpoon> so [1,2,3] is a list
12:36 <mniip> yes
12:36 <WhereIsMySpoon> whats an array example
12:36 <mniip> that's syntactic sugar for
12:36 <mniip> 1:2:3:[]
12:36 <WhereIsMySpoon> right
12:36 <mniip> read: 1:(2:(3:[]))
12:36 ErinvanderVeen joined
12:37 <mniip> : is the "cons", the prepend operation
12:37 jimmyrcom_ joined
12:37 <mniip> arrays aren't a primitive type in haskell
12:37 <mniip> there's a module, Data.Array that lets you use arrays, but the datatypes in there aren't "transparent"
12:38 <mniip> on the contrary they are opaque
12:38 <mniip> :t listArray
12:38 <lambdabot> Ix i => (i, i) -> [e] -> Array i e
12:38 <mniip> :t listArray (1, 10 :: Int) [1..10 :: Int]
12:38 <lambdabot> Array Int Int
12:38 <mniip> there, you have an array, but you can't "look inside" it other than with the provided functions
12:40 <WhereIsMySpoon> ok let me try and understand that function def
12:40 <WhereIsMySpoon> so the i’s are of type Ix
12:40 <mniip> you mean 'type'
12:40 <mniip> I think it's best you forget this for now and come back to it later
12:40 <WhereIsMySpoon> >,<
12:40 <WhereIsMySpoon> ok
12:40 <WhereIsMySpoon> :D
12:41 <mniip> as far as palindromes with pattern matching go
12:41 <WhereIsMySpoon> i just find it interesting that there are completely different ways to write functions that cant map to each other
12:41 <mniip> your best bet is to implement == and 'reverse' with pattern matching
12:41 <mniip> and then write isPalindrome with that
12:41 <Cale> WhereIsMySpoon: what do you mean?
12:41 fendor joined
12:42 <WhereIsMySpoon> mniip: well that seems like a waste of time :)
12:42 kritzcreek joined
12:42 <mniip> implementing your own reverse is a good excercise
12:42 <WhereIsMySpoon> ive already done that
12:42 <WhereIsMySpoon> :)
12:42 Boomerang joined
12:42 <mniip> may I take a look
12:42 <WhereIsMySpoon> https://wiki.haskell.org/99_questions/1_to_10
12:42 <WhereIsMySpoon> doing ths
12:42 <WhereIsMySpoon> sure
12:42 <WhereIsMySpoon> reverseM :: (Ord a) => [a] -> [a]
12:42 <WhereIsMySpoon> reverseM [] = []
12:42 <WhereIsMySpoon> reverseM (x:xs) = (reverseM xs)++[x]
12:43 <mniip> why Ord
12:43 <WhereIsMySpoon> ive been using it for all my list function types
12:43 <mniip> you shouldn't
12:43 <WhereIsMySpoon> it isnt necessary i see now :)
12:43 <WhereIsMySpoon> Eq, right?
12:44 Costar joined
12:44 <mniip> no
12:44 <mniip> none
12:44 <WhereIsMySpoon> oh, right
12:44 <WhereIsMySpoon> it doesnt matter what type a is
12:45 primal joined
12:45 <WhereIsMySpoon> hm..i dont know how to put “any” type
12:45 kthnnlg joined
12:45 <MasseR> Just remove the Ord constraint :)
12:45 <MasseR> Ord a => [a] -> [a] into [a] -> [a]
12:46 <WhereIsMySpoon> oh, right
12:46 <WhereIsMySpoon> coolio :)
12:46 <mniip> also, I'm not sure if it's the right time for nitpicking on your implementation
12:46 saussure joined
12:46 <WhereIsMySpoon> feel free
12:46 <mniip> (basically, it's terrible)
12:46 <WhereIsMySpoon> probably
12:47 <WhereIsMySpoon> performance wise you mean?
12:47 <mniip> good for now i gues
12:47 mmn80 joined
12:48 <* hackage> simple-text-format 0.1 - Simple text based format strings with named identifiers. https://hackage.haskell.org/package/simple-text-format-0.1 (justus)
12:48 <quchen> It’s correct, but won’t perform well.
12:49 xtreak joined
12:49 <quchen> Correct is good enough in the beginning I think. :-)
12:49 <mniip> yes
12:49 <WhereIsMySpoon> alrighty
12:49 <quchen> Reversing a singly-linked list, which lists are, has this pitfall.
12:49 <mniip> maybe after you learn the semantics of data, laziness, sharing, strictness, memoization, and have a good understanding of types, you can come back and we'll explain
12:50 <quchen> Haha that’s a mouthful ;-)
12:50 Sindriava joined
12:50 <WhereIsMySpoon> ive mostly worked with arraylists and not linked lists
12:50 <WhereIsMySpoon> im a java person :)
12:50 <quchen> But the issue is independent of most of these actually. Reversing a singly linked list in C this way has similar issues.
12:50 <WhereIsMySpoon> so im not very up on these pitfalls
12:50 <quchen> Java has this pitfall as well.
12:50 <quchen> It’s just that in Java singly linked lists are much less used.
12:50 <WhereIsMySpoon> plus performance of processing this stuff is not generally an issue when network latency gets in the way more often than not much more
12:51 Sindriava joined
12:51 rickygee joined
12:51 <mniip> ooh java
12:51 <WhereIsMySpoon> quchen: thats what i meant :)
12:51 <mniip> there are many useful analogies
12:51 sdothum joined
12:51 <WhereIsMySpoon> mniip: ive found coming back to haskell again after using java streams has highlighted a lot of things
12:51 Sindriava joined
12:52 <WhereIsMySpoon> like how much the object inheritance stuff gets in the way of programming
12:52 <WhereIsMySpoon> and that i want currying
12:52 Sindriava joined
12:53 <mniip> a few months ago I've rediscovered java after years of denial
12:53 <mniip> the structuredness of OOP has been a relief to me...
12:53 Sindriava joined
12:54 Cale joined
12:54 <Cale> ah, it appears I was disconnected for a bit there
12:55 <Cale> WhereIsMySpoon: I thought I might explain how to make that implementation of reverse more efficient
12:55 primal_ joined
12:55 <mniip> Cale, noooooo
12:55 <Cale> why not? :)
12:55 <mniip> we just discussed why not ;)
12:57 <Cale> Did you talk about how to make it linear?
12:57 <Cale> I missed some stuff
12:57 <mniip> no
12:57 <mniip> see logs
12:58 <quchen> Cale: Nothing relevant. Go ahead.
12:58 <Cale> WhereIsMySpoon: Okay, so xs ++ ys takes (necessarily) O(length xs) reduction steps to evaluate
12:58 <Cale> @src (++)
12:58 <lambdabot> [] ++ ys = ys
12:58 <lambdabot> (x:xs) ++ ys = x : (xs ++ ys)
12:58 <lambdabot> -- OR
12:58 <lambdabot> xs ++ ys = foldr (:) ys xs
12:59 <Cale> You can see here that it will recursively pattern match on the left list until it reaches the end of that
13:00 twomix joined
13:01 <Cale> of course, if we repeatedly add one element to the end of a list with (++), that will result in quadratic time, as the number of reduction steps will look something like 1 + 2 + ... + n = (n (n+1))/2 where n is the length of the list.
13:01 <Cale> While there's no way to implement (++) any better for lists, there is a way to avoid it when we're building up a list like this
13:02 xtreak_ joined
13:02 cdg joined
13:02 <Cale> WhereIsMySpoon: following this? :)
13:02 spacecadetbrown joined
13:02 juanpaucar joined
13:03 <Cale> anyway... the trick is that instead of constructing a list of type [a] as the result directly, we can construct a function of type [a] -> [a] which will add elements to the beginning of any list it's given
13:04 <WhereIsMySpoon> Cale: sorry, was chatting to coworkers
13:04 <WhereIsMySpoon> reading now
13:04 <Cale> [] will become id (the identity function, which adds no elements to the beginning of a given list)
13:04 saussure joined
13:04 <Cale> [x] will become (x:) (the function which adds x to the beginning of any list)
13:04 <Cale> and, most importantly, (++) will become (.) -- that is, function composition
13:05 obihann joined
13:05 <Cale> Since (f . g) x = f (g x) always reduces fully in a single step, it's constant time instead of linear, which will make the resulting reverse function linear time overall:
13:05 mjs2600 joined
13:05 <Cale> reverse' [] = id
13:05 <Cale> reverse' (x:xs) = reverse' xs . (x:)
13:05 <WhereIsMySpoon> *system warning*
13:06 <WhereIsMySpoon> im sorry, ive shut down
13:06 <halogenandtoast> I haven't, keep going
13:06 <WhereIsMySpoon> the way that a lot of haskell gets explained in these meta terms is just confusing to me
13:06 <WhereIsMySpoon> mostly because im not familiar with a lot of the words that are used
13:06 <Cale> WhereIsMySpoon: Feel free to ask questions about what I mean
13:06 <WhereIsMySpoon> i didnt mean that to shut you down cale :)
13:06 cordawyn joined
13:07 <Cale> So now, in order to recover our original reverse function, we can apply the resulting function to an empty list:
13:07 <Cale> reverse xs = reverse' xs []
13:07 <WhereIsMySpoon> whats with the —OR foldr
13:07 <WhereIsMySpoon> in the src of ++
13:08 <Cale> WhereIsMySpoon: That's just another possible implementation
13:08 mohsen_ joined
13:08 <mniip> Cale, is the ShowS trick any better than 'go (x:xs) ys = go xs (x:ys)'
13:08 <Cale> mniip: It's totally equivalent to it.
13:08 <sullyj3> Why don't haskell lists just have end pointers for constant (++)?
13:08 mgu_ joined
13:08 <Cale> We could add a second parameter to reverse'
13:08 <mniip> sullyj3, data is immutable
13:08 <Cale> reverse' [] ys = id ys
13:08 prophile joined
13:09 <Cale> reverse' (x:xs) ys = (reverse' xs . (x:)) ys
13:09 <Cale> and then simplify the right hand sides:
13:09 <WhereIsMySpoon> adding one element to a list with ++ is O(n2)?
13:09 <Cale> reverse' [] ys = ys
13:09 <* quchen> likes to think of reverse as if I had a large stack of books to invert. Take the uppermost book, and put it on the other stack. Keep doing this until your original stack is empty. Your new stack is the initial stack, but reversed.
13:09 <Cale> reverse' (x:xs) ys = reverse' xs (x:ys)
13:09 <merijn> sullyj3: They're immutable so you can't append to an existing list anyway
13:09 <mniip> yeah
13:09 <sullyj3> WhereIsMySpoon: no, it's O(n) in the size of the first list
13:09 <Cale> WhereIsMySpoon: No, it's O(n)
13:09 <mniip> my/quchen's analogy is more useful than function composition
13:09 <WhereIsMySpoon> why did you say it was quadratic?
13:09 <Cale> WhereIsMySpoon: But if you do that n times, reverse is O(n^2)
13:10 <Cale> (the length of the list you do it to varies, but not enough to prevent it from being quadratic)
13:10 <WhereIsMySpoon> oh right
13:10 <WhereIsMySpoon> ok
13:10 <sullyj3> mniip, merijn yeah, but doesn't horrible impure black magic go on under the ghc hood?
13:11 <mniip> not that kind of
13:11 jesyspa joined
13:11 Cerise joined
13:11 Cerise joined
13:11 <WhereIsMySpoon> i dont follow the bit about the ids
13:11 <Cale> WhereIsMySpoon: So this trick I explained above replaces the linear time (++), with constant time (.)
13:11 <WhereIsMySpoon> and function composition
13:11 whald joined
13:11 <Cale> ah, okay
13:11 rickygee joined
13:11 <mniip> registerization of certain tight loops, maybe, might use registers as mutable variables for primitive types
13:11 <Cale> So, the idea is that instead of using lists, we're going to use functions which add elements to the start of lists
13:11 <mniip> but heap data is certainly not overwritten in this fashion
13:12 <Cale> id x = x
13:12 <Cale> Is a function which doesn't add any elements to the start of a list
13:12 <Cale> and so it's our analogue to the empty list here
13:12 <WhereIsMySpoon> right..
13:13 <Cale> (x:) is the function which adds x to the beginning of any list, and so it's our analogue for [x]
13:13 <sullyj3> mniip Ah. It's easy to conceptualize a black box as having magic powers
13:13 oisdk joined
13:13 <quchen> Heap data is only overwritten when updating a thunk. It’s not black magic, just a very limited form of mutability.
13:13 <mniip> sullyj3, everything can be taken apart
13:13 <WhereIsMySpoon> Cale: ok
13:13 <mniip> ghc has an implementation that you can read an understand
13:14 tromp joined
13:14 <merijn> This sounds like a moment to bring up the STG paper :p
13:14 <ventonegro> Even Racket (a Scheme-ish language) is using immutable cons cells now
13:14 SkyPatrol_ joined
13:14 <Cale> and then if we have two functions say f and g which each add some elements to the beginning of a list, then f . g will be a function which adds all of those elements, i.e. it has the same effect as appending the lists of elements they would have added, and then adding those
13:14 saussure joined
13:14 `^_^v joined
13:14 <mniip> @where stg
13:14 <lambdabot> http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.3729
13:15 <sullyj3> merijn: That looks interesting, ta
13:15 <WhereIsMySpoon> Cale: huh?
13:15 <WhereIsMySpoon> whats the .
13:15 <Cale> ah
13:15 <Cale> (f . g) x = f (g x)
13:15 <Cale> It's composition of functions
13:15 <mniip> Cale, I think you might be misjudging their skill
13:15 <ventonegro> > :t (.)
13:15 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
13:15 <Cale> :t (.)
13:15 <lambdabot> (b -> c) -> (a -> b) -> a -> c
13:15 <mniip> oh huh hey ventonegro
13:16 <WhereIsMySpoon> Cale: can i get a concrete example?
13:16 <Cale> sure...
13:16 <phadej> I understand the dlist trick as "tail recursion module cons"
13:16 <WhereIsMySpoon> sorry if im being slow
13:16 ertes joined
13:16 <sullyj3> Conceptually, composition feeds the output of g into the input of f
13:16 <Cale> > (reverse . map toUpper) "hello"
13:16 <lambdabot> "OLLEH"
13:16 <ventonegro> mniip: Hello!
13:16 <phadej> e.g. you build a list (a : b : c :) but leave the "tail" hanging
13:16 <sullyj3> > (+1).(*4) 3
13:16 <lambdabot> error:
13:16 <lambdabot> • No instance for (Typeable a0)
13:16 <lambdabot> arising from a use of ‘show_M686304298927314073511402’
13:16 meoblast001 joined
13:16 <halogenandtoast> lol
13:16 <phadej> and et the end just say "here's the end: []"
13:16 <mniip> sullyj3, needs more ()
13:17 <halogenandtoast> or a $
13:17 <sullyj3> > (+1).(*4) $ 3
13:17 <Cale> > ((+1) . (*4)) 3
13:17 <lambdabot> 13
13:17 <lambdabot> 13
13:17 <WhereIsMySpoon> why do you need a . if haskell has currying?
13:17 <phadej> it's not the same
13:17 <Cale> Currying doesn't help us to compose functions
13:17 <halogenandtoast> because of how functions eval
13:17 <halogenandtoast> so for example
13:17 <mniip> how does currying help you build a function
13:17 <halogenandtoast> > reverse map toUpper "hello"
13:17 <lambdabot> error:
13:17 <lambdabot> • Couldn't match expected type ‘(Char -> Char) -> [Char] -> t’
13:17 <lambdabot> with actual type ‘[a1]’
13:18 <sullyj3> WhereIsMySpoon: what do you mean? Try writing my function using currying.
13:18 sternmull joined
13:18 <halogenandtoast> basically reverse takes a single argument, and so it read map as the argument
13:18 <LKoen> > reverse $ map toUpper "hello"
13:18 <lambdabot> "OLLEH"
13:18 <halogenandtoast> so you can do what LKoen just said as a solution
13:18 <WhereIsMySpoon> what is this $
13:18 <LKoen> > reverse (map toUpper "hello")
13:18 <lambdabot> "OLLEH"
13:18 <halogenandtoast> but it's still a little different
13:19 <WhereIsMySpoon> i dont think ive gotten to it yet
13:19 <mniip> WhereIsMySpoon, would I blow your mind with "$ is just id"
13:19 <halogenandtoast> WhereIsMySpoon: think of "$" as do everything to the right first
13:19 <Cale> WhereIsMySpoon: f $ x = f x, but $ has really low operator precedence, that is, it binds really weakly to its arguments
13:19 <LKoen> $ is basically syntactit sugar for "open a parenthese and don't close it until the end of the expression"
13:19 <WhereIsMySpoon> right
13:19 <merijn> LKoen: $ is just another operator, it's not syntactic sugar
13:19 <LKoen> okay
13:19 <mniip> merijn, I concur
13:19 <LKoen> it's equivalent to
13:19 <halogenandtoast> :t ($)
13:19 <mniip> runST $ do
13:19 <lambdabot> (a -> b) -> a -> b
13:20 <quchen> 6 people answering the same question and rising! ;-)
13:20 <sullyj3> merijn: Sure, but sugar is a good pretheoretic intuition
13:20 <halogenandtoast> quchen: HEY MAN I FINALLY KNOW SOMETHING
13:20 <WhereIsMySpoon> :D
13:20 <merijn> quchen: I'm just commenting on others, not actually getting involved :p
13:20 <merijn> quchen: I thought stgi was online somewhere or did I imagine that?
13:20 <WhereIsMySpoon> ive forgotten what we’re talking about
13:20 oisdk joined
13:20 <ventonegro> #haskell is overwhelmingly helpful :D
13:20 <WhereIsMySpoon> i am a bit overwhelmed right now lol
13:20 <mniip> over-whelmingly
13:20 <Cale> halogenandtoast: Careful about that "first"
13:20 <sullyj3> That's because they're easy questions, and answering easy questions makes me feel smart
13:20 <halogenandtoast> Where is Cale? Come back Cale!
13:20 <quchen> merijn: Yes, at every search engine when you enter »quchen stgi« for example.
13:21 beekill95 joined
13:21 <quchen> merijn: If you mean »as a webapp«, then no.
13:21 <Cale> halogenandtoast: It doesn't really have anything to do with the order of evaluation, only how the expression is parenthesized
13:21 <merijn> quchen: That gives me the github, I mean like as interactive webpage
13:21 <halogenandtoast> Cale: yes but I don't want to explain that.
13:21 <merijn> quchen: Ok, so just my imagination then :)
13:21 <quchen> merijn: Yes, sadly.
13:21 <WhereIsMySpoon> if (f.g)x = f(g x) why not write f(g x)
13:21 fendor joined
13:21 <WhereIsMySpoon> its like..not confusing
13:21 <quchen> merijn: That nonexisting website is the reason I rewrote the prettyprinter though, so at least something came from it.
13:22 <Cale> WhereIsMySpoon: Well, maybe we don't want to write x
13:22 mohsen_ joined
13:22 <halogenandtoast> WhereIsMySpoon: because you can pass around functions for instance
13:22 <mniip> perhaps, we should move to #haskell-beginners
13:22 <sullyj3> WhereIsMySpoon: (.) lets you do things like f.g.h.i.j etc
13:22 <merijn> quchen: Join me in my quest of farming out yak shaving to beginners ;) Whenever someone says "what project should I work on?" we just tell them to do our work for us ;)
13:22 <Cale> WhereIsMySpoon: This is a functional programming language, we're meant to be treating functions as things unto themselves.
13:22 <halogenandtoast> without arguments.
13:22 <Cale> WhereIsMySpoon: (.) glues two functions together end to end
13:22 iAmerikan joined
13:22 <WhereIsMySpoon> i thought let was for that
13:22 <sullyj3> which would be f(g(h(i(j x)))) otherwise
13:22 <WhereIsMySpoon> let combo = f g
13:22 <WhereIsMySpoon> combo x
13:23 <halogenandtoast> (b -> c) . (a -> b) returns a new function that is (a -> c) so to speak
13:23 <Cale> WhereIsMySpoon: that's not right. f g means f *applied to* g
13:23 <Cale> WhereIsMySpoon: i.e. g itself would be the argument to f
13:23 <mniip> damn, this is a mess
13:23 <Cale> Not g x
13:23 <merijn> I would cautiously recommend getting back to some more fundamental introductory literature, at this point
13:23 nyuszika7h joined
13:23 <mniip> WhereIsMySpoon, why don't we move over to #haskell-beginners for a more calm discussion
13:23 bodisiw joined
13:23 <WhereIsMySpoon> ok :P
13:23 <WhereIsMySpoon> sorry everyone
13:23 <Cale> WhereIsMySpoon: You have no reason to apologise
13:24 <halogenandtoast> No problem, I'm going to hop in haskell-beginners as well, but not speak.
13:24 <sullyj3> WhereIsMySpoon: Check out learnyouahaskell.com, it's fantastic
13:24 <WhereIsMySpoon> im using it
13:24 <WhereIsMySpoon> i just sidetracked to the 99 exercises page
13:24 <ventonegro> WhereIsMySpoon: not your fault, 20 people answering at once is the problem here
13:24 <sullyj3> ah
13:24 dni joined
13:24 <scav> i also think HaskellBook is nice
13:24 <WhereIsMySpoon> wanted to see how much i could do
13:24 primal joined
13:25 <Cale> I generally recommend Graham Hutton's book and the CIS 194 course materials (especally Brent Yorgey's edition)
13:25 <Cale> http://www.cis.upenn.edu/~cis194/spring13/
13:25 <Cale> http://www.cs.nott.ac.uk/~pszgmh/pih.html
13:26 <halogenandtoast> Cale is that book Haskell98?
13:26 jgertm joined
13:26 <Cale> halogenandtoast: Pretty much?
13:26 <mniip> halogenandtoast, it's a standard
13:26 obihann joined
13:27 <mniip> referential, not educational literature
13:27 <halogenandtoast> Just a question mostly. I've never used (afaik) Haskell98
13:27 rickygee joined
13:27 <Tspoon_> WhereIsMySpoon: cool nick, btw!
13:27 <mniip> er
13:27 <WhereIsMySpoon> Tspoon_: :D hi, thanks
13:27 <Cale> halogenandtoast: There might be some use of extensions, I don't recall. Haskell 98 is essentially the same thing as Haskell 2010.
13:27 <halogenandtoast> So I wasn't sure if there are any fundamental differences.
13:27 <mniip> halogenandtoast, sorry I misunderstood
13:28 <halogenandtoast> mniip: I forgive you.
13:28 <Cale> halogenandtoast: (Haskell 2010 was really silly, the biggest thing they did was merge in a bunch of other standards which had already been published alongside H98)
13:29 <merijn> Cale: Well, they added PatternGuards and removed the silliness that is DatatypeContexts, so that's something!
13:29 <halogenandtoast> Wasn't there a big Applicative push at some point?
13:29 <merijn> halogenandtoast: That was really recently
13:29 <mniip> merijn, also NPlusK iirc?
13:29 <merijn> halogenandtoast: Applicative as superclass of Monad isn't even Haskell2010
13:29 <* LKoen> sets out to read "learn you a haskell", "real world haskell", "programming in haskell" and "cis 194: introduction to haskell"
13:29 <merijn> mniip: Those too
13:29 <merijn> LKoen: Better start with the latter two
13:30 <LKoen> thank you
13:30 <halogenandtoast> merijn: so... Haskell2013?
13:30 <mniip> I've learned haskell from lyah and lots and lots and lots of practice
13:30 <merijn> halogenandtoast: No, there's a new Haskell Prime committee to create a new report, but it's work in progress
13:31 <halogenandtoast> merijn: I was mostly kidding.
13:31 <ventonegro> +1 for practicing a lot
13:31 <halogenandtoast> These days I just look at GHC versions.
13:31 tsmish joined
13:31 dfeuer joined
13:31 theelous3 joined
13:32 prophile joined
13:32 saussure joined
13:32 <halogenandtoast> I know it's not, but Haskell and GHC are synonymous for me at this point in my Haskell life.
13:32 <quchen> »really recently« was 2 years ago or so.
13:33 <halogenandtoast> quchen: Yeah I was actually around for it "kinda"
13:33 <halogenandtoast> I was just cutting my teeth and hating on Haskell
13:33 dan_f joined
13:34 <quchen> … you’re writing Haskell out of hate?
13:34 <halogenandtoast> quchen: a few years ago when I was learning Haskell, I didn't get it
13:34 ertes joined
13:34 <halogenandtoast> A lot of people at work were harping about it, and I wanted to understand
13:34 <halogenandtoast> So I was working hard to learn it and getting angry at the usual things.
13:34 primal_ joined
13:34 <Cale> I'm rather upset with all of the recent threads on the Haskell Prime list actually. We need to just get a bunch of relevant people into a room together at some point.
13:35 <halogenandtoast> Mostly random numbers.
13:35 <* hackage> zip 0.1.11 - Operations on zip archives https://hackage.haskell.org/package/zip-0.1.11 (mrkkrp)
13:35 toby1851 joined
13:35 <Cale> Haskell 2020 is never going to happen if the best we can come up with are proposals for syntax changes which would only be appropriate if one had a time machine to send them back to 1989.
13:36 <merijn> Cale: Agreed
13:36 <halogenandtoast> Cale: I assume because of backwards compatibility
13:36 <Cale> halogenandtoast: Well, that and the fact that it has nothing to do with reporting on what exists, which really is what needs to happen.
13:36 <merijn> "Here is an absolutely minor peeve that will dramatically alter the way code gets parsed"
13:37 <halogenandtoast> I assume moving Semigroups to Base would be a good thing?
13:37 <merijn> Cale: to be fair, I think most of those aren't from committee members
13:37 jathan_ joined
13:37 <Cale> merijn: I know.
13:37 <Cale> merijn: It's just, there's no apparent movement otherwise.
13:37 <halogenandtoast> Maybe there's nothing wrong with Haskell at this point.
13:38 <quchen> If I could formulate a proper RankNTypes proposal I would.
13:38 <Cale> halogenandtoast: The Report doesn't tell us enough about all the stuff that GHC can do today.
13:38 lavalike joined
13:38 <Cale> I don't even care about folding extensions into the main language at all.
13:38 <Cale> I just care about specifying what those extensions mean.
13:38 <mniip> if it did, haskell would be near impossible to implement
13:38 <halogenandtoast> Cale: I've thought about that as well, and I like having most of them as extensions
13:39 <mniip> if I'm not mistaking, report haskell stays within HM
13:39 <Cale> My dream would be if we picked some core type theory, specified a bunch of the extensions in terms of a reduction to that type theory, and then defined a denotational semantics for the core.
13:40 indi_ joined
13:40 <Cale> We haven't *really* had a denotational semantics since Haskell 1.0, because nobody's ever bothered to update it
13:40 <merijn> Cale: I think it's just a matter of the people who are both qualified and interested being rather busy
13:40 <Cale> yeah
13:40 <merijn> Cale: I mean, I assume that's why you're not on it? :)
13:40 <halogenandtoast> I wish I was qualified :(
13:40 <merijn> halogenandtoast: Get qualified! ;)
13:40 <halogenandtoast> Type theory is difficult.
13:40 <merijn> halogenandtoast: Where have you tried to learn it from?
13:41 <halogenandtoast> The one book I tried to read scared me away.
13:41 <merijn> halogenandtoast: TaPL?
13:41 <Cale> merijn: Yeah, too much of my day is taken up with writing Haskell programs to really work all that much on it.
13:41 <halogenandtoast> Category Theory by Steve Awodey
13:41 <merijn> halogenandtoast: That's category theory, not type theory
13:41 <Cale> That's not even a book on type theory
13:41 <halogenandtoast> well shit
13:41 <merijn> halogenandtoast: Also, that book is murder for your brain
13:41 <halogenandtoast> merijn: It was!
13:41 <halogenandtoast> See what it did to me!
13:41 <merijn> halogenandtoast: Get a copy of Types and Programming Languages by Pierce
13:42 <halogenandtoast> I confused category and type theory
13:42 <merijn> halogenandtoast: It is, like, orders of magnitude simpler than Awodey
13:42 <merijn> halogenandtoast: And comes with runnable example code!
13:42 <Cale> I dunno, it's a pretty gentle intro to category theory as far as those go. But yeah, it might not be easy if you have not much of a mathematical background.
13:42 carlomagno joined
13:42 <ski> @where TaPL
13:42 <lambdabot> http://www.cis.upenn.edu/~bcpierce/tapl/
13:42 <merijn> Cale: Yes, but that's only because all CT intros are murder
13:42 <Cale> (and you don't have someone sitting nearby to help)
13:43 <halogenandtoast> merijn: I'll check it out
13:43 <halogenandtoast> I've actually been wanting to write a simple statically typed programming language
13:43 <halogenandtoast> so maybe this will give me a leg up.
13:43 <mniip> hmm
13:43 wei2912 joined
13:43 <mniip> while we are on this topic
13:44 <merijn> halogenandtoast: It should be far more accessible for you. It starts with untyped lambda calculus and builds all sorts of type systems on top of that. There's example interpreters/type checkers included (in OCaml, but basic enough you should be able to grok it with only Haskell experience)
13:44 <mniip> can someone explain
13:44 joco42 joined
13:44 <Cale> I think it could be fine for a bunch of beginners as a textbook, but 1) you need to read it much slower than the average book (but not slower than the average mathematics text), and 2) it's going to be really hard to self-teach if you don't already have a strong mathematics background
13:44 <mniip> what fills the gap between Hindley-Milner and OutsideIn
13:44 <merijn> halogenandtoast: You should be able to write a simple statically typed language without getting further than like halfway through TaPL
13:44 mjs2600 joined
13:44 <halogenandtoast> merijn: great I'll actually read this
13:44 <merijn> halogenandtoast: 2/3rds should cover most of Hindley-Milner/extension free Haskell
13:44 <Cale> mniip: Perhaps stuff like System F_omega?
13:44 primal joined
13:45 <halogenandtoast> then return as a qualified person.
13:45 <ski> merijn : "Conceptual Mathematics: A First Introduction to Categories" by Steve Schanuel and William Lawvere isn't that bad, i think
13:45 Robin joined
13:45 <merijn> halogenandtoast: (I say this as someone whose read most of TaPL and struggled to get past, like, chapter 2 of Awodey :p)
13:45 oisdk joined
13:46 <sullyj3> @pl flip $
13:46 <lambdabot> (line 1, column 7):
13:46 <lambdabot> unexpected end of input
13:46 <lambdabot> expecting white space or simple term
13:46 <merijn> ski: My problem is that most of the CT stuff is written with a math background assumed. So all the focus/explanation doesn't relate to the stuff I wanna know
13:46 <halogenandtoast> merijn: I skipped out in chapter 1, I was spending too long remembering how to read math equations.
13:46 <sullyj3> @pl flip ($)
13:46 <lambdabot> flip id
13:46 moongazer joined
13:46 <halogenandtoast> flip id is one of my favorite types
13:46 <halogenandtoast> :t flip id
13:46 <lambdabot> b -> (b -> c) -> c
13:46 <Robin> anyone at KA????????
13:46 saussure joined
13:46 <merijn> ski: Where "what I wanna know" is basically "the PL papers are starting to refer to CT, but I don't understand enough to get what they mean"
13:46 <halogenandtoast> by type I mean type signatures.
13:46 <wz1000> What is the outlook for first class ghc support for row types>
13:46 <ski> merijn : aye. there's not that many books written from a CS perspective. there's a few, though
13:46 peti left
13:46 <merijn> wz1000: Don't hold your breath ;)
13:46 <wz1000> Because that is what I really, really want
13:47 <merijn> wz1000: Same here
13:47 <merijn> wz1000: Be the change you want to see in the world! Hack GHC!
13:47 <Xion_> halogenandtoast: Wait what? Why isn't it just a -> a like id itself? o.0
13:47 <Cale> merijn: Yeah, also learning CT is probably somewhat of a waste of time if you have no intention of doing more than one field of mathematics -- you can just as well have someone stomp on the definitions from CT and apply them to your area, and from there just understand them not-abstractly
13:47 <halogenandtoast> Oh that's one thing I wanted in Haskell. Not to have name clashes on records.
13:47 <halogenandtoast> Xion_: ah ha
13:47 <sullyj3> halogenandtoast: I'm basically looking for an infix for programming in a concatenative, "data flows right" style
13:47 rickygee joined
13:47 <halogenandtoast> :t flip
13:47 <lambdabot> (a -> b -> c) -> b -> a -> c
13:47 <halogenandtoast> :t id
13:47 <lambdabot> a -> a
13:47 <halogenandtoast> you have to specialize id
13:47 <Xion_> oooh, right
13:47 <wz1000> Vinyl and TH just aren't satisfying to use
13:48 <halogenandtoast> (a -> b) -> (a -> b) is still id
13:48 av joined
13:48 <Cale> merijn: But it is fairly beautiful on its own, so one of those fields of mathematics might be category theory itself.
13:48 <halogenandtoast> then plug in the holes
13:48 <merijn> Cale: My problem is, I try to read the stuff edwardk and co write and I don't get half the explanations/references without that background
13:49 <lpaste> av pasted “Binary” at http://lpaste.net/355811
13:49 <edwardk> category theory is for me a good way to steal results by analogy from all sorts of places
13:49 <av> Hi guys, I need some help, this is the problem: http://lpaste.net/355811
13:49 <Cale> merijn: ah, yeah
13:50 <edwardk> there are a ton of combinators we'd never have figured out in lens without that sort of formal basis as well
13:50 <merijn> Cale: Or Conal, etc. and there's no sorta "here's what you need to know" primer for that stuff
13:50 <av> Loading it into ghci works fine on all but one computer of mine. Each have the same GHC, all packages locally installed with cabal, and only one of them gives me this error:
13:50 <ski> halogenandtoast : have you tried looking at "Polymorphic Type Inference" by Michael I. Schwartzbach in 1995-03 at <http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/TYPE/typeinf.p(s|df)> ? .. it doesn't explain in as much detail as a book, but more than the typical type system paper. might be useful to glance at
13:50 <lpaste> av pasted “Binary” at http://lpaste.net/355812
13:50 <edwardk> merijn: the trick is 'what you need to know' is constantly expanding as we learn how to apply more category theory
13:50 <wz1000> edwardk: That sounds fascinating. Have you written about it somewhere?
13:50 <av> What's going on here?
13:50 <halogenandtoast> ski: would you recommend reading it before or after TaPl
13:51 <merijn> edwardk: Sure, but right now I don't even understand the basics
13:51 <Xion_> :t flip id 42 id
13:51 <lambdabot> Num c => c
13:51 <Xion_> Silliness.
13:51 <halogenandtoast> av: I'm a beginner but I don't think that's a instance declaration
13:51 <merijn> halogenandtoast: TaPL can be read with little to no background, IMO (well, basic lambda calculus and FP knowledge helps)
13:51 <halogenandtoast> merijn: check
13:51 ErinvanderVeen joined
13:51 <edwardk> i spent a good chunk of compose talking to folks about simplicial sets and operations of that sort for instance, to reason about environment manipulation, leader election in distributed processes, etc.
13:51 <merijn> halogenandtoast: Since it's written to be (at least partially) suitable for undergrad students
13:52 <edwardk> that was barely on my radar a few years back
13:52 <Cale> merijn: I was going to take Ali Abrar (my coworker) through Awodey's book and see how far we get, but we haven't really scheduled things yet. Perhaps we should include some additional people :)
13:52 oisdk joined
13:52 <ski> halogenandtoast : you could take a glance at the start of it right now, and see what you think. probably some of the latter sections will be mostly over your head, without some experience with what they're talking about. but i can say that i found this paper helpful, when i started reading about type systems
13:52 <ventonegro> I ordered TaPL for the library office but I'm going through the Idris book at the moment, wondering when I will get out at the other side...
13:53 <ventonegro> office library*
13:53 meba joined
13:53 <edwardk> merijn: starting from nothing,, you might want to look at something like the lawvere and schanuel book "conceptual mathematics"
13:53 <edwardk> that book doesn't go very far, but it does drill the crap out of the topics it covers
13:54 <av> A hint: if I omit the "V3" constructor, i.e. don't mix binary with linear, the code works fine in all cases. GHC is 8.0.1 on all machines, fyi.
13:54 <ski> halogenandtoast : you don't need to understand everything to have gain from it. you can skip parts, and perhaps later come back to it, or perhaps try to hunt down some paper in the references, in the hope that it'll go more into details of basics (that's a general strategy i use when reading papers)
13:54 <edwardk> where most category theory books just assume you are going to read at an incredibly slow methodical pace and that every nuance of every word matters
13:55 <halogenandtoast> edwardk: Any suggestions for a beginner outside of school to get their feet wet.
13:55 <halogenandtoast> Particularly ones with practical examples.
13:55 coot____ joined
13:55 <ski> halogenandtoast : if you have some experience with how polymorphism (subtyping) works in an OO setting, and some with what the same term "polymorphism" means in e.g. Haskell, then possibly parts of "On Understanding Types, Data Abstraction, and Polymorphism" by Luca Cardelli,Peter Wegner in 1985-12 at <http://lucacardelli.name/Papers/OnUnderstanding.A4.pdf> could also be helpful
13:55 primal_ joined
13:55 <wz1000> I've been holding off reading too much CT until I know enough algebra
13:55 <halogenandtoast> ski: I do
13:55 <mniip> edwardk, any idea what I should read to have a better understanding of type theory papers
13:55 <merijn> edwardk: Well, for the forseeable future I don't have much time anyway, so I guess I'll just have to be confused for now :)
13:55 saussure joined
13:55 <edwardk> halogenandtoast: https://www.quora.com/What-is-the-best-textbook-for-Category-theory?share=1 <- gives my usual recommendations for category theory text books.
13:56 <merijn> mniip: Depends, what's your current knowledge level?
13:56 <halogenandtoast> edwardk: Thanks, I'll look into them.
13:56 <edwardk> bartosz milewski has a pretty accessible set of lectures on the topic, giving you an intro to category theory with a strong haskell accent
13:56 <edwardk> (and a slight polish one)
13:56 <halogenandtoast> edwardk: I've started watching some of his stuff.
13:56 <ski> mniip,halogenandtoast : also reading Philip Wadler papers helped me. they're often quite accessible
13:56 qubits joined
13:57 <Cale> wz1000: Yeah, it can help to see the same patterns a few times in different areas of mathematics (especially algebraic ones), before jumping into category theory. But from another perspective, category theory can be treated in a way where it's not more or less abstract than, say, group theory.
13:57 <edwardk> ski++ # wadler's papers on things like monads really helped cement them in my brain when i was new to haskell
13:57 <edwardk> av: what is going wrong with the binary instance?
13:58 <mniip> merijn, how do I evaluate it
13:58 <halogenandtoast> av: Your code compiles for me btw.
13:58 <merijn> mniip: Well, is it basically "I grok most haskell extensions, but have no solid foundation"?
13:58 <ski> halogenandtoast : i remember it also helped a lot when someone on <news:comp.lang.functional> explained that the "division line" in type system notation means "if all of the things above the inference stroke/line hold, then then thing below also holds" ;)
13:58 <halogenandtoast> or the small example you provided.
13:59 <av> av: no idea, take a look at the second paste of mine for the errors, it's on a fresh install, with the packages I need manually installed using cabal. Again, it works on two machines, but fails on the third.
13:59 ystael joined
13:59 <halogenandtoast> ski: I'll copy that line for reference later on.
13:59 <wz1000> Cale: I tried learning algebra a few years ago, but didn't get very far. But then I learnt enough linear algebra to make sense of the examples
13:59 <mniip> merijn, I've tried reading papers, and I can understand some stuff
13:59 <mniip> but yes, no solid foundation
13:59 ystael_ joined
14:00 <ski> halogenandtoast : the first paper i mentioned is good in the way that it goes more into why we use type environments, and what they're good for, in addition to how to read typing rules
14:00 <merijn> mniip: Right, then I'd say TaPL for you as well :)
14:01 <av> edwardk: no idea, take a look at the second paste of mine for the errors, it's on a fresh install, with the packages I need manually installed using cabal. Again, it works on two machines, but fails on the third.
14:01 <ski> (and probably also in some other ways i've forgotten atm)
14:01 <merijn> mniip: That's everything from untyped up to "how to typecheck Java style subtyping", System F, higher rank, etc.
14:01 <edwardk> if you use ghc-pkg list can you see if the versions of binary or linear differ between machines?
14:02 meag joined
14:02 <mniip> merijn, I meant more of...
14:02 <mniip> what's with the Gamma thing
14:02 <edwardk> av: can you link the errors again? i can't find it in the scrollback noise
14:02 xinming joined
14:03 rickygee joined
14:03 dbmikus joined
14:03 <av> edwardk: http://lpaste.net/355811 and http://lpaste.net/355812
14:03 oisdk_ joined
14:04 <merijn> mniip: Common meta variable for "environment"
14:04 <av> edwardk: there's a difference indeed, on the old machine it's linear-1.20.5 and binary-0.8.4.1, the new one has linear-1.20.6 and binary-0.8.5.1
14:04 <edwardk> which one broke?
14:04 <mnoonan> that's another place where TaPL is great.. scan forward until the first appearance of a symbol :)
14:04 <ski> mniip : ⌜Γ⌝ is the conventional variable name for a type environment
14:04 primal joined
14:04 <mniip> what is a "type environment"
14:05 <av> edwardk: the newer one: linear-1.20.6 and binary-0.8.5.1
14:05 <mniip> is it like a set of statements?
14:05 <merijn> mniip: Bindings in scope
14:06 <ski> mniip : ⌜Γ ⊢ e : τ⌝ means : Given the association of free variables to types in ⌜Γ⌝ (which then says which variables are in scope), the expression ⌜e⌝ has type ⌜τ⌝
14:06 <av> edwardk: Just downgraded to binary-0.8.4.1, same thing happens (error still there)
14:07 <mniip> ski, is it an atomic expression
14:07 <mniip> or can it be torn apart into ⊢ and :
14:08 <ski> mniip : ⌜Γ ⊢ e : τ⌝ is a three-place (meta-language) relation, with parameters ⌜Γ⌝,⌜e⌝,⌜τ⌝
14:08 mb013619 joined
14:09 <ski> mniip : ⌜Γ⌝ is a set (or sometimes list) of variable typings, like ⌜x : Integer,y : Bool,z : Integer -> Bool⌝
14:09 Big_G joined
14:09 <ski> mniip : so ⌜Γ ⊢ e : τ⌝ can also be thought of as claiming that the expression typing ⌜e : τ⌝ follows from assuming all the individual variable typings in ⌜Γ⌝
14:10 <av> edwardk: downgrading binary further to 0.8.3.0 appears to fix it!
14:11 hurkan joined
14:11 juanpaucar joined
14:11 dbmikus joined
14:11 <edwardk> av: that is discouraging
14:11 <* hackage> hnormalise 0.3.0.0 - Log message normalisation tool producing structured JSON messages https://hackage.haskell.org/package/hnormalise-0.3.0.0 (AndyGeorges)
14:12 <ski> mniip : e.g. ⌜x : Integer,z : Bool ⊢ (z,\y. x + y) : Bool × (Integer → Integer)⌝ is an example typing judgement (using the common ⌜⋯ × ⋯⌝ notation for product types (cf. cartesian product of sets), rather than the Haskell pair (tuple) type notation `(...,...)')
14:12 ChristopherBurg joined
14:12 juanpaucar joined
14:13 <av> edwardk: now the question is there binary is broken or I failed to stay up to date with API changes...
14:13 <mniip> I see
14:13 <av> s/there/whether/
14:13 <sullyj3> If you could add 5 unicode symbols to the keyboard in order to make programming with them practical, what would they be?
14:13 <edwardk> good question
14:13 <ski> mniip : so the answer to "is it an atomic expression or can it be torn apart into ⊢ and :" is .. both, whichever you please. formally/syntactically, it's usually treated as a three-place-relation, though
14:14 <edwardk> if you throw an issue on the linear issue tracker on github we can make sure to follow up
14:14 <edwardk> it seems likely to be a binary issue though
14:14 eklavya joined
14:15 <av> edwardk: OK, will do when I find some time, for now it seems to work if I just downgrade binary
14:15 <ski> mniip : anyway, if you want to, you could take a look as well at the two papers i mentioned above for halogenandtoast ..
14:16 <av> edwardk: thanks for your great work, btw, but I just have to mention the hell of a time I had installing ad a few months ago: I have to go through tor on one machine to install things, and the privoxy I use to access tor blocked ad because it was -- well -- named "ad"!
14:16 <ventonegro> sullyj3: lambda for lambda expressions, \z -> ... sucks
14:16 <mniip> ski, what's up with the (X) in HM, OutsideIn
14:16 <sullyj3> ∘, λ, →, ∅, ↦
14:16 Gurkenglas joined
14:16 thunderrd joined
14:16 <ertes-w> edwardk: while you're here… would you be open to adding some utility functions to kan-extensions for Codensity for stuff like exception handling? if yes, i'll send a PR instead of creating a separate package
14:17 tromp joined
14:17 <ventonegro> `λx -> x + x`
14:17 <wz1000> http://lpaste.net/355813
14:17 <mniip> sullyj3, the only symbol I can think of is ∀
14:17 <wz1000> Why does x typecheck but not y
14:18 <mniip> for the symbols you posted, I'm ok with their ascii renditions
14:19 <mniip> wz1000, welcome to RankNTypes
14:19 <ski> mniip : logically, the symbol ⌜⊢⌝ as in e.g. ⌜A,B ⊢ C⌝ means "from ⌜A⌝ and ⌜B⌝, ⌜C⌝ follows". it goes back to Gottlob Frege's "Begriffsschrift" (a two-dimensional notation for logical formulae. also had higher-order functions and macros) in the late 1800s
14:19 <mniip> wz1000, $ is special like that because for typechecking it is equal to ' '. In general RankNTypes inference is undecidable
14:19 primal joined
14:20 Sgeo joined
14:20 <ski> mniip : iirc, that's a variable part of the type system where you can "plug in" any constraint system `X' (such as type class constraints, "record lacks" constraints, equality constraints, subtyping constraints, &c.) into the surrounding framework of the type system being presented
14:20 <sullyj3> ventonegro: `λx ↦ x + x` :)
14:20 <* ski> approves of sullyj3's version
14:20 <av> edwardk: thanks again, have to leave now, see you later
14:20 earldouglas joined
14:21 Faucelme joined
14:21 portnov joined
14:22 <portnov> hi all
14:22 Xion__ joined
14:22 xall joined
14:23 <mniip> ski, and a constraint system is?
14:23 <portnov> qnikst: https://github.com/portnov/libssh2-hs/issues/30
14:23 rickygee joined
14:23 Xion_ joined
14:24 <ventonegro> sullyj3: I would gladly remap some of the f-keys for that
14:24 <ski> mniip : do you know any Prolog (or other logic programming system) ?
14:24 <mniip> yes
14:25 <mniip> I haven't touched it in years but I have residual memory of the programming paradigm
14:25 marmalod1 joined
14:26 rblaze joined
14:26 <sullyj3> ventonegro: ooh, good idea
14:26 <ski> basic Prolog only have equality constraints (on terms/trees). the most exciting part of it is that you can alias two variables with each other, before binding/instantiating/initializing them. then, as soon as you give one of them a value, the other will automatically be given the same value as well
14:27 <c_wraith> spooky assignment at a distance
14:27 <ski> several Prolog systems add some kind of disequality constraints on top of that. so that you can claim that two variables are not equal before either having a value. if you later try to give both the same value, the constraint system will detect the inconsistency (this can be useful for modularity purposes, e.g.)
14:27 primal_ joined
14:28 <ski> c_wraith : yes, aliased logic variables feel a bit like working with pointers .. only that (partly due to that you can't reassign to a logic variable) you can reason logically/declaratively more easily about code which uses them
14:28 <mniip> I have a good grasp on logic variables as they appear in prolog
14:29 <mniip> and maybe as they appear in haskell
14:29 fendor joined
14:29 <mniip> not that the two are the same
14:29 <ski> type variables in Haskell types behave like logic variables in logic programming
14:29 quobo joined
14:30 <mniip> ski, alright so
14:30 Sgeo joined
14:30 HarveyPwca joined
14:30 mizu_no_oto joined
14:30 <ski> (there's some differences in parts of the systems, but the basics of that is the same)
14:30 bigos joined
14:31 <ski> mniip : anyway, there's the paradigm of constraint programming, which probably is most nicely expressed in its combination with logic programming as CLP, constraint logic programming
14:31 ertes joined
14:32 <mniip> can this be formalized?
14:32 tristanp joined
14:32 <mniip> I feel like it has to be formalized before we can talk about how HM is parametric in it
14:32 <mniip> parameterized by it?
14:33 <ski> mniip : there's constraint systems like CLP(R), which allows you to express equations, inequations, and disequations between real number expressions. think of "linear programming"
14:33 <ski> and CLP(Q), which is similar, but for rational numbers
14:33 <mniip> ooooh
14:33 <ski> CLP(FD) is for reasoning about constraints for finite domains, which tends to mean integers in practice
14:33 <mniip> this starts to connect with my "theory of formal systems" course
14:33 <mniip> I think
14:34 <ski> there's CLP(BN), for Bayesian Network reasoning with probabilities
14:34 <mniip> ski, are you talking about a system of judgements with "real number atoms"?
14:34 <ski> so, there's all these different constraint solvers, for particular constraint problem domains
14:34 <dmiles> CLP(Set) allows for partially instantiated sets
14:34 Boomerang joined
14:35 <ski> the point is that one is able to (programmatically) "post/tell" constraints between variables (which *haven't* been associated before with values, or computations which'll hopefully produce such), and the constraint solver is then expected to :
14:36 jao joined
14:36 <ski> (a) determine whether the posted constraints, taken together, are inconsistent, without a model (iow an assignment of values to the variables which makes all the constraints hold true) or not
14:36 obihann joined
14:36 ErinvanderVeen joined
14:37 <mniip> I'm lost
14:37 <ski> (b) simplify the posted constraints to "solved form", possibly removing (*satisfiable*, iow not inconsistent) constraints which only involve intermediate/internal variables (as opposed to "end variables", which one is really interested in)
14:37 coltfred_ joined
14:37 primal joined
14:37 <ski> e.g. if we post `x > x + 1', our solver should alert us that this is impossible
14:37 chlong joined
14:38 <APic> Aaaah.
14:38 <bodisiw> MiniZinc is my favorite new language for this stuff
14:38 ragepandemic joined
14:39 rickygee joined
14:39 <mniip> ski, how did we get from prolog to this
14:39 <shapr> lambdaProlog?
14:39 <ski> mniip : one example of using constraints would be to automatically lay out graphical components on a screen without overlapping. or generate a schedule from given activities with a specified dependency relation and perhaps restrictions on which resources are needed for each, and which resources are available
14:40 <ski> mniip : several constraint solvers are integrated with Prolog systems
14:40 <dmiles> most prologs contain CLP libraries
14:40 <mniip> no like
14:41 <mniip> we were talking about Prolog, you said that its handling of variables is an example of a constraint system
14:41 yellowj joined
14:41 zcourts joined
14:41 <ski> mniip : anyway, in general, one can speak of `CLP(X)' as a generic model of constraint (logic) programming, where the particular constraint domain `X' can be filled in with a particular theory about how to simplify constraints, and detect inconsistency. such as a theory for how to solve linear equations and inequations in real numbers
14:42 <dmiles> in order to implement the constraint systems of prolog there are some rudemntary constraint parts that are genralized to control even just varaible assignments
14:42 <* dmiles> saying the same things as ski
14:42 <ski> mniip : yes, handling equality (implemented by unification, logic variables) in Prolog is a constraint system, granted a quite simple one
14:43 Kreest_ joined
14:43 latro`a joined
14:43 mbuf joined
14:43 dni joined
14:43 <mniip> so how is it formalized
14:43 <ski> mniip : .. if you compare with `HM(X)', then this is a specification of a general Hindley-Milner style type system, with a "pluggable component" `X', which a user of this system could specify to the type class constraints e.g.
14:44 <mniip> what *is* and X, and how does 'HM' use it
14:44 <mniip> s/and/an/
14:46 <ski> mniip : there's a survey paper about constraint programming by Jaffar and Maher which goes into more formal details
14:46 <ski> "Constraint Logic Programming: A Survey" by Joxan Jaffar,Michael J. Maher in 1994 at <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.8566>
14:46 <ski> dmiles : hi there, btw :)
14:47 <ski> mniip : `X' there is just a variable-name, a stand-in for some unspecified particular constraint problem domain
14:47 <mniip> huh is that pdf backwards
14:47 mjs2600 joined
14:47 primal_ joined
14:48 <ski> er, it appears to be
14:48 <* ski> always looked at the PS version
14:48 oisdk joined
14:48 <mniip> ski, yes, but what is the Type of the variable
14:49 eyck joined
14:49 <mniip> your example of an X was unsatisfactory because you haven't defined exactly what the bounds of the X are
14:49 zcourts joined
14:50 Rodenbach joined
14:50 <ski> ok. yes, obviously the constraint system has to be presented (if possible) so as to fit a particular interface
14:50 aarvar joined
14:50 <ski> i don't recall the details of how they did that for HM(X)
14:50 mizu_no_oto joined
14:51 <mnoonan> ski, it's in the TaPL followup Advanced Topics in Types and Programming Languages
14:51 tempus joined
14:51 <mnoonan> I'm pretty sure that chapter is also available as a stand-alone paper
14:51 <ski> (<https://courses.engr.illinois.edu/cs522/sp2016/ConstraintLogicProgrammingASurvey.pdf> looks to not be backwards, though, at least here, the font looks less readable. perhaps better if printed, dunno)
14:51 romank joined
14:52 uglyfigurine joined
14:52 mjs2600 joined
14:53 <ski> bodisiw : i still have to look at MiniZinc
14:53 <dmiles> I was looking at the Haskell APT the other month and they were tryinhg to formallize prolog like varaibles and poissibly what they can be bound to.. theyt had to create tehis type of Any
14:53 <dmiles> APT/ATP
14:55 <mniip> ski, that's what I'm trying to understand
14:55 nickolay joined
14:55 <ski> dmiles : Seres and Spivey has this paper about implementing logic variables in Haskell. and Koen Claessen did a follow-up on that, improving efficiency and making the logic variables typed, by using "state threads and reference cells" (`ST' and `STRef')
14:55 <dmiles> so i was going to say just that intial formalizaion was showing some examples i was thinking made things already hard from the getgo
14:56 <ski> mniip : ok
14:56 buglebudabey joined
14:56 bodisiw joined
14:57 <dmiles> ski: that (?) / (?)Ref is a good idea
14:57 primal joined
14:58 <mniip> alright, I should probably finish TaPL
14:59 rickygee joined
14:59 <bodisiw> ski, i like minizinc... it seems like a good abstraction over many solving backends, which i'm sure will continue improve a lot in the near future
14:59 <ski> dmiles : "Lazy Functional State Threads" by John Launchbury,Simon L. Peyton Jones in 1993 at <http://homepages.dcc.ufmg.br/~camarao/fp/articles/lazy-state.pdf> explains `ST',`STRef',`STArray'. Mercury also has something similar, probably borrowed
15:00 SkyPatrol joined
15:00 <bodisiw> ski, i'd also like to figure out a bit more about http://newartisans.com/2017/04/haskell-and-z3/ but too noob when it comes to haskell still
15:00 buglebudabey joined
15:00 <ski> bodisiw : you're not in ##prolog (or #mercury) ?
15:01 dan_f joined
15:01 <ski> bodisiw : looks like an interesting post
15:02 <bodisiw> nope, unfortunately i have to limit myself... so i can get 'actual' work done in whatever small amounts
15:02 <* ski> nods
15:03 <dmiles> out of the 80 channels i am on i think i have a small handfull ski is not in
15:03 seangrove joined
15:03 <Axman6> oh I thought the name was familiar, I forgot MiniZinc as another Data61 project, it used to be all over the screens in the foyer at work
15:03 <Axman6> was*
15:04 obihann joined
15:04 <Axman6> bodisiw: I wrote a sudoku solver in Haskell using the Z3 bindings the other week, it ws much easier than writing a solver in Haskell from scratch
15:05 <bodisiw> nice!
15:05 <clamchowder> Hello
15:05 <zv> I wrote a SAT solver from scratch and it wasn't bad at all, Writing a SMT solver is a whole other can of worms
15:05 <bodisiw> using z3cat Axman6?
15:05 <Axman6> not sure what that is
15:05 <zv> Defining the Tsietin transformations is like, a can of *wyrms*
15:05 <bodisiw> oh, that specific package
15:06 <zv> Axman6: I assume he means concatenating bitvectors in QF_BV in the z3 solver
15:06 <Axman6> https://hackage.haskell.org/package/z3-4.1.0/docs/Z3-Monad.html
15:06 <bodisiw> ahh gotcha
15:06 <Zemyla> zv: I thought by SMT solver you meant Shin Megami Tensei. :V
15:07 <Axman6> I ended up representing it using 4-bit vectors for each square - tried to do something funky with 9-bit vectors and one-hot-coding, but it was a lot slower than the obvious solution
15:07 primal_ joined
15:08 oisdk joined
15:08 sepp2k joined
15:08 <* Axman6> wonders if there's a non circuit design name for one-hot-coding
15:10 gawen joined
15:10 cyborg-one joined
15:10 <ski> "one-hot-coding" being what demux/mux does ?
15:10 <ski> (or uses, rather)
15:10 <Axman6> possibly AKA "powers of two" :\
15:11 <Axman6> it's just a vector where exactly one bit is true
15:11 <* hackage> titan 0.1.0.0 - Testing Infrastructure for Temporal AbstractioNs https://hackage.haskell.org/package/titan-0.1.0.0 (keera_studios_ci)
15:11 <qnikst> portnov: oh will take a closer look (I didn't receive notification for some reason)
15:11 <Axman6> apparently quite common in representing state machines
15:11 <ski> ok. which is the input of demux, and output of mux :)
15:11 <qnikst> portnov: I'd be happy to get rid of c2hs there, but I don't remember how much it will cost there :]
15:12 <Axman6> I guess so... my muxes always multiplexed more than one bit :P
15:12 ragepandemic joined
15:12 Sgeo joined
15:13 im0nde joined
15:14 <portnov> qnikst: as far as i see, this problem is not caused by c2hs, but by changes of libssh2 api itself. Last time when I looked into this library, i used libssh2, it was 1.2.8, now it is 1.8.0. And now documentation says we should use standard poll(2) instead of libssh2's poll* functions.
15:14 tomphp joined
15:14 SenpaiSilver_ joined
15:15 gcross joined
15:17 primal joined
15:18 pera joined
15:20 buglebudabey joined
15:20 strykerkkd joined
15:21 tromp joined
15:22 oisdk joined
15:23 Itkovian joined
15:24 oisdk joined
15:25 JBbankss joined
15:26 buglebudabey joined
15:26 netheranthem joined
15:26 CyberShadow left
15:26 djanatyn joined
15:30 FreeBirdLjj joined
15:31 <athan> Given that I have some arbitrary `xs :: [(a,b)]`, how can I use that to construct a function `a -> b` which is total over `fst <$> xs`? And does this already exist in quickcheck?
15:31 sleffy joined
15:31 yqt joined
15:31 cschneid_ joined
15:31 <athan> oh wait, this is just a `fromJust . lookup` sorry :x
15:32 eyck joined
15:32 <* hackage> yaml 0.8.23 - Support for parsing and rendering YAML documents. https://hackage.haskell.org/package/yaml-0.8.23 (MichaelSnoyman)
15:32 oisdk joined
15:34 eschnett joined
15:35 alfredo_ joined
15:35 rickygee joined
15:35 mjs2600 joined
15:35 dni joined
15:35 oisdk joined
15:35 zachk joined
15:36 conal joined
15:36 marinelli joined
15:36 netheranthem joined
15:36 ErinvanderVeen joined
15:37 augur joined
15:38 primal_ joined
15:38 LordBrain joined
15:38 buttbutter joined
15:39 <marinelli> hi everyone
15:39 <shapr> hi marinelli
15:39 <shapr> How's code?
15:41 <* APic> laughs magically.
15:42 indi_ joined
15:42 osa1 joined
15:42 osa1 joined
15:43 Icewing joined
15:43 urodna joined
15:44 <shapr> APic: magic code?
15:44 <APic> Probably.
15:44 clamchowder left
15:44 gaze__ joined
15:44 clamchowder joined
15:44 <shapr> I'm enjoying doing simple stuff with Spock
15:44 buglebudabey joined
15:44 <APic> k
15:44 <shapr> APic: what are you writing?
15:45 <APic> No Idea.
15:45 joco42 joined
15:45 Costar joined
15:48 primal joined
15:49 Itkovian joined
15:50 eklavya joined
15:51 rickygee joined
15:51 trism joined
15:54 raichoo joined
15:54 <Unode> hi all, if I have two stack projects living in different locla directories,
15:54 <Unode> *local directories, is there any standard way to include modules from one in the other?
15:55 <Unode> I'm familiar with the --package syntax for external dependencies but haven't found an example of how to use this to reference local projects not available upstream
15:56 mmhat joined
15:56 <dmj`> Unode: you could add the hs-source-dirs of one into the other. Has nothing to do w/ stack really. Can one pkg just depend on the other?
15:56 <* ski> suspects APic of implementing magic sets
15:56 <APic> Not my Dept.
15:56 {emptyset} joined
15:57 <sm> Unode: add local dir to package list in stack.yaml
15:57 <Unode> dmj`: at this point is just for development purposes. This will all be under the same project at some point but to avoid rebuilding the entire project I'm keeping it independent.
15:57 <sm> this is it's hard to miss in the docs
15:58 primal_ joined
15:58 acarrico joined
15:59 eschnett joined
15:59 kmels joined
15:59 simukis joined
16:00 pandeiro joined
16:01 yamad joined
16:03 Noldorin joined
16:03 ertes joined
16:04 Sonolin joined
16:05 oisdk joined
16:05 indi_ joined
16:06 <qnikst> portnov: lets do that
16:06 afarmer joined
16:06 chrisdotcode joined
16:07 LAZAR joined
16:07 Sh4rPEYE joined
16:07 <portnov> qnikst: I did nearly that: https://github.com/portnov/libssh2-hs/commit/4204798b4f0cbfd7fbc596723c8584daa9eb31bb
16:07 <portnov> it works for me on debian and ghc8. at least does not crash and does not hang on large files. maybe you have comments on these changes in code?
16:07 primal joined
16:08 <LAZAR> I wrote a Knapsack problem solver, anyone has an idea why it is slow for inputs > 1.000.000? The function is fillKnapsack, I just wonder if it could not be faster: https://github.com/AdHominem/CIS194/blob/master/Knapsack.hs
16:09 <* hackage> criterion 1.2.0.0 - Robust, reliable performance measurement and analysis https://hackage.haskell.org/package/criterion-1.2.0.0 (ryanglscott)
16:09 tommd joined
16:10 flatmap13 joined
16:11 rickygee joined
16:11 |sync| joined
16:12 Elish joined
16:12 <ph88> LAZAR, run prof
16:13 <ph88> https://github.com/jaspervdj/profiteur
16:13 <LAZAR> You can also try the app using docker by pulling from adhominem/knapsack
16:13 ianclark joined
16:13 mrkgnao joined
16:14 <portnov> heh
16:14 <portnov> sorry if... but just...
16:14 <LAZAR> ph88 what is profiteur?
16:14 <ph88> viwer for profile files
16:15 <ph88> stack build --profile --fast --ghc-options="-j -auto-all +RTS -A128m -n2m -RTS"
16:15 <ph88> stack exec -- myProgram --help +RTS -p
16:15 <ph88> use this to make profile files
16:16 <portnov> >> I wrote a Knapsack problem solver
16:16 <portnov> me: WUT o_O
16:16 <portnov> >> anyone has an idea why it is slow for inputs > 1.000.000?
16:16 <portnov> me: ah, everything is ok, world did not turn upside down yet...
16:16 uglyfigu_ joined
16:16 buglebudabey joined
16:16 <portnov> :)
16:17 hybrid joined
16:17 primal_ joined
16:17 tromp joined
16:18 poxar joined
16:18 <LAZAR> ghc --make -auto-all -prof your-program.hs gives me some errors on compilation
16:18 bollu joined
16:18 StianL joined
16:20 uglyfigurine joined
16:20 <Cale> LAZAR: Note that xs !! n takes O(n) time
16:21 <Cale> That might or might not be something to worry about
16:21 slackman joined
16:21 ertes joined
16:21 <LAZAR> Cale: You think the most effort is the generation of items?
16:21 <Cale> Also, the pseudorandom generator in System.Random is notoriously slow
16:22 <LAZAR> Cale: I just see its not... both attributes and names are pretty short arrays and generateItems does not scale with input
16:22 bennofs joined
16:24 fotonzade joined
16:24 tzh joined
16:24 mizu_no_oto joined
16:25 <LAZAR> Cale: I just see I print the first 100 items and also access length items, will that be lazy evaluated?
16:25 lambdaTom joined
16:25 davean joined
16:26 slackman joined
16:26 rickygee joined
16:27 ianclark joined
16:27 <Cale> LAZAR: length has to traverse the entire list
16:27 SpinTensor joined
16:28 primal joined
16:28 freeside joined
16:28 ertes joined
16:29 juanpaucar joined
16:29 kjanosz joined
16:31 armyriad joined
16:31 kadoban joined
16:34 target_i joined
16:34 Krocyon joined
16:36 alfredo joined
16:36 <orion> I don'
16:37 <orion> I don't hear much about reflection. Is it me, or is it generally not that popular?
16:37 primal_ joined
16:38 juanpaucar joined
16:38 <wz1000> orion: You mean like Typeable and Generic?
16:39 raynold joined
16:39 WhereIsMySpoon joined
16:39 WhereIsMySpoon joined
16:40 <orion> https://hackage.haskell.org/package/reflection
16:40 inad922 joined
16:40 markus1189 joined
16:40 markus1199 joined
16:41 <cocreature> orion: it’s definitely not superpopular
16:41 <portnov> probably the mention of the Oleg in the header makes everyone look to other side
16:42 mattyw joined
16:42 <orion> What's wrong with Oleg?
16:42 juanpaucar joined
16:43 jleon joined
16:43 grumble2 joined
16:43 <cocreature> orion: nothing but he’s known for “advanced haskell”
16:43 juanpaucar joined
16:43 <portnov> probably something is wrong with everyone like us, whos type-system kung-fu is measured in milli-olegs
16:43 <cocreature> although reflection is funny since it replaces all of Oleg’s clever trickery by one line of GHC internals
16:44 actualHuman_462 joined
16:44 <orion> Is there a personal feud between Oleg and Ed?
16:44 <nshepperd_> I just don't have that many opportunities to store things in types
16:45 <nshepperd_> I suppose if I needed to, I'd use reflection
16:46 joco42 joined
16:47 rickygee joined
16:47 <Cale> orion: That seems doubtful :)
16:47 SeMas joined
16:48 zv joined
16:48 aarvar left
16:50 furkanmustafa joined
16:50 yogsototh joined
16:51 <orion> Is there any technical reason to avoid reflection?
16:51 <uglyfigurine> https://news.ycombinator.com/item?id=14402378#14409595
16:52 <bollu> cocreature: ping
16:52 <cocreature> bollu: pong
16:53 primal joined
16:55 WhereIsMySpoon joined
16:55 WhereIsMySpoon joined
16:56 gestone joined
16:56 <bollu> so, we just need to read the intrinsics file and generate haskell code, yeah?
16:56 <bollu> can you use TH for this?
16:57 <cocreature> bollu: no we can’t. llvm-hs-pure does not depend on the LLVM library so when we install it we can’t access the .td file
16:57 <bollu> cocreature: ah, I see
16:57 <cocreature> bollu: so we’ll have to generate an actual file that we update from time to time and bundle that with llvm-hs-pure
16:57 <bollu> cocreature: so, some kind of pre-processing step?
16:57 cyborg-one joined
16:58 <bollu> cocreature: yeah, we could perhaps version control the stuff that generates this
16:58 <cocreature> sure
16:58 nbro joined
16:58 <bollu> cocreature: hmm, how would you organise this?
16:58 <nbro> Hello!
16:58 <bollu> nbro: hey!
16:59 <nbro> If someone is interested in alternatives to this chat (which a very active one, so you probably don’t need alternatives, but anyway…) here you have a chat room on SO: http://chat.stackoverflow.com/rooms/110313/haskell
16:59 <Cale> :S
16:59 <bollu> cocreature: we can write the generator in haskell? I
17:00 <cocreature> bollu: I think the best solution is probably to write a C++ TableGen backend that generates the Haskell code we want
17:00 <bollu> cocreature: hm
17:00 <cocreature> bollu: I’ve thought about it but I’m not sure if the effort of implementing a parser for TableGen is worth it
17:00 <bollu> cocreature: generating Haskell code is annoying by hand, I was hoping to write a haskell backend
17:00 <bollu> cocreature: I see
17:00 iAmerikan joined
17:00 <bollu> cocreature: is it that hard a format, or is it just a "why do the work"?
17:00 oberstein joined
17:01 drewbert joined
17:01 <cocreature> bollu: I haven’t really lookedinto how difficult writing a C++ backend is (as I mentioned earlier, the docs on that are missing) and I don’t know really know the format either :)
17:01 <bollu> xD I see
17:01 <bollu> cocreature: OK, I'll give this a shor
17:02 <cocreature> bollu: http://llvm.org/docs/TableGen/LangRef.html doesn’t look so bad so maybe writing it in Haskell is reasonable after all
17:02 <cocreature> if we can avoid writing C++ code then by all means let’s do it :)
17:02 rickygee joined
17:03 t7 joined
17:03 jleon joined
17:03 <cocreature> hm maybe not, it has loops and annoying stuff like that
17:03 SkyPatrol joined
17:04 <cocreature> although that seems to be the only control flow construct
17:04 gienah_ joined
17:04 meck joined
17:05 <bollu> cocreature: which loop construct?
17:05 <* hackage> servant-auth-cookie 0.5.0.3 - Authentication via encrypted cookies https://hackage.haskell.org/package/servant-auth-cookie-0.5.0.3 (zohl)
17:06 <cocreature> bollu: http://llvm.org/docs/TableGen/LangRef.html#foreach I got scared and thought they might have invented their own programming language including if statements and whatnot but it seems like they left it at simple loops
17:07 <mnoonan> is there some standard idiom that gives me this: class Container c i
17:07 <mnoonan> | c -> i where items :: c -> [i]
17:07 connrs joined
17:08 <mnoonan> (or maybe I should just provide a Getter or something?)
17:09 primal joined
17:11 fnurglewitz joined
17:11 jleon joined
17:11 <bollu> cocreature: how exactly do we use TableGen to get the intrinsics info?
17:11 baus8788 joined
17:11 <cocreature> bollu: take a look at include/llvm/IR/Itrinsics.td
17:12 <nbro> the nice thing about that chat is that messages are persistent even if you leave the chat room
17:13 <nbro> "nice", here, is relative, clearly
17:13 <bollu> cocreature: there's no foreach used in it
17:13 <bollu> cocreature: so technically we don't need to support it
17:13 <bollu> cocreature: I'm a strong believer of doing the minimal work possible :P
17:14 MarioBranco joined
17:14 <cocreature> bollu: yeah supporting only a subset is probably reasonable
17:14 <bollu> cocreature: yes, I mean, we can probably extend it and make sure we're doing the right thing later
17:14 <bollu> cocreature: but, for practical use, I'm okay with supporting the minimal amount
17:14 <bollu> cocreature: do you want to write the parser in say, megaparsec?
17:15 <bollu> cocreature: or do you want to use a parser generator?
17:15 <srhb> mnoonan: No, but many container-likes have a toList
17:16 eacameron joined
17:16 Achylles joined
17:16 <cocreature> bollu: I guess a parser generator is probably easier since you can just directly translate the grammar. but admittely I’ve not used alex/happy so far
17:16 <mnoonan> srhb: the problem is that I'm wrapping some foreign API types, many of which are containers (of other foreign types), but everything just has kind *.
17:16 balor joined
17:17 replay joined
17:17 skeuomorf joined
17:18 <cocreature> mnoonan: MonoFoldable?
17:18 <bollu> cocreature: neither have I, I've never used Haskell parser generators.
17:18 Krocyon left
17:19 <mnoonan> cocreature: ooh, that looks like the kind of thing I was after
17:19 epsilonhalbe joined
17:20 <mnoonan> thanks
17:20 <Lokathor> Stackage Nightly 2017-05-24: 0.5.7.1
17:20 <Lokathor> Latest on Hackage: 0.5.10.2
17:20 <Lokathor> rrrraugh
17:21 ianclark left
17:21 ianclark joined
17:21 ianclark left
17:22 ianclark joined
17:22 ianclark left
17:23 rickygee joined
17:23 ianclark joined
17:23 <bollu> cocreature: so, can we come to a consensus?
17:24 primal joined
17:26 jgertm joined
17:28 ertes joined
17:28 juanpaucar joined
17:29 primal_ joined
17:29 eazar001 joined
17:30 twomix joined
17:30 arpl joined
17:30 FreeBirdLjj joined
17:31 arpl left
17:32 yogsototh left
17:33 afarmer joined
17:35 mkoenig joined
17:37 TheInfosphere joined
17:38 afarmer_ joined
17:38 primal joined
17:38 rickygee joined
17:39 Bassetts joined
17:39 paolino joined
17:39 <cocreature> bollu: so I think the best solution is to write a parser & generator in Haskell based on alex/happy
17:39 Swizec joined
17:40 <Philonous> bollu, What are you people working on of you don't mind me asking?
17:40 <cocreature> Philonous: support for LLVM intrinsics in llvm-hs
17:40 <Philonous> Oh, neat!
17:40 <bollu> cocreature: I see, OK
17:40 <bollu> Philonous: yep :) I want it for this: http://github.com/bollu/simplexhc
17:41 <bollu> (shameless plug and all)
17:41 <bollu> cocreature: in the meantime, does it make sense for me to fork llvm-hs and simply setup the stuff I need?
17:41 <bollu> cocreature: like, I need 3 intrinsics literally :P
17:42 lambda-11235 joined
17:43 texasmynsted joined
17:43 jw0t0 joined
17:44 plutoniix joined
17:45 uglyfigurine joined
17:45 indi_ joined
17:45 plutoniix joined
17:47 leif_erikson joined
17:47 <cocreature> bollu: sure
17:48 primal_ joined
17:49 anton___ joined
17:49 <Lokathor> oh my gosh I think i've got myself in an actual MonadReader situation :/
17:49 fakenerd_ joined
17:53 joco42 joined
17:54 mjs2600 joined
17:54 elodinn joined
17:57 primal joined
17:58 <srhb> Lokathor: ?
17:58 <Lokathor> i've been building up a ton of local function definitions in a half-baked way because they all depend on window size and texture size data set at the top of main
17:59 rickygee joined
17:59 <Lokathor> what i obviously should do is use MonadReader to make them easily accessable from more than one place and break the funcs apart more
18:00 al-damiri joined
18:00 <Lokathor> "let foo arg = let"
18:00 <Lokathor> this is a sign
18:00 peterbecich joined
18:00 <clamchowder> I have a question in Parsec
18:00 kaychaks joined
18:01 <clamchowder> say I want to parse a string to find a '*' without any preceding spaces, and return the substring preceding the '*' if succeed
18:02 <clamchowder> here's what I have: p = manyTill anyChar (try ((noneOf " \t\n") >> (char '*')))
18:02 <EvanR> Lokathor: when you have program-wide parameters like that, another way is to use the reflection trick. another way is implicit params but thats wildly unpopular
18:02 obihann joined
18:02 <Lokathor> reflection trick?
18:02 <EvanR> ah the word is implicit configuration
18:02 <srhb> clamchowder: manyTill (noneOf " \t\n) >> char '*' seems better to start with
18:02 <EvanR> http://okmij.org/ftp/Haskell/tr-15-04.pdf
18:03 <srhb> Woops, missed a quote.
18:03 <srhb> Err
18:03 <Lokathor> oh boy a paper >_<
18:03 JakePeralta joined
18:03 <Lokathor> I think I'll just use MonadReader :P
18:03 <srhb> manyTill (noneOf " \t\n") (char '*')
18:03 <clamchowder> srhb: but that won't work for input string " a*"
18:03 <srhb> clamchowder: Oh, I thought you said that was invalid.
18:04 juanpaucar joined
18:04 <clamchowder> srhb: the character directely before * should not be a space
18:04 <srhb> clamchowder: Oh, oops!
18:04 <EvanR> Lokathor: its worth a read just to learn about what its calling "the configuration problem" which is what youre experiencing
18:04 <clamchowder> srhb: :)
18:05 <Lokathor> EvanR, i do seem to be having a config problem, yes. Specifically, I've got all these values which I need to normalize all the time
18:05 <clamchowder> The problem with my code is: the try ((noneOf " \t\n") >> (char '*')) part consumes the character that's right before the * when the parser succeeds
18:05 <EvanR> Lokathor: erm, you need to normalize all the time?
18:05 juanpaucar joined
18:05 <clamchowder> for example, when parsing "abc*", the returned substring is "ab", rather than "abc"
18:06 <srhb> clamchowder: Bail out to monadic style might be easier to begin with :)
18:06 <EvanR> how many normalizations does it take to become normal? ;)
18:06 <clamchowder> How do I fix this?
18:06 <Lokathor> well, not repeatedly, but building up that first suite of data is the tricky part
18:06 juanpauc_ joined
18:06 replay joined
18:06 <EvanR> oh the setup phase?
18:06 <Lokathor> yeah
18:06 <clamchowder> srhb: sorry what do you mean?
18:06 hybrid joined
18:07 <Lokathor> EvanR, this is for the glyph grid that I think you've mentioned wanting before. There's the row/col data in screen space, and the char data in texture space
18:07 <luigy> any tips on how to go about profiling/or things to look out for that make loading ~120 modules in one project take 6 times more versus another with also ~120 modules
18:07 <EvanR> i just have a big setup function that outputs a record of 6 finally setup things
18:07 <luigy> loading in ghci ****
18:07 primal_ joined
18:08 <Lokathor> EvanR, yeah I'm headed that way. Just trying to slowly explore things out
18:09 <sm> luigy: narrow it down to individual module(s)
18:09 Costar joined
18:09 <EvanR> Lokathor: but actually... i now realize i am passing this record awkwardly to many "scenes" as they transition
18:10 <sm> maybe some of them are large, have expensive declarations, or use template haskell
18:10 <Lokathor> ah ha, so there we go then
18:10 <EvanR> and i might be able to make use of this implicit configuration thing
18:10 MarioBranco joined
18:10 <EvanR> instead of
18:10 <EvanR> coolScene :: System -> Fix IO
18:10 <EvanR> it could be
18:10 <luigy> sm let me get some stats on that
18:10 <Lokathor> mmm, Data.Vector.Storable.Mutable, what a module
18:11 <luigy> this is really kiling my cycles so hopefully there is something obvious in the stats :)
18:11 <EvanR> coolScene :: UnderSystem t => Scene t (Fix IO)
18:11 Kanoxbox_ joined
18:11 Rajkumar joined
18:11 <EvanR> or something
18:11 <Rajkumar> hi
18:11 <sm> also, why must you reload all 120 modules every time ?
18:12 <EvanR> instead of sys being a parameter to each one, sys would be a typeclass method
18:12 <Rajkumar> I am seeing .deb install for leksah is stopped for long time
18:12 <EvanR> after sys is ready, the first scene could be introduced with a wrapper withSystem sys (...)
18:12 <Rajkumar> is there any reason for that
18:12 <cocreature> EvanR: that looks very much like Reader System (Fix IO) :)
18:12 <Lokathor> EvanR, that seems like MonadReader r, can you still do "local" to re-define your context?
18:12 raatiniemi joined
18:12 <EvanR> cocreature: no, because thats a monad
18:13 <Rajkumar> I am trying to install leksah on ubuntu 16.04
18:13 <cocreature> EvanR: ah fair enough
18:13 <EvanR> in the paper they use "what modulus am i in" for doing modular arithmetic everywhere without mentioning the modulus
18:13 <EvanR> or with using monadic code
18:13 drewbert joined
18:14 <EvanR> as an example
18:14 alx741 joined
18:14 electrostat joined
18:14 halogenandtoast joined
18:14 rickygee joined
18:14 <EvanR> in my case i could also have 6 "methods" build on the main one to talk about the 6 components without having to do asks or separate actions
18:15 <EvanR> but the rub is it requires a runtime creation of an instance
18:15 <EvanR> which oleg and then edk figured out
18:17 <* EvanR> reads the paper again
18:17 mada joined
18:17 primal joined
18:19 tromp joined
18:21 <Kanoxbox_> hi guys I am trying to install pidgin on linux...
18:21 <Kanoxbox_> getting some errors
18:21 Neo_07 joined
18:22 <Kanoxbox_> how do I install including dependencies?
18:22 <kadoban> Kanoxbox_: There is a ##linux channel, along with distro-specific ones for the big ones, depending on what is approptiate. Unless this is somehow a haskell question that I'm missing.
18:22 NoCreativity joined
18:22 <shapr> uh, I think this channel is about the Haskell programming language
18:22 <Kanoxbox_> ok guys...will get to ##linux
18:22 drewbert joined
18:22 Kanoxbox_ left
18:23 <Tuplanolla> Is that for the kernel or just everything?
18:23 jleon joined
18:23 <kadoban> Mostly userland I believe
18:23 <briansteffens> a distro-specific channel would probably be better for figuring out how to install a package with dependencies
18:23 <clamchowder> srhb: OK I figured it out:
18:23 <clamchowder> p = do
18:23 <clamchowder> x <- manyTill anyChar $ try $ lookAhead $ (noneOf " \t\n") >> (char '*')
18:23 <clamchowder> y <- anyChar
18:23 <clamchowder> return $ x ++ [y]
18:23 Bardusbasium joined
18:24 romank joined
18:24 <srhb> Didn't you reverse the order of try and lookahead?
18:24 <srhb> Or... Maybe not
18:24 <Philonous> shapr, Why would you think that? That's absurd! I know the dude who created it, and he doesn't care about Haskell one bit! :P
18:25 sleffy joined
18:25 ubsan joined
18:26 <shapr> Philonous: he doesn't?
18:26 <shapr> huh
18:26 iAmerikan joined
18:26 <Philonous> shapr, So I've heard.
18:26 <shapr> wow, neat
18:27 <srhb> :q
18:27 <srhb> eep
18:27 <shapr> NO
18:27 <srhb> :-P
18:27 <shapr> you are not allowed to leave!
18:27 primal_ joined
18:28 <Philonous> She was just trying to quit vim so she could fire up a proper editor :>
18:28 <srhb> Philonous: >:|
18:28 <shapr> Philonous: are you writing any cool code?
18:28 electrostat joined
18:29 <shapr> I mean, clearly srhb is writing code
18:29 <Philonous> shapr, I'm tinkering with a (dependently-typed) heterogenous Map
18:29 <shapr> ohh neat!
18:30 ubsan_ joined
18:31 <shapr> I just heard about grenade: https://github.com/HuwCampbell/grenade
18:32 <Philonous> That does look nifty
18:33 erisco joined
18:33 hybrid joined
18:33 <Philonous> Shame it's limited to CPU :(
18:34 <sternmull> can someone tell me how i bind a keyboard shortcut to the "Build Project" command of the ide-haskell plugin for the atom editor?
18:34 plutoniix joined
18:34 mfukar joined
18:34 rickygee joined
18:35 saussure joined
18:36 bollu joined
18:37 bendo joined
18:37 KunoMark joined
18:37 <KunoMark> hi, peeps.
18:37 <KunoMark> A quick lens question...
18:37 primal joined
18:38 <KunoMark> I have the following: data A = {b :: Maybe B}, and data B = {c :: C}
18:39 <KunoMark> given an A, how do I get a Maybe C value, using lenses?
18:39 <Gurkenglas> preview (blens . _Just . clens)
18:39 <shapr> if you don't get an answer here, you could also try #haskell-lens
18:39 <KunoMark> I can do a ^. b, to get a Maybe B, but
18:40 <shapr> Philonous: grenade training time sounds small even though it's CPU-only
18:40 <Gurkenglas> a ^? b . _Just . c
18:41 <KunoMark> Excellent! Thanks Gurkenglas and shapr :-D
18:41 <shapr> I also wonder if grenade handles multicore transparently.
18:41 <shapr> My xeons are too cold
18:41 <Philonous> shapr, I'm not a ml-person, but AFAIK 12 minutes for a mere 1.5% error rate is rather bad
18:42 <Philonous> For MNIST, I mean
18:42 ph88^ joined
18:42 <shapr> I wouldn't know, I haven't gotten into machine learning yet.
18:43 <ph88^> i'm using State .. but i noticed that some state i need to access after the function is completed .. while order state can be discard .. is there any way to make a distinction between this? or should i move stuff out of state ?
18:43 meoblast001 joined
18:44 torstein joined
18:44 <Tuplanolla> Define your data structures based on what changes together, ph88.
18:44 <Tuplanolla> The problem should solve itself.
18:46 <ph88^> Tuplanolla, i just have a record as state
18:47 <Tuplanolla> Something like `State (staysPut, changesALot) a` since you can `fmap` over `(,) staysPut`.
18:47 <Gurkenglas> ph88^, do you ever read the values that you need afterwards while still changing the state, or do you only ever write to them?
18:48 <Gurkenglas> If the latter, you could use a WriterT layer in addition to the StateT layer
18:48 ecognium joined
18:48 primal_ joined
18:48 xkapastel joined
18:48 meoblast001 joined
18:49 juanpaucar joined
18:49 peterbecich joined
18:49 drewbert joined
18:49 saussure joined
18:50 rickygee joined
18:52 <ph88^> Gurkenglas, i have 2 values that are R/W and two are W .. but of those 2 R/W i want to read 1 afterwards and not the other one
18:53 rblaze joined
18:54 dni joined
18:55 Neo_07 left
18:56 juanpaucar joined
18:56 <ecognium> Is there a way to force a compile error on non-exhaustive pattern match? I get warnings when a pattern match is redundant but not when one of the constructors is not matched.. I would prefer an actual error than a warning.. is it possible to throw an error when all constructors are not matched? I am using ghc-options: -Wall -O2
18:56 <kadoban> ph88^: Use the state function that lets you get all the state at the end, and then just have a function that narrows it to what you need, if you want?
18:57 euler2323 joined
18:57 <ph88^> can do :)
18:57 <kaychaks> am using -XTypeInType & -XGADTs, I have an ADT : data Concept a = Entity a | Role a | Relation a | Resource a | Sub (Concept a), I want to constrain types of another GADT with the promoted constructor types from this ADT, something like this: data Construct :: Concept * -> Concept * -> * where Has :: Concept a -> 'Resource b -> Construct (Concept a) ('Resource b). I could not figure out the types
18:57 primal joined
18:57 dni joined
18:58 TheFuzzball joined
18:59 castlelore joined
19:00 nakal joined
19:01 darjeeli1 joined
19:01 drewbert joined
19:01 Guest86 joined
19:02 <nshepperd_> Concept a isn't a member of Concept *
19:03 CoderPuppy joined
19:04 <nshepperd_> So Construct (Concept a) is a type error (kind error?)
19:05 Jesin joined
19:05 <cocreature> gnah, if haddock wasn’t so slow it might be easier to convince myself to write docs
19:06 <nshepperd_> Maybe you wanted data Construct :: * -> (Concept *) -> * ?
19:06 <kaychaks> yes am getting that error. I am getting confused in the representation of the GADT. The thing I want is to have an explicit type signature for `Has` constructor of `Construct` which should take any Concept as first type (a) & a 'Resource (promoted type of Concept) as second type (b) to construct finally a `Construct a b`
19:07 phyrex1an joined
19:08 primal_ joined
19:09 obihann joined
19:10 rickygee joined
19:10 <* mbrock> extracts some code from one module to a new one and spends a bunch of time fiddling with imports
19:11 <EvanR> needs more IDE keycombos
19:12 <EvanR> or thinking ahead by importing a module that imports literally everything in every module
19:12 hybrid joined
19:12 <ph88^> shapr, did you get the spock repo in shape ?
19:12 <EvanR> i would say smaller modules, but even those seem to have a page of imports
19:13 <EvanR> probably because of smaller modules
19:13 <mbrock> it's also a somewhat nice opportunity to rethink my imports and potentially feel bad about all my dependencies
19:13 <shapr> ph88^: I have it at the point where it does insert and select: https://github.com/shapr/sporkle
19:13 <shapr> I'm planning to bring the python equivalent up to the same functionality this evening, so I can give a lightning talk at work tomorrow
19:13 <ph88^> jle`, is this your blog ? https://blog.jle.im/ that's nice that you have a blog i will read a bit of it
19:14 mgu_ joined
19:14 <shapr> hej mikael!
19:14 <ph88^> shapr, can you do one url with static content plz plz plz ? :P
19:14 dni joined
19:14 fresheyeball joined
19:14 <shapr> ph88^: hopefully! the real one hour talk is in two weeks
19:14 brailsmt joined
19:14 <fresheyeball> Hello out here
19:14 <fresheyeball> I'm failing to make a Show instance for a singleton
19:15 dni joined
19:15 <fresheyeball> Why is there no `Show a => Show (Sing a)` instance?
19:15 <mbrock> hej shae! :D
19:15 <* shapr> hops cheerfully
19:15 cpup joined
19:15 <mbrock> one of our cats got lost for a while and our other cat was sad but then we found him again and my program is totally working, so yay!
19:16 <shapr> yay!
19:16 <ph88^> you have a haskell program looking after cats ?
19:16 Costar joined
19:17 <mbrock> no :) but for a while when I was walking around outside searching I was thinking we might need to quickly set up a cat detection system for the night
19:17 primal joined
19:17 <mbrock> yet another reason to get familiar with some of all this "AI" technology, I guess!
19:18 dni_ joined
19:19 <sm> you category theorists and your cute jargon..
19:19 <nshepperd_> kaychaks: perhaps the thing to ask is what should the possible values be when you pattern match on a Construct?
19:20 <ph88^> mbrock, have you see that write up about the cat feeder ?
19:21 <mbrock> haha, yeah, the one where the guy keeps failing to keep the cat out and ends up putting more and more steel reinforcements?
19:21 <ph88^> i have here 3 lines of haskell code .. compared to 1 line of imperative code .. ok they are not exactly the same .. but i find the imperative code much easier to understand .. is there anything i can do to refactor the haskell code to make it shorter and more readable ? https://bpaste.net/show/80aaa3d77b6e
19:21 <ph88^> mbrock, yes that one :P
19:22 tusj joined
19:22 gestone joined
19:23 <mbrock> :t until
19:23 <lambdabot> (a -> Bool) -> (a -> a) -> a -> a
19:23 <mbrock> > until (> 8) (* 2) 1
19:23 <lambdabot> 16
19:23 <sm> :t while
19:23 <lambdabot> error: Variable not in scope: while
19:23 <nshepperd_> ph88^: head . dropWhile (<t1) $ iterate something
19:24 <nshepperd_> Until, huh
19:24 <shapr> :t when
19:24 <lambdabot> Applicative f => Bool -> f () -> f ()
19:24 <shapr> :t until when
19:24 <lambdabot> error:
19:24 <lambdabot> • Couldn't match type ‘f0 () -> f0 ()’ with ‘Bool’
19:24 <lambdabot> Expected type: Bool -> Bool
19:25 iAmerikan joined
19:25 <kaychaks> nshepperd_ : ok. but am still confused in how to encode the types for the `Has` constructor of Construct
19:25 meoblast001 joined
19:26 <sm> ph88^: looping there seems unnecessary
19:27 <ph88^> until, while, head . dropWhile, when, until when .. eeeeh
19:27 <ph88^> what to choose xD
19:27 mjs2600 joined
19:28 primal_ joined
19:28 <ph88^> can't even find the right while on hoogle
19:28 ecognium left
19:29 bananagram joined
19:29 <sm> let t' = if t1 > t then t + ((t1 - t) / sampleTime + 1) * sampleTime else t
19:30 <kadoban> ph88^: Also, probably besides the point, but you can do that with just math, specifically div
19:30 tomboy64 joined
19:30 peterbec` joined
19:31 alx741 joined
19:31 <ph88^> sm, i just ran your code and it gives the wrong result
19:32 pie___ joined
19:32 Discovery joined
19:33 <ph88^> https://bpaste.net/show/6a9d0a287244
19:34 <ph88^> kadoban, you mean a solution similar to the one of sm ?
19:34 caumeslasal joined
19:34 Johan_Meh joined
19:34 <sm> I just wrote down what the voices told me.. but I'm surprised
19:35 <ph88^> lol
19:35 <kadoban> ph88^: Yes. It's in principle not hard to do, but getting all of the off-by-ones and special cases right is minorly tricky.
19:35 Costar joined
19:35 <ph88^> sm, do you think the numerical solution will be faster than until (at least if i get until working, i seem to be using it in the wrong way)
19:36 <kadoban> If the number of iterations grows, the numerical solution will eventually be infinitely faster. But if the typical/maximum number of iterations is small, it doesn't matter (the loop could even be faster)
19:36 brailsmt joined
19:37 augur joined
19:38 <thang1> I think the main issue is not that haskell can't do the iterative loop as easily/clearly, but that in haskell I don't really think I've ever seen a reason why you would even do that in the first place
19:38 <ph88^> why did i get until wrong ?
19:39 primal joined
19:39 <srk> thang1: :D nicely put
19:39 <sm> ugh, / was wrong of course. And I assumed integers. MULTIPLY ALL BY 100
19:39 <sm> until is pretty clear, and probably easier to figure out than the numerical one
19:39 <Logio> let t' = head $ filter (> t1) [t, t+sampletime..]
19:40 <sm> until (>= t1) (+ sampleTime) t
19:41 <Logio> oh right, that exists :)
19:41 <ph88^> lol i was reading "until" as "while" -___-
19:41 <sm> there is a while, but it's not in base
19:42 Bardusbasium joined
19:42 hanna joined
19:42 <thang1> There's probably like 15 differnt while variants. 2 with documentation, 7 with "just grok the types bro", and 8 with no documentation whatsoever and that haven't been updated since 2008
19:42 leif_erikson joined
19:42 ph88^ joined
19:44 <mbrock> there's usually a straightforward way to write such iterative loops as recursive functions, if you really want to
19:44 <sm> Logio: that literal list is interesting, I didn't know it could do that
19:45 <Logio> I remembered doing something like that once, it surprised me too
19:46 uglyfigurine joined
19:46 perrier-jouet joined
19:46 <thang1> It's pretty neat. Looks like you could also do something like that with a list comprehension?
19:46 rickygee joined
19:48 dsantiago joined
19:48 <ph88^> why do i get a parse error here? https://bpaste.net/show/98ce8029ec7d
19:48 indi_ joined
19:48 uglyfigurine joined
19:49 <kadoban> ph88^: Which line is that?
19:49 takle_ joined
19:49 <ph88^> huh ?
19:49 kmels joined
19:49 <ph88^> line 273
19:49 primal_ joined
19:49 JagaJaga joined
19:50 <kadoban> Oh, I didn't see the comment
19:50 tromp joined
19:51 govg joined
19:51 silver_ joined
19:51 nbro joined
19:52 <ph88^> i'm using that boolean because i only need to check this once at the start of the stream .. i need to adjust some offset
19:53 tomboy64 joined
19:53 tiny_test joined
19:53 joco42 joined
19:54 primal joined
19:55 <kadoban> ph88^: The things in if's branches have to be expressions. "let t' = t" isn't an expression, it's part of do syntax. You might want let t' = if ... but then the modify line doesn't fit in well. Kind of depends how you want to refactor that
19:55 <ph88^> i don't know what my options are
19:55 <ph88^> can't think of something
19:56 <kadoban> At the worst you could always do t' <- if ... then return t else do {let x = ...; modify ...; return x}, but there's probably a better way
19:57 tiny_test joined
19:57 <ph88^> ok i found something .. but i think it's ugly because i need to check twice ! https://bpaste.net/show/981875f87cb6
19:57 <ph88^> oh i like your solution better than mine kadoban
19:59 tiny_test joined
19:59 dual joined
20:00 <ph88^> ye this looks alright to me https://bpaste.net/show/a7c1dbbac058
20:00 <ph88^> eh i meant t' <- ofc
20:01 <kadoban> Cool, if it works for you I don't mind the look of that. I'd probably do the indentation a little different, but I think that comes down to style.
20:01 primal_ joined
20:02 tiny_test joined
20:02 quchen joined
20:02 patbecich joined
20:02 patbecic` joined
20:03 cdg joined
20:03 <quchen> cocreature: Your »shorter text« problem won’t let go of me
20:03 <ph88^> »text« , it's shorter
20:03 unK_ joined
20:04 <cocreature> quchen: heh sorry about that. btw david christiansen has published a preprint on a prettyprinting algorithm for non-monospaced fonts :)
20:04 <cocreature> but I haven’t read it yet
20:04 <quchen> cocreature: The final prettyprinter?
20:04 <quchen> Yeah it sounds interesting
20:04 <cocreature> yep
20:05 <quchen> But the paper isn’t simple enough for me to read it on the fly ;-)
20:05 <quchen> It seems like a completely different approach though
20:07 dni joined
20:08 sz0 joined
20:09 <ph88^> there is also this which seems somewhat related https://github.com/google/xi-editor/tree/master/doc/rope_science
20:09 CoderPuppy joined
20:11 drewbert joined
20:11 <* hackage> dirstream 1.0.3 - Easily stream directory contents in constant memory https://hackage.haskell.org/package/dirstream-1.0.3 (GabrielGonzalez)
20:11 juanpaucar joined
20:11 ralu joined
20:12 joco42 joined
20:12 primal joined
20:13 peterbec` joined
20:13 dc0de joined
20:15 obadz joined
20:16 tusj joined
20:17 BlueRavenGT joined
20:17 Eduard_Munteanu joined
20:17 pie___ joined
20:19 codygman_____ joined
20:19 TheInfosphere joined
20:20 <clamchowder> Question: how do I use HUnit to test 1 + 2 = 3?
20:21 <codygman_____> Was teaching a beginner Haskell but couldn't come up with a good comprehensible answer to: "What is ‘<-’ and why isn't ‘let x = val’ also used for it? ". Any ideas?
20:22 drewbert joined
20:22 stefann joined
20:22 primal_ joined
20:22 baldrick joined
20:22 rickygee joined
20:22 <stefann> @pl \f a b c d -> f (a, b, c, d)
20:22 <lambdabot> (. (,,,)) . (.) . (.) . (.)
20:23 <EvanR> looks like a worm monster
20:23 uglyfigurine joined
20:23 <kadoban> codygman_____: I never teach, but depending on where they are in their studies, I'd either go with " <- is for running an action and assigning a name to the result" or go into what do notation desugars into.
20:23 <EvanR> coming at you in first person nethack view
20:23 <stefann> @pl \f (a, b, c) -> f a b c
20:23 <lambdabot> (line 1, column 11):
20:23 <lambdabot> unexpected "c"
20:23 <lambdabot> ambiguous use of a non associative operator
20:23 <EvanR> huh
20:24 <geekosaur> kinda poor error message for "I don't know how to pointfree 3-tuples"
20:24 cpup joined
20:24 <EvanR> > \f (a, (b, c)) -> f a b c
20:24 <clamchowder> OK I got it: t = TestCase (assertEqual "" (1 + 2) 3)
20:24 <lambdabot> error:
20:24 <lambdabot> • No instance for (Typeable t0)
20:24 <lambdabot> arising from a use of ‘show_M894443424140670564923073’
20:24 <EvanR> @pl \f (a, (b, c)) -> f a b c
20:24 <lambdabot> (`ap` snd) . (. fst) . flip flip snd . (ap .) . flip flip fst . ((.) .)
20:24 <clamchowder> runTestTT t
20:25 <Gurkenglas> kinda poor error message for "I can't show functions"
20:25 <codygman_____> kadoban: i think a follow up would be: how do i know when something is an action? Which could be answered with "the type includes IO"
20:25 <geekosaur> also true
20:25 ChaiTRex joined
20:26 <kadoban> codygman_____: Right, if they're at the point where do notation is just something you use for IO, that sounds fine.
20:26 nbro joined
20:26 <Gurkenglas> Can we get a lawless function Show instance into lambdabot that shows the type?
20:26 <stefann> @pl (\f (a, b, c) -> (f a b c))
20:26 <lambdabot> (line 1, column 12):
20:26 <lambdabot> unexpected "c"
20:26 <lambdabot> ambiguous use of a non associative operator
20:27 herr_jth joined
20:27 balor joined
20:27 <stefann> @pl (\f (a, b, c) -> f a b c) :: (a -> b -> c -> d) -> (a,b,c) -> d
20:27 <lambdabot> (line 1, column 12):
20:27 <lambdabot> unexpected "c"
20:27 <lambdabot> ambiguous use of a non associative operator
20:28 herr_jth joined
20:28 <codygman_____> kadoban: i think that explanation was pretty good.
20:28 romank joined
20:28 <kadoban> I would imagine there's a better one, but I'm not sure what it is :-/
20:29 JackOfBlades joined
20:29 JackOfBlades left
20:30 herr_jth joined
20:32 primal joined
20:33 juanpaucar joined
20:37 moth joined
20:38 dfeuer joined
20:40 a3f joined
20:40 a3f joined
20:40 acarrico joined
20:45 <EvanR> codygman_____: kadoban: if you introduce do notation and <- completely referring to IO actions... and dont reveal any polymorphism or other uses, it will be right. but we unfortunately dont have good ways of getting specialized type signature output
20:46 <EvanR> everything you do in IO has Monad all over it
20:46 kolko joined
20:46 <EvanR> and then you have to teach how to substitute types for variables
20:46 <kadoban> If I were forced to teach, I'd probably try to say that it's useful for other things, but at first just worry about IO and give them rules to replace 'm' with IO for now. But yeah it's not perfect.
20:48 tomphp joined
20:48 <thang1> idk, I kinda like the idea of teaching in haskell by completely avoiding in IO as long as possible (until people are ready for it, at least)
20:49 eHammarstrom joined
20:50 im0nde joined
20:50 <kadoban> Not sure that's feasible. Or at least that time period sounds short. You can't even run any program at all without IO. I guess you could give them a template that takes care of IO for you ...
20:52 <EvanR> thang1: a function like idris... repl :: String -> (String -> (String, String)) -> IO () would be nice...
20:52 <EvanR> :t interact
20:52 <lambdabot> (String -> String) -> IO ()
20:52 <EvanR> is kind of not that
20:53 <EvanR> code.world/haskell has a number of entry points that do IO for you, pretty cool, even apparently to the point of multi-user networked simulation
20:54 <thang1> oooh neat
20:54 Itkovian joined
20:58 <* hackage> hackport 0.5.3 - Hackage and Portage integration tool https://hackage.haskell.org/package/hackport-0.5.3 (SergeiTrofimovich)
20:59 nbro joined
21:01 <* hackage> simple-log 0.9.2 - Simple log for Haskell https://hackage.haskell.org/package/simple-log-0.9.2 (AlexandrRuchkin)
21:01 hanna joined
21:03 toby1851 joined
21:07 kantokom1 joined
21:11 zero_byte joined
21:11 Achylles joined
21:13 sleffy joined
21:16 jleon joined
21:17 dxld joined
21:19 skrnnm joined
21:20 fnurglewitz joined
21:21 jleon joined
21:23 bollu joined
21:25 jleon joined
21:26 vektorweg1 joined
21:29 snamellit joined
21:30 fotonzade joined
21:32 jleon joined
21:35 bjz joined
21:36 jleon joined
21:37 twanvl joined
21:37 rey_gr joined
21:37 flatmap13 joined
21:37 romank joined
21:39 gestone joined
21:41 pookleblinky joined
21:41 darjeeli1 joined
21:42 dni joined
21:43 takle joined
21:46 ziocroc2 joined
21:46 juanpaucar joined
21:48 juanpaucar joined
21:49 afarmer joined
21:49 plutoniix joined
21:50 <nshepperd_> Gurkenglas: lambdabot already has such an instance. But it needs Typeable for the argument and result so it can print their types
21:50 modori518 joined
21:50 <nshepperd_> It really needs some special magic so that it can act like :t for functions generally
21:50 augur joined
21:51 indi_ joined
21:51 <nshepperd_> And print their fully general type including foralls
21:52 <Gurkenglas> > const undefined :: (Typeable a, Typeable b, Typeable (a -> b)) => a -> b
21:52 <lambdabot> error:
21:52 <lambdabot> • No instance for (Typeable a0)
21:52 <lambdabot> arising from a use of ‘show_M633173445441179135825665’
21:52 Snircle joined
21:53 <Gurkenglas> <Gurkenglas> @more <lambdabot> Plugin `more' failed with: Prelude.init: empty list
21:53 <nshepperd_> > \x -> (x :: Int)
21:53 <lambdabot> <Int -> Int>
21:53 hiratara joined
21:53 <nshepperd_> It works when it knows which Typeable instance to use
21:54 gestone joined
21:54 <geekosaur> more specifically current Typeable is not polymorphic
21:54 <geekosaur> that should change with 8.2
21:54 <nshepperd_> Not polymorphic?
21:54 <* EvanR> wonders how that would work
21:54 hlysig joined
21:55 <EvanR> can a Char -> Char be recovered if you think its a type rep for "a -> a"
21:55 <EvanR> if you have a type rep for
21:55 <geekosaur> as with your example. it can handle a function Int -> Int, but Num a => a -> a cannot be represented
21:55 <nshepperd_> Impredicative Typeable instances? Typeable (forall a. a -> a) o_O
21:55 <geekosaur> but in 8.2 thee is type-indexed Typeable
21:55 <geekosaur> *there is
21:56 saussure joined
21:56 jleon joined
21:57 plutoniix joined
21:57 romank joined
21:58 saussure joined
21:59 takle joined
22:00 jleon joined
22:01 juanpaucar joined
22:03 mjs2600 joined
22:04 jleon joined
22:05 augur joined
22:09 jleon joined
22:09 saussure joined
22:10 juanpaucar joined
22:12 MarioBranco joined
22:12 jleon joined
22:15 LHoT10820 joined
22:16 Cassiopaya joined
22:17 bishop_neaster_ joined
22:17 <c_wraith> I didn't realize that the new Typeable interface gives you polymorphic TypeReps
22:18 augur joined
22:18 jleon joined
22:18 <geekosaur> there's a discussion in ghc trac wiki. I don't quite understand it >.> but it does claim to give you polymorphic TypeReps
22:19 <EvanR> polymorphic typereps... typereps of polymorphic types?
22:20 gestone joined
22:23 <c_wraith> EvanR, more like preserving a polymorphic value's type when getting a TypeRep from it.
22:23 <c_wraith> instead of the current situation..
22:23 <c_wraith> > typeOf Nothing
22:23 <lambdabot> error:
22:23 <lambdabot> • No instance for (Typeable a0) arising from a use of ‘typeOf’
22:23 <lambdabot> • In the expression: typeOf Nothing
22:24 <c_wraith> you currently have to make the type concrete.
22:24 <c_wraith> > typeOf (Nothing :: Maybe Int)
22:24 <lambdabot> Maybe Int
22:24 mjora7 joined
22:25 <EvanR> a polymorphic value
22:25 dcoutts_ joined
22:25 xkapastel joined
22:25 <EvanR> ok
22:25 saussure joined
22:26 mfukar joined
22:27 im0nde_ joined
22:27 dsh joined
22:30 codygman_____ joined
22:31 anuxivm joined
22:31 Achylles joined
22:31 Koterpillar joined
22:31 oisdk joined
22:31 hiratara joined
22:33 zzz joined
22:33 texasmynsted joined
22:37 tromp joined
22:37 zzz joined
22:38 segmond joined
22:39 takle joined
22:41 shangxiao joined
22:41 jleon joined
22:43 saussure joined
22:44 jleon joined
22:47 simukis joined
22:48 jleon joined
22:51 indi_ joined
22:52 Achylles joined
22:52 sleffy joined
22:52 louispan joined
22:53 saussure joined
22:54 <angerman> joeyh: let me know your use case and I might use that as an example :-)
22:54 wroathe joined
22:55 mjora7 joined
22:58 <joeyh> angerman: I cross-compile to android, it's a PITA
23:00 <angerman> joeyh: I mean the specific TH pain :-)
23:00 ertes joined
23:00 Jesin joined
23:01 <joeyh> oh well, nothing unusual. persistent and yesod
23:01 <angerman> joeyh: yesod on android?
23:02 <joeyh> yes
23:02 eschnett joined
23:02 tromp joined
23:03 augur joined
23:03 <angerman> joeyh: ahh well. Yes of does a lot of file IO, not sure about process IO, but that might work with a small patch to yesod.
23:03 Koterpillar joined
23:03 <joeyh> there's some file IO in yesod-static, mostly it's TH code generation though
23:03 <angerman> joeyh: I'm not sure what th persistent uses, but that could be little enough to make it a viable example.
23:04 ubsan_ joined
23:04 <nshepperd_> Oh, the new typeOf Nothing would produce something :: Typeable a => TypeRep (Maybe a)?
23:05 <angerman> joeyh: code gen should work. Just file and process IO need some special handling due to the reasons laid out in the medium post.
23:05 davr0s joined
23:06 <angerman> joeyh: https://www.irccloud.com/pastebin/iuaW4a2s ;-)
23:06 <nshepperd_> No, that wouldn't help because you still don't have the instance
23:07 gaze__ joined
23:09 <joeyh> angerman: I was thinking the external interpreter would need a ghc running on android, which does not exist AFAIk.
23:09 <joeyh> but, hmm, I suppose it could just use the build system's ghc
23:09 louispan joined
23:09 <angerman> joeyh: I'll go into detail in the post later today :/)
23:10 <joeyh> as long as the TH doesn't involve something architecture specific
23:10 jleon joined
23:10 <angerman> joeyh: it does work on RPi, Android and iOS :-)
23:11 <angerman> joeyh: the key is https://github.com/zw3rk/ghc-slave
23:11 saussure joined
23:12 <angerman> I'll push the latest changes to that repo after breakfast.
23:14 juanpaucar joined
23:14 Guest53184 joined
23:15 mjora7 joined
23:15 bigos joined
23:18 juanpaucar joined
23:18 <thang1> that runGit function looks horrifying
23:23 juanpaucar joined
23:24 dan_f joined
23:24 juanpaucar joined
23:25 augur joined
23:25 juanpaucar joined
23:25 juanpaucar joined
23:27 theDon_ joined
23:29 kvda_ joined
23:29 jleon joined
23:29 <angerman> thang1: it's only a slight alteration of the on from the gitrev package.
23:29 saussure joined
23:29 CaptainLex joined
23:30 markus1209 joined
23:30 markus1219 joined
23:30 dni joined
23:30 Costar joined
23:31 saussure joined
23:31 <* hackage> hpio 0.8.0.9 - Monads for GPIO in Haskell https://hackage.haskell.org/package/hpio-0.8.0.9 (dhess)
23:33 jleon joined
23:36 nakal_ joined
23:36 mjs2600 joined
23:37 replay joined
23:38 jleon joined
23:38 saussure joined
23:41 prophile joined
23:41 <mniip> when we speak of End(Hask) do we usually mean all datatypes of kind *->* or do we usually speak of exactly functors
23:43 pookleblinky joined
23:43 jleon joined
23:43 <mniip> both make a category (kinda)
23:44 prophile joined
23:44 <joeyh> angerman: seems you have been slightly burying the lede ;)
23:47 felixphew joined
23:47 dni joined
23:47 <felixphew> hi!
23:48 zcourts joined
23:48 <felixphew> if anyone remembers my annoying language from the other day, I'm having a go at using alex
23:48 <felixphew> but I seem to be having trouble learning the syntax
23:48 <felixphew> http://lpaste.net/1166517670258933760
23:48 saussure joined
23:48 wroathe_ joined
23:48 <dmj`> oh shoot, Control.Monad.Trans.Select
23:48 <felixphew> this first hits an error at line 13
23:48 <felixphew> what's wrong?
23:50 <glguy> I'll take a look, but while I'm doing that, consider lining things up so that it isn't so crazy to look at :) https://github.com/glguy/config-value/blob/master/src/Config/Lexer.x#L56
23:50 <angerman> joeyh: pardon me?
23:50 aarvar joined
23:50 <glguy> felixphew: You needed to escape your - and )
23:51 <felixphew> well that was simple
23:51 <felixphew> thanks!
23:52 halogenandtoast joined
23:52 markasoftware joined
23:53 <thang1> Me: "why is this not working" *stares at function for 5 minutes* oh... I guess I should recurse on the correct function, shouldn't I?
23:53 <thang1> Also me: "why is my brain so broke inside"
23:53 mjora7 joined
23:53 joco42 joined
23:54 acarrico joined
23:54 chao-tic joined
23:55 sanitypassing joined
23:55 <mniip> hmm, does 'Free' have a ziplike interface
23:56 mr_sm1th joined
23:56 path[l] joined
23:57 YongJoon joined
23:57 juhp joined
23:57 cschneid_ joined
23:57 <mniip> Applicative f => Free f a -> Free f b -> Free f (a, b)
23:57 <mniip> or something
23:57 saussure joined
23:58 wroathe joined
23:59 <lyxia> that doesn't seem too crazy
23:59 infinity0_ joined
23:59 infinity0_ joined