<    March 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 25  
26 27 28 29 30 31
00:00 <benzrf> but what are the types of a b c
00:00 <clmg> Split, Split and Window
00:00 bydo joined
00:00 <clmg> I'm looking for a split where its left window name == "ident"
00:00 <benzrf> then how are you using them with (^.)
00:01 atk joined
00:01 vikaton joined
00:01 <clmg> benzrf: they are lenses I suppose
00:01 <c_wraith> clmg: to "ignore" a Maybe, you need to accept the fact that there can be no target. at that point, you aren't working with lenses anymore. Traversals, perhaps.
00:01 fizbin joined
00:01 <clmg> c_wraith: I'm doing a traversal already
00:01 <benzrf> clmg: wait, so are they lenses or are they Splits
00:01 <clmg> I'm traversing over splits
00:02 <c_wraith> clmg: in which case, ^. is the wrong operator
00:02 skeuomorf joined
00:02 <clmg> c_wraith: which other operator?
00:02 <c_wraith> clmg: You'd want ^? or ^..
00:03 Jesin joined
00:04 <benzrf> clmg: wait, so are they lenses or are they Splits
00:04 acarrico joined
00:05 <sphinxo> How would this be best written in haskell? "for item in items: if someFn(item): return True"
00:05 <clmg> benzrf: they must be lenses
00:05 <c_wraith> sphinxo: any someFn items
00:05 <c_wraith> :t any
00:05 <lambdabot> Foldable t => (a -> Bool) -> t a -> Bool
00:05 <sphinxo> sweet
00:06 <c_wraith> > any even [1,3,7]
00:06 <lambdabot> False
00:06 <c_wraith> > any even [1,3,4,7, undefined]
00:06 <lambdabot> True
00:06 <benzrf> clmg: then... what type are they?
00:07 isd joined
00:07 <clmg> benzrf: bro idk
00:07 <Cale> > any (> 100) [1..]
00:07 <lambdabot> True
00:07 clmg left
00:07 <benzrf> o_o
00:08 <lyxia> that was weird
00:08 <Tuplanolla> He's a repeat offender, benzrf.
00:09 <Tuplanolla> He comes around to ask vague questions every couple of weeks.
00:09 <Cale> It's always a little weird when someone joins IRC just to ask one question and then closes it. :P
00:10 redmq joined
00:10 ali_bush joined
00:10 ali_bush joined
00:10 <Tuplanolla> It's a good chance to practice advanced mind reading.
00:10 tromp joined
00:10 cschneid_ joined
00:11 dan_f joined
00:13 lavalike_ joined
00:14 tobiasBora joined
00:14 <tobiasBora> Hello,
00:14 <tobiasBora> I've a problem with my haskell install.
00:14 ali_bush joined
00:14 ali_bush joined
00:14 marcopullo joined
00:14 louispan joined
00:15 <tobiasBora> When I run a program with runhaskell, it works without any problem,
00:15 <redmq> how do i add a vector to the last part row of a matrix using ekmett's linear?
00:15 aarvar joined
00:15 systemfault joined
00:16 <mniip> I wonder if edwardk knows :p
00:17 ddere joined
00:17 <tobiasBora> but if I use the "ghc" program, if fails: http://pastebin.com/ZGU4uiyd
00:17 <tobiasBora> the main error is /usr/bin/ld: final link failed: Nonrepresentable section on output
00:17 JeanCarloMachado joined
00:18 lavalike joined
00:18 <tobiasBora> I'm running the last haskell version (The Glorious Glasgow Haskell Compilation System, version 8.0.2)
00:19 <tobiasBora> installed in my Debian sid, using the install-linux script available online.
00:19 <geekosaur> 8.0.2 should have that fixed, I thought
00:19 meba joined
00:20 <tobiasBora> geekosaur: Well... I have this problem, I can confirm you!
00:20 <redmq> mniip: i'll just construct a matrix with the vector as the last component
00:21 shayan_ joined
00:21 <redmq> jw if there was a faster approach
00:21 dylukes joined
00:21 <redmq> *more concise
00:21 nakal_ joined
00:22 <geekosaur> yeh, I'm a bit confused by this. there was a rash of such reports when debian switched over to PIE, but building a new ghc on such debian installations should detect and configure correctly for it
00:22 Lord_of_Life joined
00:23 <geekosaur> What is this install-linux script?
00:23 <tobiasBora> geekosaur: the one taken from the haskell-platform website, in the section general linux
00:24 <geekosaur> I am wondering if it's installing a binary ghc built for a non-PIE debian, in which case you would see this
00:24 <geekosaur> that would presumably be a haskell-platform bug
00:24 <edwardk> mniip: ?
00:24 <* edwardk> tunes in
00:24 dan_f joined
00:25 <geekosaur> [20 00:15:32] <redmq> how do i add a vector to the last part row of a matrix using ekmett's linear?
00:25 louispan joined
00:25 <edwardk> myMatrix & _z +~ V3 1 2 3 or whatever
00:25 <edwardk> if you want to add to a column use column _z
00:26 ludat joined
00:26 knx32542 joined
00:27 <redmq> edwardk: hah, thanks :)
00:27 JeanCarloMachado joined
00:28 <edwardk> replace _z with whatever lens you have for the appropriate basis element
00:29 mdarse joined
00:29 mr_sm1th joined
00:29 <tobiasBora> geekosaur: So how should I install haskell? The debian sid package is 3 years old...
00:31 <Cale> tobiasBora: See if just installing the GHC binary from https://www.haskell.org/ghc/download_ghc_8_0_2 works
00:31 mkoenig joined
00:34 systadmin joined
00:34 <centril> is there some sort of monadic sorting in any hackage lib ? (can always write my own, but...)
00:34 <Cale> tobiasBora: Another approach would be to install stack and use that to install GHC.
00:34 <centril> like: (a -> a -> m Bool) -> [a] -> m [a]
00:36 mizu_no_oto joined
00:36 eschnett joined
00:36 kav joined
00:37 andyhuzhill joined
00:37 <Cale> centril: There's apparently a sortByM in the package monadlist
00:38 <centril> Cale: thanks - hoogle was failing me :/
00:39 <Cale> It doesn't appear to be a very actively maintained package
00:39 <kadoban> sortByM, that sounds like an interesting function
00:39 <Cale> But you could steal the code
00:39 <centril> Cale: it's for a bachelor thesis, so it's never going to be executed in production anyways (lol...)
00:40 <kadoban> I wonder if anything sane happens if you use like \_ _ -> [True, False]
00:40 <centril> i am free to pull whatever dependencies I like ^^
00:40 minn joined
00:40 <centril> kadoban: [True, False] as what? in the comparator ?
00:40 plutoniix joined
00:40 <centril> still has to be a -> a -> m Ordering
00:40 <Cale> Well, it's (a -> a -> m Ordering)
00:40 <Cale> yeah
00:40 knx32542 left
00:41 <Cale> But that should be good enough :)
00:41 <kadoban> Oh, I was looking at the other type sig
00:41 <centril> Cale: yes, it is exactly what i need
00:41 <centril> I already had a -> a -> Ordering
00:41 plutoniix joined
00:41 <Cale> (\_ _ -> [LT, EQ, GT])
00:41 gugah joined
00:41 <kadoban> Right
00:42 <centril> oh - that's funky
00:42 <Cale> find isSorted (sortByM (\_ _ -> [LT, EQ, GT]) xs)
00:42 <kadoban> Is that like bogosort? Or maybe worse somehow?
00:42 <kadoban> It's probably like ... exploring every leaf of the decision tree, I guess ... or even more, maybe even the impossible ones.
00:45 <kadoban> I wonder what the real uses of that thing are. All I can think of that'd be practical would be ... using IO or something and sorting indexes or something by whatever they refer to, maybe from a file. Or maybe Writer and recording what comparisons get done? But that doesn't sound very useful.
00:45 <centril> Cale: there is also: https://unknownparallel.wordpress.com/2012/07/03/using-monadic-effects-to-reverse-a-merge-sort/
00:45 <kadoban> Or Maybe could make sense possibly
00:45 <sphinxo> What's the best way to walk through a list eg: given "abcde" call some function with "a" "bcde" then "ab" "cde" and so on?
00:45 <centril> kadoban: uses for monadic sorting ?
00:45 <kadoban> Ya
00:46 zcourts joined
00:46 <centril> kadoban: well... I am writing a normalizer which sorts variables by types - my monad is isomorphic to (Any, a)
00:46 <Cale> I really wish that Data.List had a few more things along those lines... it's not hard to write of course...
00:46 markus1189 joined
00:47 halogenandtoast joined
00:47 markus1199 joined
00:47 FullyFunctional left
00:47 <kadoban> centril: Hmm, interesting
00:47 <centril> the side-effectful comparator is used to notify that things have changed if x > y
00:47 <Koterpillar> > let splits xs = zip (inits xs) (tails xs) in splits "hello"
00:47 <lambdabot> [("","hello"),("h","ello"),("he","llo"),("hel","lo"),("hell","o"),("hello","")]
00:47 <centril> since normal form is x < y
00:47 <sphinxo> Koterpillar: Thanks!
00:47 <Koterpillar> sphinxo: a more efficient version is possibly in Data.List.Split
00:48 <Cale> sphinxo: one thing I often find myself using is:
00:48 <Cale> select [] = []
00:48 <centril> Cale: which one would you pick, Control.Monad.ListM, or the one in the blogpost ?
00:48 <centril> the package has more functions, so it could be more useful over time
00:48 <Cale> select (x:xs) = (x,xs) : [(y,x:ys) | (y,ys) <- select xs]
00:48 <centril> but i cant tell which one is the better sort
00:48 pera joined
00:49 <centril> both seem to be variants of mergesort
00:49 <c_wraith> My favorite sort is idsort. It's O(1), with the precondition that the input is sorted.
00:49 <kadoban> Cale: Is that ... a list of pairs of single-item + rest-of-list ?
00:49 <Cale> centril: I wouldn't bother with the package anyway, that code is just getting copied in, since I have zero confidence in that package.
00:50 <Koterpillar> > let select (x:xs) = (x,xs) : [(y,x:ys) | (y,ys) <- select xs] in select "hello"
00:50 <lambdabot> [('h',"ello"),('e',"hllo"),('l',"helo"),('l',"helo"),('o',"hell")*Exception:...
00:50 <centril> c_wraith: don't we all love that sort
00:50 <Cale> kadoban: yeah
00:50 <kadoban> Neat
00:50 <centril> Cale: how come ?
00:50 <c_wraith> Koterpillar: the base case is necessary
00:50 <Koterpillar> o hell, exception
00:50 <Koterpillar> I like it
00:50 <Cale> centril: It hasn't been updated since 2011
00:50 <Cale> centril: and has no documentation
00:50 <centril> Cale: oh, right
00:50 <centril> :P
00:50 <Cale> and nothing depends on it
00:50 <centril> oh right
00:51 <centril> and the license is AllRightsReserved
00:51 <centril> i cant even copy the code
00:51 <centril> how sad
00:51 <Cale> Well, lol
00:51 <kadoban> Ugh, that's annoying
00:51 <Cale> The code is just the code from GHC's Data.List anyway
00:51 <Cale> with some liftM2's and whatnot jammed in
00:51 <centril> oh...
00:51 halogenandtoast joined
00:51 <centril> then it can't be AllRightsReserved
00:52 <centril> or... depends on the GHC license i guess
00:52 <Cale> It's only AllRightsReserved because the user didn't bother setting a license.
00:52 <centril> ah
00:52 <centril> well, that is too bad... it was going to get us as a dependency, but nope
00:53 parcs joined
00:53 <Cale> I mean, they could claim copyright, but I don't think they could actually defend it
00:54 <centril> Cale: well, if GHC isnt GPL or MPL you can do pretty much anything given attribution
00:54 P1RATEZ joined
00:55 marcopullo joined
00:55 <kadoban> Anything except claim copyright on something you didn't really do anything with, AFAIK
00:56 theDon_ joined
00:56 <centril> kadoban: well, if GHC has a permissive license, and you modify its source, you can claim copyright
00:56 <centril> on the modified parts
00:56 vydd joined
00:57 <kadoban> Only if the modification is non-trivial, IIUC. But yeah
00:57 <centril> given that it is "original" enough
00:57 <centril> kadoban: I'd say Control.Monad.ListM qualifies
00:57 <kadoban> You could very well be right, I didn't look at the code side-by-side.
00:58 <centril> hmm... the code in: https://unknownparallel.wordpress.com/2012/07/03/using-monadic-effects-to-reverse-a-merge-sort/ is it also AllRightsReserved ?
00:58 robertkennedy joined
00:59 <Cale> I don't think you could argue successfully that it required sufficient nontrivial effort to be copyrightable as an extension of the work which was already in GHC
00:59 <kadoban> centril: I don't see a license :-/ You could ask though
00:59 <Cale> It could have been constructed mechanically.
01:00 <centril> Cale: maybe not to a seasoned haskller, but... it's not trivial to be a seasoned haskeler
01:00 <halogenandtoast> It's probably best to consult a copyright lawyer
01:00 cschneid_ joined
01:00 <centril> kadoban: ah, it's here anyways: http://stackoverflow.com/questions/11469806/haskell-sort-list-with-impure-function
01:00 dfeuer joined
01:00 <Cale> I wouldn't bother.
01:00 <Cale> Also, are you even distributing the code?
01:00 <centril> and stuff published on SO is not AllRightsReserved
01:01 jmiven joined
01:01 <centril> Cale: our stuff is public on GitHub under GPL2+
01:01 <kadoban> Is SO content explicitly licensed? I wasn't aware of that
01:01 <centril> so yes
01:01 <Cale> Oh, wait a minute
01:01 <Cale> Where do you see AllRightsReserved?
01:01 <Cale> monadlist is marked BSD3
01:02 <centril> https://hackage.haskell.org/package/monadlist-0.0.2/docs/src/Control-Monad-ListM.html
01:02 <centril> file header
01:02 cschneid_ joined
01:02 <Cale> http://hackage.haskell.org/package/monadlist-0.0.2
01:02 Micamo joined
01:02 <Cale> License BSD3
01:02 <centril> that is hella confusing
01:02 <centril> I guess it is BSD3 then
01:02 <kadoban> There is even a license file too. But yeah, I have no idea how that'd work if it's contradictory, heh.
01:02 <Cale> It's a shitty package, and nobody's going to care
01:03 <centril> kadoban: https://meta.stackexchange.com/questions/271080/the-mit-license-clarity-on-using-code-on-stack-overflow-and-stack-exchange
01:03 parcs left
01:04 louispan joined
01:05 <kadoban> centril: Nice, that's good to know
01:05 <centril> =)
01:05 <kadoban> Thanks for that. I know in the past I've skipped SO code for license issues. I wonder if I just never noticed it was actually licensed, or if that's changed in the meantime.
01:06 <centril> TL; DR: after 2016 it is MIT licensed, before it is CC-BY-SA
01:06 <centril> it was*
01:07 <kadoban> That's funny, it sounds like it's MIT with optional attribution, unless the copyright holder requests? Kinda funny.
01:07 <centril> kadoban: its basically a move from copyleft to permissible
01:09 raycoll joined
01:09 louispan joined
01:10 YongJoon joined
01:11 prkc joined
01:12 chao-tic joined
01:13 systadmin joined
01:17 JeanCarloMachado joined
01:17 jimmyrcom_ joined
01:18 zcourts joined
01:19 lifter joined
01:19 eacameron joined
01:21 <lifter> I'd like to use spacemacs for Haskell dev but I'm confused where to start. What do I need to do to configure spacemacs for Haskell dev?
01:21 <Koterpillar> lifter: it should work OOB
01:22 <Koterpillar> lifter: I only needed to add this: https://github.com/koterpillar/desktop/blob/master/dotfiles/spacemacs#L53
01:23 <lifter> Koterpillar: You didn't have to paste the code found here anywhere? https://commercialhaskell.github.io/intero/
01:25 sanett joined
01:27 gpbaran joined
01:27 Apocalisp joined
01:28 FreeBirdLjj joined
01:28 mkoenig joined
01:31 mac10688 joined
01:33 <geekosaur> intero is an alternative
01:34 rekahsoft joined
01:34 <geekosaur> there are some who will assert that it is a necessity, but it is not
01:35 Apocalisp joined
01:35 <lifter> I guess I'll start by trying spacemacs out of the box then.
01:38 eacameron joined
01:40 HoierM joined
01:41 gugah joined
01:41 andyhuzhill joined
01:41 zcourts joined
01:42 fizbin joined
01:47 <mac10688> reactimate $ fmap print eWorld
01:47 <mac10688> anyone know how I can go about combining clearScreen :: IO()
01:47 <mac10688> with the function print?
01:48 farrioth joined
01:48 <mac10688> :t print
01:48 <lambdabot> Show a => a -> IO ()
01:48 <mac10688> :import System.Console.ANSI
01:48 <mac10688> wait I think I might have this
01:50 louispan joined
01:51 brynedwards joined
01:52 <Koterpillar> lifter: no
01:52 <Koterpillar> lifter: spacemacs will activate intero and that hook automatically
01:52 <lifter> Cool yeah it seemed to download some intero stuff when I first opened a Haskell file
01:53 <centril> Cale: damn it, the sortByM thingy was an unstable sort :(
01:53 FreeBirdLjj joined
01:53 acidjnk22 joined
01:54 <Cale> Well, if things compare as Eq, they really ought to be equal :P
01:54 <Cale> But yeah, I suppose you'll have to get a stable sort and do the same kind of thing to it
01:54 YongJoon_ joined
01:55 <centril> sortByM (\a b -> pure Prelude.EQ) [1,2,3] got me [3,2,1]
01:55 <Cale> reasonable
01:55 <Koterpillar> centril: how did that compile?
01:55 <Koterpillar> oh, sorry, ignore
01:56 <Cale> btw, what monad are you using?
01:56 AX3L joined
01:57 <centril> Cale: newtype NormT m (a :: *) = NormT { _runNormT :: WriterT Unique m a }
01:57 <Guest35804> I might be stating the obvious here, but I would convert the list to [(1, 0), (2, 1), (3, 2)], where (, i) is the list index, and then make the comparator use a thenBy on the index so that Ordering is semantic.
01:57 <centril> Cale: Unique == Any
01:57 louispan joined
01:58 alx741 joined
01:58 <centril> Guest35804: right, if they are equal, take the first index
01:59 <centril> seems like a hack tho
01:59 <Guest35804> I think it's a fairly straightfoward definition of stability.
01:59 cschneid_ joined
02:00 <centril> Guest35804: well yes, but it's a hack in the sense that you are using an unstable sort for a stable sort
02:00 <centril> stable sorts are optimized for stable sorts, and unstable for unstable
02:00 <Guest35804> oh, yeah, I'm with you there
02:00 gugah_ joined
02:01 <centril> Cale: fortunately, the sort in monadlist is stable
02:02 Schoolmeister joined
02:02 <Cale> centril: You're writing a bunch of stuff while sorting?
02:02 Schoolmeister left
02:02 AX3L joined
02:03 <centril> Cale: yes, im conditionally flipping the Any
02:06 Argue_ joined
02:06 ricardo82 joined
02:08 Apocalisp joined
02:10 <sophiag> anyone have time to answer an annoying cabal question? it's failing at installing a package i need as a dependency...
02:11 <Koterpillar> ask the question
02:11 <Cale> It may help if you give more details than that :)
02:11 <pacak> Don't asks to ask...
02:12 <sophiag> i know :) just tried that several times when the channel was busy and got no response
02:12 <Koterpillar> I'm sure if someone knew, they'd jump in
02:12 <sophiag> it's failing at installing pcre-light due to not being abel to find pkg-config. i need it as a dependency for ghc-core
02:12 <Koterpillar> OS?
02:12 louispan joined
02:13 <sophiag> nix
02:13 <Koterpillar> pass
02:13 <sophiag> i'm not sure if this is related, but i have stack installed as well but can't set it up because it fails at installing ghc after download :/
02:14 <Cale> It's not in nixpkgs?
02:14 <sophiag> ghc?
02:14 <Cale> pcre-light
02:14 <sophiag> i have both haskell-platform and stack installed
02:14 <sophiag> oh
02:14 <sophiag> hmm, i didn't think abou tthat
02:15 <Cale> I just added it to my reflex-platform config, and it installed fine from the cache
02:15 <Cale> So it's probably in there :)
02:15 <sophiag> there's regular pcre listed in nix packages
02:16 <sophiag> i figured this was haskell specific th
02:16 <sophiag> *tbh
02:18 Gurkenglas joined
02:18 <Koterpillar> pkg-config isn't haskell-specific
02:18 louispan joined
02:19 <sophiag> hmm, yeah i put pcre in my nix config and rebuilt and am getting the same error :(
02:20 <sophiag> makes sense since it was always failing during the configuration step
02:20 meba joined
02:20 <Cale> https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/haskell-modules/hackage-packages.nix
02:20 uglyfigurine joined
02:20 <Cale> search for "pcre-light"
02:20 <Cale> It's in there
02:21 <Cale> (search with quotes)
02:21 <sophiag> Cale: cool, thanks! i haven't actually had to put any haskell packages in my nix config yet
02:21 <sophiag> i thought you were referring to the regular pcre
02:21 mda1 joined
02:21 <nshepperd> sophiag: have you tried installing pkg-config
02:22 infinity0 joined
02:22 <Cale> It seems like it's setting libraryPkgconfigDepends
02:22 <Cale> which might trigger the installation of pkg-config as necessary
02:22 <Cale> I don't actually know
02:22 gpbaran joined
02:23 wtetzner joined
02:24 <sophiag> nshepperd: i just added pkg-config and pcre as well, but cabal is still telline me i'm misisng pcre. i wonder if this means i need to reboot :/
02:25 <Cale> sophiag: Oh, I guess I assumed you'd actually be building Haskell stuff using nix, if you're crazy enough to be using nixos as your desktop already :)
02:25 <sophiag> i am using nixos
02:25 <sophiag> but did not assume i'd be using nix to install haskell packages
02:25 <Cale> Ah, well, there's pretty good support for doing that
02:25 <Cale> It's what we use where I work
02:26 andyhuzhill joined
02:26 louispan joined
02:26 <Cale> You can sidestep the entire debate between stack and cabal-install
02:26 infinity0 joined
02:26 <sophiag> that would be great :)
02:27 <sophiag> can you link me to something with the syntax? i assume it's similar to installing emacs packages, which i do use nix for
02:27 <Cale> There's a program called cabal2nix which will construct a nix expression for a cabal project
02:27 mizu_no_oto joined
02:27 omilu joined
02:28 <Cale> https://github.com/NixOS/cabal2nix -- the readme here shows how to use it
02:28 <sophiag> oh, it's listed under nix packages anyway
02:28 <Cale> yeah
02:29 infinity0 joined
02:29 <Cale> So you can write your .cabal file as usual
02:29 <Cale> and then cabal2nix . > default.nix
02:30 <sophiag> woah...i just found the part of the nix manual on haskell and apparently i can have hoogle cli?
02:30 <Cale> yeah
02:31 Destol joined
02:31 <sophiag> but the section on haskell packages is all done imperatively. do you not just put them in your config?
02:31 infinity0 joined
02:32 <Cale> Well, usually you just have your own project depend on them
02:32 louispan joined
02:32 <Cale> and just use nix-build to build
02:33 <sophiag> right, like this is the first package (ghc-core) i'm having to actually install with this setup for obvious reasons
02:33 conal joined
02:33 <Cale> But I'm like the least competent nix user ever
02:33 <Cale> Since I just rely on my coworkers to know what the heck is going on there :)
02:34 <Cale> (I don't use nixos myself, just the package manager for building our projects)
02:34 infinity0 joined
02:34 <sophiag> ah ok
02:34 eacameron joined
02:35 <sophiag> i'm pretty new to it, but after switching between three machines in as many months it's definitely worth the learning curve
02:36 <sophiag> do you at least know if the syntax in that github file you linked me to is what i'd throw in my config for packages i need to install manually?
02:36 <Cale> You mean, if you want them to be globally available?
02:37 <sophiag> yeah, and just declaratively so i don't have to think about this again
02:38 <Cale> Like, if you're building your project with nix, all you have to do is add the dependencies to your .cabal file, rerun cabal2nix, and it'll make you a derivation for building the project, and nix will make sure all the right stuff is installed when it builds for you.
02:38 <Cale> So you wouldn't normally need very much to be installed globally
02:38 dmwit_ joined
02:38 <sophiag> oh i see
02:39 <sophiag> i'm surprised there's not a way to shift that from .cabal to configuration.nix
02:39 <sophiag> there may be, but at least it doesn't seem to be the standard way to do things
02:39 <Cale> I'm sure there's some way, I just don't have any idea what I'm doing
02:39 Noldorin joined
02:40 <Cale> There's probably some haskellPackages thing you can set somewhere
02:40 <sophiag> that's exactly what i was thinking
02:41 <sophiag> (also tbh i've never edited .cabal directly)
02:41 fizbin joined
02:42 <Cale> https://nixos.org/releases/nixpkgs/nixpkgs-17.03pre91860.124f25b/manual/#how-to-install-haskell-packages
02:43 <sophiag> i'm already reading that, but as mentioned it's all done imperatively which is a bit odd
02:43 <Cale> I think that implies you can just install them like any other package
02:43 <Cale> But add "haskellPackages." on the front of the name
02:43 andyhuzhill joined
02:44 <sophiag> oh really?
02:44 <sophiag> because they've already been ran through cabal2nix i suppose?
02:44 <sophiag> and i mean to ask, is that the case for that list you linked me to?
02:44 <Cale> Yeah, that's what that giant .nix file I linked you was
02:45 <centril> If I have a Traversal' a [b] and Traversal' b c how do i compose these ?
02:45 acarrico joined
02:46 <centril> my lens-fu needs improvement
02:46 ryantrinkle joined
02:46 <lyxia> put a . traverse . in the middle
02:47 <centril> lyxia: oh, that is so neat
02:47 <centril> thanks
02:47 raycoll joined
02:47 louispan joined
02:48 <sophiag> Cale: it seems i can bypass that if i just use the snippet in the manual and list packages directly tho. the only thing i'm confused about is it says to put it in ~/.nixpkgs/config.nix and i'd rather keep everything in /etc/nixos/configuration.nix
02:48 canadiangregster joined
02:48 <Cale> sophiag: I guess the expectation is that you don't really need that stuff globally.
02:50 <sophiag> it's not that i want it globally, but that i'm using this for my personal box and would prefer to only have one config file. for example, some people have a separate one for emacs whereas i put it directly in configuration.nix
02:50 orphean joined
02:51 <Cale> ohhh
02:51 <Cale> There might be a problem with just installing things separately... I'm not sure
02:51 <Cale> er, wait
02:52 <Cale> I dunno, maybe it's fine
02:52 <sophiag> well, the syntax in ~/.nixpkgs/config.nix is not that different. i think i can adjust it
02:52 <Cale> Well, there's this ghcWithPackages thing
02:52 <Cale> which takes a list of packages to install
02:52 mkoenig joined
02:52 orphean_ joined
02:52 <Cale> Maybe that's just the packages to install globally in the GHC sense.
02:53 <sophiag> yeah, that's what i'm talking about anyway
02:53 <sophiag> just putting it in a different file instead
02:53 <sophiag> the manual says the same with emacs and someone in #nixos recommended i just put it in configruation.nix as well
02:53 <sophiag> yikes, my typos are nuts today
02:55 cschneid_ joined
02:57 vydd joined
03:00 hucksy_ joined
03:02 xtreak joined
03:03 <sophiag> Cale: ugh...so rebuilding nix seemed to go fine, but apparently that snipped didn't work since now i don't even have cabal
03:03 <sophiag> i'm still using ghci in emacs tho...
03:03 xaviergmail joined
03:04 Rainb joined
03:07 coot joined
03:08 sword865 joined
03:09 andyhuzhill joined
03:14 yianni joined
03:15 <Cale> sophiag: perhaps https://www.youtube.com/watch?v=G9yiJ7d5LeI will be helpful...
03:15 mizu_no_oto joined
03:15 kthnnlg joined
03:16 <sophiag> interesting, thanks. i'll take a look. someone on #nixos is helping me with this simple rebuild for now tho
03:19 mounty joined
03:21 <centril> is the order of transformation in doing transformMOf uniplate deterministic?
03:22 gpbaran joined
03:22 <Cale> centril: It had better be
03:22 andyhuzhill joined
03:23 <centril> Cale: cause it seems to me that it isnt :/
03:24 nomotif joined
03:24 <centril> Cale: so I have: [Stmt] -> WriterT [Stmt] [Stmt] - and in this I'm filtering out some statements and putting in the writer and keeping others
03:24 <centril> and doing this with transformMOf uniplate
03:25 <centril> then Im running the writer and checking if the statements collected in the writer is a prefix of the one given to me
03:25 <centril> but it doesnt seem to preserve order
03:25 eacameron joined
03:26 <Cale> But is it the same order every time?
03:27 louispan joined
03:28 <centril> Cale: the first time, the statements are taken, so it wont be a prefix, but the output of the first run when run with the same normalizer is then given back in a different order
03:28 <centril> ill try with a third time and see what happens
03:32 <centril> Cale: [a, [b], c] -> [b, c, a] -> [a, c, b] -> [b, c, a]
03:32 <centril> (variable names, and scopes)
03:33 <Cale> huh.
03:33 <Cale> I wouldn't expect the order in which items are traversed by uniplate to be any different if repeated.
03:33 <sophiag> Cale: thanks for the help. turns out all i was missing was including myHaskellEnv in my pkg list
03:34 <Cale> ah
03:34 <Cale> cool
03:34 <centril> Cale: i must be doing some epic fuckup
03:35 <Cale> centril: You were the one that was doing weird monadic sorting stuff that I didn't properly make sense of earlier?
03:35 <centril> Cale: that one worked out fine
03:35 <Cale> ah, yeah
03:35 <Cale> hmm
03:35 <centril> this is a different normalization for moving statements to the top
03:35 <sophiag> although not ghc-core doesn't seem to be working as expected based on the tiny README...it says i just pass it the haskell file, but seems it's looking for an executable?
03:36 <Cale> ghc-core should mimic ghc in its behaviour
03:36 <Cale> It literally just runs ghc with some additional options and colours the output
03:36 <sophiag> oh, i see
03:36 <Cale> Specifically -ddump-simpl
03:36 <sophiag> that's not how the examples on hackage make it seem: https://hackage.haskell.org/package/ghc-core
03:37 plugin joined
03:37 <sophiag> -ddump-simple is what i want to see the colorized core output?
03:37 <lpaste_> Centril pasted “uniplate is being weird” at http://lpaste.net/353729
03:37 <centril> Cale: ^ hopefully you can follow
03:37 <Cale> -ddump-simpl is a flag to GHC to make it output the core after the simplifier runs
03:37 howdoi joined
03:38 <Cale> It won't print it colourfully, or put it in a pager
03:39 <Cale> Oh, ghc-core also has a nix package
03:40 <Cale> I was able to install it and it works
03:40 <sophiag> i have it installed, but it doesn't take a -o flag like ghc
03:40 <Cale> oh, it won't
03:40 <sophiag> and even passing ghc -ddump-simpl isn't outputting anything...
03:41 <Cale> It's not going to produce any executable output
03:41 <sophiag> right, that part confused me
03:41 <sophiag> it still seems to want an executable name tho
03:41 <Cale> hm?
03:41 <Cale> How are you running it?
03:41 <sophiag> the example says just run it like: ghc-core A.hs
03:41 <sophiag> but that doesn't work
03:42 <Cale> It works on the program I tried it on :)
03:42 <sophiag> hmmm
03:42 <Cale> What error exactly?
03:42 <sophiag> i get "ghc-core: less -R: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory)"
03:42 <Cale> ohh
03:42 <Cale> apparently you don't have less?
03:42 <Cale> and nix didn't know that less is secretly a dependency of ghc-core
03:43 tromp joined
03:43 exferenceBot joined
03:43 <sophiag> oh...
03:43 <Cale> Or maybe that's not the problem? Hard to tell.
03:44 <sophiag> welp, rebuilding now
03:44 rekahsoft joined
03:44 <sophiag> nah, that's not the problem
03:44 <centril> Cale: also tried with tinplate instead of uniplate - problem persists :/
03:44 <Cale> centril: I strongly suspect it's not the traversal's fault
03:45 <centril> Cale: yes, i suspect so to
03:45 <Cale> oh, you pasted stuff
03:45 <* Cale> looks
03:45 <centril> yeah
03:45 <centril> i stripped some stuff i can paste if you want
03:45 <centril> but then you have a wall of code ^^
03:45 <Koterpillar> sophiag: is someone trying to execute ["less -R"] instead of ["less", "-R"]?
03:45 <Cale> Well, it's really hard to tell what that does
03:45 <centril> Cale: i get that =)
03:46 pavonia joined
03:46 <centril> Cale: normEvery = transformMOf uniplate
03:46 <sophiag> Koterpillar: "someone" would be ghc-core so idk
03:47 <Cale> centril: There's no way that this function could be producing different results for the same input
03:47 <sophiag> i just tried running it manually and it works fine
03:47 <Cale> centril: It's a pure function on lists of Stmts
03:47 hexagoxel joined
03:47 <Cale> centril: It produces a Writer action, Writer is just glorified (,)
03:48 <centril> Cale: i know i know =)
03:48 <centril> Cale: added another statement to make sure i understand what it is doing
03:48 <centril> and: it is reversing the list every time
03:48 <centril> why... i dont know
03:48 <Cale> How are you testing it?
03:49 <Cale> Are you just applying vdSteal to the same argument multiple times?
03:49 <Cale> Or is other stuff going on? Are you sure you're passing it the exact same argument?
03:49 <centril> Cale: I parse some java code => AST => and then I run execVDTop on the top level ast
03:50 <Cale> Well, execVDTop involves IO somehow
03:50 <Cale> So it might do lots of stuff
03:50 <Cale> Get a suitable argument for vdSteal and test it in isolation
03:50 <centril> Cale: right - tho... execVDTop just prints stuff ;)
03:50 <centril> the io is just for debugging
03:51 <centril> but ill do that
03:52 conal joined
03:52 <centril> Cale: getting the suitable argument was really easy since i printed the stuff out anyways
03:52 <centril> :D
03:54 <Cale> So, what do you get, is it misbehaving still?
03:55 <centril> Cale: so the first time it reverses the list, second time it behaves as id, third: id, ...
03:55 <centril> hcPrint $ (vdSteal >=> vdSteal ) fixture
03:56 <Cale> that's... not what I asked for
03:56 <Cale> But okay, that's very different from what I thought you were talking about
03:57 <centril> Cale: which was?
03:57 <Cale> I just meant evaluate the expression multiple times
03:57 <Cale> I thought you were saying it wasn't deterministic
03:57 <Cale> even though it should be a pure computation
03:57 <centril> oh, well, i did that too
03:58 <centril> it is deterministic
03:58 <Cale> okay
03:58 vydd joined
03:58 <Cale> Well, even for a pure function f, it shouldn't be surprising if f . f = f -- that happens a fair amount
03:58 dawehner joined
03:58 <Cale> For example, a function which sorts a list has that property
03:59 <centril> right, i dont think the problem really lies in vdSteal other than it reversing the list
04:00 <centril> well, if you reverse on every time, that is a problem
04:01 uglyfigurine joined
04:02 <centril> Cale: right, so if i reverse the output i get from vdSteal (in the writer monoid) it works
04:02 Ralith_ joined
04:03 <centril> why uniplate / tinplate gives me a reversed list i dont know
04:05 doodlehaus joined
04:06 <sophiag> ugh, i'm still super confused by this error from ghc-core when i can literally run the same command it's failing on fine. doesn't help that there's pretty much no documentation on it
04:07 <Koterpillar> sophiag: is it not finding "less" or is it not finding "less -R" as a single command?
04:07 <Koterpillar> (strace will tell)
04:08 <Cale> Koterpillar: I would be surprised if it were just broken, because it works on my machine
04:09 <sophiag> google seems to say it's related to how i installed everything with nix
04:09 tristanp joined
04:09 <sophiag> Koterpillar: what exactly am i looking for in the output from strace? it's quite long...
04:09 buttons840 joined
04:10 <Koterpillar> some kind of exec that fails
04:10 <Koterpillar> you will need these parameters to strace: -e trace=process -f
04:11 xplat joined
04:11 <buttons840> Here's a web app I'm building wih Spock. I'm new and wondering if anyone sees any glaring issues with it? http://lpaste.net/353730
04:11 <centril> > runWriter $ (transformMOf uniplate $ filterM $ \x -> tell [x] >> pure False) [1,2,3]
04:11 <lambdabot> ([],[3,2,1])
04:11 <sophiag> Koterpillar: as expected it's "less -R" not "less" "-R" (the latter made no sense to me tbh)
04:11 <centril> Cale: ^
04:12 <Koterpillar> sophiag: show the relevant line?
04:13 sanett_ joined
04:13 <centril> runWriter $ (filterM $ \x -> tell [x] >> pure False) [1,2,3]
04:13 <centril> > runWriter $ (filterM $ \x -> tell [x] >> pure False) [1,2,3]
04:13 <lambdabot> ([],[1,2,3])
04:13 <sophiag> there are a bunch of lines, but they're all basically like this: "[pid 3998] execve("/home/sophia/bin/less -R", ["less -R", "/tmp/ghc-core-XXXX18042893838469"...], [/* 71 vars */]) = -1 ENOENT (No such file or directory)"
04:13 <sophiag> so it appears the exec it can't find is not less, but actually the output from ghc?
04:15 <pacak> Suppose I'm trying to apply some transformation on a product type. For most fields there is a property `Monoid b => Proxy a -> b, for some it must be `Monoid b => a -> b`. At the end I'm trying to get monoidal sum of every field but trying to perform as much of computation on compile time as possible. What would be the most intelligent approach? (ghc will calculate foo :: Int -> Int, foo x = 1 + x + 2 as 2 additions, not 1).
04:15 <geekosaur> sophiag, you have an option in the pathname
04:16 <Koterpillar> sophiag: that program is broken
04:16 <Koterpillar> sophiag: ghc-core or what was it
04:16 <geekosaur> it is looking for a file literally named "/home/sophia/bin/less -R", with embedded space
04:16 <Koterpillar> sophiag: _maybe_ you can trick it with setting PAGER (?) to just 'less', but not likely
04:16 <Koterpillar> I would trail its code for "less -R"
04:16 <geekosaur> it may be parsing an environment variable expecting it to be a pathname, when it is actually a shell command
04:16 vektorweg1 joined
04:17 <sophiag> ugh
04:18 Guest91787 joined
04:19 <sophiag> there is an open issue related to using PAGER: https://github.com/shachaf/ghc-core/issues/3
04:19 <geekosaur> hack: drop a script which does `exec less -R "$@"` somewhere and put the path to that in $PAGER
04:20 conal joined
04:20 <geekosaur> (...just don't name the script "less" :)
04:20 <Koterpillar> hack^2: name the script "less -R" (with a space)
04:20 <geekosaur> heh. that'd work too :)
04:22 <sophiag> i can't tell whether this was fixed here: https://github.com/shachaf/ghc-core/commit/630196adf0bebf073328325302453ef1c409fd9a
04:23 {emptyset} joined
04:23 <geekosaur> looks like it is, yes
04:24 <geekosaur> switched from rawSystem (which directly exec()s what it's handed) to createProcess with a shell-based command specification
04:24 mymosh joined
04:25 <sophiag> ok, so stupid question...but how exactly do i bypass this using PAGER?
04:25 <geekosaur> the hack I mentioned above
04:25 forgottenone joined
04:25 <geekosaur> instead of putting the option you want in $PAGER, make a script which runs the real pager with that option and set $PAGER to point to that script
04:26 <lpaste_> mymosh pasted “No module named ‘Char’ is imported.” at http://lpaste.net/353731
04:26 <sophiag> oh, i wasn't certain i actually had to go that route
04:26 <geekosaur> until thatcommit you pointed to lands in a release, it's probably the easiest solution
04:27 <mymosh> Hello, does anyone know what is causing this error? http://lpaste.net/353731
04:27 <geekosaur> mymosh: the module "Char" is from Haskell98 without hierarchical libraries
04:27 <sophiag> i couldn't tell whether that had been solved yet...seems not since the issue is still open
04:27 <geekosaur> it's Data.Char these days
04:27 norotartagen joined
04:27 <mymosh> geekosaur Thanks!
04:27 <mymosh> Trying to learn Haskell by following https://en.wikibooks.org/wiki/Yet_Another_Haskell_Tutorial/
04:28 <geekosaur> sophiag, if you were to reinstall ghc-core from the git repo instead of from hackage, you would have a fixed version
04:28 <mymosh> Looks like it might be out of date then.
04:28 <geekosaur> yeh, parts of the wiki are heavily bitrotted
04:28 <sophiag> ah
04:29 <sophiag> i'm just trying not to do imperative configurations like that because then when i switch systems i'll inevitably forget how to replicate them...
04:30 <sophiag> one thing that's odd is i don't seem to even have cabal-install after switching my nix config...
04:30 Xanather joined
04:32 hsk3 joined
04:33 coot joined
04:33 lithie joined
04:33 t77 joined
04:33 hexagoxel joined
04:33 FreeBirdLjj joined
04:37 mymosh joined
04:38 timrs2998 joined
04:38 isenmann joined
04:38 Xanather_ joined
04:45 mac10688 joined
04:46 andyhuzhill joined
04:46 eacameron joined
04:50 mexisme joined
04:51 jshjsh joined
04:51 mson joined
04:53 tmtwd joined
04:54 arkeet joined
04:54 arkeet joined
04:56 nomicflux joined
04:56 cschneid_ joined
04:57 dawehner joined
04:59 robotroll joined
05:00 plugin joined
05:00 nepiktaz joined
05:01 louispan joined
05:03 nepiktaz joined
05:04 Destol joined
05:04 <dfeuer> edwardk?
05:05 plutoniix joined
05:05 DataComputist1 joined
05:07 variable joined
05:18 mstruebing joined
05:19 gpbaran joined
05:19 sanett joined
05:25 benl23 joined
05:29 osa1 joined
05:29 osa1 joined
05:29 xaviergmail joined
05:30 mexisme joined
05:35 JuanDaugherty joined
05:36 windsing joined
05:38 halogenandtoast joined
05:45 Apocalisp joined
05:49 wtetzner joined
05:49 gpbaran joined
05:50 treehaqr joined
05:51 andyhuzhill joined
05:52 eacameron joined
05:54 FreeBirdLjj joined
05:55 plugin joined
05:56 kylefang joined
05:57 praduca joined
05:58 zhulikas joined
05:58 eacameron joined
05:59 zhulikas joined
05:59 vydd joined
05:59 rossberg joined
06:01 xtreak joined
06:04 sanett joined
06:05 Destol joined
06:06 juhp joined
06:07 dec0n joined
06:12 yellowj joined
06:12 sanett joined
06:15 jgt joined
06:15 arawack joined
06:16 DataComputist joined
06:19 hexagoxel joined
06:20 sanett joined
06:21 jchia joined
06:21 Sose joined
06:21 meba joined
06:27 dawehner joined
06:28 Rotaerk joined
06:29 halogenandtoast joined
06:31 ubsan_ joined
06:33 tromp joined
06:34 ali_bush joined
06:34 ali_bush joined
06:35 andyhuzhill joined
06:35 danvet joined
06:35 _sg joined
06:36 Destol joined
06:37 Gredu joined
06:38 <ertes> Cale, sophiag: nixpkgs includes everything from hackage… the haskell package set is generated automatically from a script
06:39 marcopullo joined
06:39 <dfeuer> FYI: (unsafeCoerce unsafeCoerce) is unsafe.
06:39 <ubsan_> dfeuer: I'm absolutely shocked :P
06:40 <dfeuer> ubsan_: I just crashed the compiler with it :P
06:40 <* ubsan_> continues to be shocked
06:40 <ubsan_> :P
06:40 <dfeuer> Pfff.
06:40 <ubsan_> wait, like, ICE?
06:40 <ubsan_> oooh, bug report time!
06:40 <ubsan_> :D
06:41 FreeBirdLjj joined
06:41 <dfeuer> ICE?
06:41 <ubsan_> internal compiler error
06:41 <sophiag> ertes: thanks. i figured out the config. now just having trouble running ghc-core, which i'm suspicious may be nix specific...
06:41 <ubsan_> it means, basically, a compiler crash
06:41 <dfeuer> Yeah, one of those. Ticket #13458.
06:42 <dfeuer> Night all.
06:42 <ubsan_> o/
06:42 <dfeuer> ubsan_: http://ghc.haskell.org/trac/ghc/ticket/13458
06:43 <dfeuer> It's pretty bogus code, but that's supposed to get caught by the type checker.
06:43 <dmwit_> inb4 wontfix
06:44 <dmwit> "I turned off the type checker and the type checker didn't save me." uh... okay
06:44 <dfeuer> unsafeCoerce id also breaks there...
06:45 FreeBirdLjj joined
06:45 <dfeuer> dmwit: unsafeCoerce is supposed to be able to produce runtime memory corruption and such fun.
06:45 <dfeuer> It's not supposed to be able to produce compile-time crashes.
06:46 <dmwit> Yeah, we'll see. Perhaps crashing the compiler is serious enough to pay attention to.
06:46 <dmwit> as you say =)
06:46 <dfeuer> Crashing the compiler is a much less important bug than crashing the runtime, but it's a question of whose fault it is...
06:47 <geekosaur> I... *think* something related to this has been discussed recently? Something about unsafeCoerce not getting along with RuntimeRep?
06:47 <dfeuer> Worst sort of bug, generally is "Incorrect result at runtime". Those are the real nightmares....
06:48 <geekosaur> wait no, that;s the internal version. that level shouldn't be exposed by the non=-# one
06:48 <geekosaur> (right. typing gone. should be in bed...)
06:48 <dfeuer> geekosaur: I think the issue is that even a representation polymorphic function has a type of kind *.
06:48 <dfeuer> So unsafeCoerce is happy. But then when it inlines,
06:48 <dfeuer> unsafeCoerce# gets unhappy in core lint.
06:49 athan joined
06:49 meandi_2 joined
06:50 quchen joined
06:51 Ayey_ joined
06:52 justan0theruser joined
06:52 jchia joined
06:54 andyhuzhill joined
06:54 hexagoxel joined
06:56 jchia joined
06:57 vydd joined
06:57 vydd joined
06:57 ThomasLocke joined
06:59 jchia joined
06:59 jshjsh joined
07:00 <sphinxo> Are there any tools to analyse the time complexity of (my) functions?
07:01 <sphinxo> oh looks like I can do something with criterion
07:03 <geekosaur> that's timing. "time complexity" sounds more like source analysis (but, good luck with that in a graph reduction language)
07:03 DataComputist joined
07:03 louispan joined
07:04 Jin joined
07:06 <nshepperd> you can estimate 'asymptotic' complexity by running your function on different inputs and fitting a function to it
07:07 raichoo joined
07:08 Bashmetim joined
07:09 jchia joined
07:10 owiecc joined
07:10 kritzcreek_ joined
07:12 UserJosh joined
07:13 tomphp joined
07:15 razi1 joined
07:17 <sphinxo> Does this function exist in the standard library?
07:17 <sphinxo> substr s i j = [s !! x | x <- [i..j]]
07:19 xtreak joined
07:20 sanitypassing joined
07:20 coot joined
07:23 freusque joined
07:23 systadmin joined
07:24 <dmwit> sphinxo: No, but you can make it much more efficient: `substr s i j = take (j-i) . drop i $ s`.
07:25 CurryWurst joined
07:25 <sphinxo> Thanks, that's cool
07:26 zeroed joined
07:28 Ayey_ joined
07:28 dan_f joined
07:29 hexagoxel joined
07:29 plutoniix joined
07:34 Shatnerz joined
07:34 xtreak joined
07:36 louispan joined
07:37 ali_bush joined
07:38 windsing joined
07:38 CurryWurst_ joined
07:38 lehof joined
07:39 t0by joined
07:40 cschneid_ joined
07:40 vaibhavsagar joined
07:43 plugin joined
07:43 NdaX404 joined
07:43 <NdaX404> Hi Everyone
07:44 fizruk joined
07:46 takuan joined
07:46 mfukar joined
07:46 NdaX404 left
07:47 sanett joined
07:49 ali_bush joined
07:49 ali_bush joined
07:49 guiben joined
07:50 hexagoxel joined
07:51 Grisha joined
07:51 kosorith joined
07:52 <lehof> hello, I'm new to functional programming and I'm kind of stuck: http://rextester.com/SNOAR45047
07:53 <lehof> how would I print something inside the isprime function?
07:53 <lehof> I'm talking about line 10
07:53 dawehner joined
07:54 sanett joined
07:54 <dmwit> lehof: You wouldn't.
07:54 <lehof> I would like to print n there and continue with executing check
07:54 <dmwit> If you want to print, you have to have an IO type.
07:54 <dmwit> No way* around it, I'm afraid.
07:55 <lehof> in imperative programming I would know how to get this done, but in Haskell I'm a bit confused
07:55 uncertainty joined
07:55 <lehof> but if isprime becomes an IO type, wouldn't that break the algorithm?
07:55 <lehof> check wants it to be a Bool
07:56 <dmwit> Something like this would do: `isprime :: Int -> IO Bool; isprime n = do print n; check n (n-1)`, then change `gameloop t = if t < 40 then do ip <- isprime t; if ip then do {- ... -} else {- ... -} else {- ... -}`.
07:56 <lehof> i mean gameloop
07:56 wing22 joined
07:56 lithie joined
07:56 <dmwit> oops, I mean `isprime n = do print n; return (check n (n-1))`, of course.
07:57 sanett joined
07:57 raichoo joined
07:59 <lehof> Am I correct in assuming that I don't understand this situation, because I don't have a clear understanding of monads?
07:59 <lehof> or is this about a different subject?
07:59 <dmwit> I don't think understanding monads is necessary. But you may like to stick to `(>>=)` and `return` instead of `do`-notation for a little while.
07:59 NdaX404 joined
07:59 <dmwit> Use these specialized to `IO`.
08:00 <dmwit> `(>>=) :: IO a -> (a -> IO b) -> IO b` and `return :: a -> IO a`.
08:00 Mortomes|Work joined
08:00 fbergmann joined
08:00 jhrcek joined
08:01 <dmwit> You might like sigfpe's "IO Monad for People Who Simply Don't Care"; or, if you are excited about monads anyway (certainly encouraged!), then I really liked sigfpe's "You Could Have Invented Monads (and Maybe You Already Have)".
08:02 andyhuzhill joined
08:02 <lehof> thanks :)
08:02 zenware joined
08:02 refold joined
08:03 pwnz0r joined
08:03 pylbrecht joined
08:04 <shiona> A while ago I wrote a piece of code "main = let x = some_somewhat_complicated_calculation; forever do_stuff_with x" and after finding out that x was computed for each round of do_stuff_with, fixed it with a bang. However I do feel like I would never catch any of these without the use of a profiler. Is there anything I could read so I could learn to avoid such traps?
08:06 doodlehaus joined
08:07 bjz joined
08:07 vydd joined
08:08 xtreak joined
08:09 eyck joined
08:09 <mfukar> shiona , start here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html
08:09 ali_bush joined
08:09 ali_bush joined
08:09 <lehof> what is the <- thing called in haskell?
08:09 ragepandemic joined
08:10 <lehof> your suggestion seems to work :)
08:10 bjz_ joined
08:10 pylbrecht joined
08:10 chenyu joined
08:11 andyhuzhill joined
08:11 <liste> lehof: it's do notation, it's a shorthand for using >>=
08:11 mattyw joined
08:11 <mfukar> lehof : "bind"?
08:12 <liste> lehof: do { a <- foo; b; return a; } is equivalent to foo >>= \a -> b >> return a
08:12 <liste> @undo do { a <- foo; b; return a; }
08:12 <lambdabot> foo >>= \ a -> b >> return a
08:14 <lehof> ok thanks :)
08:14 Beetny joined
08:14 <lehof> I have only scratched the surface, but I feel like Haskell/FP is incredibly powerful :D
08:15 <NdaX404> Nice
08:16 systadmin joined
08:16 jestjb joined
08:17 vala joined
08:17 <MarcelineVQ> shiona: Why did a bang help?
08:17 dennisvennink joined
08:18 mohsen_ joined
08:19 magneticduck joined
08:20 <vala> hi
08:22 aeroxam joined
08:22 <wing22> hi everyone, what are good places to hire haskellers for small projects,can I ask here?
08:24 <quchen> wing22: Sure, just don’t spam it every couple of minutes (or hours). Reddit is also a popular option.
08:27 guiben joined
08:28 farrioth joined
08:28 andyhuzhill joined
08:29 wedens joined
08:29 <lehof> I'm having a lot of trouble with Invariant Programming :(
08:30 <lehof> I've learned that Invariant Programming works the same in Functional Programming and Imperative Programming, but for some reason I can't wrap my head around it while using FP :(
08:30 <quchen> I’ve never heard of »invariant programming« :-/
08:31 chipc joined
08:31 <vala> i'm starting with Haskell
08:31 BartAdv joined
08:32 <lehof> the course I'm following describes it as adding arguments to a function such that a recursion function gets transformed to a tail recursive function
08:32 sanett joined
08:32 ricardos joined
08:32 <quchen> lehof: Ah, that’s more commonly known as the »worker-wrapper transformation«.
08:33 <quchen> reverse = reverse' []; reverse' xs [] = xs; reverse' xs (y:ys) = reverse' (y:xs) ys
08:33 <lehof> quchen: ah ok... is there a reason it seems incredibly hard to do in FP?
08:33 <quchen> That sort of thing
08:33 <wing22> quchen, i'll post it in reddit thx
08:34 <quchen> lehof: Not really, no :-x
08:34 <sphinxo> is there a name for this pattern? http://lpaste.net/8703440454395363328 ( apart from recursion/ tail call )
08:34 <lehof> hmmm
08:34 <quchen> sphinxo: Worker/wrapper transformation ;-D
08:34 <quchen> sphinxo: Or at least akin to it
08:35 free_beard joined
08:35 <sphinxo> thanks
08:35 <quchen> lehof: I think »length« is the canonical example, actually.
08:36 <quchen> Straightforward: length [] = 0; length (_:xs) = 1 + length xs
08:36 <sphinxo> How could you rewrite that with any?
08:36 <quchen> Worker/wrapper: length = go 0; go n [] = n; go n (_:xs) = go (n+1) xs
08:37 raichoo joined
08:37 plugin joined
08:38 dennisvennink joined
08:38 zeroed_ joined
08:38 mojjo joined
08:39 <sphinxo> ( when I say rewrite with any I mean the example I gave, not with length )
08:42 vala left
08:42 Yuras joined
08:42 uncertainty joined
08:43 Qommand0r joined
08:43 Swizec joined
08:44 thc202 joined
08:46 mgu joined
08:46 connrs joined
08:47 sanett joined
08:47 MoALTz joined
08:48 kungp joined
08:48 xtreak joined
08:49 wtetzner joined
08:50 SCHAAP137 joined
08:52 augur joined
08:53 <mfukar> sphinxo : `any somefn [0..len]`
08:53 nilg joined
08:56 fendoer joined
08:56 andyhuzhill joined
08:56 kthnnlg joined
08:57 <sphinxo> What's the time complexity of this? http://lpaste.net/8480091744002637824 O(n^2) ?
08:57 meta-coder joined
08:57 nilg joined
08:58 _sras_ joined
08:59 systadmin joined
08:59 <_sras_> Is there a package that can display/format monetary values in a local aware way...?
08:59 Rotaerk joined
08:59 <_sras_> local/locale
09:01 bennofs joined
09:01 mbw joined
09:01 john2x joined
09:01 Rotaerk joined
09:02 oish joined
09:03 <mbw> The documentation of the Network.Sockets API https://hackage.haskell.org/package/network- more or less recommends Network as a high-level interface. However, the Network documentation again recommends Network.Sockets... Is this stuff all deprecated?
09:04 uncertainty joined
09:04 ramzifu joined
09:04 <Rembane> mbw: I use both depending on if I need the low-level stuff or not. Go for high level for as long as it does what you want.
09:05 NeverDie joined
09:05 zero_byte joined
09:06 Rodenbach joined
09:06 hdeshev joined
09:07 biglama joined
09:07 <mbw> Rembane: It _does_ say "Network _was_ intended as a "higher-level" interface[...]", which kind of sounds like it was abandoned. But if you say you still use it, I guess it's okay to do so. It's for pedagogical reasons only, anyway.
09:08 merijn joined
09:09 <mbw> Rembane: What's the recommended way to make things exception-safe, do you bracket things or... ?
09:10 alfredo joined
09:10 <Rembane> mbw: bracket is nice, but I don't know if it properly works with exceptions.
09:11 Rotaerk_ joined
09:11 xaviergmail joined
09:11 balor joined
09:11 <Rembane> mbw: Go for it and see if it breaks! :D
09:12 <mbw> Rest assured, it will...
09:13 <Rembane> mbw: Then come back here and tell us how it broke and you can blame me for giving you stupid advice if somebody asks. :)
09:14 kosorith joined
09:15 <mbw> Rembane: More importantly, what is the canonical way of testing things? I keep coming across a lot of deprecated information in this regard (telnet etc.), a lot of which doesn't work with localhost for security reasons. I saw there are some nice sites like httpbin. However, is there still a way of trying out the basics locally without making myself vulnerable?
09:16 <mbw> I really am a beginner in this regard :(
09:16 <Rembane> mbw: Bind to localhost and a port, and nobody but somebody who has access to the machine will be able to access the socket.
09:16 <Rembane> mbw: Being a beginner is cool. :)
09:16 <merijn> I missed the start, testing what?
09:17 puregreen joined
09:17 <Rembane> mbw: Telnet actually isn't deprecated in this regard. You don't need encryption when nobody can snoop.
09:17 <mbw> merijn: The very basics of the information super-highway. HTTP, sockets, ...
09:17 <opqdonut> well telnet is deprecated in the sense that netcat is better
09:18 <opqdonut> and for http there's curl, wget, httpie, ...
09:18 <mbw> Well I did figure out that the verbose option of curl is very helpful.
09:18 <opqdonut> it is
09:18 <merijn> telnet is bad because telnet is a protocol, not just a dumb pipe for bytes
09:18 antoine2 joined
09:18 <antoine2> salut
09:18 <Rembane> You got me there. :D
09:18 <merijn> netcat *is* a dumb pipe for bytes
09:18 <opqdonut> merijn: yeah
09:20 FreeBirdLjj joined
09:20 <mbw> So I tried out binding a sockets the way the do it here: https://hackage.haskell.org/package/network- (socket example), but then I quickly got stuck. How can I read/write without failing and see what happens?
09:20 <merijn> mbw: I learned socket the old school C way, i.e. beej's guide
09:20 <antoine2> beginer here. May someone explain in a nutshell why `not . null x` and `not (null x)` don’t return the same results ?
09:20 <merijn> https://beej.us/guide/bgnet/
09:20 tomphp joined
09:20 nmattia joined
09:20 <merijn> antoine2: because "not . null x" == "\y -> not ((null x) y)"
09:21 <antoine2> then just not . null ?
09:21 <merijn> antoine2: Yes
09:21 <antoine2> ok
09:21 <mbw> merijn: I think I came across this before. I think there is also this classical unix networking book that deals with this, but the author has been dead for a while and the material seems deprecated to some extent.
09:21 <merijn> mbw: I'm not sure how well beej's guide has aged
09:21 <antoine2> gotit
09:22 <merijn> mbw: There's also "Advanced Programming in the UNIX Environment", which covers basically *everything* you ever wanted to know and more about everything on *nix
09:22 <merijn> mbw: So I'd be surprised if it didn't cover networking
09:22 nmattia left
09:23 <antoine2> merijn, well, in my case, don’t work: [tail x | x<-xs, not . null]
09:23 <merijn> mbw: Note that the network package is really just a rather low level wrapping around C's socket functions, so if you find a better tutorial in another language you should be able to transplant that knowledge to haskell rather directly
09:23 <antoine2> • Couldn't match expected type ‘Bool’
09:23 <antoine2> with actual type ‘t0 a0 -> Bool’
09:23 <antoine2> • Probable cause: ‘(.)’ is applied to too few arguments
09:23 <merijn> antoine2: That's because guards must be booleans, not functions producing Bool
09:23 <mbw> It's kind of a shame that there is no "Learning Networking with Haskell" kind of material. All the tutorials/documentation of the libraries I checked out seem to assume some formal background
09:24 <merijn> antoine2: You need one of the following: "not (null x)", "(not . null) x", "not . null $ x"
09:24 <antoine2> so filter attemps function, but not guards, ok
09:24 <merijn> mbw: There's honestly not really a formal background, but most of it basically assumes you've used sockets in another language
09:25 <antoine2> and what’s the difference between `.` and `$` couldn’t we just replace all dots by dollar ?
09:25 <mbw> Well I just meant that you're either a professional, have some prior experience in another language, or you studied CS or something similar.
09:25 <merijn> antoine2: No, "($) :: (a -> b) -> a -> b" that is, it takes a function and an 'a' to produce a 'b'
09:26 <antoine2> a function that transforms a into b ?
09:26 <merijn> mbw: For example, if you look at the type of 'Network.Socket.socket' and compare it to the first line of 'man socket' you'll see it's basically the same (hence why I mentioned beej's guide)
09:29 <seequ_> antoine2: `(f . g) x = f (g x)` and `f $ x = f x`
09:29 <mbw> merijn: For me, a first milestone would be something like being able to automatically extract some links from a webpage and download them, or something like that. While I can "slap something" together with wreq or something, I still wouldn't really understand what I'm doing. That includes http requests and headers, which I have already been reading up about. But it also builds on TCP/IP of course. From a
09:29 <mbw> pedagogical perspective, would you recommend a certain order of learning things? How did you learn all of this stuff?
09:29 <Rembane> mbw: Do it with netcat first.
09:29 Kreest__ joined
09:30 <seequ_> antoine2: `f . g $ x` is equal to `f $ g $ x`, but f . g` is not equal to `f $ g`
09:30 <mbw> This all sounds like there is not this one book that takes you by the hand...
09:31 sgflt joined
09:31 <seequ_> The former is usually preferred because it's slightly neater.
09:31 <mbw> Rembane: So with netcat I can also throw out GET requests etc.?
09:31 <Rembane> mbw: Bingo
09:31 <Rembane> mbw: You need to know HTTP to retrieve a homepage.
09:31 <Rembane> mbw: Well, a small part of it at least.
09:32 <mbw> Is using HTTP/1.1 still ok?
09:32 <antoine2> ’cause of the automatical argument thing?
09:33 <Rembane> mbw: Anything that the server responds to is okay. :D
09:33 <merijn> mbw: Honestly, I had my first "computer networking" class 12 years ago, so I don't remember how I learned this stuff
09:34 tromp joined
09:34 coot joined
09:35 louispan joined
09:35 <merijn> mbw: The only recommendation I have is: We used Tanenbaum's "Computer Networks" book and I remember all 3 Tanenbaum books I used at university as being excellent, so. But I don't remember how much that book focuses on theory vs practical
09:36 <antoine2> seequ_ it is ’cause the automatical argument thing?
09:36 <mbw> Ok but at least you did have a class... So now I have several options the way I see it. Using something like curl/netcat/whathaveyou, do it in C and use beej's guide or a book. I see this is all pretty involved and I have to go about this systematically to not get lost.
09:37 <merijn> mbw: Well, like I said, you could try simply using beej's guide and use Haskell
09:37 <merijn> mbw: Most of the API is identical, just the syntax isn't
09:37 <quchen> mbw: I generally read stuff, skipping things I don’t like or understand, until I hit the »all of this makes no sense to me« wall. I then revisit the first spot I skipped. Repeat!
09:37 <mbw> mbw: And this covers http as well, or only sockets?
09:37 <merijn> (and in Haskell you don't use select since it's built into the runtime)
09:37 <merijn> beej only covers sockets
09:37 <quchen> I like to call it »hammering the nail« learning tactic. It works fairly well for me. :-)
09:39 shurick joined
09:39 detrumi joined
09:39 <mbw> quchen: Still, you have to start somewhere. In my case this now boils down to whether to start with sockets or http.
09:39 DarkLeggend joined
09:39 <DarkLeggend> !list
09:39 <mbw> And of course there's all this html/xml/json stuff also :(
09:40 hexagoxel joined
09:41 indi_ joined
09:41 <merijn> mbw: The one true way of learning is "Start somewhere (doesn't really matter where), keep going until you hit something you don't understand, then look for a way to learn that first and continue"
09:41 czeq joined
09:41 hamid joined
09:43 <quchen> Ignoring the induction basis makes keeping going much easier.
09:43 <quchen> It also makes it much easier to prove things, such as that every odd number is even ;-)
09:43 pie__ joined
09:45 DarkLeggend left
09:45 takle joined
09:46 <mbw> I think I should start with the high-level presentation-layer stuff, to get practical results and keep me motivated, then. I have one more question about that. The way I understood it, if I GET a resource I can either get an html page, a media type or something like xml/json. In the latter case I think I can also request one of both, if the server supports it. But in practice, it might not. Now if I take
09:46 <mbw> something like wreq for example, which works with json, I have to know beforehand that the server is able to throw json at me. Is that correct, or is there a more universal way to look at this?
09:47 <merijn> You always have to know beforehand what the server will talk to you
09:47 <merijn> Unless the server sends you stuff without you requesting it first, in which case you can try to guess based on what it sends you
09:47 <merijn> This is why we have protocols and assigned ports
09:48 AndreasK joined
09:50 <mbw> Aren't those two seperate things, protocol/port and resource presentation format? For instance, both xml/json can be used to present some kind of record type I might be interested in. The way I understood it, the format is encoded in the response header in some way. But it still can both be sent via tcp on port 80... Or am I totally mixing things up now...
09:50 marr joined
09:51 Sose joined
09:51 uncertainty joined
09:51 xtreak joined
09:51 gregman_ joined
09:51 <merijn> No, before the idiocy of web2.0 and "everything is http"
09:51 <merijn> Actually, still
09:51 <merijn> XML and JSON are not protocols
09:51 gawen joined
09:51 <merijn> They are file formats
09:52 <merijn> HTTP is a protocol which was made to send arbitrary blobs of data, so it doesn't care whether those blobs are images, HTML, XML, or JSON
09:52 <merijn> The IANA (Internet Assigned Numbers Authority) allocates port numbers to protocols
09:52 <mbw> k, that's the stuff in /etc/services.
09:53 <merijn> See: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
09:53 <merijn> So, you generally expect port 80 to talk HTTP to you, port 25 to talk SMTP, port 21 to talk FTP, etc.
09:54 <merijn> If you don't know what a server on port X talks, there's no reasonable way to interact with it
09:57 <mbw> ok, but then in what way do http and tcp differ fundamentally? The way I understood it, you use tcp for data that needs to arrive losslessly, and udp for something like online games or skype or whatever. Now if you say http is for arbitrary blobs of data, that _again_ sounds like the kind of unstructured information tcp/udp are talking about. Man...
09:57 bennofs joined
09:57 <merijn> mbw: There's levels (see OSI layers) and generally each level is handled differently
09:58 <merijn> At the physical level (wifi or ethernet) your network cards hardware talks to another cards hardware
09:58 <merijn> These are usually just frame blobs with some boundaries
09:59 <merijn> ip is a higher level protocol that implement (unreliable, unordered) datagrams, this is implemented in your kernel and talks with your network card driver to convert it to whatever your card speaks
09:59 cpup joined
09:59 <merijn> TCP and UDP are implemented (again in your kernel) on top of IP
10:00 <merijn> HTTP is a layer 7 (i.e. application layer) protocol, implemented on top of TCP. Your kernel doesn't know HTTP, it just sees a TCP connection that contains bytes
10:00 <merijn> Your application has to turn those bytes into something sensible
10:00 <merijn> mbw: HTTP does a bunch of stuff beyond TCP
10:01 <merijn> HTTP supports resuming, compressing, it tells you (sometimes) the size of the binary data in advance, etc.
10:01 mmn80 joined
10:01 yqt joined
10:02 xtreak joined
10:02 <mbw> ok, this is helpful
10:03 arquebus joined
10:03 nmattia joined
10:04 nmattia left
10:04 _sg joined
10:06 jaspervdj joined
10:06 xtreak joined
10:06 <mbw> merijn: Could you also expand on your remark on the idiocy of web2.0? You seem to refer to some specific problems with "how things are done nowadays"...
10:07 <merijn> mbw: The web2.0 crowd is reinventing literally every protocol by tunneling it over HTTP
10:08 djellemah joined
10:08 tv joined
10:09 <mbw> What would be a concrete example of that?
10:11 <merijn> mbw: Things like all "smart" devices talking HTTP to everything
10:11 <merijn> HTTP doesn't add anything there, since the actual requests in the HTTP tend to be opaque blobs anyway, so just writing a proper protocol would be easier and neater
10:14 <mbw> So, all this IoT stuff uses http?
10:14 bjz joined
10:15 fendor joined
10:15 oish joined
10:16 <merijn> Lots of it
10:17 <merijn> Probably JSON too, because people like making me sad
10:18 <mbw> Is this the reason for why the majority of IoT communication is insecure, resulting in botnets ?
10:18 <sbrg> yes and no. the reason for the bad security is basically bad programmers, bad companies, bad ethics, bad pay
10:18 <sbrg> etc
10:18 <AndreasK> Going by the code quality of many embedded systems we should probably be thankful that they use existing http/json libraries instead of inventing new stuff. Although I bet some do write their own http stack too which has the worst of both worlds ...
10:18 <merijn> No, the reason is "companies with little software experience writing software in C"
10:18 <sbrg> they don't care, they don't have any gov. institutions demanding they do stuff properly, etc
10:20 ogrady joined
10:20 balor joined
10:20 ramzifu joined
10:21 marfoldi joined
10:21 <mbw> So what would be "doing things properly"? Your did mention "writing a proper protocol would be easier and neater", however that kind of sounds like it would make things worse since there is more that can be done wrong...
10:21 Glooomy joined
10:23 meba joined
10:26 plugin joined
10:26 <merijn> Honestly, protocols are not that hard
10:26 <merijn> It's not rocket science, it's like defining a file format
10:27 <merijn> There's only 2 rules that are actually important: 1) have a unique header token 2) have a version number
10:27 coot joined
10:27 <merijn> Especially rule two
10:29 <mbw> Ok, so the problem you mentioned with web2.0 isn't really about "reinventing things", but the abuse of http?
10:29 <merijn> mbw: My problem is "reinventing things *poorly*"
10:30 twanvl joined
10:30 <mbw> I see.
10:30 fizruk joined
10:30 <merijn> Adding HTTP below protocol X almost never makes X better, and often DOES make X worse
10:31 <mbw> This is probably something that I can only reasonably understand/judge after I have more knowledge and experience.
10:33 <merijn> Honestly, pick some goal that seems unrealistic and keep plugging away until you get somewhere. Most "hard" things (in terms of programming, not theory :p) I've encountered in CS were, in hindsight, not nearly as hard as they seemed
10:33 <merijn> (I'm talking filesystems, TCP implementations, compilers, etc.)
10:35 <tdammers> writing "a" compiler for "a" language isn't hard
10:35 <tdammers> the hard part is making it really really good
10:35 <merijn> :)
10:35 <Cale> merijn: There's a significant challenge in doing rule two well.
10:36 <mbw> (But there's only so much time...) But you're right, and I think I now have some good ideas on where to take things from here. I'd like to thank you for your patience with my naive questions, especially considering they were only _somewhat_ Haskell related :)
10:36 <merijn> tdammers: Not if you believe the Ur/Web guy :)
10:36 <merijn> Cale: Doing rule 2 at all is already a pretty big leap away from eternal regret
10:36 <tdammers> merijn: the problem with compiler and programming language design is that it usually happens by accident
10:36 <merijn> tdammers: That's because no one is willing to pay me for doing it on purpose :(
10:37 harfangk joined
10:37 <tdammers> merijn: I had this HTML template engine that started out as a one-liner involving a regex and a dictionary lookup. By now it has turned into a turing-complete dynamically-typed programming language.
10:37 <centril> Given a Traversal' s a , how do I get s -> [a] ?
10:37 <centril> i.e: get all elements that this traversal applies to
10:37 dawehner joined
10:37 <merijn> tdammers: Poor you :)
10:37 jeltsch joined
10:38 fizbin joined
10:38 <mbw> This sounds suspiciously like Perl.
10:39 <tdammers> first incarnation was PHP
10:39 <tdammers> a.k.a. Perl's retarded little brother
10:39 bjz joined
10:39 <mbw> D:
10:39 <tdammers> I was young and needed the money
10:40 <Cale> merijn: Well, minimally, you get to check that the versions match, and if not, present the user with an error. That's good, but then the next thing is implementing a server which can talk to old versions of the client, or a client that can talk to old versions of the server, and that's when stuff seems to get hard (I'm trying to figure out how we're going to arrange this for one of our applications right now -- just putting in a
10:40 <Cale> version number is not the hard part :)
10:40 windsing joined
10:41 <merijn> Cale: Sure, that's not easy, but I've had to do that (for a file format, not protocol) when my very first and 2nd version...didn't HAVE a version number
10:41 <merijn> Cale: And then your bollocksed
10:41 systadmi1 joined
10:41 <Cale> haha, yeah
10:41 <merijn> On a completely unrelated note
10:41 Reshi joined
10:41 xtreak joined
10:41 sphinxo joined
10:43 <merijn> Is anyone aware of a good intro on how to implement typechecking for (complex) pattern matches in something System F like. TaPL's coverage of sums/variants and polymorphism is rather disjoint, the Henk paper by SPJ and Erik Meijer also seems to gloss over some important details
10:43 hamid joined
10:44 benl23 joined
10:44 <Cale> The problem is that we have this interface which consists of... jeez, something like 160 data types? I'm not sure exactly how many of those actually go over the wire, but it's a significant fraction of them, and we need to work out some sort of answer to how we're going to cope with mismatched versions between backend and frontend, simply because Apple takes an unpredictable amount of time to check new releases of things on the App
10:44 <Cale> Store.
10:45 silver joined
10:45 <Cale> (and you're not allowed to deliver new code)
10:45 carlosdagos joined
10:47 <sbrg> merijn: [..] pick some goal that seems unrealistic [..] -- it's funny you should say that, but that is exactly the thing that I like to say is the most important thing I learned studying at uni. I don't know how many times I've stared at something that started out as more or less completely incomprehensible, and then had a good understanding of the subject a couple of weeks later, just because I kept banging my head against the
10:47 <sbrg> proverbial wall.
10:47 <sbrg> people really do underestimate persistence
10:48 <merijn> sbrg: Not the students we're currently making suffer through compiler constructions ;)
10:48 sanett joined
10:50 dawehner joined
10:50 <Cale> We'll probably just end up with N rolling copies of the libraries which define all our application data types and TH-generated Aeson instances, and then just painfully write annoying migrations.
10:50 <Cale> TH could automate a significant fraction of it
10:50 xtreak joined
10:50 <Cale> But still, it's going to be really irritating
10:51 fotonzade joined
10:51 ebzzry joined
10:53 <sbrg> "migrations"
10:53 <sbrg> that word gives me the creeps
10:54 <merijn> So no recommendations on pattern matching explanations?
10:55 <mbw> Among the many options Haskell seems to give you when it comes to generic programming, are there that are "clearly to be preferred" and others "to be avoided", or do you at some point have to know them all?
10:55 araujo joined
10:55 araujo joined
10:55 <merijn> mbw: I don't think I know any of them? :p
10:55 <mbw> *are there some
10:55 <merijn> Unless you include TH as "generic programming", I suppose
10:55 <mbw> I thought the cool kids were using them.
10:56 <Cale> mbw: They only come up somewhat rarely, depending on what kind of programming you tend to do, none of them are absolutely terrible
10:56 <Cale> You can certainly write a heck of a lot without learning about any of them
10:57 sanett joined
10:57 <mbw> To be fair, I haven't really encountered a situation yet where I missed these kind of features. Also, the term "generic" seems to be somewhat differently in Haskell than for instance in C++, where you call making use of parametric polymorphism "generic programming"...
10:58 <Cale> Yeah, our "generic" is a whole other kind of thing, where you're building programs which act at many types based upon the structure of the type itself
10:58 balor joined
10:58 kosorith joined
10:58 <Cale> Rather than just generic in the sense that you have a things which works at many types because it doesn't care about the structure of the type.
10:58 <Cale> a thing*
10:59 locallycompact joined
10:59 <mbw> Is there some kind of context in which Haskell generic programming constructs are used most often?
10:59 <Cale> Serialisation and deserialisation
11:00 <Cale> Of various kinda
11:00 <Cale> kinds*
11:00 <Cale> I can't type :)
11:00 oish_ joined
11:01 oisdk joined
11:01 <mbw> Always? There have to be situations in which you can just "dump binary", right? For instance plain arrays. Don't know about lists.
11:02 _sg joined
11:02 <Cale> For example, Aeson uses generics to get you standard instances of ToJSON and FromJSON -- you can write "instance FromJSON MyType" and not fill the instance in if your type is an instance of Generic.
11:02 <Cale> (and GHC can derive Generic)
11:02 Snircle joined
11:03 <mbw> But Generic is GHC specific, right? (I know that GHC kind of "won", but still...)
11:03 <Rodenbach> Is there a way to implement Show on functions, so that they will output their module+name when shown?
11:03 shayan_ joined
11:03 <Cale> Well, somewhat. It doesn't need to be GHC specific
11:03 <Cale> But most of the generics solutions people actually use are.
11:04 <mbw> Rodenbach: I guess the simplest approach would be newtype wrappers.
11:04 <Cale> Well, it's almost hard to measure whether these things are specific to GHC, because there just isn't really much of a competitor
11:04 <Cale> at least at the moment
11:04 <mbw> And what is the difference between Generic and Typeable? Is the latter only used for reflection kind of things?
11:04 <Rodenbach> mbw: okay, thanks for this suggestion!
11:05 <Cale> Typeable only gives you runtime type level information.
11:05 <Cale> It doesn't give you information about which constructors some data type has, for example
11:05 oish_ joined
11:06 <mbw> Cale: This kind of scares me, tbh. In conventional languages, it was always fruitful to have some healthy compiler competition, like clang for instance which resulted in a lot of improvements for gcc also. It feels like if I don't use other Haskell compilers out of pity or something, they will at some point all be gone...
11:06 <Cale> mbw: Well, the community for Haskell is only so large at the moment
11:06 <tdammers> then again, Haskell isn't the only single-implementation language out there
11:07 <Cale> and having two compiler implementation projects on the scale of GHC would be kind of a waste of scarce resources compared to the benefit it would provide
11:07 fizruk joined
11:07 <Cale> There are only so many people capable of working on GHC, and then only so many of those people actually have time to do it
11:08 <tdammers> also, the "other" compilers aren't so much pity cases; most of them are research vehicles, and quite a bit of that research eventually ends up in GHC and its ecosystem
11:08 <Cale> Though, there is now GHC and GHCJS
11:08 <Cale> but those two share a lot :)
11:08 <mbw> But GHC doesn't belong to anyone, right? I mean I saw that a lot of stuff is done in the context of projects of Microsoft Research..
11:08 MEIRL joined
11:08 <MEIRL> NO
11:08 <Cale> Right
11:09 <MEIRL> Not ME
11:09 <mbw> (??)
11:09 <Cale> Please be considerate and try not to shout.
11:09 <MEIRL> okOk
11:09 FullyFunctional joined
11:10 skapazzo joined
11:11 oish__ joined
11:11 JagaJaga joined
11:11 mizu_no_oto joined
11:12 lep-delete joined
11:15 <mbw> Cale: If Typeable is about rtti only, what is it commonly used for? I thought rtti was basically what the implicit use of dictionary arguments are used for, since because of polymorphic recursion not everything can be resolved at compile-time...
11:16 <mbw> Excuse my grammar.
11:16 acidjnk22 joined
11:16 netheranthem joined
11:17 cfricke joined
11:17 louispan joined
11:18 moongazer joined
11:18 <Cale> mbw: Well, there are various ways to forget the type of something. Existential types and GADTs can lose information about what type something had. Typeable provides a way to recover that, conditionally.
11:18 <Cale> :t cast
11:18 <lambdabot> (Typeable b, Typeable a) => a -> Maybe b
11:19 <Cale> For example, if I define a (fairly silly) type like data Showable where S :: (Show a) => a -> Showable
11:19 <Cale> Then having constructed something like S (5 :: Integer) :: Showable
11:20 plugin joined
11:20 <Cale> The only thing I will know about the argument to S when I pattern match is that it's some instance of Show, and so the only thing I can do with it, pretty much, is to apply the show function (or shows/showsPrec)
11:21 <Cale> If I need to be able to recover the fact that it's an Integer whenever it happens to be one, then Typeable gives me that abilit
11:21 <Cale> y
11:21 <Cale> If we added Typeable a to the constraint on S
11:22 <Cale> Then we could do something like foo (S x) = case cast x of Just n -> ... use n as an Integer here ...; Nothing -> ....
11:23 doodlehaus joined
11:23 <Cale> Typeable is also central to the way that exceptions work
11:23 <mbw> I was just going to ask about typical use cases, but this seems like a pretty important one.
11:24 <mbw> So you probably won't find it in willy-nilly run-of-the-mill code?
11:25 buoto joined
11:25 <Cale> Probably not.
11:26 yellowj joined
11:26 obadz joined
11:27 <Cale> Another example is Dynamic
11:27 kylefang joined
11:27 <Cale> But people don't tend to use Dynamic so much in Haskell, they just use existentials, and possibly Typeable.
11:28 sdothum joined
11:28 buoto joined
11:28 <Cale> But yeah, anything of a Typeable type, you can turn it into a Dynamic, and then turn it back.
11:28 <Cale> (conditionally, as a Maybe again)
11:29 <Cale> The simple implementation being
11:29 <Cale> data Dynamic where MkDynamic :: Typeable a => a -> Dynamic
11:30 <Cale> Or to use the other notation, that would be data Dynamic = forall a. Typeable a => MkDynamic a
11:31 <Cale> and then you have fromDynamic :: Typeable a => Dynamic -> Maybe a; fromDynamic (MkDynamic x) = cast x
11:31 osa1 joined
11:31 osa1 joined
11:32 <mbw> Is data X where Y the notation for GADTs?
11:32 <Cale> Yeah, you list the types of the constructors under the where
11:33 <Cale> and the key point is that you get some extra flexibility with regard to the resulting type
11:33 <lep-delete> you can also only use -XGADTSyntax :D
11:34 <mbw> This is all so much more stuff to learn...
11:34 <Cale> Yeah, GADTSyntax turns on the syntax, but not the extra capacity to define types with constructors that restrict their type parameter
11:34 <Cale> For example, you can do the following as a GADT
11:34 <Cale> data Expr t where
11:34 <Cale> Lit :: Integer -> Expr Integer
11:35 <Cale> IsZero :: Expr Integer -> Expr Bool
11:35 livingbeef joined
11:35 <Cale> IfThenElse :: Expr Bool -> Expr a -> Expr a -> Expr a
11:35 storms joined
11:35 <Cale> and now, you could define:
11:35 tromp joined
11:35 <Cale> eval :: Expr t -> t
11:35 <Cale> eval (Lit n) = n
11:36 storms left
11:36 <Cale> -- note that, having pattern matched on (Lit n), we discover that t is Integer, and so n is a valid result on the right hand side here
11:36 <Cale> eval (IsZero e) = eval e == 0
11:36 bjz_ joined
11:37 <Cale> eval (IfThenElse b t e) = if eval b then eval t else eval e
11:37 kthnnlg joined
11:38 <mbw> How does eval (IsZero e) work?
11:38 vwker joined
11:38 <mbw> specifically, eval e...
11:38 <Cale> Well, in that case, we know that IsZero e :: Expr Bool
11:38 <Cale> and so we know that t = Bool
11:39 <Cale> and so the right hand side needs to be a Bool
11:39 <Cale> and of course, the argument to IsZero has type Expr Integer
11:39 <Cale> that is, e :: Expr Integer
11:39 <Cale> and so eval e :: Integer
11:39 <Cale> and so eval e == 0 :: Bool
11:39 <Cale> as desired
11:40 uncertainty joined
11:40 <mbw> I have to type this into a file...
11:40 <Cale> The key thing about GADTs which makes them GADTs is that you can recover information about their type parameter by pattern matching on their constructors
11:40 <mauke> see /topic for a link to channel logs
11:41 narff joined
11:41 <Cale> So even though you only started out knowing that you had some Expr t, after pattern matching, you might know more
11:41 <mbw> Do I need GADTs or GADTSyntax?
11:41 <Cale> GADTs
11:41 windsing joined
11:41 buoto joined
11:41 <Cale> GADTSyntax should complain that this is a real honest GADT.
11:42 <Cale> and not just an ordinary algebraic data type with the generalised syntax
11:42 petermw joined
11:42 eacameron joined
11:42 HoierM joined
11:43 <mauke> :t field_1
11:43 <lambdabot> error: Variable not in scope: field_1
11:44 <AndreasK> merijn: What do you consider complex pattern matching in contrast to simple pattern matching?
11:44 <Cale> AndreasK: I'm guessing nested patterns
11:45 <mauke> map _ [] = []; map f ((f -> y) : (map f -> ys)) = y : ys
11:45 <mbw> Ah I think I get it.
11:46 <opqdonut> mauke: nice
11:46 lukaramu joined
11:47 <mbw> No I don't.
11:47 <AndreasK> merijn:I think "The Implementation of Functional Programming Languages" covers typechecking including patterns. But in something SystemF like wouldn't you translate all pattern matching to case expressions first and then typecheck the result of that?
11:47 <Cale> mbw: Anything I can clear up?
11:47 <mbw> In IfThenElse, eval b should go into IfThenElse again, I think. Will this terminate?
11:47 buoto joined
11:47 <Cale> hm?
11:47 <narff> how can I 'map' on every other element? i.e. map' negate [1..10] output: [-1,2,-3,4,-5,6,-7,8,-9,10]
11:47 <mbw> My thinking was.
11:47 <Cale> why would it?
11:48 <mbw> In IsZero e
11:48 <mbw> eval e goes into the "Lit n" pattern match and returns an integer.
11:48 <Cale> Consider something like IfThenElse (IsZero 5) (Lit 3) (Lit 6)
11:48 <mbw> Ah.
11:48 <mbw> Ok.
11:48 <mauke> > zipWith id (cycle [negate, id]) [1..10]
11:48 <lambdabot> [-1,2,-3,4,-5,6,-7,8,-9,10]
11:48 danza joined
11:49 <mbw> But it really is just pattern matching on types, right?
11:49 <merijn> AndreasK: I mean nested/compound patterns
11:49 JeanCarloMachado joined
11:49 <Cale> There's no runtime matching on types
11:49 <Cale> Only on constructors
11:49 buoto joined
11:49 <merijn> AndreasK: TaPL seems to only cover Sum/Variant types separately from polymorphic types and I'm having a hard time making things work that way
11:50 <Cale> It's just we know something more about what the types of things are, because we're able to set up this contract for eval
11:50 <Cale> eval :: Expr t -> t
11:50 <merijn> AndreasK: I wrote an implementation of Henk (see "Henk: a typed intermediate language" by SPJ/Erik Meijer), which seems like you should be able to do typechecking without needing unification, but I seem to get stuck with the typechecking of 'case'
11:50 buoto joined
11:50 <Cale> and so we know that the program will be safe
11:51 <Cale> even once we forget what all the types were
11:51 <mauke> I'd like to see an implementation of Cowboy Henk
11:51 <mbw> Is this related to polymorphic recursion?
11:51 <mbw> Since the t's can be different.
11:51 <Cale> I suppose our eval is polymorphically recursive.
11:52 <Cale> But consider, for example, if we tried something like this:
11:52 hamid joined
11:52 <merijn> AndreasK: Basically, the Henk paper suggest storing constructors as just their signature. I currently don't do type erasure, so all types are passed explicitly, including to constructors, but that means if you have "Foo a b c" (when constructing) some (or all) of 'a', 'b', and 'c' could be types
11:52 <Cale> data Expr t = Lit Integer | IsZero (Expr Integer) | IfThenElse (Expr Bool) (Expr a) (Expr a)
11:53 <Cale> and then tried to write
11:53 <Cale> eval :: Expr t -> t
11:53 <Cale> eval (Lit n) = n -- nope! Won't typecheck already.
11:53 <merijn> AndreasK: But I'm unsure how to deal with that in a pattern. Naively you could include a pattern variable for the types too, but that seems like it doesn't work out to well
11:53 <shiona> MarcelineVQ: I assume "let x = func >> forever print x" creates a thunk for x, and for each round in forever, the evaluation notices the requirement for x, evaluates it, uses it and then frees it, as there is no further need for the value. But there is, it's just too implicit for the runtime to understand it. That's my guess. "let (!x) = func >> forever print x" then forces x to some level outside the
11:53 <Cale> n :: Integer, but we want something of type t
11:53 <shiona> forever part, so within it x cannot be (completely) freed
11:53 <merijn> AndreasK: In the actual paper they just "sort of" annotate case with the types, but don't explain how you can figure out which positions *are* types and where they come from
11:54 <Cale> and, we know that Lit n :: Expr t
11:54 <merijn> So I'm wondering whether I have to go all the way and do unification to make things work, or whether I'm missing something here
11:54 <Cale> But we don't learn from that that t = Integer
11:54 <AndreasK> merijn: It's sadly not really knowledgable about typechecking myself, I just remember a chapter being dedicated to it in that book. But I just looked it up and it doesn't really seem to go into detail and doesn't mention patterns explicitly at all :(
11:54 buoto joined
11:54 <Cale> and so it doesn't typecheck
11:55 <Cale> t could very well be String
11:55 <Cale> for all we know
11:55 <merijn> AndreasK: Yeah, this goes for most papers/books I know. TaPL goes into details, but only for the separate individual pieces and leaves putting them together as "exercise for the reader" apparently
11:55 <mauke> this is like Nothing :: Maybe whatever
11:55 <mauke> and we can't write Maybe a -> a
11:56 <Cale> Well, it's a little different...
11:56 <AndreasK> merijn: As far as I know GHC's core (more or less SystemF) doesn't have nested patterns though as they are desugared away.
11:56 <Cale> But kinda
11:56 <Cale> We actually have a value of type Integer, and we'd really like for t to be Integer here.
11:56 <Cale> But there's nothing which is constraining it to actually be that, so that we can use the Integer that we have.
11:56 ericsagnes joined
11:57 <AndreasK> merijn: Sorry I couldn't be more helpful, I want to look into typechecking at some point but not there yet.
11:57 <merijn> AndreasK: Even without nested patterns you have the same issue about whether you treat types as bindable in patterns
11:57 <Cale> mbw: Does that make sense?
11:58 <narff> mauke: cool
11:58 <mbw> Kind of. It's only surprising that such a simple looking problem hasn't ocurred to me yet...
11:58 <merijn> Cale: You don't happen to have any pointers for me? :)
11:58 <Cale> merijn: References on how to typecheck nested patterns?
11:58 <mbw> Although I'm pretty sure I've probably encountered it without noticing.
11:59 <Cale> merijn: I wonder if there's something in SPJ's book
11:59 <merijn> Cale: Not necessarily nested, although a sort of "comprehensive" approach would be welcome
11:59 <Cale> merijn: I know there's stuff on compiling nested patterns
11:59 <merijn> My real issue is more how to typecheck polymorphic patterns, I think
11:59 <Cale> mbw: Seems to show up kinda rarely in actual practice.
11:59 <AndreasK> merijn: If you figure it out you should write a blog post about it sparing me the pain when I get there :D
12:00 <merijn> As in
12:00 jeltsch joined
12:00 <merijn> Suppose we have
12:00 <Cale> mbw: But when you're writing interpreters, it lets you hijack Haskell's type system for your own interpreter's use (as you might've guessed from this mini-example)
12:00 <merijn> data ProxyT : * -> * where
12:00 <merijn> Proxy : forall a . a -> a -> ProxyT a
12:01 <merijn> Naively a pattern for ProxyT would look like "case p of Proxy t r r", since Proxy takes 3 arguments
12:01 <Cale> mbw: and since the main overarching design pattern of functional programming is to invent a language in which your problem is easy to solve and then write an interpreter or compiler for that language, it can come up :)
12:01 <merijn> However, that doesn't seem right, since 't' is a type variable that's already determined by the type of 'p', but I'm unsure how to handle that
12:02 <merijn> Simply eliding the types means 1) figuring out "what are types" and 2) having a different arity in patterns than you do in applications
12:02 uncertainty joined
12:02 <merijn> The Henk paper does seem to elide the types from patterns, but provides no explanation or justification for how they do this
12:03 petermw joined
12:03 <mbw> Cale: On the other hand, we write mini-interpreters all the time I think. Like expressing invariants in terms of types, and then work with those. From this perspective (which might be wrong of course), I still don't have this "Aha! Now I need GADTs!" decision making tool at hand...
12:04 Sonderblade joined
12:04 <merijn> mbw: You notice rather quickly when you need GADTs, since when you try to write (fairly simple/obvious) code, it will fail to work
12:04 <mbw> But I have this problem with most GHC extensions still
12:05 <merijn> mbw: GADTs, like RankNTypes are something that usually don't make a lot of sense until you're trying to write some code that needs them, then you go "oh..."
12:05 <merijn> Especially GADTs and RankN, since what they're doing is actually rather simple. It's the implementation that's hard and requires lots of theory
12:06 <Cale> merijn: I guess one thing is that since you don't have a GADT ;) the type argument occurs in the type of p, and you could steal it from there
12:06 <merijn> Incidentally, the Henk paper is here: http://citeseerx.ist.psu.edu/viewdoc/download?doi= and section 5.4 is the explanation of pattern matching, which you'll, hopefully, agree is rather light
12:06 <merijn> Cale: Yes, but I don't know *how*
12:07 <Cale> merijn: Well, is p going to be in your context?
12:07 <Cale> It had better be, I think
12:07 <merijn> Cale: Because that means somehow identifying which part of the computed type of 'p' correspond to which part of the pattern
12:07 <Cale> Or else that variable lookup is going to fail
12:07 ebzzry joined
12:08 <Cale> The types that the data constructors are applied to are the same as the types that the type constructor is applied to
12:08 <Cale> hmm
12:08 <Cale> I think
12:08 <merijn> Do I simply just keep a list of types and every time I see a Pi type in the type of Proxy pick the first element of said list?
12:08 <Cale> yeah, that should be right
12:08 bennofs joined
12:08 <Cale> uh
12:08 <mbw> Are existentials, Rank2/NTypes, explicit forall etc. all expressing the same concept? A lot of extentions seem to use "forall", for instance ScopedTypeVariables which I use often in conjunction with typed holes, as well..
12:09 <merijn> mbw: ScopedTypeVariables merely uses the forall to introduce scoping, but they are the same forall in sense of the underlying theory
12:09 <Cale> merijn: I mean, when you're typechecking a case, you look up the type of the scrutinee in your context (after typechecking it)
12:09 <merijn> mbw: Haskell, implicitly has a forall everywhere, but it's never printed (hence, implicit)
12:09 <Cale> merijn: and then you pick it apart, and whatever types its constructor was applied to
12:09 bjz joined
12:09 <Cale> those are your implicit type arguments
12:10 ramzifu joined
12:10 <merijn> Cale: Currently I don't really have an "pick apart" implementation for types, but I suppose I will need to construct one?
12:10 <merijn> Cale: This is the kinda detail I was hoping got covered somewhere
12:10 <Cale> uhh, not implementation
12:10 <Cale> I just mean you need to extract the arguments to the type constructor
12:11 <Cale> It's going to have a list of type arguments
12:11 <Cale> those are the things you would have otherwise obtained from the data constructor's type arguments
12:11 <mbw> If I take something like Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s. What would happen if I didn't use forall?
12:11 praduca joined
12:12 <merijn> Cale: Let's stick with the ProxyT example. The point is, I need to match the 'a' in 'ProxyT a' to the relevant fields in Proxy, but it's not obvious how I can compute that
12:12 <praduca> Hi everibody
12:12 <merijn> Cale: In case of proxy I need to somehow figure out that the first ProxyT argument corresponds to the type of both 'x' and 'y' in 'case p of Proxy x y'
12:12 <merijn> mbw: It wouldn't compile
12:13 <merijn> mbw: I wrote a minimal example show casing RankN here: https://gist.github.com/merijn/77e3fa9757658e59b01d
12:13 <praduca> can someone tell me a good way to start using haskell and stack on nixos?
12:13 systadmi1 joined
12:14 <merijn> Cale: And I need to figure out which arguments to 'Proxy' are type and can be elided from the match, which is also not obvious to me
12:15 <Cale> https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/jfp-outsidein.pdf
12:15 <merijn> mbw: RankN deals with 'who gets to pick the type of a type variable'\
12:15 <Cale> I think Fig. 2 actually probably gets you there :)
12:15 <Cale> So, read from below the line to above the line for typechecking
12:15 <merijn> mbw: Normally, the *caller* of a polymorphic function gets to pick, but that doesn't always work, like in that gist. Since the caller can't know what 'a' will end up being
12:16 djellemah joined
12:16 <merijn> Cale: That's just using constraint based unification, no?
12:17 <merijn> I was hoping to get away with not implementing unification, since I don't think it's necessary if you don't do inference (I don't)
12:17 <Cale> yeah, though look carefully at what's going on with the list of types \bar{tau}
12:17 laz joined
12:17 <Cale> Oh, I mean, probably something simpler works too, the constraint part is unimportant, I think
12:18 <merijn> Cale: I'm a bit unfamiliar with some of the syntax there, is it explained elsewhere?
12:18 <Cale> Are you generally familiar with this style of syntax for typing rules?
12:18 ericsagnes joined
12:19 <Cale> There's a lot here which I'm not interested in, right now, maybe I could just write down the part which I think is relevant if you want :)
12:19 <merijn> Yeah, it's the forall double arrow and bar'ed substitution in VarCon I don't get it
12:19 <Cale> Ignore everything except the rule for Case
12:19 <Cale> and then ignore most of that
12:19 <merijn> Cale: I'm "got to chapter ~22 of TaPL" familiar with typing rules syntax ;)
12:20 <Cale> just notice that we're typechecking an expression of the form case e of blah blah blah pattern matches
12:20 <mbw> It's amazing how all these "minimally not working examples" are so simple.
12:20 <Cale> and the first thing on the top of the line is Gamma |- e : T \bar{\tau}
12:20 j2j joined
12:20 <Cale> i.e. we typecheck e first
12:21 <merijn> Cale: \bar{\tau} is just "an unspecified indexed number of tau's", right?
12:21 <Cale> yeah
12:21 <Cale> so, the list of type arguments to the type constructor
12:21 <merijn> mbw: Like I said, what RankN actually does is not particularly hard. But most uses of it are confusing since there's usually multiple things going on at once :)
12:21 <Cale> and then we go to typecheck each of the branches of the case
12:22 nomicflux joined
12:23 <merijn> Cale: hmmm, this seems to actually be what I initially implemented, I think? But that messed up. But maybe that's because I did have types in the pattern math and tried to use them in the result
12:23 <Cale> and there's this K_i: forall a. v_i -> T a (where I'm eliding the bars, but eh, just the same with lists of things)
12:23 <tobiasBora> Hello,
12:24 <Cale> and then we substitute the types tau that we unified while typechecking e
12:24 <Cale> for the type arguments to the data constructor
12:24 <merijn> Cale: Let's say I try to swap the two variables inside ProxyT, initially I'd write that as 'case p of Proxy t x y -> Proxy t y x', but that doesn't seem to work out nicely.
12:24 <tobiasBora> I've a question that may sounds stupid, but what are the main differencies between stack and haskell-platform? Is one way more popular that another? Are the projects written for one are simply usable by the other one?
12:25 <Cale> merijn: Er, but would you have the explicit type argument?
12:25 <merijn> Cale: I don't know?
12:25 <Cale> Or are you just making that explicit
12:25 <Cale> Wait, why doesn't it work out?
12:26 <merijn> Cale: I don't know, things got really messy and I never figured out how to fix it nicely. But that might also be me screwing up the implementation...
12:27 <merijn> Cale: I'm not even sure whether making the type an explicit matchable thing is even sensible, tbh
12:27 <Cale> The type of both x and y should be the type a that gets unified with the type obtained by typechecking the scrutinee of the case
12:27 <mbw> tobiasBora: The way I see it, people seem to recommend stack these days, though these things are of course always subjective. Some people actually argue actively against haskell-platform: https://github.com/bitemyapp/learnhaskell#also-do-not-install-haskell-platform
12:27 <Cale> merijn: At the term level?
12:28 <merijn> Cale: Yes
12:28 <Cale> merijn: I think it should be sensible, but it will throw away parametricity.
12:28 <merijn> Cale: Does it? How?
12:28 <Cale> If you do *that* then it makes sense to keep the types around as explicit arguments to your data constructors, because that's where they'll have to live at runtime
12:29 <merijn> Cale: I don't support a polymorphic case anyway
12:29 <Cale> I assume you mean you can type-case?
12:29 <merijn> So at best it can let you write more errors
12:29 <Cale> Or...
12:29 <merijn> Cale: I don't know what I'm doing tbh, because TaPL doesn't cover putting the pieces together like this and I haven't found any other resource
12:30 <merijn> So I honestly don't know if what I'm doing makes any sense at all
12:30 acarrico joined
12:30 <merijn> Henk doesn't seem to include an explicitly matchable type argument.
12:30 <Cale> merijn: Your typechecker will of course make the type constructors matchable things, because that's what it does is to make sure that types match :)
12:30 <merijn> But including it won't change the actualy behaviour since that won't allow
12:30 <Cale> But you don't necessarily expose this ability to branch on type arguments to your users
12:30 <merijn> Cale: No, I mean I don't see how explicitly including a type argument in the pattern breaks parametricity
12:31 <Cale> ohh
12:31 <tobiasBora> mbw: Thank you!
12:31 <merijn> Cale: Because doing that doesn't seem like it will allow you to do typecase? Which I assume you meant is what breaks parametricity
12:31 <Cale> Well, it doesn't. It only breaks it if you allow, say, a non-variable type pattern there
12:31 <merijn> Cale: Even then it doesn't, since I require all patterns to have the same type
12:31 Shatnerz0 joined
12:31 <Cale> ahh
12:31 <Cale> Then sure
12:31 <merijn> So that'd be a type error
12:32 <Cale> right, it would be a type error then to attempt to type case :)
12:32 <merijn> Or rather, I require all patterns to match the type of the scrutinee
12:32 systadmi1 joined
12:33 <Cale> But then, if the type argument never varies, and it can be determined from the type of the scrutinee, why bother writing it in the syntax?
12:33 castlelore joined
12:33 castlelore joined
12:33 <Cale> Just because we like it? :)
12:33 <merijn> Cale: Because I didn't know how else to make it make sense
12:33 <Cale> I guess you could write a variety of type variables there and have them unified by the type checker
12:35 lep-delete joined
12:35 <Cale> merijn: You have to look up the type of the constructor in the context already, right?
12:35 <merijn> Yeah
12:35 kthnnlg joined
12:35 <Cale> merijn: and then you unify its type variables with the type arguments you got while typechecking the scrutinee, right?
12:36 tromp joined
12:36 <Cale> Well, the rule in the paper is more to the point
12:36 <Cale> it says you extend the context
12:36 <merijn> Cale: Well, I first need to check the pattern before I can unify with the scrutinee
12:36 <hsk3> main :: IO ()
12:36 <hsk3> main = do
12:36 <hsk3> assert False True `seq` return ()
12:36 <hsk3> putStrLn "asdf"
12:37 <hsk3> Why doesn't that assert get executed?
12:37 <merijn> Cale: Since the type of the constructor is something like 'Proxy : ∀a . a -> a -> ProxyT a' whereas the scrutinee is 'ProxyT x' for some 'x'
12:37 <Cale> right...
12:37 yellowj joined
12:38 <Cale> and you might have a pattern like Proxy u v
12:38 <hsk3> ah one sec
12:38 <opqdonut> hsk3: are you compiling with -O? that turns off asserts
12:38 xaviergmail joined
12:39 Sose joined
12:39 <Cale> and so you typecheck that, and find that u : a and v : a
12:39 <hsk3> opqdonut yeah. is there another assert that never turns off?
12:39 <Cale> and then you substitute the a in those types with the tau that you got from typechecking e, according to the paper's rule
12:40 sphinxo joined
12:40 <opqdonut> hsk3: I guess you can just use throw
12:40 <opqdonut> hsk3: or call error
12:41 <hsk3> right yeah. thanks
12:41 windsing joined
12:41 <Cale> and add the types of those variables to the context, while checking that the right hand side of the match has type tau_r
12:41 sanett joined
12:41 moongazer joined
12:42 <Cale> (the variables bound by pattern matching)
12:43 <Cale> I guess mixing this in with nested patterns gets a little interesting
12:43 <Cale> But it shouldn't really be that much more interesting -- you just need to keep track of all the stuff that you'll be adding to the context while checking the pattern recursively
12:43 <Cale> hmm
12:45 sanett_ joined
12:46 doodlehaus joined
12:46 kosorith joined
12:47 <Cale> merijn: Oh, maybe while checking the pattern, you can already make the substitution of the type parameters for the type arguments obtained while checking e
12:47 <Cale> and that might make it simpler to deal with nested patterns rather than doing that later
12:47 <Cale> (and having to do unification-y stuff)
12:47 PSoBI joined
12:48 _kit_ joined
12:49 windsing joined
12:51 Snircle_ joined
12:51 fizbin joined
12:52 <merijn> Cale: What I was doing before, was basically "compute type from pattern, inserting wildcards for the type variables", then unify that with type of the scrutinee and then re-check the pattern know that I know the actual types for the parts of the pattern, but somehow I kept bollocksing that up
12:52 <merijn> I think I just need to sit down and stare at this for several hours again
12:53 mbw joined
12:54 <Cale> merijn: I suppose you can't just replace the types of the constructors in your context, because they need to remain polymorphic in case they're used multiple times at different types in the same pattersn
12:54 <Cale> pattern*
12:55 sepp2k joined
12:55 ramzifu joined
12:56 <merijn> Ok, the end conclusion is: My approach was probably sound, I just suck at implementing it
12:57 Micamo joined
12:57 <Cale> Cool. Someday I will have to try actually doing this as well. I've only ever thought a bunch about parts of typecheckers, and watched other people implement them.
12:57 fizbin joined
12:58 tipu joined
12:59 halogenandtoast joined
12:59 <merijn> I'm not actually maintaining a context, though. I was using bound to deal with variable capture/substitution. Instead of maintaining a context I'm simply substituting variables with types
12:59 <Cale> ahhh
13:00 <merijn> Which in some sense is really nice, but in some other sense is horrifically confusing
13:00 <merijn> Since my types might have variables to, so you end up with a confusing recursive type for your types
13:00 tipu left
13:01 psychicist__ joined
13:04 fizruk joined
13:04 eschnett joined
13:04 sanett joined
13:04 fendor joined
13:05 mfukar_ joined
13:05 Unhammer joined
13:06 kylefang joined
13:09 odi joined
13:10 fizbin joined
13:10 coot joined
13:11 shayan_ joined
13:12 sanett joined
13:12 doodlehaus joined
13:12 uncertainty joined
13:13 ziyourenxiang joined
13:13 fizbin joined
13:13 jaspervdj joined
13:15 leonardo1 joined
13:16 <tobiasBora> When I install stack, I get haskell 7.*, how could I get Haskell 8.* using stack?
13:16 <merijn> tobiasBora: Do you have any specific reason for wanting 8.0?
13:16 balor joined
13:16 <cocreature> tobiasBora: LTS 7.* is not the same as GHC 7.*
13:16 mgu joined
13:17 cpennington joined
13:17 <tobiasBora> merijn: If I remember, 8.0 had better functionnalities for debugging, and since I juste hate how debugging works in haskell, I hoped that upgrading to 8.0 would solve some of my problems
13:17 <tobiasBora> cocreature: Well I think that when I installed stack I saw "downloading GHC 7.10"
13:17 <cocreature> tobiasBora: it depends on the snapshot you’re working in
13:18 <cocreature> at least lts >= 7 should use ghc 8.0 iirc
13:18 <geekosaur> at a guess, you have a global stack.yaml from your first install pointing to an old resolver
13:18 <geekosaur> you can either remove it and let it be regenerated, or edit it to point to a newer resolver
13:18 kylefang joined
13:19 tumbihe joined
13:19 <tobiasBora> cocreature: Hum... What I did is to install the debin sid haskel-stack, and then run as explained in the documentation "stack upgrade --install-ghc" (or something like this)
13:19 plutoniix joined
13:19 <tobiasBora> geekosaur: Hum, maybe I've one that got installed by cabal before, is it supposed to be the same configuration files?
13:19 <geekosaur> cabal does not use stack.yaml
13:20 <cocreature> tobiasBora: if you don’t care what happens outside of a project, you can just create a new project with a sufficiently new stackage snapshot and run "stack setup" in that directory
13:20 <geekosaur> but, with your described commands, the sid haskell-stack might have written out a stack.yaml before upgrading itself
13:20 ramzifu joined
13:20 <cocreature> if you do care about what happens outside a project you need to edit the snapshot in ~/.stack/global/stack.yaml
13:20 <tobiasBora> geekosaur: hum... where could I find it?
13:20 <tobiasBora> cocreature: Yes I care about the "global libraries"
13:21 <geekosaur> otherwise it might be new project templates; I don't know offhand how you update those or if they do point to fixed snapshots
13:22 <tobiasBora> ok, I removed my .stack file, I'll see what is happening now
13:22 windsing joined
13:22 ebzzry joined
13:23 <tobiasBora> grrr... I have "Downloaded lts-6.25 build plan.
13:23 doodlehaus joined
13:23 Boomerang joined
13:23 <cocreature> just edit ~/.stack/global/stack.yaml
13:23 <tumbihe> Hey all:-)
13:24 <geekosaur> around now I'd probably be recursively grepping local stack dirs for the string "6.25".... not that I recommend this as a solution
13:24 <geekosaur> (rather, "lts-6\.25")
13:25 Argue__ joined
13:25 al-damiri joined
13:25 orphean_ joined
13:25 buttbutter joined
13:25 <tobiasBora> geekosaur: I don't have any lts-6* in the files in the .stack folder, nor ~/.stack/global/stack.yaml. Shall I create one?
13:26 john2x joined
13:26 <cocreature> huh, I thought stack created that automatically
13:26 fizbin joined
13:26 <cocreature> but you can just create it yourself and add a line "resolver: lts-8.3"
13:26 <geekosaur> I... don't know. I would actually be hitting the stack docs now to try to figure out where it gets defaults from
13:27 tumbihe left
13:27 <tobiasBora> cocreature: Ok thank you. Would it be possible to specify a general resolver like "pick the latest lts" ? It's very annoying to manually update the files when I want to upgrade
13:28 <tobiasBora> grr, I put resolver: lts-8.3 in the file, do stack upgrade, and got: "ghc-7.10.3: 6.51 MiB / 85.53 MiB ( 7.61%) downloaded...
13:28 <Cale> tobiasBora: You'd be updating much more than your stack.yaml if you did that
13:28 eSVG joined
13:28 <cocreature> tobiasBora: no, the reason why we have snapshots is that they’re supposed to represent a fixed set of packages and thereby guarantee reproducability. allowing something like “pick the latest lts” would defeat that
13:29 <Cale> Being randomly hit with a bunch of new version incompatibilities in every package when a new lts came out would be pretty difficult.
13:29 <tobiasBora> cocreature: Well, how is it different than manually edit the file?
13:29 <cocreature> tobiasBora: maybe stack upgrade does some weird things. what does "stack ghc -- --version" tell you
13:29 bjz joined
13:29 sanett joined
13:30 fizbin joined
13:30 ebzzry joined
13:30 <cocreature> tobiasBora: oh you want to run a command to update it once. I thought you want stack to always chose the newest stack resolver automatically without doing anything
13:30 sphinxo joined
13:30 <cocreature> you can do "stack init --resolver lts" on a new project but I’m not sure about the global project
13:30 <Cale> That's what I thought as well
13:31 <tobiasBora> cocreature: when I do that it stats downloading the ghc 8.*
13:31 <tobiasBora> I'm sorry I need to leave, but I'll be back soon
13:31 <tobiasBora> Thank you for your help though
13:31 <cocreature> tobiasBora: then everything should be fine. just run "stack upgrade" without --install-ghc and everything should be fine :)
13:32 asmyers joined
13:34 deepfire joined
13:34 sanett_ joined
13:35 lukaramu_ joined
13:37 dsh joined
13:38 <lpaste_> halogenandtoast pasted “ShouldIUseReader.hs” at http://lpaste.net/353739
13:38 <halogenandtoast> Is this something where the Reader monad could be used effectively ^^
13:38 <halogenandtoast> I feel like I'm passing the GameState an awful lot
13:40 mada joined
13:40 <merijn> halogenandtoast: Looks more like State(T)
13:40 <cocreature> I don’t think it does. the game state is never updated
13:40 ystael joined
13:41 <merijn> cocreature: Not here, but if he plans to loop takeTurn
13:41 <cocreature> merijn: oh right
13:42 Argue_ joined
13:43 meba joined
13:43 sanett joined
13:44 <halogenandtoast> hmm
13:44 oisdk joined
13:44 leshow joined
13:44 windsing joined
13:44 <halogenandtoast> alright thanks for the info merijn
13:45 Lord_of_Life joined
13:45 Boomerang joined
13:46 kosorith joined
13:46 piyush-kurur joined
13:48 <piyush-kurur> anyone tried ATS
13:48 PSoBI joined
13:48 <piyush-kurur> ?
13:48 mson joined
13:48 bodisiw joined
13:48 mizu_no_oto_work joined
13:49 <piyush-kurur> the type theory seems very interesting. Might be a better low level language than Rust may be
13:50 AX3L joined
13:50 AndreasPK joined
13:51 tomphp joined
13:51 blueonyx joined
13:53 odi joined
13:55 bts- joined
13:57 robkennedy joined
13:57 uglyfigurine joined
13:57 rekahsoft joined
13:58 ryantrinkle joined
13:59 Gurkenglas joined
14:00 muesli4 joined
14:01 mfukar joined
14:02 jbuurlage joined
14:03 ddellacosta joined
14:03 przembot joined
14:06 `^_^v joined
14:06 <jbuurlage> am trying to understand the derivation of Data.Fix (https://hackage.haskell.org/package/data-fix-0.0.3/docs/Data-Fix.html), is it easy to see why the initial algebra has to have this shape? I can see that the usual definition of `cata` gives an arrow to any other F-algebra (which only gives me weak initiality), but is there a constructive proof for
14:06 <jbuurlage> Fix?
14:07 e14 joined
14:08 ystael joined
14:08 makalu joined
14:08 govg joined
14:09 wraithm joined
14:10 sanett joined
14:11 muesli4 joined
14:12 ramzifu joined
14:13 kylefang joined
14:13 <sphinxo> How with quickcheck can I generate a list of strings, and a string not in that list of strings?
14:14 eacameron joined
14:14 oaao joined
14:15 odi joined
14:16 <c_wraith> there are a bunch of options. Do you care if the string's content makes sense?
14:17 refold joined
14:18 <sphinxo> c_wraith: nope
14:20 <makalu> I can use cabal sandbox add-source to depend on a library that is not on hackage. But what if I want to have a local version of a library that IS on hackage? If I add it with add-source, cabal attempts to build the library twice (I guess because cabal finds it on hackage)
14:20 kylefang joined
14:20 <c_wraith> makalu: at the moment, the best option for that is changing the version in the local copy to something that isn't on hackage, then depending on exactly that version
14:21 <makalu> ok that seems reasonable, thanks
14:21 <merijn> c_wraith: I don't think you need even that, since I think add-source has priority over hackage
14:21 <lyxia> sphinxo: the probability of two random strings being equal is pretty small, so you can just generate and check.
14:21 <merijn> So afaik you only have to pin the version to the one in your local directory
14:21 <merijn> The problem is if cabal picks a version that you don't have, but is on hackage
14:22 <kylefang> hey guys, quick question, is there any way to split up large files into multiple small files? Do I have to declare module for each file?
14:22 <c_wraith> merijn: maybe that was fixed since I complained about it a while back, but it certainly wasn't the case then. :)
14:22 <merijn> c_wraith: I'm not 100% sure
14:22 <merijn> c_wraith: But I've worked with sandbox without changing the version number and it worked for me unless my memory is wrong
14:23 <lyxia> kylefang: one module per file, but you can have one that simply reexports many modules.
14:23 <lyxia> that way you need only one import for all of them
14:23 <kylefang> lyxia: thanks for you reply, :) Also, I'd have to declare all these files in .cabal file right?
14:24 <lyxia> yeah
14:24 <kylefang> lyxia: seems like a lot of trouble~
14:24 cfricke joined
14:24 cyborg-one joined
14:24 <nitrix> ph88^: Added to whitelist. You can try PMing me again :)
14:24 coot joined
14:25 <lyxia> kylefang: not really
14:25 ChristopherBurg joined
14:25 BusFactor1 joined
14:26 codesoup joined
14:26 <kylefang> lyxia: gotcha, thank you. :)
14:26 fizruk joined
14:27 ozgura joined
14:27 bear73 joined
14:28 <sphinxo> ok, something more difficult to generate with quickcheck: a string, and a list of strings where the single string is a arbitrary combination of strings in the list of strings?
14:28 odi left
14:28 cobreadmonster joined
14:28 <shapr> oneof ?
14:29 <shapr> sphinxo: https://hackage.haskell.org/package/QuickCheck-2.9.2/docs/Test-QuickCheck.html#g:6
14:29 crobbins joined
14:29 <sphinxo> Thanks, that looks handy
14:30 Snircle joined
14:31 sanett joined
14:31 mvr_ joined
14:32 Raddamu joined
14:32 StoneToad joined
14:33 <blueonyx> hi, whats the "-" function to use in this case: map ((-3).length) foo
14:34 eschnett joined
14:34 <c_wraith> subtract
14:34 <Raddamu> Take away
14:34 <blueonyx> kthx
14:34 <Raddamu> How does map work
14:34 <c_wraith> That's the worst wart in Haskell's syntax, but I don't have a better solution.
14:34 djellemah joined
14:34 <c_wraith> @src map
14:34 <lambdabot> map _ [] = []
14:34 <lambdabot> map f (x:xs) = f x : map f xs
14:34 <Raddamu> I am noob
14:36 _sras_ joined
14:36 <c_wraith> map creates a new list by applying a function to every element of a list
14:37 <Raddamu> Ty
14:37 <_sras_> does using a writerT leak memory for long running processes? How can it be prevented?
14:38 <c_wraith> _sras_: WriterT cannot be made strict in the values being accumulated. This can in some cases result in a leak.
14:38 <c_wraith> _sras_: the workaround is to use StateT with a restricted interface, which can be made strict in the values being accumulated.
14:38 <Raddamu> Wat about lambda expressions
14:39 eschnett joined
14:39 <Raddamu> Its a function with no name
14:40 ThomasLocke joined
14:40 <c_wraith> lambda expressions are a way to define a function without naming it. It's mostly useful if you're about to pass that function to something else.
14:40 wraithm joined
14:40 danharaj joined
14:40 <c_wraith> for instance, map's first argument is a function. It's common to pass a lambda as the first argument to map, if it needs something a bit more complicated.
14:41 <c_wraith> > map (\x -> x * 2 + 3) [1..10]
14:41 <lambdabot> [5,7,9,11,13,15,17,19,21,23]
14:41 quchen joined
14:42 sanett joined
14:43 djellemah joined
14:43 <c_wraith> _sras_: you'd do something like replacing "tell foo" with "modify' (\x -> mappend x foo)", if you need the value to be accumulated more strictly
14:44 <_sras_> c_wraith: Yes. I guess there is no issue if I evaluate the log periodically, right?
14:45 <c_wraith> _sras_: that would also work. It depends on your needs, of course. :)
14:45 eschnett joined
14:45 refold joined
14:46 xtreak joined
14:47 boxscape joined
14:48 raddamu2 joined
14:49 oisdk joined
14:50 ngqvhx joined
14:52 uncertainty joined
14:52 sanett joined
14:53 Aruro joined
14:53 gpbaran joined
14:53 Apocalisp joined
14:53 {emptyset} joined
14:53 dylukes joined
14:54 coltfred joined
14:54 osa1 joined
14:54 osa1 joined
14:56 simukis__ joined
14:57 <Aruro> is it possible to define several modules in one file? if not why
14:58 doodlehaus joined
14:58 aarvar joined
14:59 <geekosaur> not currently, and because (a) the Report doesn't specify it (b) there's no well defined way to go from a module specifier to an actual module (if you have "import Foo.Bar" it is not going to look for a definition of module Bar in Foo.hi, it will look for Foo/Bar.hi (ghc also tries Foo.Bar.hi for some reason)
14:59 <merijn> Aruro: No and "because things weren't defined to work that way"
14:59 <merijn> I Don't actually think having multiple modules per file as actually against the report, but no compiler implements that
15:00 <merijn> geekosaur: Well, why *wouldn't* it try "Foo.Bar.hi"?
15:00 bodisiw joined
15:00 Raddamu joined
15:00 <shapr> if you want to be pedantic, template haskell splices can do it, but ...
15:00 <geekosaur> and "fi not why" sounds like "this should be basic functionality" which pretends that nobody (as opposed to, uh, pretty much *everybody*) has ever had a problem with mapping semantic modules to filesystem objects
15:00 sanett joined
15:00 <Aruro> i mean maybe question is more broad, why directory structure is imposed on the project?
15:00 <merijn> geekosaur: Well, the main problem is that the Report refuses to specify this mapping
15:01 <geekosaur> some languages have registries that try to deal with that... which means now you get to deal with registries, especially when they break
15:01 <Aruro> additionally is is possible to include cabal file in the same multi module file?
15:01 ramzifu joined
15:01 <geekosaur> because you'd like to be able to actually find things without having to read the entire project and build maps for it up front?
15:01 <merijn> geekosaur: What we have now is a "pseudo" spec of this mapping, where all tools *assume* GHC's mapping
15:02 <merijn> I'd much rather have the spec specify the behaviour so tools are portable
15:02 miskomali12 joined
15:02 <Aruro> is there conceptual problem of working with one potentially big file?
15:03 <Aruro> like a latex book, cabal is intro and modules are chapters
15:03 Denthir joined
15:03 <geekosaur> only experience of decades that that rapidly becomes unmaintainable, especially in a shared context
15:04 <shapr> Aruro: You could use the LaTeX literate Haskell, but I still don't think that gets you separate modules in the same file.
15:04 <miskomali12> Hello there. I dont know if im in the correct channel, if not please let me know or tell which one would be better. I'm looking for danish people that has english knowledge, im looking to export WINEs from my country to denmark. Need recommendation or bussiness agents or so. Anybody knows something i pay in advance paypal or skrill. thanks
15:04 was kicked by shapr: Kicked by shapr
15:04 <merijn> Latex isn't normally written in a single file either
15:04 <geekosaur> (likewise I know of few large ... that)
15:04 <geekosaur> every latex doc of ore than a few pages I've seen uses subdocuments
15:04 <Aruro> well simple file has its advantages, easier to distribute?
15:05 <merijn> Aruro: Why would you distribute source anyway?
15:05 <merijn> Just distribute binaries
15:05 <merijn> "just"
15:05 <merijn> :p
15:05 <quchen> merijn: Like a tarball including a compiler and everything!
15:06 <Aruro> is compiler plugin for ghc up the tast to make multimodule single file support?
15:06 <shapr> Aruro: you could probably do it, but I don't know if anyone would use it.
15:06 <merijn> Aruro: Why would you go through the huge effort?
15:07 skapazzo joined
15:07 <geekosaur> this feels like shaving huge yak to save a tiny amount of exra work
15:07 Yuras joined
15:07 wraithm joined
15:08 <merijn> geekosaur: Possibly negative amount of extra work, since the single file itself might introduce added work with regards to merging changes, etc.
15:08 <geekosaur> that one seems to have already been discounted/ignored
15:09 Sose joined
15:09 dylukes joined
15:09 <shapr> Aruro: have you tried writing Haskell with the existing module per file structure? If yes, what were the downsides?
15:09 <Aruro> what is community agreement on reasonable module size (number of lines) ?
15:10 <merijn> ha!
15:10 crobbins joined
15:10 <merijn> Community agreement in Haskell
15:10 <Aruro> shapr: i did, i dont like fragmentation, hard to keep track of whole project structure
15:10 <quchen> Try to stay below 1000.
15:11 <Aruro> then all the hussle with jumping between different files
15:11 <c_wraith> I don't even try to keep functions below 1000. :P
15:11 <shapr> Aruro: Have you tried intero and using that to jump to definition?
15:11 sword865 joined
15:11 <Aruro> shapr: yes, haskell-mode can do it too
15:11 <Aruro> but it needs ghci to load project
15:11 <quchen> c_wraith: Hah, you must be using newlines
15:12 <c_wraith> quchen: my greatest weakness
15:12 umib0zu joined
15:13 <quchen> c_wraith: I learned from the best, and defined my own trigraphs. My files have two lines, a GHC preprocessor directive and then the source.
15:13 robertkennedy joined
15:13 Rizy joined
15:13 <quchen> If you see ???????????? in my code, that’s a newline. I insert them occasionally for readability.
15:13 doodleha_ joined
15:14 <shapr> Aruro: so, still frustrating when you can jump to the definition and get the type signature?
15:14 <merijn> Anyone know if there's an intero for vim yet?
15:14 <c_wraith> Aruro: the best approach is to put things together that belong together, and separate things that don't. Unfortunately, you need to be experienced with Haskell before that starts making sense.
15:16 <Aruro> shapr: certainly jumping to def helps a lot
15:16 <merijn> c_wraith: Isn't it "put all types and classes in one file and weep", rather than grouping things belonging together together
15:16 PennyNeko joined
15:16 henriksod joined
15:16 <c_wraith> merijn: after banging your head on that wall long enough, you believe they all belong together.
15:17 <merijn> One of the few aspects where I wish GHC was more Report conformant >.<
15:17 <c_wraith> Yeah, actually supporting mutually recursive modules would be nice
15:17 marsam joined
15:18 fotonzade joined
15:18 <shapr> Aruro: are you using M-. and M-* to jump to def and jump back?
15:18 <Aruro> yes
15:18 cdg joined
15:19 <fendor> Hello everyone! has someone an idea when GHC will support LVM version 3.9?
15:19 <Aruro> one thing i would like it orgstruct like functionality
15:19 <Aruro> where u can bring any two pieces of code into visual range
15:19 <Aruro> on single page
15:19 <shapr> fendor: looks like HEAD supports LLVM 3.9: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing#LLVMSupport
15:20 raycoll joined
15:20 <merijn> fendor: There's ongoing work for GHC to switch to LLVM microcode, which would make it portable across LLVM versions, but I don't know how far that is
15:20 <shapr> Aruro: maybe a larger monitor that can show more text at the same time?
15:20 wraithm joined
15:20 <c_wraith> shapr: next you'll be recommending portrait mode. >_>
15:21 kody joined
15:21 <shapr> I've seen edwardk use that to great profit
15:21 plugin_ joined
15:21 <shapr> Mind you, he had multiple massive monitors in use at the same time, but that's what got me using 4k screens.
15:21 <Aruro> shapr: i do have large monitor :) code should not be linear thats my point
15:22 <fendor> shapr, weird, when i try to compile it with -fllvm it still complains about the version
15:22 <fendor> merijn, cool! but i think, this does not help me at the moment?
15:22 <fendor> merijn, i can just wait for the project to finish?
15:23 msko joined
15:23 sanett joined
15:23 deepfire joined
15:23 <shapr> fendor: or put up PRs to speed the project along?
15:23 <merijn> fendor: That work is going on in HEAD, so presumably it's going into 8.2 or 8.4, so no it doesn't help you right now
15:23 <fendor> shapr, what are PRs?
15:23 <merijn> fendor: So you basically have two options: 1) wait, 2) contribute/help test :)
15:23 <fendor> merijn, what a pity :/
15:23 <merijn> fendor: Pull Requests, i.e., patches
15:24 <shapr> fendor: pull request, that is... put in your own improvements :-)
15:24 <fendor> merijn, i would love to help... but i dont believe in myself enough to do something valuable
15:24 <Aruro> shapr: basically orgstruct is something like advanced narrow in emacs you can make visible any parts of code u want
15:24 serendependy joined
15:24 <merijn> fendor: I think investing effort in making it work with 3.9 is wasted effort, given the overall "more flexibility" that's being worked on
15:24 <merijn> fendor: depends, are you experienced with the LLVM part of things?
15:24 sssilver joined
15:24 <fendor> merijn, no i'm not^^
15:25 <fendor> merijn, i'm merely a software developer for java and haskell
15:25 <merijn> ah, then it might be trickier, you could still help test :)
15:26 <shapr> fendor: what's the big gain with llvm 3.9?
15:26 wraithm joined
15:26 <fendor> shapr, it's just the version of the OS i'm using and rebuilding everything from scratch seems to be hard
15:26 <merijn> shapr: Presumably the big gain is "not needing to have multiple LLVM installs around" :)
15:26 <shapr> ah, I see
15:27 <merijn> And that installing LLVM can be a pain :)
15:27 marsam joined
15:28 <fendor> well, yeah... so either wait or do not use it?
15:29 <merijn> fendor: Pretty much
15:29 theelous3 joined
15:29 <merijn> fendor: Any specific reason you want to use llvm?
15:29 <merijn> Because, with the exception of heavy numeric code, the native codegen of GHC is generally better performing
15:29 plugin joined
15:30 pera joined
15:31 <fendor> merijn, i'm writing my bachelor thesis in performance comparison between c and haskell, and it is requested that i use SIMD instructions and also testing the llvm backend
15:31 dylukes joined
15:31 <boxscape> I'm trying to install sdl2, but there appears to be a problem with the current version where you have to put "cpp-options: [...]" into the .cabal file. Instead of downloading it and changing the .cabal file, could I run "stack install sdl2" with some kind of command line option to do that instead?
15:32 <shapr> fendor: oooh, sounds like fun.
15:32 <merijn> Ah, yes, then you're boned unless you install the LLVM GHC wants :)
15:32 <fendor> also there will be heavy numeric code, so it might make sense ^^^
15:32 <fendor> merijn, yeah, sounds like fun :)
15:32 <fendor> any other suggestions to help me with my thesis? for example something i should lokk into?
15:32 <fendor> i will come here often now to ask loads of questions :D
15:32 moongazer joined
15:33 <fendor> so, prepare yorselves
15:33 chlong joined
15:33 <merijn> fendor: You might wanna join #numerical-haskell if you're gone do SIMD stuff
15:33 <lyxia> boxscape: perhaps you can add a --ghc-options
15:33 <merijn> fendor: carter is generally much more aware of that kinda stuff than many others :)
15:34 <Tuplanolla> I've worked with AVX for Haskell in the past, fendor.
15:34 AndreasK joined
15:34 <fendor> Tuplanolla, how was your experience?
15:35 <fendor> merijn, ok i will join the numerical haskell channel, thanks for that suggestion!
15:35 <Tuplanolla> Unpleasant but interesting, fendor.
15:35 AndreasPK joined
15:35 <boxscape> lyxia: that could potentially work, I'll try it, thanks
15:35 <Tuplanolla> I have some sparse lecture notes about it here (see `Step10.hs`): https://github.com/Tuplanolla/ties341-profiling
15:35 Jacoby6000 joined
15:36 yogsototh joined
15:36 sanett joined
15:37 <fendor> Tuplanolla, thanks! ill read it
15:37 urodna joined
15:38 trism joined
15:38 marr123 joined
15:39 <carter> fendor: are you the new possible simd ghc hacker? Also yes join my channel :)
15:39 <carter> fendor: are you the new possible simd ghc hacker? Also yes join my channel :)
15:40 oisdk joined
15:41 <fendor> carter, maybe? :D ill join ^^
15:43 <carter> Tuplanolla: the lack of real rather than LLvm flavor ops ishe real issue. I'm pretty convinced that the LLvm generic stuf exists mostly so that auto vectorization optimization is platform independent
15:43 HarveyPwca joined
15:45 marsam joined
15:46 change joined
15:46 dfeuer joined
15:47 yogsototh joined
15:47 moongazer joined
15:48 xaviergmail joined
15:48 anton___ joined
15:48 sanett joined
15:48 cpennington joined
15:49 Rizy joined
15:51 Aune joined
15:55 SpinTensor joined
15:58 ramzifu joined
15:59 mrrec joined
15:59 <boxscape> ok, so now I did end up downloading sdl2 and installing it from that, but if I use stack build on my project, that requires sdl2, it still wants to install it new. Can I tell stack to use the version I already installed instead?
16:00 <boxscape> or rather, it wants to install it again
16:00 jmelesky joined
16:00 <mrrec> hi, i have a question about the hatex lib, anyone any experience with it?
16:01 DataComputist joined
16:01 <glguy> mrrec: It's better to just ask your actual question.
16:01 <lyxia> boxscape: you must add your local version in the extra-deps
16:02 alx741 joined
16:02 marsam joined
16:03 <boxscape> lyxia: so just sdl2-<version>? because if I have write sdl2-2.2.0, which should be the one I installed, it still tries to install it
16:03 <mrrec> ok, yeah, i want to create a table with fixed width columns, i think i need to use ParColumnBot LaTeX
16:03 <nitrix> metafoobar: I do have an idea in mind that I was to implement in haskell and could be open-source (very little risks there as most people wouldn't understand what it's about anyway).
16:03 nilof joined
16:03 caumeslasal joined
16:04 skeet70 joined
16:04 sid_fules joined
16:04 <nitrix> metafoobar: The only one I keep closed source atm is my trading neural net :)
16:04 <mrrec> but im confused by the signature, shouldnt it take an Measure instead of an LaTex type?
16:05 <lyxia> boxscape: sorry, add the path to it inpackages
16:06 cogrendel joined
16:06 Sigyn joined
16:06 gpbaran joined
16:07 Benzi-Junior joined
16:07 spacedog82 joined
16:08 Randy joined
16:08 <boxscape> lyxia: works, thanks!
16:08 Xnuk joined
16:08 felixsch__ joined
16:09 hrehf joined
16:10 raichoo joined
16:11 wraithm joined
16:11 yellowj joined
16:11 <lyxia> boxscape: packages: [{location: path/sdl2, extra-dep: true}] would be more correct, see https://docs.haskellstack.org/en/stable/yaml_configuration/
16:11 <boxscape> ok, thanks
16:12 Sonolin joined
16:12 ludat joined
16:13 osa1 joined
16:13 osa1 joined
16:14 solatis joined
16:15 mohsen_1 joined
16:16 oisdk joined
16:19 ryantrinkle left
16:20 `^_^v joined
16:22 fizbin joined
16:26 dylukes joined
16:27 initiumdoeslinux joined
16:28 initiumdoeslinux joined
16:28 pavonia joined
16:31 <boxscape> I need a SDL2.dll file at runtime in the directory of the executable; is there any canonical way to do something like that with stack, or should I just copy it into the directory where stack puts the executable?
16:32 mstruebing joined
16:32 AndreasK joined
16:33 muesli4 joined
16:34 Claudius1aximus joined
16:34 windsing joined
16:34 ompaul joined
16:34 windsing joined
16:35 <boxscape> actually, putting it into that directory doesn't even work
16:35 <boxscape> (at least not if I try to run stack exec <exe> from the project dir)
16:36 <Boomerang> boxscape: if you use stack exec maybe place it at the top of the project dir
16:36 dsh joined
16:38 zeroed joined
16:38 zeroed joined
16:38 <boxscape> hm, actually, I'm not sure if it works with stack exec at the moment. If I run it manually, it works (i.e. no error message), but it closes itself immediately, so I may actually have a mistake in my source code
16:39 alx741 joined
16:39 alx741 joined
16:40 sz0 joined
16:40 conal joined
16:41 tlaxkit joined
16:41 <boxscape> Boomerang: ok, you were right, placing it in the project dir works
16:44 moongazer joined
16:44 <Boomerang> boxscape: you should be able to install SDL2 system wide if you need to. Otherwise just keep it there while developing
16:44 Denthir joined
16:44 <Gurkenglas> Does some tool automatically find common patterns and extract them?
16:44 <boxscape> Boomerang: Ah, I'll look into that
16:44 gienah joined
16:45 dan_f joined
16:45 osa1 joined
16:45 osa1 joined
16:45 MP2E joined
16:45 Apocalisp joined
16:48 oberstein joined
16:49 Aruro joined
16:50 <Aruro> is there any haskell "ide" which can easily transpose haskell expressions? like transpose elements of list, transpose applicative arguments , etc
16:51 nosyminotaur joined
16:52 nosyminotaur left
16:53 Apocalisp joined
16:54 emmanuel_erc joined
16:56 esennesh joined
16:56 Zekka joined
16:57 cur8or joined
16:57 moongazer joined
16:59 `^_^v joined
17:00 Aruro joined
17:01 hackebeilchen joined
17:01 <Aruro> is haskell-src-exts a good way to parse haskell file? are there lenses for it?
17:02 windsing joined
17:05 oberstein joined
17:06 gpbaran joined
17:06 HoierM joined
17:06 <shapr> What's the state of using GPUs in Haskell? I just got internet at home and now I'm thinking of setting up a multi-GPU server to run Haskell code, if that's possible.
17:06 HoierM joined
17:07 ft joined
17:07 Swizec joined
17:09 <shapr> Is Data.Array.Accelerate with accelerate-cuda the best option?
17:09 <shapr> Aruro: have you looked at HaRe? the haskell refactorer?
17:09 <alanz> Aruro: you might look at ghc-exactprint too
17:10 <Aruro> i wanted to install it but then got discouraged because of their use of ghc-mod
17:10 <fendor> something bad about ghc-mod?
17:11 tsmish joined
17:12 <Aruro> its huge and scary, takes lots of memory
17:12 <shapr> I actually have enough memory at the moment.
17:12 <Aruro> i was fun of it untill i realized its very slow and big
17:12 Deide joined
17:12 <Aruro> now the refactorer which has ghc-mod deps , that can not be fast
17:12 <shapr> I don't know of a laptop that supports 128GB of ram, but probably I'll upgrade when I find one.
17:13 <Aruro> i have 2gb ram
17:13 <shapr> oh, I have 64GB ram
17:13 <monochrom> Haha, Richard Eisenberg wrote in haskell-cafe "apologies for a newbie question"...
17:14 {emptyset} joined
17:14 raycoll joined
17:15 <MarcelineVQ> from what I've seen ghc-mod only gets heavy when you used it with stack
17:15 <shapr> Oh, the bryn mawr prof?
17:15 mson joined
17:15 oberstein joined
17:15 <esennesh> So I've got a pattern functor for a little AST sort of thing, and I want to make a Set of AST values. How do I define the Eq1 instance I apparently need?
17:15 differentpho joined
17:15 <differentpho> http://imgcash.co/oon4hVr
17:16 <lyxia> esennesh: the package generic-deriving can derive it
17:16 <shapr> lyxia: aha, one you didn't write!
17:16 <shapr> Also, it turns out I don't need generic-random for this project :-(
17:17 ragepandemic joined
17:17 _sras_ joined
17:18 <lyxia> hmmm I thought it derived it... but I can't find it
17:18 <_sras_> What is the standard way to do logging in latest version of the Servant web framework?
17:22 Zekka joined
17:22 <lyxia> esennesh: sorry I was mistaken, you'll probably have to write it by hand
17:22 jbuurlage joined
17:23 refold joined
17:25 JagaJaga joined
17:25 <esennesh> So I tried to write "instance (Eq a) => Eq1 MyTree where"
17:25 <esennesh> And got, "Type synonym ‘MyTree’ should have 1 argument, but has been given none"
17:26 <esennesh> When I include the "a", I just get the complaint that "MyTree a" has kind * instead of *->*.
17:26 <esennesh> Beh
17:26 <lyxia> esennesh: http://hackage.haskell.org/package/deriving-compat-0.3.5/docs/Data-Eq-Deriving.html
17:27 <lyxia> esennesh: don't use a type synonym
17:27 <esennesh> I was getting the same problem with "Fix (MyTreeF a)" though.
17:27 ragepandemic joined
17:28 <lyxia> I think you should implement Eq1 MyTreeF
17:28 Bob131 joined
17:28 Apocalisp joined
17:28 danza joined
17:29 huonw joined
17:29 meta-coder joined
17:29 <lyxia> Or Eq1 (MyTreeF a), I don't know what kind MyTreeF has
17:29 kyclark joined
17:29 <esennesh> "Expecting one more argument to MyTreeF".
17:29 Rainb joined
17:30 <esennesh> Ok, that finally got the error message to move a line down, thanks.
17:30 plutoniix joined
17:30 windsing joined
17:30 <lyxia> So the first rule is not to implement instances for type synonyms
17:30 dylukes joined
17:31 <lyxia> Then, Eq1 expects a type of kind (* -> *)
17:31 sns joined
17:31 <kyclark> Given this code, how do I extract the “fastaSeq” from each of the FASTA records? http://lpaste.net/353750
17:31 <lyxia> esennesh: I'm guessing you defined data MyTreeF a b = ..., so MyTreeF :: * -> * -> * needs to be applied to one argument for that to match the expected kind of Eq1
17:32 takle joined
17:32 replay joined
17:32 <esennesh> Yeah, got the compiler to stop complaining. Thanks for your help!
17:32 <lyxia> esennesh: the deriving-compat package I just linked derives the instance in template haskell
17:32 <lyxia> yw
17:33 <lyxia> kyclark: map fastaSeq (parseFasta fa)
17:33 wraithm joined
17:34 presiden joined
17:37 <Aruro> are there lenses for haskell-src-exts package?
17:37 <Aruro> how do people work with ast?
17:38 viuo joined
17:38 <edwardk> Aruro: i don't have any. you can use uniplate/biplate from Data.Data.Lens for some of it
17:38 wraithm_ joined
17:38 <_sras_> How can I rotate logs when using Network-Wai-Logger with servant?
17:38 <cocreature> there is https://hackage.haskell.org/package/haskell-src-exts-prisms
17:38 <edwardk> oh neat
17:39 <cocreature> it looks like it’s slightly out of date but it’s not that bad
17:41 <kyclark> lyxia: I tried that, but I get “Variable not in scope: fastaSeq”
17:41 moongazer joined
17:41 <kyclark> I update the lpaste to show the Data.Fasta.String.Parse module I’m using
17:42 <Aruro> edwardk: cocreature: ty, that package has LOTS of prisms :)
17:42 <kyclark> I’m struggling just to understand how to use the module when there is no documentation showing basic usage.
17:42 <Aruro> cocreature: seems abandoned?
17:42 JeanCarloMachado joined
17:42 <cocreature> Aruro: yeah looks like it. but bringing it up2date shouldn’t be too bad
17:42 gpbaran joined
17:42 ivana joined
17:43 <tobiasBora> Hum...
17:43 <tobiasBora> Is it possible to install stack for the whole system?
17:44 <geekosaur> no
17:44 grayjoc joined
17:45 <geekosaur> it would likely need a complete overhaul to be able to manage a global package cache securely across multiple users (or need to be run always as root)
17:45 zcourts joined
17:45 <_sras_> How can I rotate logs when using Network-Wai-Logger with servant?
17:45 wraithm joined
17:46 oberstein joined
17:46 <theelous3> so, I have a program that bugged out, and won't close with mod+shift+c. I haven't had to deal with this. How kill?
17:46 <theelous3> (two instances of thunar)
17:47 <Aruro> cocreature: hm, source code has like 95 lines of code :)
17:47 vaibhavsagar joined
17:47 <shapr> theelous3: kill -9 on the pid?
17:47 <lyxia> kyclark: you need to import a module exporting fastaSeq, like Data.Fasta.String.Types
17:48 <lyxia> kyclark: or simply Data.Fasta.String
17:48 <shapr> theelous3: or perhaps "killall thunar" ?
17:48 <tobiasBora> geekosaur: ok too bad. So If I want to have ghc available for the whole system, I need to install it manually?
17:48 <geekosaur> yes
17:48 <theelous3> shapr: thanks
17:48 <tobiasBora> ok thank you
17:50 <kyclark> lyxia: Oh! Got it, thanks.
17:50 robertkennedy joined
17:50 <tobiasBora> and so there is no way to have ghc, with given libraries, installed for the whole system
17:51 <Aruro> tobiasBora: which system?
17:51 <tobiasBora> Aruro: debian sid
17:51 <Aruro> why no way? simple cabal+ghc?
17:52 <* tobiasBora> just discovered all the debian libghc-* available!
17:53 <ggVGc> "Stack for the whole system" is basically nix isn't it?
17:53 <ggVGc> or at least nixpkg
17:53 bodisiw joined
17:53 <Aruro> cabal can also install globally for given user
17:53 padre_angolano joined
17:53 <tobiasBora> Aruro: I'm a bit lost... cabal is not for a given user?
17:53 <Aruro> it is
17:54 <Aruro> u have ghc and cabal in path
17:54 <geekosaur> cabal can even be used for true global installs; it's just a relaly bad idea since you are then dependent on ghc not getting its knickers in a twist over multiple installed versions
17:54 coot joined
17:54 fizbin joined
17:54 <Aruro> then install packages with cabal install MYgratePackage
17:54 path[l] joined
17:54 <Aruro> library(*)
17:54 <tobiasBora> Aruro: Well me I mean for all users. For example If I want to share some haskell scripts between several users, I don't want that my 50 users each have their own haskell installation
17:54 phyrex1an joined
17:54 <geekosaur> tobiasBora, cabal can be used in global, user, or sandbox mode. (new-build etc. are always sandboxed, nix-style, which in practice likely means package caching per user like stack.)
17:55 oisdk joined
17:55 <geekosaur> but cabal won't install ghc for you
17:56 <Aruro> tobiasBora: its possible, there are labs with thousands of users and ghc in path
17:56 <kyclark> I’d like to use the “hstats” package (https://hackage.haskell.org/package/hstats-0.3/docs/Math-Statistics.html), but when I add “hstats-” to my “extra-deps” in “stack.yaml,” stack complains “base- must match >=3.0 && <4.9 (latest applicable is”. Does “base” here refer to the Prelude? Should upgrade/downgrade? How do I fix this?
17:56 raycoll joined
17:57 oberstein joined
17:57 tomphp joined
17:58 <tobiasBora> ggVGc: nix is not dead? It does not receive any update since 2010
17:58 <Aruro> kyclark: base is not just prelude, a lot of other modules
17:59 <Aruro> tobiasBora: who told u nix is dead?:)
17:59 <ggVGc> I didn't know that
17:59 <ggVGc> I thought it was growing in popularity
17:59 Noldorin joined
17:59 castlelore joined
17:59 castlelore joined
17:59 <shapr> I've heard great things about nixOS recently.
17:59 JeanCarloMachado joined
18:00 <tobiasBora> geekosaur: Hum... Ok. And how do you make the difference between user mode and system mode when you install a package?
18:00 acarrico joined
18:01 <tobiasBora> Aruro: ggVGc : Oh maybe, I think I read "The following old releases of Nixpkgs are available:", and I didn't read the "old", so maybe that's why I saw only 2010 version
18:01 <tobiasBora> my bad
18:01 Myrl-saki joined
18:01 <Aruro> yes, its very active
18:01 <geekosaur> tobiasBora, --global (and you will need sudo)
18:02 abh joined
18:02 eliasr joined
18:02 <geekosaur> kyclark, a dependency on base is, de facto, a dependency on a specific ghc version (or range thereof)]
18:03 <geekosaur> in other words, hstats does not claim to be able to work with your ghc, which is newer than it has been tested with
18:03 <geekosaur> you could try --allow-newer=base but no promises
18:03 castlelore joined
18:03 castlelore joined
18:04 <Aruro> anybody tried guix? they say its inspired by nix
18:04 connrs joined
18:04 LeCamarade joined
18:04 <Aruro> https://www.gnu.org/software/guix/
18:04 cdg joined
18:04 castlelore joined
18:04 castlelore joined
18:05 <tobiasBora> geekosaur: great thant you!
18:05 MP2E joined
18:06 Apocalisp joined
18:07 oberstein joined
18:07 <tobiasBora> Question not related at all: is it possible to install nix on a debian for example, as a non root user?
18:08 fizbin joined
18:09 revtintin joined
18:09 castlelore joined
18:09 castlelore joined
18:09 padre_angolano joined
18:10 honeymead joined
18:10 castlelore joined
18:10 castlelore joined
18:11 ertesx joined
18:12 xinming_ joined
18:12 <carlosdagos> tobiasBora: curl https://nixos.org/nix/install | sh
18:13 presiden-nkrj joined
18:13 <carlosdagos> if I'm not mistaken, the nix package manager is "nothing but" a set of bash/perl scripts
18:13 <tobiasBora> carlosdagos: according to this site, it creates a /nix/ folder, so I think it's using sudo: https://www.domenkozar.com/2014/01/02/getting-started-with-nix-package-manager/
18:13 <carlosdagos> so yes, I'd believe so
18:13 stef204 joined
18:13 <tobiasBora> but I found another website:
18:13 <tobiasBora> https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution%29
18:14 castlelore joined
18:14 castlelore joined
18:14 <carlosdagos> if you try it it'd be cool to know the result tobiasBora :)
18:15 <tobiasBora> carlosdagos: I will try... Hope I won't died soon!
18:15 mbeidler joined
18:16 diegoksp joined
18:17 raichoo joined
18:17 <tobiasBora> "directory /nix does not exist; creating it by running ‘mkdir -m 0755 /nix && chown leo /nix’ using sudo
18:17 <tobiasBora> [sudo] Mot de passe de leo :
18:17 <tobiasBora> "
18:18 Berra joined
18:18 coot joined
18:19 <tobiasBora> "(We cannot use one of the pre-built binaries available on the Nix website because the Nix store path is hard-coded to /nix/store.)"
18:20 JuanMiguel joined
18:20 zcourts_ joined
18:20 ner0x652 joined
18:21 fizruk joined
18:21 caumeslasal joined
18:21 <tobiasBora> so or I need to compile it, or I rely on pchroot. But anyway, it's a bit offtopic, thank you for your help
18:21 ft joined
18:21 moongazer joined
18:21 wraithm joined
18:22 xaviergmail joined
18:22 ADG joined
18:23 <ADG> Hi
18:23 <shapr> hello ADG
18:24 <ADG> I just started learning haskell and this place was recommended.. I just came in to say hi
18:24 dawehner joined
18:24 robkennedy joined
18:24 sssilver_ joined
18:25 <shapr> ADG: this is often a nice place, do you have any questions about Haskell?
18:25 <ADG> Not yet i just started thanks btw
18:25 tomboy64 joined
18:25 fizbin joined
18:25 raynold joined
18:26 <shapr> ADG: are you using stack? Are you learning from haskellbook.com ?
18:26 <ADG> http://learnyouahaskell.com/syntax-in-functions
18:26 <ADG> Ghci on linux/ubuntu
18:27 ubsan_ joined
18:28 gawen joined
18:28 <shapr> ADG: are you writing something fun/interesting?
18:28 plugin joined
18:28 fizbin joined
18:30 BernhardPosselt joined
18:30 <BernhardPosselt> is a promise a monad?
18:30 mvr_ joined
18:32 <lyxia> it is
18:33 niez joined
18:33 <BernhardPosselt> i suppose the js implementation doesnt match the interface then
18:33 <niez> hi, are there any alternatives to reflex-dom or react-flux? what else can be used (is usable) with ghcjs?
18:33 wraithm joined
18:33 <lyxia> BernhardPosselt: how does it not match the interface?
18:34 <cocreature> BernhardPosselt: iirc it’s pretty close. "then" is >>= and you can do something like pure
18:34 <davean> niez: I'm not the person to ask, but you'll likely get better answers if you say how you'd like them to differ.
18:34 asmyers joined
18:34 <monochrom> What is promise?
18:34 <BernhardPosselt> https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
18:34 <BernhardPosselt> is the constructor the pure function?
18:35 <davean> BernhardPosselt: not *all* consutructors must be the pure function
18:35 <davean> BernhardPosselt: such a pure function must be able to exist
18:35 <BernhardPosselt> right i meant pure in the sense of return
18:36 <davean> yes
18:36 <cocreature> BernhardPosselt: pure creates a promise that resolves immediately
18:36 <BernhardPosselt> the thing to put stuff into monads :D
18:36 <davean> BernhardPosselt: what cocreature said is also what I was saying if that helps
18:36 <davean> I can write a pure for it
18:36 <BernhardPosselt> i see
18:36 coltfred joined
18:36 <davean> Not *all* ways of getting data into a monad are "pure/return"
18:36 <niez> davean, I just want a list of frontend libs used with ghcjs, so I can evaluate them, I know only about react-flux and reflex-dom, are there any others?
18:37 gpbaran joined
18:37 <davean> BernhardPosselt: monad is a minimum required level of structure, not a limit
18:39 <davean> BernhardPosselt: Did this help?
18:39 fizbin joined
18:39 <BernhardPosselt> yep
18:39 <BernhardPosselt> just couldnt think of the pure function :D
18:41 <monochrom> pure x = new Promise( (resolve, reject) => { resolve(x); } )
18:41 hongminhee joined
18:41 blakeembrey joined
18:41 <monochrom> See also my http://www.vex.net/~trebla/haskell/cont.xhtml
18:42 cyborg-one joined
18:42 sssilver joined
18:43 kosorith joined
18:43 zcourts joined
18:43 <monochrom> Also praise the person who introduced the (param)=>{body} syntax.
18:43 presiden-nkrj joined
18:44 uglyfigurine joined
18:44 muesli4 joined
18:45 gpbaran joined
18:47 marsam joined
18:48 mojjo joined
18:50 RegEchse joined
18:50 Zowlyfon joined
18:50 bjz joined
18:51 puregreen joined
18:52 zcourts_ joined
18:52 _sg joined
18:53 plugin joined
18:54 obijankenobi joined
18:56 JeanCarl1Machado joined
18:56 zcourts joined
18:57 ricardos joined
18:57 blakeembrey joined
18:58 zcourts__ joined
18:59 deepfire joined
19:01 Apocalisp joined
19:01 cpup joined
19:02 <Aruro> does haskell wiki support book making? like wikibooks?
19:02 <Tuplanolla> Probably not. It doesn't even support correct syntax highlighting.
19:03 windsing joined
19:03 marr joined
19:03 kolko joined
19:04 <Aruro> does it sound like good community project for zurihac?
19:04 zcourts joined
19:04 <Aruro> to migrate it to something uSeful
19:05 takle joined
19:06 wraithm joined
19:06 gpbaran joined
19:07 zcourts_ joined
19:08 Discovery joined
19:08 dawehner joined
19:10 psychicist__ joined
19:11 ph88 joined
19:12 tsmish joined
19:12 moongazer joined
19:14 wraithm joined
19:15 taksuyu joined
19:16 <ph88> can anyone help to figure out the type of this function (line 62) which i can put in my source file? https://bpaste.net/show/1e7cbe17bdf2
19:18 twanvl joined
19:19 <Tuplanolla> Start by stripping the package qualifications, ph88.
19:19 <ph88> Tuplanolla, i think i need to use HasEot
19:19 uncertainty joined
19:19 tctara joined
19:20 <ph88> also some of the things there are internal to the generics-eot package so i can not use them directly
19:20 locallycompact joined
19:21 nomotif joined
19:21 <Tuplanolla> I'd simplify the type until it matches a known type internal to the package.
19:21 marsam joined
19:21 oisdk joined
19:21 psychicist__ joined
19:23 presiden joined
19:23 alx741 joined
19:23 connrs joined
19:25 albertus1 joined
19:26 <ph88> Tuplanolla, don't know what to do with that comment
19:26 <Tuplanolla> Let's see.
19:26 <lyxia> your traversal isn't doing anything
19:26 <lyxia> and I don't understand why you would want to compose it with toEot
19:27 marcopullo joined
19:27 <lyxia> toEot does not output a function.
19:27 <ph88> ah ok, maybe the eot should go as second argument to eotTerminal
19:27 takle joined
19:28 <Tuplanolla> In general you'd wrangle it into the form `(Constructors g ~ (a -> f a), Rep a ~ M1 D c g) => (Applicative f, HasConstructorsG g, EotTerminal eot, GenericConstructors g, Generic a, Generic b, Datatype c) => a -> eot -> f eot` and try to figure out where the constraints come from.
19:28 <lyxia> terminalEot . toEot is nonsense
19:28 <Tuplanolla> It's not a substitute to understanding however.
19:29 peterbecich joined
19:30 canta joined
19:30 mexisme joined
19:32 <lyxia> ph88: HasEot defines an isomorphism between a and Eot a, which you can then compose with the traversal.
19:32 Eric-K joined
19:33 <ClaudiusMaximus> i have toDouble :: (Rounding r, Precision p) => Rounded r p -> Double and i want to have a RULES pragma to use toDouble instead of realToFrac whenever the types match - is this possible? can't figure out how to put toDouble's constraints into the RULES.. http://lpaste.net/6173391635410321408
19:34 wraithm joined
19:36 tag joined
19:37 Apocalisp joined
19:38 gpbaran joined
19:40 rdesfo[m] joined
19:41 e14 joined
19:42 indi_ joined
19:42 takle_ joined
19:42 AlphaAtom joined
19:44 <c_wraith> ClaudiusMaximus: iirc, RULES automatically are type-restricted. They are applied only when the type after is the same as before.
19:45 AlphaAtom joined
19:45 wraithm joined
19:47 <ClaudiusMaximus> c_wraith: right, but i get an error (see paste)
19:47 AlphaAtom joined
19:47 <ph88> lyxia, i wanted to use my eotTerminal function instead of the ints function here https://bpaste.net/show/3d8b69878563
19:48 <ph88> lyxia, now i think should apply toEot on value first
19:48 Wizek joined
19:49 zereraz joined
19:49 augur joined
19:50 AlphaAtom joined
19:51 <zereraz> hi, here `instance (MonadState m, StateType m ~ EventF) => ` what is the StateType m ~ EventF mean? I have not come across `~`
19:51 <lyxia> It means that EventF is the type of states in m
19:52 path[l] joined
19:52 AlphaAtom joined
19:53 plugin joined
19:53 <zereraz> is ~ an operator ?
19:53 <zereraz> what do you mean "in m"
19:54 <lyxia> Something like that, it is type equality
19:54 <zereraz> what is StateType ?
19:54 <lyxia> MonadState m means that it is a monad with operations to access a "state". StateType m is the type of that state.
19:55 <jle`> zereraz: ~ is type equality, you can use it anywhere
19:55 AlphaAtom joined
19:55 windsing joined
19:55 <jle`> @let addTwo :: (a ~ Int) => a -> a; addTwo x = x + 2
19:55 <lambdabot> Defined.
19:55 <zereraz> So for any MonadState we have to give a StateType?
19:56 <jle`> it depends on how it's implemented
19:56 <jle`> > addTwo 3 :: Int
19:56 <lambdabot> 5
19:56 <zereraz> jle`: got it, why use it? to help the compiler infer?
19:56 windsing joined
19:56 cdg joined
19:56 <jle`> in this case it looks like it's just used as a constraint
19:56 mda1 joined
19:56 <jle`> so you have instance (some constraints) => MyClass Blah
19:57 <jle`> it cmeans that Blah is an instance of MyClass, provided that those constraints are satisfied
19:57 <zereraz> ok
19:57 <zereraz> thanks
19:57 cdg joined
19:57 <jle`> for example, 'instance Show a => Show (Maybe a)'
19:57 <zereraz> and for MonadState we have to give the StateType ?
19:58 <jle`> means that 'Maybe a' has a Show instance, as long as a is an instance of Show
19:58 caumeslasal joined
19:58 <jle`> or alternatively, that having an instance of Show for 'a' implies an instance of Show for (Maybe a)
19:58 <jle`> zereraz: that depends on how MonadState is implemented
19:58 <zereraz> can we give primitive type constraint without '~' ?
19:58 conal joined
19:58 windsing_ joined
19:58 <jle`> usually, what a typeclass requires is a part of its definition
19:58 <jle`> without knowing more about the typeclass, i can't say what it requires
19:59 <jle`> like, if you gave me a typeclass 'MyClass' and asked if it required a function 'foo', i wouldn't be able to tell you
19:59 <zereraz> ok got it
19:59 <jle`> that depends on the methods and contents of the typeclass
19:59 <zereraz> I came across it here https://www.schoolofhaskell.com/user/agocorona/a-monad-for-reactive-programming-part-1
19:59 curious_corn joined
20:00 <AWizzArd> shapr: My update about pros/cons: I think that there is less need to debugging in Haskell, less need to trace. Things work regularily, when they compile.
20:01 <jle`> zereraz: that's interesting that they don't give any context
20:01 <jle`> but that MonadState probably comes from the mtl-tf library
20:01 <nshepperd> ClaudiusMaximus: it sounds like that can't be done http://stackoverflow.com/questions/19745038/ghc-rewrite-rule-specialising-a-function-for-a-type-class
20:01 <jle`> https://hackage.haskell.org/package/mtl-tf-0.1/docs/Control-Monad-State-Class.html
20:02 bydo joined
20:02 <zereraz> if I want to learn to make my own state monad should I read that source code?
20:02 <nshepperd> ClaudiusMaximus: you can specialise to concrete types, but not 'any type with those constraints'
20:03 canta joined
20:03 AlphaAtom joined
20:03 <jle`> zereraz: if you want to learn how to make an instance of that specific typeclass, then you would read the documentation
20:03 <jle`> but mtl-tf isn't the normal state monad people use
20:03 <zereraz> no just as a concept
20:03 <jle`> also, that package doesn't implement any state monads
20:03 ragepandemic joined
20:04 <jle`> it only provides a unified interface over many different types of state monads
20:04 <jle`> so no, it won't help you make a state monad
20:04 <jle`> it's like asking "if i want to learn how to implement Integers, should i read the source of the Show typeclass?"
20:04 <monochrom> Yes!
20:05 <mauke> which is approximately: class Show a where { show :: a -> String }
20:05 <mauke> except with more showsPrec
20:05 <monochrom> Or rather, the code for "instance Show Integer". It helps you reverse-engineer Integer.
20:05 <zereraz> ok thanks
20:06 marsam joined
20:06 <jle`> zereraz: regarding StateType in specific, it's a type family, which lets you associate a type with each 'm' input. the purpose is to let you work polymorphically with different monads 'm' that are all 'state monads' in a way
20:07 <jle`> so the StateType type family lets you say "ok so for a given monad m, the type of its state is StateType m"
20:07 <jle`> it's basically a lot of hoops to go around to let you work polymorphically over many different 'state monads'
20:07 FaSe29 joined
20:08 <ClaudiusMaximus> nshepperd: thanks, a comment there led me to syntax that compiles: {-# RULES "realToFrac/toDouble" forall (x :: (Rounding r, Precision p) => Rounded r p) . realToFrac x = toDouble x #-} still need to check that it is effective...
20:09 wraithm joined
20:09 fizruk joined
20:10 <* ski> would be surprised if that syntax worked
20:10 <zereraz> jle`: I didn't understand `let you work polymorphically over many different 'state monads'`
20:12 <ski> (presumably, the intended type of `x' there would be `Rounded r p', where `(Rounding r,Precision p)' .. which is not at all the same as saying that the type of `x' is `(Rounding r,Precision p) => Rounded r p')
20:35 irclogger_com joined
20:35 Topic for
20:35 wizonesolutions joined
20:35 raynold joined
20:35 haasn` joined
20:37 sssilver joined
20:37 Monoide joined
20:38 MrWoohoo joined
20:38 ramzifu joined
20:39 mbw joined
20:39 featherlessbiped joined
20:40 <nitrix> Curiously, which area could Haskell executables (or more accurately GHC compiled programs), see the most performance improvement?
20:40 ph88^ joined
20:40 Willis joined
20:40 5EXAANIJ9 joined
20:40 mero joined
20:41 CurryWurst joined
20:41 <ph88> could as in theoretically possible ?
20:41 <nitrix> As fancy as the garbage collector is, I've heard a lot of good things about Go's GC.
20:41 <EvanR> SIMD support?
20:41 Willis joined
20:41 <nshepperd> ClaudiusMaximus: yeah, I saw that too, but I couldn't get it to actually fire...
20:41 <nitrix> ph88: As in what you'd like to see happen.
20:42 <ph88> no gc ofcourse
20:42 flxw joined
20:42 pinupgeek joined
20:43 moth joined
20:44 albertus1 joined
20:44 lyxia joined
20:45 <yushyin> nitrix: did you also heard the bad parts about Go’s GC?
20:45 <ClaudiusMaximus> nshepperd: it fires here in a simple test, as reported by -ddump-rule-firings
20:45 <mbw> In the wreq tutorial http://www.serpentine.com/wreq/tutorial.html under "Uploading data via POST", they give an example using (:=), which is the only constructor for the "FormParam" data type https://hackage.haskell.org/package/wreq- . While the example works in ghci, in a source file I have to add type signatures, otherwise it gives me an error about ambiguous types
20:45 <mbw> preventing the constraint FormValue from being resolved. Is there a way around having to write this: r <- post (sampleURL ++ "post") [("num" :: B.ByteString) := (3 :: Integer), ("str" :: B.ByteString) := ("wat" :: B.ByteString)] ?
20:45 <nitrix> yushyin: I'd love to.
20:46 <nitrix> Can Haskell even work without a GC?
20:46 <ph88> no
20:46 <nitrix> Everything would turn into reference counting?
20:46 vqrs joined
20:47 <yushyin> nitrix: maybe this for starters https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e#.vdkcqhuw8
20:47 <EvanR> haskell can easily work without a gc
20:47 <EvanR> if you have infinite memory
20:47 <ph88> easily
20:47 <lyxia> mbw: you only need to specify the second one
20:47 <EvanR> or if the program has a very short runtime
20:48 Rachel joined
20:48 boxofdeath joined
20:48 NocnaShada joined
20:48 <lyxia> mbw: and I can't think of a way not to specify it
20:49 ludat joined
20:49 FaSe29 joined
20:49 <Guest33694> What do you guys think about commercial stalking?
20:50 <glguy> Guest33694: Did you have a question about Haskell programming?
20:50 merijn joined
20:51 <nitrix> EvanR: What makes it need a GC so much? The thunks?
20:51 <nitrix> EvanR: And lambda capturing environments?
20:52 <mbw> lyxia: I have tried all the combinations though, and it will only shut up after having specified _all_ the types...
20:52 indi_ joined
20:52 <lyxia> mbw: What error do you get on "num" := (3 :: Integer)
20:52 indi_ joined
20:53 marcopullo joined
20:53 Qfwfq joined
20:53 meoblast001 joined
20:54 wahrsagevogel joined
20:54 SCHAAP137 joined
20:54 connrs joined
20:54 <mbw> lyxia: None iff it is the only list element
20:55 ericsagnes joined
20:55 <lyxia> uh... what if you put another one?
20:57 <mbw> Then I have to specify the other rhs's of (:=) as well. Otherwise: Ambiguous type variable ‘v0’ arising from a use of ‘:=’ prevents the constraint ‘(FormValue v0)’ from being solved [...] .
20:58 path[l] joined
20:58 <mbw> This is kinda surprising with Integer, since I don't have NoMonomorphismRestriction enabled...
20:59 <lyxia> You must annotate the second argument, because there's no other way to tell its type for overloaded literals
20:59 <lyxia> this has nothing to do with the monomorphism restriction
20:59 <mbw> I thought it'd just default to Integer.
20:59 <lyxia> but you don't need to annotate the first one at least
20:59 <lyxia> ["num" := (3 :: Integer), "str" := ("wat :: B.ByteString)]
20:59 e14_ joined
21:00 <monochrom> Both defaulting and the monomorphism restriction come with fragile preconditions too.
21:00 CurryWurst joined
21:00 <monochrom> i.e., there are ways you can introduce class contraints to kill even defaulting.
21:02 luis joined
21:02 gpbaran joined
21:02 sandstorm joined
21:02 <mbw> I guess I will just have to live with it :/
21:03 <lyxia> you could define synonyms of (:=) with specialized types
21:03 sdothum joined
21:03 ramzifu joined
21:04 kyclark joined
21:04 <lyxia> it's just going to be another way of specifying the type you want
21:04 qz joined
21:04 fendor joined
21:04 Rodya_ joined
21:04 <mbw> That's not a bad idea at all.
21:05 muesli4_ joined
21:05 <merijn> I just opened some code I haven't touched in a year...I'm completely lost wrt what the hell I was doing >.>
21:06 hanDerPeder joined
21:06 <Rembane> Does it work?
21:06 louispan joined
21:06 epsilonhalbe joined
21:06 <mbw> Sounds pointless.
21:06 <merijn> Rembane: Well no, it was broken then and I don't remember which parts I ripped up trying to fix it xD
21:07 dat_toy joined
21:07 <Rembane> merijn: Ah one of those codebases, between states. They are fascinating. :)
21:08 <dat_toy> can someone tell me what the order of `id` is?
21:08 wraithm joined
21:08 <dat_toy> can't find it anywhere.. I guess it's about \infty
21:09 <lyxia> what's an order
21:09 <merijn> Relatedly, I could use some tips, I have an AST type which stores annotations (specifically: source location, variable names) but for some operations (e.g. equality) it'd be better to not have those, but I'm unsure how to cleanly accomodate that
21:09 cdg joined
21:10 <dat_toy> well, a constant has order 0, a function taking Int's or such as arguments has order 1, a function taking a function as argument has order 2 (eg. map) etc.
21:10 <ski> the order of an element in a group is the least number of times you have to multiply it with itself, in order to get the neutral element
21:10 conal joined
21:10 cdg joined
21:11 <dat_toy> as in higher order function, or first-order logic
21:11 <ski> in this case, `id :: a -> a' is itself the neutral element of the group of bijections over `a', so the order would be one, then ..
21:11 <lyxia> well looks like it's not about group theory.
21:11 <dat_toy> no it's not about group theory
21:11 mathk joined
21:12 <ski> oh. then the order is `n', for any positive integer `n'
21:12 <dat_toy> okay ^^
21:12 <dat_toy> so you mean it depends on the context
21:12 <ski> the order of `id :: Bool -> Bool' is one. the order of `id :: (Integer -> Bool) -> (Integer -> Bool)' is two, &c.
21:13 cfricke joined
21:13 <mathk> Hi all, would it make sense to implement actor model in haskell?
21:13 <dat_toy> that would be an answer that makes sense, I guess
21:13 <lyxia> "order" has lots of different meanings indeed.
21:14 <seequ_> Well, I guess you could argue it's first order function as it just returns the value untouched without caring what it is. It could be a function, but doesn't need to be.
21:15 <dat_toy> yeah, I know. sry for being unclear
21:16 sphinxo joined
21:16 ompaul joined
21:16 <ski> yeah, one could argue that `id :: forall a. a -> a' has order one
21:16 <ski> `id :: a -> a', otoh ..
21:18 <dat_toy> but if I `let a = id`, clearly it takes a first order function as argument and it is thus 2nd order, no?
21:18 <dat_toy> otoh?
21:19 <merijn> dat_toy: that doesn't have any arguments
21:19 ramzifu joined
21:20 <dat_toy> true, also I think one cannot apply functions to itself :S
21:20 <dat_toy> so if we `let a = (\ x -> x+1)` then
21:20 jeltsch joined
21:20 <merijn> :t id id
21:20 <lambdabot> a -> a
21:20 <merijn> Sure you can
21:21 <monochrom> That gets us into "what is itself?"
21:21 <seequ_> :t fix id
21:21 <lambdabot> a
21:25 wraithm joined
21:25 ipuustin joined
21:25 circ-user-6d0Sj joined
21:26 mxf joined
21:27 cyberlard joined
21:27 mda1 joined
21:27 gregoire joined
21:29 windsing joined
21:29 RegEchse joined
21:29 marcopullo joined
21:30 Intensity joined
21:30 <ertes> mathk: it's pretty much in the base library
21:31 <ertes> mathk: threads can send each other messages via MVar or TChan
21:32 <mathk> in which module ?
21:32 blakeembrey joined
21:33 BlueRavenGT joined
21:35 Fairy joined
21:37 <ertes> mathk: Control.Concurrent gives you threads ("actors") and MVars (communication channels)
21:37 eacameron joined
21:37 <ertes> mathk: in fact most of the time i suggest using the async library instead
21:38 <ertes> it gives you easier control over thread termination
21:39 <ertes> MVar is like a channel bounded to one message, so if the reader can't keep up, writers will block… if you want non-blocking message sends in exchange for overall performance, you can use STM: Control.Concurrent.STM.TChan
21:41 <ertes> actually Chan is good enough
21:41 plugin joined
21:41 <ertes> Control.Concurrent.Chan
21:42 <mathk> were is the async lib? in base library ?
21:42 <ertes> https://hackage.haskell.org/package/async
21:43 <mathk> But actor can be distributed can you have that with MVar / TChan ?
21:44 michbad joined
21:45 <ertes> nope, it's all single-process… there are efforts to make this distributed like the distributed-process library (a.k.a. "cloud haskell")
21:45 takuan joined
21:45 fizbin joined
21:45 ompaul joined
21:45 <ertes> or manually: of course a thread can serialise messages and send them through a socket to some other process
21:46 <ertes> but it's not built into the concurrency framework
21:46 <ertes> https://haskell-distributed.github.io/
21:47 <mathk> yes and you would need to have away to queue message.
21:49 gpbaran joined
21:49 <ertes> you will have that in both cases… for example in the manual case you have an MVar that communicates with the "local correspondent" thread that sends your message through a socket to another process, which on its end has a correspondent thread that unserialises the message and puts it into an MVar
21:49 <ertes> cloud haskell streamlines this… remote listeners appear much like local MVars
21:50 Edith joined
21:50 <ertes> and it also provides an RPC-like framework, so you can actually call functions in remote processes directly
21:51 doomlord joined
21:51 <kyclark> Given a string like “0123” I’d like to create a list of integers [0,1,2,3] — how? I would have thought “map read "0123" :: [Int]” or “map (\x -> read x :: Int) "0123”” would have worked, but they don’t (“Couldn't match type ‘Char’ with ‘[Char]’”). “map show "0123”” does what I would expect. Why doesn’t “read"?
21:51 <mathk> interesting. Does it have also some back pressure implementation ?
21:52 <merijn> :t map read
21:52 <lambdabot> Read b => [String] -> [b]
21:52 <merijn> kyclark: ^^
21:52 <ertes> kyclark: you can first map each character to a string, and *then* use read
21:52 <merijn> kyclark: "map read" expects [String], but you're giving it String
21:52 <ertes> mathk: could you summarise what that is?
21:52 <merijn> And since String == [Char]
21:52 <merijn> You're trying to apply 'read' to a Char
21:52 <merijn> :t read
21:52 <lambdabot> Read a => String -> a
21:52 hiratara joined
21:52 <merijn> Which is a type error
21:53 <ertes> merijn: hi! i wanted to ask you, if you have any experience with vulkan compute and how it compares to CUDA in terms of performance
21:53 <merijn> ertes: back pressure == slow down senders if rate of sending exceeds rate of handling
21:53 <merijn> ertes: Usually implemented via, e.g. a fixed size buffer and blocking sends
21:53 <merijn> I haven't used vulkan, no
21:54 <ertes> mathk: ah, i don't know… you can certainly implement back pressure yourself on top of TBQueue
21:54 uglyfigurine joined
21:54 <ertes> which is a bounded queue
21:54 <Tuplanolla> Back pressure is a silly term, because it's often on the opposite side in fluid mechanics.
21:54 <merijn> ertes: As for vulkan, I don't think it's comparable to CUDA?
21:54 <mathk> merijn: blocking sends imply that you have a way to signal to the sender from the receiver.
21:54 <merijn> ertes: AFAIK Vulkan is mostly aimed at doing graphics
21:55 <ertes> merijn: it seems to have a full compute API… you can choose not to use any of the graphics chains
21:55 atomi joined
21:55 <ertes> so it's not graphics-only
21:56 Micamo joined
21:56 <ertes> this might be a way to have fast compute across many GPUs, i.e. what OpenCL wanted and failed to be
21:56 Lord_of_Life joined
21:57 <merijn> ertes: Honestly, I haven't really looked into it, since the non-NVidia GPUs aren't really worth getting anyway :)
21:58 <merijn> ertes: Most sources seem to say "The point of Vulkan's compute pipeline is to provide compute facilities for rendering operations. Despite the ridiculous tagline, Vulkan is not trying to compete with OpenCL. "
21:58 takle joined
21:59 <merijn> OpenCL 2.x would be ok, but I'm *still* not aware of anyone actually implementing anything other than OpenCL 1.2
21:59 <ertes> merijn: well, the point of this is to have fast compute everywhere, not necessarily for special applications
21:59 <ertes> for example applications could use compute on the laptop to save power, not necessarily to be done faster
21:59 JeanCarloMachado joined
22:00 ompaul joined
22:00 Reshi joined
22:01 louispan joined
22:01 <merijn> ertes: Anyway, consensus seems to be still OpenCL for compute if you want portability
22:01 <Tuplanolla> I have no doubt both 3d graphics and hpc will remain extremely messy.
22:01 doodlehaus joined
22:01 <ertes> merijn: even CL 1.2 over vulkan?
22:01 Koterpillar joined
22:02 <Tuplanolla> This keeps happening: https://softwareengineering.stackexchange.com/a/88055
22:03 <merijn> oh, there seems to be some CL2.0 support now
22:04 <merijn> Tuplanolla: Well, it's more an issue of: OpenCL 2.0 is catching up with features CUDA had like 5 years ago, and since OpenCL is ugly as sin and painful to use and the performance of non-NVidia cards is trash anyway no one cares about OpenCL
22:04 b4ff3r joined
22:05 louispan joined
22:05 aeroxam_ joined
22:05 RayNbow` joined
22:06 <ertes> CL is a mess though
22:07 <merijn> There's basically 3 vendors "supporting" OpenCL in the PC/server market: Intel (they don't care, only support it to be compatible, use OpenMP/Intel TBB if you want performance/programmability), NVidia (they don't care, only support it for compatability, if you want performance/programmability, use CUDA) and AMD (they care, since it's the only thing they have). But since the other 2 have no real incentive
22:07 <merijn> to improve OpenCL we have the ugly mess that it is now
22:07 Micamo joined
22:07 <ertes> what a lot of people don't know is that vulkan is not GPU-only either… if a device provides only compute, it can only offer the compute chain
22:07 codesoup joined
22:07 <ertes> so in principle it could work for FPGAs as well
22:07 marsam joined
22:07 <merijn> I'll believe that when I see it
22:07 <merijn> If you wanted to do FPGA stuff, get Clash ;)
22:08 <ertes> FPGAs are too expensive… and i don't really have a use case for them =)
22:08 <merijn> ertes: But with Clash you can program them in Haskell!
22:08 <davean> ertes: uh, does an FPGA really support vulcan's compute model?
22:09 Zao_ joined
22:09 eschnett joined
22:09 <merijn> davean: That's another good question
22:09 <merijn> I don't see compute that maps well to GPU mapping well to FPGA
22:09 oleks joined
22:10 AndreasK joined
22:10 <ertes> i'm not sure… all i know is that it's not GPU-exclusive
22:10 <thoughtpolice> You can get an FPGA with a fully open source toolchain for $50 with like, 30 GPIO pins and ~8k LUTs. More than enough for some surprisingly useful designs, without having to use horrid EDA tools or break the bank.
22:10 <thoughtpolice> Hell, $20 if you're willing to go to PMOD and can get away with 1k LUTs. That's enough for an entire low-speed logic analyzer.
22:10 <davean> thoughtpolice: yes, but do they run Haskell?
22:10 <merijn> davean: They don't need to run Haskell, you just compile haskell to VHDL :)
22:10 Eagle_Erwin joined
22:10 <thoughtpolice> Yes. Clash works fine on them. I only write my circuits in Clash, in fact. (And I'd argue Clash is indeed Haskell)
22:11 <davean> merijn: Yes, but my current Haskell is GHC
22:11 <davean> merijn: can I use and FPGA to compile Haskell faster?
22:11 <merijn> thoughtpolice: If you have any feedback for them, I'm pretty confident I'm seeing the Clash guys tomorrow :p
22:12 <merijn> davean: Honestly, I don't think FPGA are any help for compilation type work
22:12 mckeankylej joined
22:12 yianni joined
22:12 <davean> merijn: I don't either!
22:12 <thoughtpolice> I've talked to Christiaan quite a bit already (in #clash-lang actually, there's a whole 1 dozen of us in there!)
22:12 a3Dman joined
22:12 tomphp joined
22:12 <davean> merijn: actually, I *would* be interested in SHA1-on-FPGA probably
22:13 <davean> merijn: but why be practical?
22:13 <mckeankylej> What is the failure constraint in constraint kinds? I want to have: `type family Elem (x :: a) (xs :: [a]) :: Constraint` but I dont know what to put when the value is not found in the list
22:13 <merijn> mckeankylej: There isn't one, sadly
22:13 <merijn> mckeankylej: But!
22:13 <mckeankylej> lol Int ~ Bool
22:14 wraithm joined
22:14 <mckeankylej> failure constraint xD
22:14 <merijn> mckeankylej: https://gist.github.com/merijn/6130082
22:14 <merijn> That, yes, but using Symbol it can be slightly more helpful
22:14 <mckeankylej> merijn: I love that idea
22:14 <mckeankylej> thanks!
22:14 deni joined
22:14 theorb joined
22:14 <ertes> davean: FPGAs aren't *faster*, they are just *more parallel* with the unique feature: the smaller your algorithm, the more parallelism you get
22:15 <ertes> so there is an incentive to run *small* algorithms on FPGAs
22:15 <davean> ertes: yes, but I want to do an embarasing number of them
22:15 <davean> SHA1 looks small to me :-p
22:15 <merijn> ertes: Not necessarily more parallel
22:15 <merijn> ertes: FPGA work well with pipelined computation
22:15 fizbin joined
22:15 <merijn> Especially with little state flowing between sections
22:16 <davean> I want to run billions of related SHA1 computations
22:16 <merijn> ertes: Duplicating the same pipeline a lot for parallelism is, arguably, one of the least efficient ways to use FPGAs
22:16 <merijn> ertes: It's far more efficient to have a single huge computation on there, if you can pipeline it nicely
22:17 <ertes> davean: bitcoin mining isn't really that profitable anymore ;)
22:17 <merijn> Because we already have GPU being awesome at duplicated computation
22:17 mysiticity joined
22:17 louispan joined
22:18 <davean> ertes: bitcoin?
22:18 ragepandemic joined
22:19 bitonic joined
22:19 hsk3 joined
22:19 FaSe29 left
22:19 <ertes> well, you seemed interested in SHA-1, and i'm not aware of any altcoins that use it =)
22:19 <davean> I have no idea why you're on coins
22:19 <hsk3> Is it possible to put "data Foo = ..." into a function scope?
22:19 <hsk3> for use only in the func
22:20 <ertes> davean: i'm kidding
22:20 <davean> ertes: I'm just confused
22:20 snowalpaca joined
22:20 <ertes> hsk3: nope
22:20 <ertes> hsk3: only module-local types are possible
22:20 <hsk3> ok thanks
22:20 dopey_ joined
22:22 kyclark joined
22:22 tmtwd joined
22:24 lieven joined
22:24 newbie21 joined
22:25 <newbie21> Hi, so I am trying to do some neural network example in Haskell.
22:27 <lolisa> So I need to generate some weight. For type safety reason they are stored in an existential type (but is actually tuple of tuple of ... of Double).
22:28 <lolisa> Now I need to generate some random value as initial weight. However I do not want to include dependency Test.QuickCheck merely for Test.QuickCheck.Gen. Is there a smaller equivalent?
22:28 <ertes> lolisa: mwc-random
22:28 <ertes> it's a super-fast generator, and if you use the 'vector' API instead of tuples, it will also generate a whole vector of randoms for you
22:29 e14 joined
22:30 <Tuplanolla> The speed must be Haskell-specific, because when I tested its C implementation against GSL's MT, they were equally fast.
22:31 <ph88> i have here an infered type signature from ghci that is using a package internal types which i can not use directly, how can i find out what types to put in my own source code? https://bpaste.net/show/03cf716ce4f0
22:31 <ph88> Tuplanolla, i didn't understand your suggested method last time
22:31 b4ff3r joined
22:31 hiratara joined
22:32 louispan joined
22:32 <Tuplanolla> Then you're better off not using it, no?
22:32 <ertes> Tuplanolla: i don't know how it compares to GSL's MT, but it's faster than the mersenne-random library
22:32 <ph88> Tuplanolla, are you talking to me ?
22:32 <lolisa> eretes, I am planning to do vector, but I do not wanna drop type safety, so it'd be a bit hard.
22:32 <Tuplanolla> Yes, ph88.
22:32 <lolisa> But thx, (Variate a, Variate b) => Variate (a, b) is exactly what I need
22:33 <ertes> lolisa: type safety in which sense?
22:33 <ph88> Tuplanolla, i'm trying to get this code to work and i don't have a good alternative
22:33 path[l] joined
22:34 wraithm joined
22:34 <lolisa> ertes, access to weight are safe (there will always be enough weights). It can be done by dependent type vector, but now I'm building a prototype.
22:35 <ertes> lolisa: i'd just consider vectors to be sparse… just assume that they denote infinite-dimensional vectors
22:35 <Tuplanolla> The gist of my suggestion was to convert the type into some sort of normal form (common ordering and naming conventions) and then try to pattern match it to existing constraints and type synonyms, ph88.
22:36 <lolisa> ertes, that's a good idea, thx :)
22:36 tag joined
22:36 <ertes> lolisa: then dot products are simply: V.foldl' (+) b (V.zipWith (*) xs ys) -- where b is bias
22:37 <ph88> Tuplanolla, what do you mean "common ordering and naming conventions" ?
22:37 <ertes> lolisa: you will need to write a custom function for vector sums, but i have a ready-made one… if you want, i can paste it
22:37 t7 joined
22:38 <lolisa> Nah, I can do that. But how do I take second derivative though
22:38 <Tuplanolla> If you had, say, `(Coercible (p (First a) c) (p (Maybe a) c), Bifunctor p, MonadReader r m) => ((Maybe a1 -> (First a1, Maybe a2)) -> r -> p (First a) c) -> m (p (Maybe a) c)`, which I recently encountered...
22:38 <Tuplanolla> ...you could rename `a1` to `a`, move `MonadReader` before `Bifunctor` and so on and recognize that it's actually an expanded and overgeneralized form of `LensLike ((,) (First a)) r t (Maybe a) (Maybe b) -> m (Maybe a, t)`.
22:39 <ertes> lolisa: in fact i have a whole class for that in my machine learning framework (which is currently not public)
22:39 <Tuplanolla> It's difficult and tedious, but might eventually get you the type you really want.
22:39 <ertes> lolisa: https://gist.github.com/esoeylemez/9fd04bed62f5876f5c08b6075f997ac6
22:39 <ph88> how can you rename a1 to a when a is already used ?
22:40 fendoer joined
22:40 <ertes> lolisa: it's an implementation of this sparse vector idea for a lot of types, including IntMap, HashMap, etc.
22:40 ebzzry joined
22:40 <Tuplanolla> It was unnecessarily general in the first place, ph88.
22:40 takle joined
22:40 bjz joined
22:40 <ertes> lolisa: (currently it doesn't use the new .Merge API of containers, but i will fix that soon)
22:40 LeCamarade joined
22:40 <Tuplanolla> I had to make some assumptions.
22:43 <hsk3> Is it valid to do seq (z1, z2) ...
22:43 <hsk3> to make sure both z1 and z2 are computed
22:43 <ertes> hsk3: it's valid, but doesn't achieve what you want
22:44 <ertes> it only makes sure the *tuple* is evaluated
22:44 <hsk3> ah
22:44 <ertes> hsk3: z1 `seq` z2 `seq` …
22:44 <hsk3> ah i see, thank you
22:45 <lolisa> ertes, I see, but can one do jacobian matrix with infinite stream of Double?
22:46 ludat joined
22:46 <ertes> lolisa: depends on the function
22:47 Voldenet joined
22:47 Voldenet joined
22:47 diegoksp joined
22:47 <ertes> lolisa: in general no
22:48 <lolisa> I dont quite get it. can you give an example?
22:49 fizbin joined
22:52 carlosdagos joined
22:54 <ertes> lolisa: let f xs = map (^2) xs… then jac f i j = ∂ (xs !! i)^2 / ∂ (xs !! j) | i == j = 2*(xs !! i) | otherwise = 0
22:54 <ertes> lolisa: you can certainly not compute an actual in-memory matrix, but you can represent this matrix as a function and that should work for most functions
22:55 <lolisa> Yes, what about the 'in general no' part?
22:55 JeanCarloMachado joined
22:58 carlosdagos joined
23:00 raynold joined
23:00 flxw joined
23:00 Qfwfq joined
23:00 wahrsagevogel joined
23:00 Lord_of_Life joined
23:00 Zao_ joined
23:00 mckeankylej joined
23:00 bitonic joined
23:01 jaspervdj joined
23:03 gugah joined
23:04 <tobiasBora> Hello,
23:06 kamyar joined
23:06 <tobiasBora> I don't like the [0..n-1] syntax because it does not follow the basic idea of "you count from 0", I really prefer the python syntax range(n) to denote [0..n-1]. Is there any haskell equivalent, or reason not to use it?
23:06 <kamyar> hello everyone!
23:07 <kamyar> I wanna start an open source project for Haskell language server.
23:07 <isd> tobiasBora: not sure if there's a handy function in the standard library, but you could always define it: range n = [0..n-1]
23:07 <hpc> tobiasBora: it's veeeeeeeeeeery rare that a loop of that style is the most natural way to write an algorithm in haskell
23:07 calvertvl joined
23:07 aarvar joined
23:07 <kamyar> Any volunteers to help me?
23:08 <isd> That said, I'd discourage pulling notation from other languages because the agreed-upon style is not to your taste. In general, best to just live with the style.
23:08 <hpc> i did it a fair bit while learning haskell, but eventually it just gets pushed out of your brain by other methods
23:08 <isd> kamyar: not sure what you mean?
23:09 <hpc> tobiasBora: my advice would be that it's annoying for a good reason (that reason being it's not useful enough to make not annoying)
23:09 <kamyar> isd: just search for lang server
23:09 fizbin joined
23:09 <hpc> tobiasBora: and if you're anything like me, it'll annoy you enough that you look for alternatives
23:09 <hpc> tobiasBora: and find they are much better :D
23:10 umib0zu joined
23:10 <isd> Ah, I see
23:10 <isd> neat.
23:10 <kamyar> We lack language server up to now
23:10 <isd> kamyar: I have far too many projects in my queue, but I wish you luck.
23:10 Fairy joined
23:10 ubsan_ joined
23:11 <kamyar> isd: Ok so you can keep in touch to help me since I am not so pro in haskell
23:11 <ertes> lolisa: actually i might be wrong, but if the function is some kind of convolution…
23:12 <Koterpillar> kamyar: isn't intero one?
23:12 <isd> kamyar: I consider myself an advanced beginner/early intermediate, but I'll hang out here, and I'm sure many others will be happy to field questions as you hit them.
23:12 JeanCarloMachado joined
23:12 <ertes> lolisa: so far i only needed gradients, and that's definitely possible
23:12 mceier joined
23:12 Enzyme joined
23:12 <ertes> tobiasBora: take n [0..]
23:13 <tobiasBora> hpc: So what is your want to compute the 100 first squares, included 0, if you don't do a map/list comprehension on [1..n] ?
23:13 <tobiasBora> ertes: take n [0..] is efficient?
23:13 <ertes> tobiasBora: i suppose your main issue is with the "n - 1", because it's based on end-point rather than count
23:13 <ertes> yes
23:13 <kamyar> Koterpillar: nope it is not lang server
23:14 <Koterpillar> kamyar: it's close
23:14 <ertes> tobiasBora: remember that it's most likely evaluated lazily
23:14 <tobiasBora> ertes: And there are no strange compilation optimisation on [0..n] that do not apply on [0..] ?
23:15 <maerwald> Koterpillar: no
23:15 <kamyar> Koterpillar: the lang server protocol is a language agnostic standard protocol not an IDE
23:15 <maerwald> there is a protocol for language servers
23:15 <maerwald> exactly
23:15 <ertes> tobiasBora: it's counterintuitive: (take n [0..]) is more likely to behave properly than [0..n - 1]
23:15 <ertes> tobiasBora: especially if you delay the 'take' until you really need it: take n (map f [0..])
23:16 <tobiasBora> ertes: well yes it makes sens
23:16 epsilonhalbe left
23:16 <kamyar> I am trying to collect a small team of haskell developers to create one implementation for haskell
23:16 <tobiasBora> ertes: Thank you!
23:16 <maerwald> kamyar: how much do you pay?
23:16 <maerwald> :P
23:16 <Koterpillar> maerwald: kamyar: I thought I'm using intero in Emacs as a language server
23:17 <ertes> kamyar: what's a "language server"?
23:17 <maerwald> ertes: https://github.com/Microsoft/language-server-protocol
23:17 <kamyar> maerwald: Zero! It is a voluntary open source project
23:17 <ertes> ah
23:17 <peddie> Koterpillar: I think they mean Language Server™, a special protocol, rather than a "language server", the generic concept
23:17 <ertes> kamyar: anything wrong with GHCi?
23:17 <Koterpillar> so I said, "it's close"
23:17 <Koterpillar> ertes: doesn't do "Jump to definition"
23:18 <ertes> it's used by a bunch of tools, including ghc-mod, haskell-mode (emacs), intero (emacs), leksah (a haskell IDE), etc.
23:18 <maerwald> yes and editors like vim support that language server protocol
23:18 <ertes> Koterpillar: haskell-mode does
23:18 <Koterpillar> while intero does: https://github.com/commercialhaskell/intero/blob/28609611c9f7c7d63370ce66e8ebb97676a8374e/src/test/Main.hs#L143
23:18 <Koterpillar> right
23:18 <ertes> Koterpillar: via GHCi
23:18 <Koterpillar> implementation detail :)
23:19 <maerwald> the editor doesn't have to know anything about the specific language server implementation, so you can use any language server implementation that follows the protocol with a generic editor plugin for the language server protocol
23:19 <maerwald> intero is not that
23:19 <ertes> kamyar: in other words: all you need is an editor that supports interactive haskell ;)
23:19 <ertes> well, i don't think i see value in such a generic framework
23:19 <maerwald> that just... your opinion man!
23:19 <Koterpillar> editor writers do
23:19 <ertes> how is it supposed to map language-specific things like GHC's holes?
23:20 <Koterpillar> the protocol can be extensible
23:20 <ertes> right
23:20 <ertes> well, go ahead =)
23:20 <kamyar> ertes: not really just read the protocol spec
23:21 <* maerwald> makes a not about ertes not liking protocols (haha)
23:21 <maerwald> *note
23:21 Rizy joined
23:21 <ertes> i wouldn't mind such a protocol, it's just that i don't see enough value to contribute to it =)
23:21 <maerwald> the protocol is already done
23:22 <ertes> s/protocol/server/
23:22 detrumi joined
23:22 <maerwald> well, less emacs-focused tools
23:22 <maerwald> or <whatever-editor>-focused tools
23:22 <maerwald> so the value is huge
23:23 takle joined
23:23 <kamyar> ertes: the problem is that we still lack excellent IDEs like jerbrain ones
23:23 <ertes> yes, it is… it just doesn't benefit *me*, because i'm not coding haskell in visual studio any time soon =)
23:23 alunduil joined
23:23 <maerwald> ertes: vim has language server protocol support too.
23:23 <tobiasBora> And is there better way to define reverse [10..1] ?
23:23 <maerwald> so no idea how you come up with visual studio
23:23 <ertes> tobiasBora: [1..10]
23:23 gawen joined
23:24 <tobiasBora> ertes: sorry I mean "reverse [1..10]" ^^
23:24 <ertes> tobiasBora: [10,9..1]
23:24 <kamyar> in fact they are trying to eliminate programming language discriminations
23:25 <tobiasBora> ertes: Hum cleaver ^^ And both are equivalent in speed?
23:25 <maerwald> kamyar: xD
23:25 <Tuplanolla> > [10 .. 1] == [10, 11 .. 1] -- This is why it's that way, tobiasBora.
23:25 <lambdabot> True
23:25 <maerwald> that gives a new meaning to "pure" languages, haha
23:26 <kamyar> All programming languages must be able to use robust tools
23:26 <tobiasBora> > [10 .. 1] == [10,9 .. 1]
23:26 <lambdabot> False
23:27 <kamyar> For example google has convinced (paid?) jetbrains for making an IDE for go language
23:27 <kamyar> but Rust language lacks it!
23:27 <maerwald> wat?
23:27 <maerwald> https://github.com/rust-lang-nursery/rls
23:28 JeanCarloMachado joined
23:28 <aeroxam_> what's your favorite IDE for haskell
23:28 <aeroxam_> ?
23:28 <Rembane> nvim!
23:28 <Koterpillar> spacemacs
23:28 <maerwald> still no IDEs there
23:28 <aeroxam_> I use geany for everything, and I wonder if I should change my habits..
23:28 <ertes> aeroxam_: mine is emacs (yes, with haskell-mode i consider it a haskell IDE)
23:29 <kamyar> maerwald: I mean there is no Jetbrains special IDE for rust or haskell
23:29 <Rembane> maerwald: I need more Visual Haskell.
23:29 <ertes> vim users probably have a similar experience with ghc-mod (although many of them choose not to integrate the interpreter, and most of those people use tmux)
23:29 <Rembane> maerwald: But until then, I use vim.
23:30 <kamyar> While there is one for golang and this is a bad discrimination
23:30 <maerwald> terminal vim is horrible, even more so in tmux
23:30 <ertes> kamyar: that's not discrimination, it's just lack of tools
23:30 <maerwald> you have 4+ layers of hotkeys
23:30 <maerwald> so when you press something, it might do random stuff
23:31 ChaiTRex joined
23:31 mu_ joined
23:31 <kamyar> ertes: this lack if tools has taken place for lack of sth like langserver
23:32 kamyar_ joined
23:32 replay joined
23:32 uglyfigurine joined
23:32 <kamyar_> ok friends I have to go now
23:32 <ertes> kamyar_: in any case, if you really want this, you should probably just start coding
23:33 windsing joined
23:33 kamyar_ joined
23:33 <maerwald> asking people first sounds like a better idea
23:33 <kamyar_> thanks anyway
23:33 <kamyar_> bye for now
23:33 <maerwald> e.g. someone might be already working on something, but just hasn't published something
23:34 <ertes> well, they did ask =)
23:34 <ertes> so that part is done ;)
23:34 <maerwald> on IRC only
23:38 eacameron joined
23:38 umib0zu joined
23:38 path[l] joined
23:39 uglyfigurine joined
23:39 takle joined
23:40 fizbin joined
23:41 refold joined
23:42 tag joined
23:43 NeverDie joined
23:44 _sras_ joined
23:44 zcourts joined
23:44 nikivi joined
23:44 Welkin joined
23:46 tsmish joined
23:46 doodlehaus joined
23:46 <tobiasBora> Is there a more efficient way to write a list of string into a file that "writeFile filepath $ lines ["Ma", "Fonction"]"
23:47 JeanCarloMachado joined
23:47 lambda-11235 joined
23:48 desktop joined
23:49 sophiag joined
23:49 {emptyset} joined
23:50 <Welkin> more efficient?
23:50 nomicflux joined
23:50 <Welkin> writing a list of bytestring :P
23:50 <Koterpillar> tobiasBora: conduit?
23:50 fizbin joined
23:51 <Welkin> that is kind of weird though
23:51 <Welkin> why would you have a list of strings?
23:51 <jle`> tobiasBora: do you mean like, write in the source code
23:51 <jle`> or write to a file?
23:51 <tobiasBora> Welkin: Well, is the writing done is a lazy way, is it written by bunch of text or char by char...
23:51 <jle`> oh sorry, there was some glare on my screen that covered part of the setnence v.v
23:51 <Welkin> I see
23:52 <Welkin> I actually don't know how it works by default
23:52 <Welkin> lazy IO perhaps
23:52 suls joined
23:53 <Welkin> if you have huge datasets, you can use pipes or conduit to stream them
23:54 <dmwit> tobiasBora: You can choose the buffering on a per-handle basis. I think `writeFile` uses block buffering. Let's check the source!
23:55 anuxivm joined
23:55 path[l] joined
23:55 <Welkin> oh yeah
23:55 <Welkin> it does
23:55 <ertes> tobiasBora: that looks pretty efficient to me
23:56 <ertes> tobiasBora: String is not inherently inefficient, it's just inefficient when you *store* strings
23:56 <tobiasBora> ok nice, thank you! So it's equivalent to play with IOHandle... ?
23:56 <dmwit> tobiasBora: Yes, the default is block buffering with a system-dependent size.
23:56 <tobiasBora> ok thank you
23:57 <ertes> tobiasBora: in other words: if you were reading those lines from another file and then writing them, String would be inefficient, and you should use ByteString or Text
23:57 <tobiasBora> ertes: Efficiency when I store strings is done using arrays?
23:57 <Welkin> tobiasBora: lol, no
23:57 zcourts_ joined
23:57 <Welkin> use Text instead of String
23:57 <dmwit> tobiasBora: Usually `Text` from the `text` package.
23:57 <ertes> tobiasBora: a String, if it happens to actually manifest in memory through evaluation, is a linked list of Char
23:57 <tobiasBora> oh
23:57 <tobiasBora> yes
23:57 <Welkin> in haskell, we have String, Text, and ByteString
23:58 <Welkin> all for different uses
23:58 <dmwit> Or, for binary data, `ByteString`. Don't use `ByteString` for text.
23:58 <tobiasBora> But here I want to write a list of list of int into a file
23:58 <tobiasBora> (and do pretty nice align of the data)
23:58 <Welkin> tobiasBora: pretty print your data using Text
23:58 <tobiasBora> Welkin: ok thank you
23:58 <dmwit> tobiasBora: You might like the `boxes` package for constructing your file contents.
23:59 msko joined
23:59 <tobiasBora> dmwit: it's alignment so not sure that boxes would do that
23:59 <dmwit> ...depending on what you want the contents to be, I guess.
23:59 <dmwit> tobiasBora: Hm. Okay. What is alignment?
23:59 <tobiasBora> 1 2
23:59 <tobiasBora> 10 42
23:59 <dmwit> Why do you think the boxes package will not do that?