<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 _2_7  
28 29 30 31
00:00 eacameron joined
00:00 infinity0 joined
00:02 louispan joined
00:02 sigmundv_ joined
00:03 zcourts joined
00:03 infinity0 joined
00:03 anuxivm left
00:04 cyborg-one joined
00:06 infinity0 joined
00:07 rkazak joined
00:07 zcourts_ joined
00:08 infinity0 joined
00:09 anodium joined
00:09 sgronblo joined
00:10 tromp joined
00:11 infinity0 joined
00:12 TheFuzzball joined
00:13 crobbins joined
00:14 Bashmetim joined
00:14 infinity0 joined
00:14 <pikajude> fix error is my favorite haskell-ism
00:14 <hpc> > floor (0/0) :: Integer
00:14 <lambdabot> -269653970229347386159395778618353710042696546841345985910145121736599013708...
00:15 <hpc> (though that's a ghc/libgmp-ism)
00:15 Reshi joined
00:15 xcmw joined
00:15 sgronblo_ joined
00:16 Hunter1 joined
00:17 infinity0 joined
00:17 filterfish joined
00:19 <Hafydd> > floor (0/0) `mod` 10
00:19 <lambdabot> 6
00:19 <Hafydd> Well, that's quite demented.
00:19 <hpc> > floor (0/0) `mod` 256
00:20 <lambdabot> 0
00:20 slack1256 joined
00:20 <Hafydd> But it seems to have more to do with floating point numbers than with integers.
00:21 <hpc> sort of
00:21 <hpc> 0/0 is NaN, which has a particular representation
00:21 <hpc> floor i expect is specialized for Double -> Int and Double -> Integer
00:21 <hpc> > floor (0/0) :: Int
00:21 <lambdabot> 0
00:22 jer1 joined
00:22 <hpc> anyhoo it's more interesting for Integer, because i expect it does some (mantissa * base ** exp) bitwise magic
00:22 <hpc> and then calls out to libgmp
00:22 acarrico joined
00:22 <hpc> which... yeah does have a lot to do with floats
00:23 ChaiTRex joined
00:26 <glguy> > base 16 # (floor (0/0)::Integer)
00:26 <lambdabot> "-18000000000000000000000000000000000000000000000000000000000000000000000000...
00:26 <hpc> :t base
00:26 <lambdabot> (Applicative f, Choice p, Integral a) => Int -> p a (f a) -> p String (f String)
00:26 <hpc> > base 5 # 100
00:26 <lambdabot> "400"
00:26 <hpc> snazzy
00:27 <* hpc> pretends to know what Choice is
00:27 <exio4> that thing is creepy
00:27 sighingnow joined
00:28 <glguy> base :: Integral a => Int -> Control.Lens.Type.Prism' String a
00:29 <slack1256> on +RTS -s -RTS, the "total bytes allocated" includes memory that was overwritten (reused on a freelist) will count at least twice on that?
00:29 <Hafydd> :t (#)
00:29 <lambdabot> error: parse error on input ‘)’
00:29 <glguy> (#) :: AReview t b -> b -> t -- Defined in ‘Control.Lens.Review’
00:29 <hpc> different extensions in ghci vs mueval
00:29 <Hafydd> Interesting.
00:29 <hpc> unless they've changed how lambdabot interfaces with ghc recently
00:30 whaletechno joined
00:30 nighty-- joined
00:31 darlan joined
00:31 <slack1256> also, how is it different from alloc rate?
00:34 cpup joined
00:36 tommd joined
00:36 <crobbins> is there a type class for data structures which support O(1) indexing?
00:36 <crobbins> like Vector, Array, etc.
00:37 <geekosaur> slack1256, yes to the first. the second... would have to check but I think alloc rate gives you an idea of *time* periodicity (as opposed to *code location* periodicity) in allocations
00:38 johnw_ joined
00:39 <geekosaur> oh, no, it's a gc thing
00:40 <geekosaur> if you divide # allocations by wall clock time you get a time that is distorted by the time needed for major gcs
00:41 jer1 joined
00:41 <geekosaur> and alloc rate is just a convenience, doing the math for you (total bytes allocated divided by the amount of time your code as opposed to the GC is running)
00:41 andyhuzhill joined
00:42 <slack1256> nice, actually the first (now you clarified) makes a lot of sense, because the copying strategy that is default on the GC
00:43 JeanCarloMachado joined
00:44 <slack1256> geekosaur: about the second, the math works. It didn't make sense to me, because the program I was testing runs on a fraction of a second :-P
00:45 <c_wraith> crobbins, why would that need a type class?
00:45 <geekosaur> this is true, and it's even kinda evident in the example in the user manual
00:45 <crobbins> c_wraith: so you can generalize among various data types
00:45 <c_wraith> crobbins, but why would the time complexity of indexing affect that generalization?
00:46 <geekosaur> on the flip side, *most* times you want to know this stuff, it's a longer running program which grows over time and you;re trying to get a handle on why
00:46 <crobbins> c_wraith: well, that's why it would need to be O(1)
00:46 jessemillikan joined
00:46 <geekosaur> or, it;'s slower than you expect and you suspect it's allocaitng too much
00:47 <c_wraith> crobbins, in what way is it more useful than being able to abstract over an arbitrary indexing operation?
00:47 acarrico joined
00:47 Noldorin joined
00:47 ContessaTP joined
00:47 Lokathor_ joined
00:48 <crobbins> c_wraith: would allow you to generalize stuff like binary search
00:49 <c_wraith> crobbins, how is that more useful than generalizing over a search algorithm?
00:50 dylanj_ joined
00:51 <crobbins> c_wraith: maybe it's not, just seemed like if you had generic length and index functions you could derive a default implementation
00:52 <c_wraith> crobbins, my point is really that most different structures are so different that there's no useful sharing between them.
00:52 <crobbins> c_wraith: fair enough
00:52 <c_wraith> crobbins, array/vector is an odd pairing in that sense, because they are conceptually the same.
00:53 <c_wraith> that's rare. :)
00:53 <crobbins> c_wraith: rare?
00:54 <c_wraith> for two libraries to export data types with all the same asymptotics
00:54 jedws joined
00:54 <Mibaz> I'm running GHC 7.10.3. What's the easiest way to upgrade to 8.0.2?
00:54 <Mibaz> From source or something automated?
00:55 <MarcelineVQ> where did you get your 7.10.3?
00:55 <Mibaz> I think it came with haskell-platform on ubuntu
00:55 <Mibaz> I don't really care about the rest of the platform, currently
00:55 <c_wraith> crobbins, though vector has a lot of performance enhancements that require any abstraction to be aware of them to not break them.
00:56 <Clint> Mibaz: upgrade to zesty
00:56 <c_wraith> crobbins, for instance, Data.Vector.Generic abstracts over boxed, unboxed, and Storable vector variants in a way that's aware of preserving its optimizations.
00:57 <Mibaz> Clint: Will haskell-platform include 8.0.2 in Zesty?
00:57 <c_wraith> crobbins, but the cost of that is that it only works with Vector
00:58 Hunter1 joined
00:58 JeanCarl1Machado joined
00:58 <Clint> Mibaz: yes
00:59 <Mibaz> Clint: Zesty it is! Thanks
01:02 juanpaucar joined
01:02 jer1 joined
01:04 e14 joined
01:07 halogenandtoast joined
01:08 jordan335 joined
01:08 <jordan335> https://ideone.com/hjGQ1B
01:08 Supersonic112_ joined
01:08 <jordan335> what do i have to change to make the program compile without errors? : /
01:09 vaibhavsagar joined
01:09 lambda-11235 joined
01:11 <jordan335> is it because i try to use list comprehension over a tuples
01:12 mkoenig joined
01:12 mrkgnao joined
01:12 <Clint> jordan335: what is four_swap_cap_char supposed to do
01:12 eacameron joined
01:12 tromp joined
01:13 <jordan335> it doesnt make sense much but its just a small part of a larger problem
01:13 <jordan335> i use it to change A to B and B to A
01:14 peterbecich joined
01:15 <Clint> jordan335: so if you pass (0,'a',True,'A') to it, what's going to happen?
01:15 cschneid_ joined
01:15 <jordan335> oh i see
01:16 <jordan335> its reversed first then it changes A to B, then it changes True to ? theres the error?
01:17 <Clint> > let four_swap_cap_char x = if 'A' == x then 'B' else 'A' in four_swap_cap_char 'Q'
01:17 <lambdabot> 'A'
01:17 benl23 joined
01:17 <Clint> > let four_swap_cap_char x = if 'A' == x then 'B' else 'A' in four_swap_cap_char (0,'a',True,'A')
01:17 <lambdabot> error:
01:17 <lambdabot> • Couldn't match expected type ‘Char’
01:17 <lambdabot> with actual type ‘(Integer, Char, Bool, Char)’
01:19 crobbins joined
01:20 andyhuzhill joined
01:22 Cooler joined
01:24 practica joined
01:25 darjeeli1 joined
01:25 jer1 joined
01:27 andyhuzhill joined
01:28 mizu_no_oto joined
01:28 asm_ joined
01:32 YongJoon joined
01:32 systadmin joined
01:32 JeanCarl1Machado joined
01:33 YongJoon joined
01:34 JeanCarloMachado joined
01:34 cdg joined
01:35 <* hackage> chart-unit 0.3.0 - A set of native haskell charts. https://hackage.haskell.org/package/chart-unit-0.3.0 (tonyday567)
01:35 johnw__ joined
01:36 drewbert joined
01:37 <* hackage> numhask-range 0.0.2 - see readme.md https://hackage.haskell.org/package/numhask-range-0.0.2 (tonyday567)
01:38 {emptyset} joined
01:41 louispan joined
01:42 fortruce joined
01:42 JoshS joined
01:42 NoCreativity joined
01:44 Zialus joined
01:44 mjora7 joined
01:45 sword865 joined
01:45 jer1 joined
01:47 <* hackage> chart-unit 0.3.1 - A set of native haskell charts. https://hackage.haskell.org/package/chart-unit-0.3.1 (tonyday567)
01:49 filterfish joined
01:50 Reshi joined
01:53 flatmap13 joined
01:53 justanotheruser joined
01:54 flatmap1_ joined
01:54 lambdamu_ joined
01:55 xcmw joined
01:56 <jordan335> how do add a tuple to a list of tuples?
01:56 burtons joined
01:56 <jordan335> > [] ++ (1,2,3)
01:56 <lambdabot> error:
01:56 <lambdabot> • Couldn't match expected type ‘[a]’
01:56 <lambdabot> with actual type ‘(Integer, Integer, Integer)’
01:57 systadmin joined
01:58 JeanCarl1Machado joined
01:58 <glguy> jordan335: What would you expect the result of doing that to be?
01:58 <jordan335> [(1,2,3)]
01:58 <glguy> > [] ++ [(1,2,3)]
01:59 <lambdabot> [(1,2,3)]
01:59 <glguy> :t (++) -- so in x ++ y, both x and y must be lists
01:59 <lambdabot> [a] -> [a] -> [a]
01:59 <kadoban> > (1,2,3) : []
01:59 jao joined
01:59 <lambdabot> [(1,2,3)]
01:59 <kadoban> That could be what you want ^
02:00 hucksy joined
02:00 jerbome joined
02:01 <jordan335> wow yeah kadoban thanks
02:02 takle joined
02:02 JeanCarloMachado joined
02:03 <jordan335> > (0,'a',True,'A') : []
02:03 <lambdabot> [(0,'a',True,'A')]
02:04 <jordan335> > let a = (0,'a',True,'A')
02:04 <lambdabot> <no location info>: error:
02:04 <lambdabot> not an expression: ‘let a = (0,'a',True,'A')’
02:04 <kadoban> lambdabot expects a single expression
02:04 <kadoban> > let x = 5 in x + x
02:04 <lambdabot> 10
02:04 afarmer joined
02:04 <kadoban> @let blah = 2000 -- or you can do this
02:04 <lambdabot> Defined.
02:04 <kadoban> > blah
02:04 <lambdabot> 2000
02:05 mjora7 joined
02:05 P1RATEZ joined
02:06 flatmap1_ joined
02:06 jer1 joined
02:08 flatmap13 joined
02:10 HoierM joined
02:14 sellout- joined
02:15 renzhi joined
02:15 louispan joined
02:16 juanpaucar joined
02:16 JeanCarl1Machado joined
02:18 simukis_ joined
02:19 <koala_man> I want to test something on GHC 8.0.2 but I only have 8.0.1 in my distro's repo. Can I have stack install an independent copy somewhere?
02:20 takle joined
02:21 canta joined
02:21 <mrkgnao> koala_man: yes, just start a new stack project with resolver lts-8.13, say, and run stack build --install-ghc
02:21 <jordan335> i begin to see the beauty of haskell
02:22 Cooler joined
02:22 <jordan335> i was stuck on a problem because i thought in imperative programming terms
02:22 <jordan335> now i found a one line solution
02:22 sgronblo joined
02:22 <jordan335> > [(a,b,c,d) | a <- [0,50..200], c <- [True,False], b <- ['a'..'c'], d <- ['A','B']]
02:22 <lambdabot> [(0,'a',True,'A'),(0,'a',True,'B'),(0,'b',True,'A'),(0,'b',True,'B'),(0,'c',...
02:23 <mrkgnao> great! :)
02:23 <koala_man> mrkgnao: nice, thanks
02:23 <mrkgnao> jordan335: this looks project euler-ish
02:24 <mrkgnao> koala_man: yeah, stack does not care about your distro's packages, so you can always use whatever GHC you want
02:24 kritzcreek joined
02:24 <mrkgnao> lts-8.13 isn't necessary: you can use any LTS that is tied to GHC 8.0.2, and 8.13 is just the newest of those.
02:24 <jordan335> maybe that's where our prof takes all the tasks from
02:24 exferenceBot joined
02:26 MedDev joined
02:27 jer1 joined
02:29 hexagoxel joined
02:29 abroz joined
02:30 Computist joined
02:31 <c_wraith> well, the cross-wiring is complete now. I'm in the store, just walked past frozen burritos, and read it as "monads"
02:32 Computist joined
02:33 <EvanR> lol
02:33 <* geekosaur> kinda wants to try that sometime (set up a burrito stand but with monad-related labeling)
02:33 <jordan335> im trying to build a program that creates a list of tuples (a,b,c) and a,b,c are natural numbers
02:33 <EvanR> talk to a monad
02:34 zero_byte joined
02:34 <jordan335> the problem is that i want the algorithm to terminate for every `elem` requeset
02:34 Computist joined
02:34 JeanCarloMachado joined
02:35 Computist joined
02:35 <koala_man> blerk, ghc 8.0.2 is still only using llvm 3.7
02:37 cyborg-one joined
02:37 mjora7 joined
02:37 Computist joined
02:39 Computist joined
02:40 maarhart joined
02:41 <jordan335> my idea is to look at the some of 3 elements
02:42 <jordan335> like first generate every 3tuples that has the sum 1 if u add all 3 elemnts
02:42 Durbley joined
02:42 <jordan335> then generate all with sum 2 and so on
02:45 sleffy joined
02:46 varuaa joined
02:46 andyhuzhill joined
02:48 <ReinH> what does 'every elem request' mean?
02:51 jer1 joined
02:55 darjeeli1 joined
02:55 lavalike joined
02:56 canta joined
02:59 dan_f joined
03:00 takle joined
03:01 CoderPuppy joined
03:01 magicman joined
03:01 atec joined
03:01 jerbome joined
03:02 <jordan335> if you load the program in ghci and then say sth like
03:02 Destol joined
03:02 <jordan335> (elem) (2,224,4) program
03:02 <jordan335> it should terminate for every input
03:03 <jordan335> ReinH
03:03 shangxiao joined
03:03 kmels joined
03:04 <ReinH> What is 'program'?
03:04 <jordan335> its the algorithm that is supposed to create 3-tuples of natural numbers
03:04 <ReinH> program is an algorithm?
03:05 <ReinH> what does 'elem' of an algorithm mean?
03:05 fDev2179 joined
03:05 j2j joined
03:05 <jordan335> nvm, program is the list that the alg should create
03:06 <EvanR> chatbot?
03:06 <fDev2179> Hello fellow haskellers. I have a question about the best way to assemble a sparse matrix using the hmatrix library.
03:06 <ReinH> @src elem
03:06 <lambdabot> elem x = any (== x)
03:06 <ReinH> @src any
03:06 <lambdabot> any p = or . map p
03:06 <ReinH> lol, down the rabbit-hole we go.
03:06 <ReinH> @src or
03:06 <lambdabot> or = foldr (||) False
03:07 tripped joined
03:07 <EvanR> ultimately... any list algorithm based on pattern matching is a fold
03:07 <ReinH> So what you need is for the algorithm to be productive
03:07 <ReinH> which essentially means that it needs foldr nature rather than foldl nature
03:07 <jordan335> well it doesnt have to be fast, it just has to terminate
03:07 <ReinH> recursion has to be guarded by the (:) constructor
03:07 <ReinH> I didn't say anything about speed.
03:08 <jordan335> im trying to do this using list comprehension
03:08 <fDev2179> I am writing a finite element code in Haskell. I am at the point where I need to assemble all the element stiffness matrices into a global matrix. Problem is that I'm trying to do this in an immutable way.
03:09 <ReinH> list comprehensions are productive
03:09 <peddie> fDev2179: can you post your code?
03:09 <ReinH> > take 10 $ [ x | x <- [1..10] ]
03:09 <fDev2179> I have a sparsity pattern from the mesh so I know which entries are nonzero in the global stiffness matrix. I'm storing the entries from the element stiffness matrices as [(Int, Int, Double)]
03:09 <lambdabot> [1,2,3,4,5,6,7,8,9,10]
03:09 m1dnight1 joined
03:09 <ReinH> specifically, [ x | x <- xs ] is productive if xs is productive
03:09 <fDev2179> peddie, it is about 200 lines in several Modules. I can post the link to the git repo.
03:10 pickyfingers joined
03:10 <fDev2179> peddie, https://github.com/jgrisham4/hfem1d
03:10 <jordan335> the one dimensional case is easy
03:10 <jordan335> aufgabeE = [(a,b,c) | a <- [1..], b <- [1..], c <- [1..]]
03:10 <jordan335> this doesnt terminate
03:10 <fDev2179> The whole code isn't necessary to understand my issue though. I'll explain.
03:11 <jordan335> but i wish it would haha
03:11 <ReinH> jordan335: ah, you need diagonalization.
03:11 deech joined
03:11 <ReinH> http://stackoverflow.com/questions/32465776/getting-all-the-diagonals-of-a-matrix-in-haskell
03:11 jer1 joined
03:11 <fDev2179> Given a list of type [(Int, Int, Double)], which represents entries in a matrix in terms of row index, column index, and value, find all duplicate entries and sum the value to return one entry.
03:12 louispan joined
03:12 <ReinH> wait, no, that's the wrong diagonalization
03:12 <ReinH> https://hackage.haskell.org/package/control-monad-omega-0.3.1/docs/Control-Monad-Omega.html
03:12 <deech> Is there a way to get 'stack build' to show output from Cabal? For instance, show each module as it's compiling?
03:12 <fDev2179> I have one solution, but I'm not sure it is the best. Also not sure if it works as it is just on paper.
03:13 <fDev2179> I should have said sum the duplicate entries to return one value for each entry in the matrix.
03:13 <ReinH> fDev2179: duplicate by value?
03:13 <fDev2179> Duplicate by row, column index.
03:14 <ReinH> I don't follow.
03:14 <fDev2179> I usually assemble these matrices in C++ or Fortran using something like a += operator.
03:14 chu joined
03:14 varuaa joined
03:14 <fDev2179> However, since I'm using Haskell, I'd like to stick to immutable data structures. I saw there is a mutable matrix in hmatrix, but I'd rather not go down that road.
03:14 halogenandtoast joined
03:14 <ReinH> so your list contains duplicates or you have more than one list? Maybe I'm missing something.
03:15 <vaibhavsagar> deech: stack build --verbose?
03:15 <peddie> fDev2179: I see what you're saying; what's your solution? I'm thinking something like `groupBy` with `sort` to get lists of matching elements
03:15 <jordan335> how do i implement diagonalization?
03:15 <deech> vaibhavsagar: Doesn't seem to do it. :(
03:15 <fDev2179> ReinH, I have a list of (Int, Int, Double) which contain coordinates of entries in a matrix in terms of row indices, column indices and values.
03:15 justanotheruser joined
03:15 <fDev2179> I have duplicated entries and I want to sum those and eliminate the duplicates.
03:15 juanpaucar joined
03:15 <fDev2179> peddie,
03:16 <ReinH> jordan335: see https://hackage.haskell.org/package/control-monad-omega-0.3.1/docs/Control-Monad-Omega.html
03:16 <fDev2179> peddie, My solution involves a list comprehension and a filter.
03:16 <peddie> > map (foldr1 (\(x, y, a) (_, _, b) -> (x, y, a + b))) . groupBy (\(a, b, _) (c, d, _) -> (a, b) == (c, d)) . sort $ [(1, 2, 22.2), (2, 1, 33.3), (1, 2, 55.5)]
03:16 <lambdabot> [(1,2,77.7),(2,1,33.3)]
03:17 <orion> Anyone know the best place to get HaLVM support?
03:17 <ReinH> fDev2179: so are you trying to do better than groupBy and map sum?
03:17 ystael joined
03:17 <ReinH> orion: here, I guess, such as it is?
03:17 <fDev2179> My solution didn't use groupBy. Did use sum though. Lemme look at peddie's solution.
03:17 <glguy> orion: Probably the HaLVM mailing list
03:18 dalek_ left
03:19 tromp joined
03:19 <ReinH> jordan335: the operative bit is `diagonal`, which you should look at if you want to understand how it works
03:20 <ReinH> fDev2179: groupBy and map sum would be the naive way
03:20 <fDev2179> ReinH, what would you suggest?
03:21 <ReinH> Map (Int,Int) Double as a first attempt
03:21 <peddie> fDev2179: you could also form a bunch of matrices and then sum them, and if it's too slow, then just do that sum in a mutable way
03:21 <fDev2179> I understand what you did there, peddie. Thanks. That is definitely cleaner than what I had.
03:21 <ReinH> Actually, Map (Int,Int) (Sum Double) to get merging for free
03:22 <ReinH> That at least gets you within a log factor of the mutable method
03:22 <fDev2179> peddie, I feel like that would take up an unnecessary amount of memory.
03:22 <fDev2179> ReinH, how do you get merging for free?
03:22 <peddie> fDev2179: would it? if they're sparse matrices?
03:22 <fDev2179> peddie, ahhhh true.
03:23 <fDev2179> That would probably be the easiest way.
03:23 <peddie> fDev2179: actually I guess if they were all sparse matrices and you were mutating one of them, it's probably not too different from ReinH's solution with the Map. but it might be a little shorter with the library
03:23 <fDev2179> I still don't quite understand what ReinH wrote.
03:23 <ReinH> fDev2179: the Monoid isntance
03:23 <ReinH> *instance
03:24 <fDev2179> Oh, not too familiar with monoids yet.
03:24 <peddie> fDev2179: if you do it his way with Sum, you can simply merge the maps for each element's stiffness matrix using the built-in way of merging maps
03:24 <ReinH> oh wait, that isn't the monoid instance
03:25 Xanather joined
03:25 <ReinH> the monoid instance is a merge that prefers values to the left over values to the right
03:25 <fDev2179> What is the built-in way of merging maps?
03:25 <peddie> ReinH: I just made the same discovery :(
03:25 <ReinH> > fromList [("foo", "bar")] <> fromList [("foo", "baz")] :: Data.Map.Map String String
03:25 <lambdabot> fromList [("foo","bar")]
03:25 <ReinH> peddie: that is sad
03:25 <peddie> fDev2179: ignore, it turns out that won't work after all
03:26 <ReinH> I don't really understand this new merge machinery
03:26 <peddie> ReinH: did the machinery change the instance?
03:26 <fDev2179> Okay.
03:26 <peddie> ReinH: maybe you're referring to the Merge module? no haddock docs :(
03:27 <ReinH> peddie: https://hackage.haskell.org/package/containers-0.5.10.2/docs/Data-Map-Merge-Lazy.html
03:27 tefter joined
03:27 xcmw joined
03:27 tromp joined
03:27 <peddie> oh, I was looking for `Data.Map.Lazy.Merge` :)
03:27 <ReinH> I just want merge :: Monoid m => Map k m -> Map k m -> Map k m :/
03:27 <peddie> wow, this is complicated
03:27 <peddie> right
03:28 parsnip0 joined
03:28 <fDev2179> I think I understand what you're talking about now. We are talking about a type Map, not a function which applies a function to a list.
03:28 <fDev2179> More like a C++ map?
03:28 <jordan335> [(a,b,c) | summe <- [3..], c <- [1..], b <- [1..], a <- [1..], a+b+c==summe]
03:28 <jordan335> doesnt terminate : (
03:29 <ReinH> fDev2179: yes, sorry, Map k v is a dictionary from k to v
03:29 <fDev2179> Okay, that makes a lot more sense!
03:29 <fDev2179> I was a little lost.
03:29 <fDev2179> Thanks.
03:29 <ReinH> it is a log factor slower than its mutable (like C++) equivalent
03:29 <koala_man> I want my haskell program to crash in a way recognizable by fuzzers. How can I abort() or segfault or similar?
03:29 <ReinH> fDev2179: basically you merge maps into maps by summing the values
03:29 <fDev2179> Right.
03:29 <ReinH> and you get better asymptotics
03:29 <c_wraith> jordan335: well.. Yeah, that's going to be problematic. It'll output (1,1,1) and then... nothing else? (if I read it right)
03:30 <fDev2179> I follow now. I didn't think about looking for a container.
03:30 <ReinH> jordan335: Did you look at Omega?
03:30 <jordan335> yes but i didnt know how to use it
03:30 <ReinH> fDev2179: Ah! Often in functional programming the right data structure is just as important as the right algorithm, if not moreso
03:30 <fDev2179> For sure.
03:30 <geekosaur> koala_man, raiseSignal sigSEGV (https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/unix-2.7.2.1/System-Posix-Signals.html)
03:31 <fDev2179> Scaling is important so I might try to find the right data structure before moving forward. This code is a 1D code, but next I'm going to write a 3D code.
03:31 <koala_man> geekosaur: perfect, thanks!
03:31 baldrick1 joined
03:31 acyed joined
03:31 <fDev2179> ReinH, any suggestions on where to look for something that merges the way I want?
03:31 <jordan335> c_wraith yeah i think thats the problem
03:32 jer1 joined
03:32 <c_wraith> jordan335: that quick & dirty solution is to apply some domain knowledge. You know that adding two positive numbers must always result in a positive number greater than either input.
03:32 sleffy joined
03:32 pavonia joined
03:32 <ReinH> jordan335: Oh, yeah, it's just fold
03:33 <c_wraith> jordan335: so you can do something like [(a,b,c) | summe <- [3..], c <- [1..summe], b <- [1..summe], a <- [1..summe], a+b+c==summe]
03:33 <ReinH> Wait, no it isn't
03:33 <ReinH> sorry
03:33 <c_wraith> jordan335: it's still not completely efficient, but it will be productive
03:33 <ReinH> ugh one sec
03:33 <ReinH> fDev2179: I guess somewhere in https://hackage.haskell.org/package/containers-0.5.10.2/docs/Data-Map-Merge-Lazy.html
03:34 <jordan335> thats exactly what i was looking for c_wraith
03:34 <jordan335> thanks a lot, that was a good idea
03:35 <fDev2179> Thanks, ReinH and peddie. I need to learn more about containers provided by the language.
03:35 <ReinH> wow, it has all this merge machinery but not a simple merge of monoidal values
03:35 <ReinH> fDev2179: not by the language, by libraries!
03:35 <c_wraith> jordan335: do you see why that version makes progress?
03:35 <fDev2179> Okay, true.
03:35 carlomagno joined
03:36 <ReinH> this is one of the advantages of Haskell for me, that user-defined data structures can be efficient in a high level language.
03:36 <fDev2179> Just saw that's the containers library.
03:36 <ReinH> which is why I mentioned the distinction
03:36 <fDev2179> Definitely agree.
03:36 <fDev2179> It is really surprising as it would be very difficult to achieve something similar in C++.
03:37 <fDev2179> Glad to know it is possible for that type of efficiency to exist in user-defined data structures.
03:37 <jordan335> yes it doesnt get stuck
03:37 <c_wraith> Oh, don't be mistaken. It's not *easy* in Haskell either. It takes a lot of benchmarking and experimenting. :)
03:37 flatmap13 joined
03:37 <ReinH> fDev2179: Oh, it's just unionWith (+)
03:37 <fDev2179> c_wraith, something I need to learn more about. haha
03:37 <ReinH> I'm so sorry, I must be having a brain aneurism
03:38 <fDev2179> So, I need to define a Map whose keys are the row and column indices and values are the entries and then use unionWith to merge the Maps, right ReinH?
03:38 <fDev2179> Whose key is a tuple of the row, and column indices, that is.
03:39 <ReinH> fDev2179: use fromList and convert (a,b,c) into ((a,b),c)
03:39 <fDev2179> Okay cool.
03:39 <fDev2179> Thanks, ReinH!
03:39 <ReinH> > fromList [((1,2),"hello")] :: Data.Map.Map (Int,Int) String
03:39 <lambdabot> fromList [((1,2),"hello")]
03:40 <ReinH> > unionWith mappend (fromList [((1,2),"hello")]) (fromList [((1,2)," world")]) :: Data.Map.Map (Int,Int) String
03:40 <lambdabot> error:
03:40 <lambdabot> • Variable not in scope:
03:40 <lambdabot> unionWith
03:40 <ReinH> > Data.Map.unionWith mappend (fromList [((1,2),"hello")]) (fromList [((1,2)," world")]) :: Data.Map.Map (Int,Int) String
03:40 <lambdabot> fromList [((1,2),"hello world")]
03:40 <ReinH> tada!
03:40 <fDev2179> Sweet!
03:41 <fDev2179> I will definitely use that. Thanks again!
03:41 <ReinH> you can use Map (Int,Int) Double and unionWith (+) or Map (Int,Int) (Sum Double) and unionWith mappend and get it 'for free'.
03:41 <ReinH> fDev2179: yw
03:41 <ReinH> hmm, I would also suggest strict maps for this, I think
03:41 erisco joined
03:41 <ReinH> and you may need to do extra work to make the values strict as well
03:41 <ReinH> to avoid building up thunks
03:41 <ReinH> but that's the basic idea
03:41 <fDev2179> Strict meaning...
03:42 JeanCarloMachado joined
03:42 <ReinH> you want your maps storing the result of 1 + 2 directly rather than a thunk representing the computation 1 + 2
03:43 <fDev2179> Oh, I wasn't familiar with the term thunk. You mean we don't want to delay evaluation, right?
03:43 <ReinH> haskell uses 'thunks' to represent unevaluated expressions
03:43 <ReinH> you don't want to store thunks in your maps, you want to evaluate them and store the result
03:44 <fDev2179> Definitely agree. Thanks. Time to go read some documentation!
03:44 <ReinH> i.e., the difference between foldl and foldl'
03:44 andyhuzhill joined
03:44 systadmin joined
03:44 <fDev2179> Learning all kinds of good stuff today.
03:45 acertain joined
03:45 JeanCarl1Machado joined
03:45 <ReinH> so, e.g., unionWith add where add x y = x `seq` y `seq` x + y, or add !x !y = x + y (using BangPatterns)
03:46 <ReinH> although tbh you might end up just wanting to use ST and a mutable array...
03:46 <fDev2179> Another newbie question, what is ST?
03:46 hybrid joined
03:46 <ReinH> sorry
03:47 <fDev2179> No worries!
03:47 <ReinH> ST is a monad for encapsulating mutation, more or less.
03:47 <ReinH> ST means strict threads (for state)
03:47 <ReinH> it gives you things like mutable arrays where mutation isn't observable outside of the ST action
03:47 <ReinH> principled mutation, you might say
03:47 <erisco> simplest is bestest if you're learning
03:47 <fDev2179> Okay. I'd like to do this in such a way that it is easy to parallelize later on.
03:48 <ReinH> all of these methods would leave that door open
03:48 <fDev2179> That's why I was trying to stick with immutable data structures. Wasn't aware this approach would leave that door open.
03:48 varuaa joined
03:49 <fDev2179> Then again, I have no experience writing parallel code in Haskell. All my experience is in other languages using MPI and OpenMP. I was just planning to learn it later.
03:49 <ReinH> well, with ST you will have to do a bit more work to divide up the problem into parallelizable chunks
03:49 <ReinH> @google parallel and concurrent programming in Haskell
03:49 <lambdabot> http://chimera.labs.oreilly.com/books/1230000000929
03:49 <lambdabot> Title: Parallel and Concurrent Programming in Haskell
03:49 otto_s_ joined
03:49 <ReinH> Here's a free book by one of the primary authors of GHC's runtime system and its parallel/concurrent bits and bobs.
03:49 <ReinH> on, you know, that
03:50 <ReinH> it's one of my favorite Haskell books
03:50 <fDev2179> Yeah, already have that book on my favorites bar. Just trying to make sure I've got the basics down before I dive into it.
03:50 xiinotulp joined
03:51 harfangk joined
03:51 <ReinH> it's a good way to learn the basics
03:51 <ReinH> it doesn't assume a lot of Haskell knowledge
03:51 <fDev2179> Okay, cool. I'll check it out after I finish this 1D code.
03:51 <ReinH> good luck!
03:52 <fDev2179> Thanks, ReinH, and thanks for your patience/help!
03:52 <ReinH> you're quite welcome
03:52 <fDev2179> \e
03:52 <ReinH> o/
03:52 jer1 joined
03:53 indi_ joined
03:55 tromp joined
03:57 acertain joined
03:57 takle joined
03:58 sanitypassing joined
03:58 varuaa joined
03:59 acertain joined
04:00 andyhuzhill joined
04:01 halogenandtoast joined
04:01 JeanCarloMachado joined
04:01 JeanCarl1Machado joined
04:01 jrahmy_ joined
04:01 nshepperd joined
04:02 cpup joined
04:05 uglyfigurine joined
04:05 jordan335 joined
04:07 acertain joined
04:09 nshepper1 joined
04:10 descender joined
04:10 uglyfigurine joined
04:11 ChaiTRex joined
04:11 Durbley joined
04:13 acertain joined
04:14 JeanCarloMachado joined
04:16 takle joined
04:16 Goplat joined
04:16 jer1 joined
04:17 vtomole joined
04:18 eSVG joined
04:19 juanpaucar joined
04:20 acertain joined
04:23 orhan89 joined
04:28 insitu joined
04:29 insitu_ joined
04:29 kamyar joined
04:29 robotroll joined
04:30 acertain joined
04:36 jmcarthur joined
04:37 mbuf joined
04:37 jer1 joined
04:41 takle joined
04:43 connrs joined
04:44 leat joined
04:44 acertain joined
04:44 andyhuzhill joined
04:45 ^bschafer1 joined
04:45 <Myrl-saki> @pl (\x y -> x :=> Identity y)
04:45 <lambdabot> (. Identity) . (:=>)
04:45 <Myrl-saki> Eh
04:46 JeanCarl1Machado joined
04:47 <jle`> Myrl-saki: you can leave in a point
04:47 <jle`> Myrl-saki: \x -> (x :=>) . Identity
04:47 brynedwards joined
04:47 orhan89 joined
04:50 <sproingie> which would be just (:=> Identity)
04:51 <sproingie> (whatever the heck :=> does, composing with Identity seems kind of a no-op)
04:52 lgas joined
04:53 <Myrl-saki> @pl (\y x -> x :=> Identity y)
04:53 <lambdabot> flip (:=>) . Identity
04:54 <Myrl-saki> sproingie: That wouldn't typecheck. Probably.
04:54 <sproingie> meh. the right-section is clearer imho
04:54 <glguy> sproingie: The thing you wrote isn't related to what Myrl-saki wrote
04:54 louispan joined
04:55 nightglare joined
04:56 <sproingie> zounds, yeah i messed it up good
04:56 <jle`> sproingie: it's definitely more clear, but it does do something different
04:58 <Myrl-saki> @pl (\(y,x) -> x :=> Identity y)
04:58 <lambdabot> uncurry (flip (:=>) . Identity)
04:58 <lgas> does anyone know if there's a way to prevent haskell-mode from asking me if I want to kill all associated buffers every time I kill ghci other than commenting those lines out in haskell.el ?
04:58 <* hackage> yesod-job-queue 0.3.0.4 - Background jobs library for Yesod. https://hackage.haskell.org/package/yesod-job-queue-0.3.0.4 (nakaji_dayo)
04:58 <sproingie> heh so you mean (x `foo` Identity) y isn't the same as (x `foo` Identity y)? :p
04:58 <Myrl-saki> lmao I giff up.
04:59 <Myrl-saki> this makes me wanna cry
04:59 <sproingie> prolonged thinko, i blame the mind control rays not working properly tonight :)
05:00 andyo joined
05:00 takle joined
05:00 JeanCarloMachado joined
05:00 JeanCarl1Machado joined
05:01 <Myrl-saki> It just stops responding lmao
05:01 jer1 joined
05:01 slacker joined
05:02 sleffy joined
05:02 nightglare joined
05:02 <MarcelineVQ> what does
05:04 <sproingie> lgas: which lines? far as i know, the prompt about killing subprocesses is something more deeply wired in emacs
05:05 <sproingie> i just use intero, it does its own ghci thing with no fuss
05:05 gabriel_laddel_p joined
05:06 radvendii joined
05:07 gabriel_laddel_p left
05:07 <radvendii> Hey guys, so I have Data.Matrix imported at the top of a file, but certain functions seem to be missing (prettyMatrix, the Num instance, ncols is called cols for some reason, transpose is called tr, multStd is missing)
05:08 vlatkoB joined
05:08 mjora7 joined
05:08 <radvendii> and it doens't seem to be that I'm just using an older version of the package, because even the first version listed on hackage had prettyMatrix
05:08 <jle`> radvendii: check the docs for the module
05:08 sgronblo joined
05:08 <glguy> radvendii: You can check which version you're using: ghc-pkg list PACKAGENAME
05:09 <jle`> radvendii: try loading it in ghci and using :browse Data.Matrix
05:09 <radvendii> @glguy it can't find anything actually. This is probably a product of my being on NixOS
05:09 <lambdabot> Unknown command, try @list
05:10 <radvendii> jle`: yeah, I did something similar and those commands are missing there too
05:10 acertain joined
05:10 {emptyset} joined
05:10 <cocreature> you probably need to run those commands inside of a nix shell or something like that
05:11 <MarcelineVQ> cols, tr, did you import from hmatrix instead somehow?
05:12 <radvendii> cocreature: Hm. Not sure what command to use though. I'm not such a veteran nix user unfortunately. Haskell itself usually works fine though, I haven't had problems in the past
05:13 <radvendii> MarcelineVQ: Interesting. Maybe? The import at the top is definitely Data.Matrix, but maybe something got confused?
05:13 <cocreature> radvendii: I think you are using this module https://hackage.haskell.org/package/matrices-0.4.4/docs/Data-Matrix.html instead of https://hackage.haskell.org/package/matrix-0.3.5.0/docs/Data-Matrix.html
05:13 <cocreature> so try changing your dependencies from matrices to matrix
05:13 <cocreature> not sure how you do that in nix
05:13 <sproingie> cocreature: golly, no chance of confusion with those package and module name combinations 8-/
05:14 <angerman> MarcelineVQ: yep, I do try to write a bit about cross compilation :) https://medium.com/@zw3rk should list them, in case you want to direct someone there the next time :-)
05:14 <Myrl-saki> I wonder if it's the X server that's rejecting me or something else.
05:14 <MarcelineVQ> angerman: I'll make a bookmark
05:14 <sproingie> FFS people, stop calling everything "Data" and "Control"
05:14 <radvendii> sproingie: hahaha
05:14 <MarcelineVQ> cocreature: golly, that's an easy mistake to make :(
05:14 <angerman> MarcelineVQ: thanks!
05:15 <radvendii> cocreature: oh man, that's probably it. thanks, i'll work on making it use the other one now
05:15 <Rotaerk> we need a Control.Data and Data.Control
05:15 <radvendii> the worst part is it wasn't showing up when I searched for Data.Matrix on the web
05:15 acertain joined
05:15 <cocreature> Rotaerk: we already have Data.Data :)
05:15 <angerman> cocreature: wow. the edit distance between those two is really tiny: -"ces-0.4.4" +"x-0.3.5.0"
05:15 <cocreature> radvendii: here’s how I found it http://hoogle.haskell.org/?hoogle=Data.Matrix%20is%3Amodule%20is%3Aexact
05:16 afarmer joined
05:16 <Rotaerk> heh
05:16 bumpkin joined
05:16 <sproingie> Control.Data - historically important ancestor to cray
05:16 eklavya joined
05:16 spacecadetbrown joined
05:17 dec0n joined
05:17 Xanather joined
05:19 <Myrl-saki> lmao
05:19 uglyfigurine joined
05:20 tromp joined
05:20 jer1 joined
05:21 insitu joined
05:21 dni joined
05:22 <radvendii> cocreature: This does indeed seem to have been the problem. Now I have to figure out how to not import 'matrices' which I never actively imported in the first place (sometimes nix is a nightmare)
05:22 <jle`> you can do package imports (a language extension), but this is the kind of thing that cabal files were made for
05:23 bumpkin left
05:25 MrWoohoo joined
05:25 meandi_2 joined
05:25 <sproingie> cabal and stack. global installs are a nightmare
05:26 <radvendii> :/ yeah, yeah. I had hoped to postpone learning how to do that a little longer
05:26 <jle`> everything is easier with stack/cabal heh
05:26 <jle`> using haskell without it is a nightmare
05:26 leat joined
05:26 <jle`> like, actually
05:26 <sproingie> stack has a small learning curve, then everything is *much* simpler
05:27 <geekosaur> until it breaks and then it breaks even more thoroughly
05:27 <sproingie> basically it's what java got right with maven: every project has its own private haskell, and stack caches all the things
05:27 <jle`> learning stack/cabal is a thousand times easier than learning how to deal without it
05:27 verement joined
05:28 <sproingie> except unlike maven (but like scala and sbt), stack will also deal with installing haskell itself
05:28 <geekosaur> but of course never tell that to a True Believer who will swear even as it hoses them that it's user error
05:28 JeanCarl1Machado joined
05:29 juanpaucar joined
05:29 <sproingie> well it is usually user error, it just needs to be more graceful about it
05:29 <geekosaur> ...
05:30 <sproingie> stack is still a little wooly, but it's way tamer than doing it by hand
05:30 <geekosaur> sorry Ive had to deal with enough stack help requests in here to know better. also, enough stack bug reports
05:30 rcschm joined
05:30 acertain joined
05:31 <sproingie> i've run into a stack bug or two myself. still better than trying to manage multiple library versions by hand
05:33 <sproingie> the fact that it doesn't always clean up stale locks when stopping it with ctrl-C is the most annoying
05:33 itihas joined
05:33 xtreak joined
05:34 baldrick1 joined
05:35 cioran89 joined
05:36 abroz joined
05:37 <radvendii> When I start writing haskell code for production, I'll definitely need to learn stack. For now it's all just for personal projects though, and I don't really need to use different versions of libraries
05:38 <MarcelineVQ> you might not, but your dependencies might ;(
05:38 lavalike_ joined
05:38 <MarcelineVQ> you should at least be using cabal sandboxes or cabal new-build :>
05:38 <sproingie> lemme give you a two-line intro to stack
05:38 <sproingie> #!/usr/bin/env stack
05:38 <sproingie> -- stack runghc --package foo-bar
05:39 fizruk joined
05:39 <sproingie> presto, haskell is a scripting language that auto-downloads dependencies
05:39 <glguy> radvendii: If you take his pamphlet he'll move on
05:40 <radvendii> wait what? as in you put that at the top of your haskell file?
05:40 <sproingie> exactly that
05:40 <radvendii> and the comment tells stack what to do?
05:40 <sproingie> yep
05:40 <radvendii> where you put as many --package 's as you need for all your packages?
05:41 <sproingie> indeed. though if you need several packages, you probably want to create a project ("stack new")
05:41 <glguy> The first two lines are free, then you gotta pay
05:41 CurryWurst joined
05:41 <radvendii> hahahaha exactly
05:41 <radvendii> but as long as all I need is to install a couple packages, I can just use that intro with a bunch of --package s
05:41 <radvendii> wow
05:41 <radvendii> that actually seems super convenient
05:41 jer1 joined
05:41 <sproingie> it's not to say stack is perfectly convenient all the time. it just manages versions in a way cabal-sandbox never could
05:42 <MarcelineVQ> installing packages isn't quite the right way to think about using stack, https://docs.haskellstack.org/en/stable/GUIDE/ can explain more about that when you're interested in trying it
05:43 caumeslasal joined
05:43 <sproingie> forget about "installing" anything with stack, it's like maven or npm that way
05:43 insitu joined
05:44 <sproingie> but even better than npm since it can install the platform itself
05:44 <radvendii> stack can't find my ghc
05:44 <sproingie> stack installs its own ghc
05:44 <radvendii> foo
05:44 <radvendii> foo
05:44 <radvendii> ahh! sorry
05:44 <radvendii> hang on
05:45 inad922 joined
05:45 <radvendii> "No compiler found, expected minor version match with ghc-8.0.1"
05:45 dscho joined
05:45 <sproingie> might need to run "stack setup" to bootstrap things
05:45 <radvendii> oh i see. i just needed to add --install-ghc
05:45 <MarcelineVQ> sproingie should have added --install-ghc to his script :>
05:45 <radvendii> yeah
05:45 <sproingie> ah right, been a while since i started from scratch
05:46 <MarcelineVQ> though I'm not sure I advocate using the scripting facilies personally
05:46 <radvendii> but then it has to install all of ghc every time? XD
05:46 JeanCarloMachado joined
05:46 <sproingie> MarcelineVQ: pah, it's perfect for single-file examples
05:46 <radvendii> It's a good start. Better than what I'm currently doing
05:46 qwertydvorak joined
05:46 <MarcelineVQ> it's perfectly misleading ^^;
05:46 <sproingie> radvendii: no, it'll find an existing installation once it's done that
05:46 <radvendii> and yeah, at this point all of my projects are one file mostly
05:46 JeanCarl1Machado joined
05:46 shayan_ joined
05:47 <radvendii> oh great. now something's assuming I have bash installed under /bin/bash
05:47 <sproingie> one killer feature is "stack ghci". in a stack project, it'll load every module in exposed-modules
05:48 <radvendii> sproingie: oh that's nice
05:48 ThomasLocke joined
05:48 ThomasLocke joined
05:49 <sproingie> i'd hope stack isn't hardwiring /bin/bash anywhere :-/
05:49 jerbome joined
05:49 orhan89 joined
05:49 mzf joined
05:49 <nightglare> sorry for the noob question but what was the command for making a new stack project?
05:49 <sproingie> stack new
05:49 <radvendii> """
05:50 <sproingie> just type "stack" without args and it'll show you the commands
05:50 cpup joined
05:50 <jle`> stack tutorial is also super helpful
05:50 osa1 joined
05:50 <sproingie> (unfortunately that's as deep as stack's docs on the CLI go)
05:50 radvendi1 joined
05:50 <radvendi1> whooops
05:50 <nightglare> ah thanks
05:50 jer1 joined
05:51 <radvendi1> anyways, it is indeed trying to use /bin/bash somewhere in bash configuration
05:51 jrahmy_ joined
05:53 <sproingie> stack works on windows, guarantee it doesn't require a \bin, but maybe it's being sloppy on unixen
05:53 Bhootrk_ joined
05:54 <radvendi1> huh. i dunno. I'll look into it more later, but for now I've gotta finish this final by tomorrow night so it's not worth it to do it now
05:54 <radvendi1> thanks for the help though :)
05:56 takle joined
05:57 <* sproingie> ponders writing stack-tutorial so "stack tutorial" will launch a browser pointed at the stack tut
05:57 <sproingie> is there even a cross-platform browser-launching lib?
05:58 quchen joined
05:58 <MarcelineVQ> stack has a tutorial, it's called the user guide and no one ever reads it
05:59 <MarcelineVQ> That's not a comment on anything talked about just now, but a comment on help people seem to need most often being things explained as pretty much the first section in the user guide
05:59 <MarcelineVQ> Where it also explains what stack is, and by inferrence what stack isn't
06:00 juanpaucar joined
06:01 <sproingie> the quick start in the readme seems all right. the shebang + magic comment thing is almost an easter egg
06:02 acertain joined
06:02 <MarcelineVQ> I actually would like the quick start section removed so people have to stumble into the user guide instead ehe
06:02 hurkan joined
06:03 ertes-w joined
06:03 <MarcelineVQ> that and "curl -sSL https://get.haskellstack.org/ | sh" could dissapear
06:03 <sproingie> on unix, i'd expect a manpage, but i don't see one for stack at all
06:04 acertain joined
06:04 <kadoban> MarcelineVQ: What's wrong with it, and what's better?
06:04 <MarcelineVQ> which item?
06:04 <kadoban> MarcelineVQ: The curl thing
06:04 <MarcelineVQ> hmm, piping into sh is just scary to me
06:05 <kadoban> Why?
06:05 <MarcelineVQ> I'm pretty sure we've had this convo though
06:05 <sproingie> MarcelineVQ: i'm no great fan of the whole "pipe scripts from random urls into shell" approach, but truth is it's exactly the same idea as any other download
06:05 <kadoban> Yes, I am as well. I don't recall you coming up with a much better idea though.
06:05 danvet joined
06:05 <MarcelineVQ> It ends with me not really knowing what I'm talking about
06:05 jedws joined
06:05 <MarcelineVQ> But it just doesn't seem like a good thing to advocate
06:06 <sproingie> yeah but it's absolutely isomorphic to downloading some installer exe and running it
06:06 <kadoban> But if there's nothing particularly better, is it something particularly to disuade?
06:07 <kadoban> Ya, it's just an executable, but better. If you actually care you can read it. (though reading it probably won't give you much/any extra security)
06:07 <radvendi1> I mean one better option is having the installation be simple enough that people can understand it and execute it themselves
06:07 <MarcelineVQ> Well for better I'm very much for distro releases and stack upgrade when needed
06:07 leat joined
06:07 <radvendi1> not always possible though
06:07 bvad joined
06:07 <kadoban> Yeah, distro releases are good. But the people who are able to do those probably already know how
06:08 JeanCarloMachado joined
06:08 <sproingie> you can also install stack through OS package managers if trust is an issue (and i'd hope it is if you're deploying a production cluster or something)
06:09 <sproingie> but ultimately you're running arbitrary code in order to install something whose purpose is also to download and run arbitrary code
06:09 JeanCarl1Machado joined
06:09 <sproingie> so ultimately you just go ¯\_(ツ)_/¯
06:09 <kadoban> Not to mention every time you're using a library without checking it, you're pretty much doing the same.
06:09 osa1_ joined
06:10 <kadoban> No idea how programmers don't get owned a lot more often than they do.
06:10 <sproingie> or even if you check it. c.f. ken thompson "reflections on trusting trust"
06:10 eatman joined
06:11 <sproingie> just that modern open source has a way more open audit trail than the compiler thompson was demonstrating
06:12 butterthebuddha joined
06:12 <kadoban> I keep meaning to figure out if I should do a VM specifically for building things, or maybe some SElinux thing to really lock down compilers and built executables. But I never get around to it, too much work.
06:12 <sproingie> thing is, the distinction of "compiler" is starting to become blurry
06:13 <sproingie> so 20 years from now it might not be a deliberately backdoored compiler, just an exploit in an existing one that somehow manages to make itself persistent
06:14 <sproingie> in some ways, java already got itself there
06:14 slackman1 joined
06:15 <sproingie> (or sun's JVM did anyway by backdooring itself)
06:15 <simon> kadoban, same reason why people don't constantly get robbed in spite of how easy it is.
06:16 mzf joined
06:16 <* hackage> config-schema 0.3.1.0 - Schema definitions for the config-value package https://hackage.haskell.org/package/config-schema-0.3.1.0 (EricMertens)
06:17 <sshine> kadoban, an automated pick gun doesn't cost a lot off ebay and will grant you easy access to the apartments of all your neighbours. not a lot of them, I reckon, have digital warning systems or physical traps to guard the door. :-P
06:18 osa1 joined
06:18 SkyPatrol_ joined
06:18 <sproingie> robbery in the real world involves risk in a law-abiding society and a moral cost that taxes anyone not a complete sociopath
06:18 <kadoban> sshine: Ya, at some point we rely on people just being decent in general, but ... that seems to fall apart a lot on the internet where people can at least pretend they're anonymous
06:18 <sproingie> increasingly, neither are all that true when it comes to online explots
06:19 <sshine> kadoban, to me, the difference on the internet is the scale; *you* can rob your neighbours, but a hacker putting an exploit into a buildfile or a compiler can target a lot more people.
06:19 <kadoban> Exactly
06:19 <* hackage> machines-amazonka 0.6.2 - Machine transducers for Amazonka calls. https://hackage.haskell.org/package/machines-amazonka-0.6.2 (misandrist)
06:20 <* sshine> wants to know what Amazonka is.
06:20 <sproingie> case in point, i occasionally pirate movies and music. i use a reputable VPN provider and run minimal risk
06:20 <kadoban> Of course that requires a relatively high level of skill, and the rewards are usually probably not that great. People with the skill hopefully mostly have better things to do with their time.
06:20 <sproingie> yeah it's wrong, i don't do it that much, but it's so easy
06:20 <dmwit> sproingie, kadoban: Is this conversation still on-topic?
06:21 <sproingie> dmwit: yeah probably not :)
06:21 <kadoban> It's about the security of language tooling and libraries, especially haskell. Seems like it to me. But I think it's run its course anyway, I don't really have more to say.
06:21 SkyPatrol joined
06:21 tromp joined
06:21 <sproingie> yah it started with stack's "curl this url | sh" thing
06:22 <glguy> and then went off topic, anyway, looks like it's all done
06:22 insitu joined
06:22 <sproingie> i've noticed CS theory geeks do like talking about moral philosophy
06:23 takle joined
06:23 <sproingie> which has been the fashion for over a hundred years or so
06:24 <sshine> the problem with "curl ... | sh" to me is not so much executing unsigned scripts on the internet, since we can always choose to trust the source, but rather copy-pasting from the browser into the terminal (since it might contain more than what's visible at first), since we implicitly trust the website that provides the copy-paste as much as the domain on which the script resides.
06:24 <sproingie> sshine: ah yes, i've seen that very exploit
06:24 <sproingie> (done as a POC that is)
06:25 <sproingie> anyway, not to continue the offtopicness. i should probably hit the stack^Wsack
06:25 Mibaz joined
06:25 <kadoban> sshine: With an executable link you're also trusting the website. Is it any different? At least with the copy/paste you can probably see what you've pasted before you hit enter, if it looks very off.
06:25 <kadoban> Is this even off-topic? I don't understand why.
06:26 fizruk joined
06:26 <sproingie> i always think of topic as the thing one comes back to when someone pops in with a topical question/point
06:26 <dmwit> Tips for pirating safely are off-topic. Tips for securing your devops are much closer to on-topic.
06:27 <kadoban> Ah, ya gotcha
06:29 ChongLi joined
06:29 conal joined
06:30 dni joined
06:30 kamyar joined
06:31 plutoniix joined
06:31 <sshine> kadoban, you can't see what you've copy-pasted before you press enter if it secretly contains a linebreak. the moral is: don't copy-paste stuff from a website you don't trust into your terminal. :)
06:31 systadmin joined
06:31 <sproingie> you could paste into a notepad then inspect that
06:31 <sshine> yup.
06:31 <kadoban> sshine: Yeah, true. But in this case the alternative would be clicking an executable link, right?
06:32 <sproingie> but then again if there was malicious intent, they could just put that into the script itself
06:32 <sshine> kadoban, I don't understand.
06:32 plutoniix joined
06:32 JeanCarl1Machado joined
06:32 <opqdonut> my shell (zsh) seems to detect multiline pastes after some recent update
06:32 <sshine> sproingie, not if the source of the command isn't the same as the source of the script. there are lots of tutorials out there.
06:32 <sshine> opqdonut, that's neat.
06:32 <opqdonut> it doesn't run them until I actually press enter
06:32 <opqdonut> yeah I was impressed
06:32 <sshine> irssi has some support for it, too.
06:33 <kadoban> sshine: Well, if the website we're talking about wants to let you install things, you seem to be saying that "curl ... | sh" is bad beacuse of the copy/paste exploit. But isn't the alternative just as bad?
06:33 <sshine> kadoban, I don't understand the alternative.
06:33 <sshine> kadoban, but it isn't very important for me to understand.
06:33 <kadoban> sshine: Well, the obvious alternative to me would be linking to an executable file
06:34 <kadoban> Which, if anything, even more directly has the "can run arbitary code" problem
06:34 <sproingie> one imagines clipboard shenanigans would get noticed very quickly
06:34 jhrcek joined
06:34 <* sshine> would like a better clipboard.
06:35 <sproingie> wouldn't we all
06:35 fkurkowski joined
06:36 JeanCarloMachado joined
06:36 darjeeli1 joined
06:36 jer1 joined
06:39 <orion> If I define a ByteString on the top level of a file, is it guaranteed to only be constructed once?
06:39 connrs joined
06:40 Itkovian joined
06:41 <orhan89> i don't know, but when you want to install something you need to understand and trust what it is. The issue to me is more something like someone alter the file on the way, which in this case can be detected by using hash
06:42 <kadoban> orhan89: Where do you get the hash from?
06:42 takle joined
06:42 hurkan left
06:42 <opqdonut> tweeted by the dev :P
06:42 <opqdonut> printed in a newspaper?
06:42 <orhan89> kadoban: it should be mention on the website
06:42 <kadoban> orhan89: Right next to the link that you're not trusting?
06:42 jgt joined
06:43 acertain joined
06:43 alfredo joined
06:43 <orhan89> i thought it's not the link that we are not trusting, but the data/file itself
06:43 mattyw joined
06:44 JeanCarloMachado joined
06:44 igniting joined
06:44 <opqdonut> the link is data too, and if it's served by the same webserver...
06:44 yoneda joined
06:44 <kadoban> The only thing "here's the hash for this thing: X" ever does for me is if I'm downloading from a mirror or over HTTP (no s) or something
06:44 <opqdonut> integrity for large things is also nice
06:45 <opqdonut> at least back in the day when downloading large linux .iso files I had some that got bitflipped somehow
06:45 <kadoban> Yeah. Though TCP seems to do fine for that usually, I can't remember my last broken download personally.
06:45 connrs joined
06:45 <opqdonut> or a silently truncated download or something
06:45 <opqdonut> but yeah, I can't remember that happening lately
06:47 flatstuff joined
06:47 reliability joined
06:49 zero_byte joined
06:49 <Myrl-saki> let xs' = (\xs' -> fmap (\x -> x <$ xs) xs') <$> xs
06:49 <Myrl-saki> @pl (\xs' -> fmap (\x -> x <$ xs) xs') <$> xs
06:49 <lambdabot> fmap (<$ xs) <$> xs
06:49 Cale joined
06:49 ericsagnes joined
06:49 <reliability> hi. I'm trying to follow this blog article here: http://blog.sigfpe.com/2009/01/fast-incremental-regular-expression.html. I have a few questions concerning this: What module do I need to load/install in order to make use of UArray? And what does 'U.!' in '(U.!) g ((U.!) f state))' mean?
06:50 insitu joined
06:50 <kadoban> reliability: UArray should be from Data.Array.Unboxed
06:51 <reliability> ok. Now, concerning the U.!: ! is array access, if I'm not mistaken, but what is U?
06:51 <kadoban> reliability: U.! should be https://www.stackage.org/haddock/lts-8.14/array-0.5.1.1/Data-Array-IArray.html the (!) from here, under "Accessing arrays" it's indexing into the array
06:52 <kadoban> reliability: U is the module alias or whatever it's called from, near the top: import Data.Array.Unboxed as U
06:53 <jgt> can you do `import Data.Array.Unboxed as U`? I thought it had to be `import qualified Data.Array.Unboxed as U`
06:53 jer1 joined
06:53 dni joined
06:53 <reliability> Ah... so the dot ('.') in this case is module access and not function composition?
06:53 <jgt> reliability: yes
06:53 <kadoban> jgt: I think you can do it, I forget what it means. I remember I used to do it accidentally when I was new.
06:54 lispy joined
06:54 <quchen> reliability: The maximally confusing case is Prelude..
06:54 <quchen> :t (Prelude..)
06:54 <lambdabot> (b -> c) -> (a -> b) -> a -> c
06:54 <quchen> That’s »Prelude-dot-functioncomposition«.
06:55 <jgt> oh, yeah, you can rename modules but also keep unqualified names
06:55 <quchen> reliability: The second most maximally confusing case is
06:55 <quchen> > [False..]
06:55 <lambdabot> <hint>:1:9: error: parse error on input ‘]’
06:55 andyhuzhill joined
06:55 <quchen> But other than that, dots are fairly well-behaved.
06:55 <quchen> > [False ..]
06:55 xtreak joined
06:55 <lambdabot> [False,True]
06:56 <reliability> Well, still not as bad as c++ templates, I guess.
06:56 abroz joined
06:56 <jgt> :t [False ..]
06:56 <lambdabot> [Bool]
06:56 <quchen> Silly behaviour is usually a special case in Haskell.
06:56 Scip joined
06:57 <quchen> jgt: »list all the Bools«
06:57 <jgt> haha yeah
06:57 <quchen> jgt: There is one even sillier thing to list all of,
06:57 <jgt> a range of bools seems silly and golfish
06:57 <quchen> > [() ..]
06:57 <lambdabot> [()]
06:57 <reliability> hmm... but that essentially means that the parser cannot figure out of what type a dot is, unless it has figure out of what type the token just before is, right?
06:57 coot____ joined
06:58 <quchen> reliability: It has to do one token lookahead, yes.
06:58 ThomasLocke_ joined
06:58 <kadoban> reliability: I don't think it cares about types, per se, just if it could be a module name (is a capitalized WordOrTwo). Unless that's what you meant
06:59 <quchen> You don’t need a typechecker to decide this though, it’s all done based on syntax, i.e. »what the code looks like«.
06:59 takle joined
06:59 <quchen> Capital letter, then a dot: that’s a qualified name.
06:59 <reliability> Ah, that's why False.. fails.
06:59 <kadoban> Exactly
07:00 <quchen> reliability: That’s (.) from the False module.
07:00 <quchen> You can make it work by creating that module though!
07:00 <quchen> Not that you’d want to.
07:00 <ertes-w> helo
07:01 raichoo joined
07:01 <halogenandtoast> > [True ..]
07:01 <lambdabot> [True]
07:02 zariuq joined
07:02 freusque joined
07:04 juanpaucar joined
07:05 Hjulle joined
07:06 bennofs joined
07:06 louispan joined
07:07 takle joined
07:07 xtreak joined
07:13 BartAdv joined
07:14 takle joined
07:14 guiben joined
07:14 bvad joined
07:15 andyhuzhill joined
07:15 vlatkoB_ joined
07:15 jer1 joined
07:15 <Hjulle> Are there any generalisations for unzip for other types than []?
07:17 <Cale> Functor alone will let you do that -- or do you mean for stuff other than pairs?
07:17 <kadoban> Should be able to make one for ... Traversable I guess? Not sure it already exists though, or how concisely it can be done.
07:17 <kadoban> Oh, right
07:17 <Cale> zip is more interesting
07:17 _deepfire joined
07:17 <opqdonut> well there's sequenceA, which will flip two functors
07:17 <opqdonut> err applicatives
07:17 <Cale> er
07:18 <Cale> :t sequenceA
07:18 <lambdabot> (Applicative f, Traversable t) => t (f a) -> f (t a)
07:18 mfukar joined
07:18 <Cale> One is Applicative, the other Traversable
07:18 <opqdonut> that'd work if f a = (a,a), right?
07:18 <opqdonut> (yeah I really botched that summary)
07:19 Bhootrk_ joined
07:19 merijn joined
07:20 <dmwit> jgt: `as` means define an additional qualified name. `qualified` means don't define an unqualified name. They're completely orthogonal.
07:21 <opqdonut> > traverse (\(x,y) -> ZipList [x,y]) (ZipList [(1,2),(3,4)]) -- Hjulle?
07:21 <lambdabot> ZipList {getZipList = [ZipList {getZipList = [1,3]},ZipList {getZipList = [2...
07:22 Mortomes|Work joined
07:22 <dmwit> :t \xs -> (fst <$> xs, snd <$> xs)
07:22 <lambdabot> Functor f => f (a, b) -> (f a, f b)
07:24 Bhootrk_ joined
07:24 <opqdonut> yeah but that can be less efficient, right?
07:24 andyhuzhill1 joined
07:24 wagle joined
07:24 ixxie joined
07:25 <dmwit> Many Functors will admit a more efficient implementation.
07:26 <dmwit> But not, like, wildly more efficient. More GC-friendly, mostly.
07:27 <phadej> :t unzip
07:27 <lambdabot> [(a, b)] -> ([a], [b])
07:27 <phadej> :t munzip
07:27 <lambdabot> error:
07:27 <lambdabot> • Variable not in scope: munzip
07:27 <lambdabot> • Perhaps you meant one of these:
07:27 <phadej> :t Control.Monad.Zip.munzip
07:27 <lambdabot> Control.Monad.Zip.MonadZip m => m (a, b) -> (m a, m b)
07:28 oish joined
07:28 <merijn> Well, if you end up strictly consuming both lists it'll be pretty significantly faster to only traverse once
07:28 <dmwit> good suggestion list, thanks \bot
07:30 <dmwit> will it really be that significant? i'm skeptical
07:30 <merijn> dmwit: Depends on the size of the list
07:31 <dmwit> why?
07:31 <merijn> dmwit: Traversing linked lists is slow and you produce a lot of cache churn
07:31 thimoteus joined
07:32 twomix joined
07:32 <merijn> You have 1 indirection for the value and another for each link, now by traversing it twice you double that.
07:32 zv joined
07:32 <merijn> Plus, you keep the list alive longer, causing a larger RES set and slower GC
07:33 <dmwit> yes, the GC issue is clear (and I mentioned it above)
07:33 <merijn> Does that matter? Probably not if your lists are small. But if you care about speed a 2-3x slow down hurts a lot
07:33 SenpaiSilver joined
07:34 takle joined
07:34 Xanather joined
07:34 <jle`> yes, unzip is particularly useful for lazy linked lists
07:35 <jle`> but...are there any other types where it would be as useful
07:35 jer1 joined
07:35 <jle`> lists might be the only commonly used type that would actually benefit from a specialized unzip function
07:36 <jle`> instead of just fmap fst &&& fmap snd
07:36 Itkovian_ joined
07:36 davr0s joined
07:36 <merijn> jle`: Well, tbh, you'd still half the time of most other containers by doing it in one go
07:36 <jle`> oh i think merijn missed the first half of the conversation
07:37 davr0s joined
07:37 <jle`> merijn: do you think so?
07:37 <jle`> how would you write an optimized unzip for, say, Seq ?
07:37 <jle`> or Map k
07:37 <merijn> jle`: Traversing a vector twice is always slower than doing so once. It might be negligibly slower for a small vector, but for large ones
07:37 davr0s joined
07:38 <merijn> jle`: I was more thinking of vectors, because everything is arrays when you gotta go fast ;)
07:38 davr0s joined
07:38 <jle`> so you're saying there's a faster unzip for vectors than just \xs -> (fmap fst xs, fmap snd xs)
07:39 <jle`> (i'm not doubting you btw)
07:39 davr0s joined
07:40 <jle`> ( but i'd be interested in seeing one :) )
07:40 davr0s joined
07:40 <merijn> jle`: For pure I don't know (then it depends on when the vector is constructed. But assuming a strict unzip, i.e. "unzip :: Vector (a,b) -> (Vector a, Vector b)" where the vectors in the result are fully evaluated, then yes
07:41 ventonegro joined
07:43 acertain joined
07:43 <jle`> how would it be done?
07:44 <merijn> pre-allocate 2 vectors of the origin vector's size. Loop over the original, pull out content tuple, write out to the freshly allocated vectors. Repeat until done.
07:45 <jle`> for what it's worth, (fmap fst xs, fmap snd xs) is how the 'vector' package implements unzip for all its pure vector types
07:45 <jle`> http://hackage.haskell.org/package/vector-0.12.0.1/docs/src/Data-Vector-Generic.html#unzip
07:45 <merijn> Benefits: elements from first vector only indexed once (and sequentially, so nice for cache), similarly sequentially walking the destination vectors is nice for cache too
07:46 fizruk joined
07:46 <jle`> but your method does make sense
07:48 <merijn> I mean, you need really big vectors (or need to unzip *a lot*) to get a noticable benefits, but I'm working with *large* arrays a lot and it's interesting how small difference like that can make stuff slow :)
07:49 baldrick1 joined
07:50 <Mibaz> If anyone uses FRP, do you find yourself using the applicative/category interface or the arrow interface?
07:50 <Mibaz> One must be more convenient than the other
07:51 <merijn> Well, the entire Arrow has fallen out of favour. It's not quite as versatile/useful as many people hoped and all of it's functionality can be achieved by mixing several more useful classes
07:51 <merijn> Mibaz: Specifically: Applicative, Category, and Profunctor
07:52 takle joined
07:53 <Mibaz> merijn: ah, that's interesting. I saw some arrow criticism around but I didn't know it was so defunct
07:54 <jle`> most API's that used to be offered using Arrow is now offered using Applicative instead
07:54 connrs joined
07:54 <merijn> Mibaz: The problem is that for a lot of usecases the "arr" function which lifts an arbitrary function into it greatly restricts it's use.
07:54 <jle`> Applicative was introduced after Arrow, and it ended up being a much more natural and usable abstraction
07:55 <merijn> Mibaz: Since it requires you to be able to lift any function
07:55 <jle`> after Applicative became a dominant abstraction in the haskell ecosystem, Arrow really only serves niche purposes
07:55 dni joined
07:55 <merijn> Category takes care of the composition part of Arrows, Applicative takes care of most "applying things to each other", and Profunctor captures the pipeline aspect of arrows
07:56 <Mibaz> Well now I feel silly for spending 2 days learning arrows XD
07:56 <Mibaz> good to know anyway, I suppose.
07:56 <Mibaz> I need to learn Profunctor, then. Haven't covered it.
07:57 <merijn> You can think of a type 'p a' as a "thing that produces 'a's" which gives you a natural interpretation to "fmap :: (a -> b) -> f a -> f b" as something turning a "source of 'a'" into a "source of 'b'"
07:58 <merijn> Alternatively, you can take 'p a' as a "thing that consumes 'a's", which gives a natural interpretation to Contravariant's "contramap :: (a -> b) -> f b -> f a" as turning a "consumer of 'b'" into a "consumer of 'a'"
07:59 Yuras joined
07:59 jerbome joined
07:59 <merijn> Profunctor combines the two into a 'p a b' with a contravariant 'a' and a covariant 'b', so it's a "consumer of 'a', producer of 'b'" (i.e. a pipe) which you can adapt on both ends to consume/produce something else
07:59 jer1 joined
08:00 <merijn> And of course if 'p' is also a Category then we can even compose our "pipes"
08:00 <TommyC> Do the vectors for an inner product have to have the same length and if not, how would it work if one is longer than the other?
08:00 <merijn> And bam, suddenly you've got most of the funcionality you wanted of arrows
08:00 eklavya joined
08:00 dni joined
08:01 lavalike joined
08:01 <Mibaz> merijn: Wow, I can see how that's a better abstraction. That's really cool
08:01 jutaro joined
08:01 Hunter1 joined
08:01 Denthir joined
08:02 <Mibaz> Thanks for the explanation!
08:02 <jle`> TommyC: are you talking about, like, the mathematical vectors
08:02 <Mibaz> Applicative really made an impact when it surfaced, it seems.
08:02 <merijn> Mibaz: And then 'lens' comes along and makes Profunctors do a crazy amount of cool/useful things
08:02 <TommyC> jle`: Yes.
08:02 <jle`> TommyC: mathematical vectors don't have a "length", per se
08:02 dm3 joined
08:02 <jle`> they are members of a vector space, which have a dimensionality
08:03 <jle`> and a given vector space might also be imbued with an inner product, which is a closed binary operation in that vector space
08:03 acertain joined
08:03 <merijn> Mibaz: It did, newcomers seem to take for granted how everything "sensibly fits together", but you have to realise Applicatives weren't invented/discovered until 14 years after the first Haskell version
08:03 <jle`> TommyC: so an inner product between vectors of different spaces could be considered "ill-typed"
08:04 <jle`> it wouldn't be an inner product, it'd be something else
08:04 <TommyC> jle`: Ok I see. Thank you.
08:04 <jle`> no problem
08:06 <merijn> Mibaz: Actually, maybe longer. I coulda sworn the Applicative paper was from 2004, but wikipedia tells me it's from 2008
08:06 thc202 joined
08:07 Beetny joined
08:07 acidjnk22 joined
08:07 Itkovian joined
08:07 nickolay_ joined
08:07 ThomasLocke joined
08:07 <Mibaz> merijn: Wow, it took a while. Applicative seems simple to the ignorant (me) but I'm sure there's more to it for it to have taken that long to dream up
08:08 <merijn> Mibaz: Well, it's simple if you have some explain it to you, but someone had to invent it from thin air/steal it from the mathematicians
08:08 <jle`> i mean, look how long it took for us to invent 0
08:08 romank joined
08:08 <jle`> think 14 years is long? try 1400 years
08:09 takle joined
08:09 <merijn> Mibaz: Interesting side note: Haskell didn't have Monads *nor* IO type at first either :p
08:09 <Mibaz> lol good point jle`
08:09 <Mibaz> and forgive me I just realized I've been spelling your tag jle'
08:09 <quchen> jle`: Most languages don’t even have sums. At that pace, having zero takes another 1400 years
08:09 <jle`> it's ok i forgive you
08:10 reliability joined
08:10 <Mibaz> merijn: how did they... You know... Get program results?
08:10 <quchen> Mibaz: A Haskell program was a function String -> String.
08:10 <merijn> Mibaz: You had "main :: [Inputs] -> [Outputs]" and treated stdin as a lazy list of input and stdout as a lazy list of output :)
08:10 simukis_ joined
08:11 <merijn> The 1.2 report specifies: "type Dialogue = [Response] -> [Reques]"
08:12 <Mibaz> aah, got it. Enough to get the job done
08:12 <merijn> Where request are things like "ReadFile String" "AppendFile String String", etc.
08:12 <merijn> And "Response" was things like "Success" or "Str String"
08:12 dni joined
08:13 quchen_ joined
08:13 <jle`> even Functor came after Monad, didn't it?
08:13 <merijn> Mibaz: The Wadler paper "Monads for Functional Progamming" was published in 1995, 5 years after the first Haskell version :)
08:13 quchen_ joined
08:13 <merijn> jle`: not afaik, but I don't know the exact history
08:14 <merijn> Functor's where in 1.3, not sure if Monad was
08:15 <merijn> jle`: Monadic IO was in 1.3 too, so seems they were added to the report at the same time
08:15 <Mibaz> Haskell without monads... As hard as they were to wrap my head around, I think I dread a world without them more
08:15 <merijn> The main reason Functor wasn't a superclass of Monad is because the committee thought it'd be a hassle to force people to write a functor instance if they only wanted the Monad interface...
08:15 <merijn> Bit of a historical booboo...
08:15 simukis_ joined
08:16 <Athas> They really wanted to avoid success at all costs back then.
08:16 acertain joined
08:16 <Athas> Haskell has definitely become more awkward for teaching lately, that's for sure.
08:17 <merijn> meh, I'm not sure I agree
08:17 <Mibaz> merijn: isn't the typeclass hierarchy messed up in a few different ways? Will they eventually push a breaking update?
08:17 <merijn> I think it's been neither better nor worse
08:17 <merijn> Mibaz: The Functor -> Applicative -> Monad thing was already pushed through. The rest is...no consensus
08:18 <Athas> It was always a little awkward for completely new programmers, due to the typeclassery. The new generic types in the Prelude don't help.
08:18 yogsototh joined
08:18 <Athas> Although I only use it for teaching master's students, so they can accept the pain.
08:18 <merijn> People argue about classes like Pointed/Apply, but many don't like them. And the Num hierarchy...is not particularly nice, but it's unclear how to improve it
08:18 <Mibaz> merijn: ah, got it.
08:18 juanpaucar joined
08:18 <Athas> merijn: have you seen SubHask or whatever it's called?
08:18 <merijn> Athas: Yeah, I agree the noisy types aren't great for teaching. But not something particularly hard
08:18 <Athas> It's a greenfield re-implementation of the type class hierarchy.
08:18 <merijn> Athas: No?
08:18 jer1 joined
08:19 <Athas> https://github.com/mikeizbicki/subhask
08:19 acertain joined
08:19 <Athas> But I've only looked at it myself, and I find it hard to obtain a sense of usability from long reams of classes and instances.
08:19 muesli4 joined
08:20 takuan joined
08:20 <Athas> They really dial up the GHC extension meter, which I'm not unconditionally a fan of.
08:20 <merijn> bleh...I really wish cabal had a way to duplicate targets so I wouldn't have to duplicate a section to run tests both threaded and unthreaded
08:20 Gloomy joined
08:21 <Athas> merijn: use hpack!
08:21 tromp joined
08:21 <Mibaz> Thanks for the info guys
08:21 <Athas> It can duplicate targets, then override some fields.
08:21 <merijn> Athas: I don't want to learn new tools either >.>
08:21 iomonad joined
08:21 <Athas> I felt the same, but I managed to convert my project from cabal to hpack in less than an hour. It helps that stack supports it transparently.
08:22 <merijn> Especially not one based on YAML
08:22 systadmin joined
08:22 <Athas> For this one use case it actually helps.
08:22 <Athas> YAML supports exactly the kinds of reference/anchor functionality that allows you to reduce duplication.
08:22 <merijn> Athas: Yeah, but not soo much that I feel it's worth it :)
08:23 <merijn> Since it's only one target
08:23 <ertes-w> Athas: i disagree about that: "Haskell has definitely become more awkward for teaching lately, that's for sure."
08:23 <ertes-w> Athas: as someone who occasionally teaches haskell to small groups
08:24 <ertes-w> it has not become easier either… nothing really changed as part of AMP/FTP
08:25 <Athas> ertes-w: they are not confused by the more generic types?
08:25 <Athas> Maybe it's different for small groups. I only have lecture/classroom experience.
08:25 Elhamer joined
08:25 <ertes-w> Athas: no, you just need to explain how to read the types
08:26 slacker joined
08:26 Wizek joined
08:26 <ertes-w> Athas: these days i tend to show them the true type of (+) early on, so i can talk about it, without going too deep into what type classes *really* are: "for now (Num a) means that we can use (+) on values of type 'a'"
08:27 <ertes-w> people get used to reading these types rather quickly… it's not really that complicated anyway
08:27 Elhamer_ joined
08:27 ragepandemic joined
08:28 kamyar joined
08:28 <ertes-w> what is the canonical sendmail package? i need to send mails via sendmail
08:29 marr joined
08:29 <merijn> ertes-w: Can't you just call out to the commandline mail program?
08:29 jer1 joined
08:29 tomphp joined
08:30 systadmin joined
08:31 harfangk joined
08:32 reliability joined
08:33 [n1x]_ joined
08:36 harfangk joined
08:37 lep-delete joined
08:37 im0nde joined
08:40 Yuras joined
08:40 bjz joined
08:40 iomonad joined
08:41 acertain joined
08:43 <ertes-w> merijn: sure, i just thought that a package might help prevent formatting bugs =)
08:43 leat joined
08:44 <ertes-w> like when sending headers
08:44 rickygee joined
08:46 abroz joined
08:48 butterthebuddha joined
08:49 kamyar joined
08:51 bjz joined
08:52 tomphp joined
08:54 selthas joined
08:55 WhereIsMySpoon joined
08:56 jer1 joined
08:59 xtreak joined
09:00 JagaJaga joined
09:00 <merijn> How do I make Haddock add a kind signature to a newtype?
09:00 nickager joined
09:01 xall joined
09:02 mjora7 joined
09:02 jerbome joined
09:02 paolino joined
09:02 xall joined
09:02 oish joined
09:03 WhereIsMySpoon left
09:03 takle joined
09:05 xtreak joined
09:05 locallycompact joined
09:07 selthas joined
09:11 xall_ joined
09:11 ub joined
09:11 benl23 joined
09:12 TheFuzzball joined
09:12 xtreak joined
09:12 gmcabrita joined
09:12 Elhamer__ joined
09:12 danvet joined
09:13 <[exa]> Hm guys. Is there any good article about monad/comonad combinations?
09:13 <merijn> Is there a way to figure out which haddock cabal is calling?
09:13 <[exa]> This guy writes about stuff that can be basically imagined as a changeable state http://www.haskellforall.com/2013/02/you-could-have-invented-comonads.html
09:13 jerbome joined
09:13 <[exa]> ...and invents the method syntax, like co-do
09:13 kamyar joined
09:14 <cocreature> merijn: increase the verbose level until it tells you :)
09:14 cloudhead joined
09:14 mmn80 joined
09:14 <merijn> cocreature: oh, turns out I was just mistaking some feature to be sensible...
09:14 jer1 joined
09:15 <[exa]> are there any good (style/syntax) examples for e.g. having a comonad as a state object StateM and modifying it easily?
09:15 revprez_cst joined
09:15 <[exa]> like, I can hack it together, but it's ugly.
09:15 <merijn> cocreature: there's a OPTIONS_HADDOCK pragma, but it only lets you specify a small set of hardcoded options, rather than any commandline option
09:15 <merijn> Next question: can I somehow tell cabal which haddock options to use?
09:15 <cocreature> merijn: that seems silly
09:15 <cocreature> merijn: there is --haddock-options but it might suffer from the same problem?
09:16 Kreest__ joined
09:17 spacecadetbrown joined
09:17 <merijn> cocreature: No that works, but I dunno if I can specify those in my cabal file somewhere?
09:17 butterthebuddha joined
09:18 pie_ joined
09:18 uiop joined
09:18 <cocreature> merijn: not sure if that’s possible
09:18 <angerman> merijn: please don't resort to build-type: Custom.
09:18 <merijn> ugh, the inability to selectively qualify names when linking is annoying with cabal :\
09:18 <cocreature> angerman: you can take build-type: Custom from my cold dead hands :P
09:19 noam__ joined
09:19 <angerman> cocreature: https://medium.com/@zw3rk/the-haskell-cabal-and-cross-compilation-e9885fd5e2f
09:19 <angerman> cocreature: just saying...
09:19 <* angerman> wonders how the reception of that will be today.
09:20 <cocreature> angerman: I know why you don’t like it but I just have no idea how I would get llvm-hs working without a custom Setup.hs
09:20 <angerman> cocreature: what's the exact deficiency in cabal you work around?
09:20 <cocreature> angerman: we query llvm-config in Setup.hs to figure out which flags we need to pass to the c++ compiler and things like that
09:20 TheFuzzball joined
09:21 <angerman> cocreature: and well, yes, llvm-hs is fair game. I don't expect that package to be cross compiled any time soon :)
09:21 <cocreature> and which system libraries we need to link against
09:21 <angerman> cocreature: that sounds like you want a configure script :) Not that that's much better :)
09:22 <merijn> I basically have a module that's exporting the same names, but exception throwing, as alternative to the non-throwing API. So I want to link to the throwing alternative in the haddock docs, but sadly a link to "Foo.Bar.foo" in the documentation of "foo" renders the same as a link to 'foo'
09:22 dni joined
09:22 yellowj joined
09:22 <merijn> I figured I could use "haddock --qual=local" but that also fully qualifies things like "Prelude.Eq" which is annoying
09:22 <merijn> So if I want to render a fake fully qualified link I end up resorting to this horror:
09:23 <merijn> @"Foo.Bar".@'Foo.Bar.foo'
09:23 <lambdabot> Unknown command, try @list
09:24 Gurkenglas joined
09:24 <cocreature> angerman: I hate autoconf even more than Setup.hs :)
09:25 <merijn> Everyone hates autoconf
09:25 <merijn> Piece of trash
09:25 <angerman> cocreature: terrible all around.
09:25 filterfish joined
09:25 <angerman> did I mention I'm going around and sending PRs to projects using configure scripts? Just so they update the ancient config.{guess,sub}?
09:26 ccomb joined
09:26 <merijn> ok, at least I got what I wanted in the resulting docs now, except for one thing
09:26 <angerman> like libffi, autoconf hasn't had an update in years. And the thread on the ML is just saddening.
09:26 <merijn> Still haven't figured out how to make haddock render a kind signature where I want it
09:28 <merijn> Right now it's rendering the type as "data BroadcastChan d a" in the docs, but that leaves it unclear that the 'd' parameter has kind Direction, rather than *
09:28 jutaro joined
09:29 tomphp joined
09:31 juanpaucar joined
09:33 nohTo joined
09:34 xall joined
09:38 mstruebing joined
09:38 bdeferme joined
09:40 TheFuzzball joined
09:40 jer1 joined
09:42 xtreak joined
09:42 romank joined
09:42 fotonzade joined
09:44 rcat joined
09:45 juanpaucar joined
09:46 LKoen joined
09:47 Elhamer joined
09:49 ziyourenxiang joined
09:49 Gabemo joined
09:50 jgt1 joined
09:52 <ph88^> anyone know how i can get my conduit exception handler to work ? https://bpaste.net/show/73ee15357694
09:52 ericsagnes joined
09:52 tomphp joined
09:53 <ph88^> i fixed the first error btw, it's about error 2 and 3
09:53 fendor joined
09:55 ArchaicLord joined
09:55 alx741_ joined
09:58 xall_ joined
09:59 Elhamer_ joined
09:59 jer1 joined
09:59 Denthir joined
10:00 gawen joined
10:01 phyrex1an joined
10:01 Aruro joined
10:02 TheFuzzball joined
10:02 Kuros` joined
10:03 takle joined
10:03 nohTo left
10:03 nohTo joined
10:05 <Gurkenglas> ph88^, tryC (CB.sourceFile input) returns an Either e0 (), if you want to explicitly discard e0, you can use void (tryC $ CB.sourceFile input)
10:07 <Geekingfrog> ph88^: The third error seems to be that sinkFile requires a bytestring, but you're feeding it with your handler, which has en Either e ByteString type
10:07 xtreak joined
10:08 <Gurkenglas> (Oh, the third error indicates that you want that e0 sent into the first type parameter of ConduitM? Lemme rethink then)
10:08 sigmundv joined
10:08 <osa1> we don't have a flag for making non-exhaustive patterns warnings errors, right?
10:09 sigmundv_ joined
10:10 cschneid_ joined
10:11 <Gurkenglas> -Werror would turn all warnings into errors
10:11 <Geekingfrog> osa1: There is a flag to make all warnings errors, and a flag to activate the non-exhaustive pattern warnings
10:11 Hunter1 joined
10:12 <* hackage> validationt 0.1.0.0 - Straightforward validation monad. Convenient solution for validating web forms and APIs. https://hackage.haskell.org/package/validationt-0.1.0.0 (typeable)
10:12 <osa1> what I want is: keep warnings as warnings except non-exhaustive pattern warnings, those need to be errors
10:13 <Aruro> Archlinux is dropping i686 by the end of the year. Thats nice..
10:14 <Gurkenglas> ph88^, what you'd need is "ConduitM i o m (Either e ()) -> ConduitM i (Either e o) m ()", to apply to the left side of .|, right? (And that result type is equal to Conduit i m o)
10:14 xall joined
10:14 mmhat joined
10:15 <Gurkenglas> *"equal to Conduit i m (Either e o)", of course
10:17 <* hackage> validationt 0.1.0.1 - Straightforward validation monad. Convenient solution for validating web forms and APIs. https://hackage.haskell.org/package/validationt-0.1.0.1 (typeable)
10:18 reliability joined
10:18 xall joined
10:18 MolluskEmpire joined
10:18 mkoenig joined
10:20 beanbagula joined
10:21 filterfish joined
10:21 kamyar joined
10:22 tromp joined
10:23 quobo joined
10:23 <ph88^> Gurkenglas left ?
10:23 augur joined
10:23 dni joined
10:24 Wizek_ joined
10:25 jer1 joined
10:25 Bhootrk_ joined
10:25 nighty-- joined
10:25 romank joined
10:26 filterfish joined
10:26 yogsototh joined
10:28 Yuras joined
10:28 petermw joined
10:28 orhan89 joined
10:28 <erisco> hrm, Ratio doesn't have a modulo operation
10:29 <ph88^> i updated my paste with the question to cut out some noise https://bpaste.net/show/8fe8fb0fb3a8
10:30 <merijn> ertes-w: What's modulo supposed to do for a Ratio?
10:30 <merijn> eh
10:30 <merijn> s/ertes-w/erisco
10:32 <quchen_> osa1: GHC 8.2 allows you to make specific warnings errors, -Werror-unused-do-binds for example
10:32 <erisco> merijn, the remainder
10:32 Kuros` joined
10:32 inad922 joined
10:32 angelos joined
10:32 <osa1> quchen_: wow, awesome. I was considering creating a ticket for this :)
10:33 <merijn> erisco: How can a Ratio have a remainder?
10:33 <quchen_> osa1: https://downloads.haskell.org/~ghc/8.2.1-rc1/docs/html/users_guide/flags.html#warnings
10:33 <erisco> merijn, I suppose made a bit strange because I am using integer multiples
10:34 <quchen_> osa1: -Wwarn= and -Werror= syntax
10:34 yogsototh left
10:34 <osa1> quchen_: thanks
10:35 leat joined
10:36 <erisco> merijn, but not that strange if you just take intuition from repeated subtraction
10:36 <erisco> with a tweak for negatives
10:36 <erisco> since you can only subtract something an integral number of times :)
10:36 <merijn> erisco: Say who?
10:36 jedws joined
10:36 joco42_ joined
10:36 <merijn> What's wrong with subtracing a fractional number of times?
10:37 <erisco> because it makes as much sense as a list with fractional length
10:38 <quchen_> Sure it makes sense, but it won’t give you a useful modulo division.
10:38 Wizek__ joined
10:38 <erisco> what?
10:38 <quchen_> erisco’s rational-modulo reduces to normal modulo if only whole fractions are defined.
10:39 <quchen_> fractional-multiples-of-fractions doesn’t even give you something well-defined.
10:39 <Taneb> erisco, if you need mod on a Ratio there's Data.Fixed.mod'
10:39 <merijn> quchen_: Honestly I find the concept of modulo on rationals to not really sensible anyway
10:39 <Taneb> (it's in the wrong place, but it does what I think you want here)
10:40 <nohTo> Yeah the modulo on Rational would always give back 0 or the first argument
10:40 <quchen_> Each fraction can be written as n*x + r, and to get the r out you use modulo. That’s well-defined, in particular it makes »mod 1« useful to get the fractional part of a number.
10:40 <erisco> no, because that is defiend on Real Taneb
10:40 cretiq joined
10:40 <Taneb> erisco, Ratios are Real
10:40 hjulle joined
10:41 <erisco> ehh I don't know what conversion goes on under the hood... not confident in it
10:41 sabali joined
10:41 <Taneb> None at all
10:42 xall_ joined
10:42 <Taneb> Real is a typeclass, there is a Real instance for Integral a => Ratio a
10:42 <erisco> that doesn't rule out conversions
10:42 Elhamer joined
10:42 fnurglewitz joined
10:43 sabali left
10:43 jer1 joined
10:43 <erisco> minimal complete definition is toRational :: a -> Rational... makes no sense to me
10:44 twanvl joined
10:45 <cocreature> the fact that we define Real as the things that can be converted to Rational is really weird
10:45 <hjulle> Why does "hoist.hoist$generalize" give an error, while "hoist$hoist$generalize" works fine? (functions from https://hackage.haskell.org/package/mmorph-1.0.9/docs/Control-Monad-Morph.html)
10:46 <quchen_> cocreature: The error is on your side, trying to reason about the numeric hierarchy
10:46 <erisco> it could be the function I want but it is so strange I don't want to touch it with a 30 foot pole
10:46 <Taneb> > (4 % 3) `mod'` (1 % 2)
10:46 <lambdabot> 1 % 3
10:47 <ertes-w> @let gmod x n | x >= n = gmod (x - n) n | x < 0 = gmod (x + n) n | otherwise = x
10:47 <lambdabot> Defined.
10:47 <ertes-w> merijn: ^ (semantically)
10:47 <erisco> I have to go through the source and make sure there isn't some conversion to Float or Double tucked in there
10:47 <erisco> which I don't want to do
10:47 <* hackage> panpipe 0.2.0.0 - Pandoc filter to execute code blocks https://hackage.haskell.org/package/panpipe-0.2.0.0 (chriswarbo)
10:47 <erisco> way easier to just define the operation I want
10:47 <ertes-w> > gmod 3 (5/2) :: Rational
10:47 <lambdabot> 1 % 2
10:48 petermw joined
10:48 <ertes-w> merijn: modulo works for anything that is a totally ordered group
10:49 juanpaucar joined
10:50 xall joined
10:53 jbalint_ joined
10:53 fendor joined
10:54 Sh4rPEYE joined
10:54 xall joined
10:55 Alex______ joined
10:56 <Sh4rPEYE> Hey. I'm doing the "Monad challenges" from mightybyte and I have trouble setting their MCPrelude up in VSCode. The thing is - the code works (with their custom functions from MCPrelude), but VSCode keeps telling me that it 'Failed to load interface' and refuses to typecheck or autocomplete anything.
10:56 <Sh4rPEYE> http://mightybyte.github.io/monad-challenges/
10:57 Denthir joined
10:57 sw1nn joined
10:57 ziocroc joined
10:58 zariuq joined
10:58 takle_ joined
10:58 xtreak joined
10:58 netheranthem joined
11:00 nh2 joined
11:00 orhan89 joined
11:01 svisz joined
11:01 <quchen_> Sh4rPEYE: Failed to load interface?
11:01 <quchen_> Is that the full error?
11:02 jerbome joined
11:02 Snircle joined
11:02 <* hackage> panhandle 0.2.0.0 - Pandoc filter to unwrap nested blocks https://hackage.haskell.org/package/panhandle-0.2.0.0 (chriswarbo)
11:02 tomphp joined
11:03 tomphp joined
11:03 xall joined
11:04 <erisco> > gmod -2 -3 :: Int
11:04 <lambdabot> error:
11:04 <lambdabot> • Couldn't match expected type ‘Int’
11:04 <lambdabot> with actual type ‘t0 -> t0 -> t0’
11:04 <erisco> > gmod (-2) (-3) :: Int
11:04 <lambdabot> mueval-core: Time limit exceeded
11:05 <erisco> I wrote this version instead http://lpaste.net/355622
11:05 jer1 joined
11:05 tomphp joined
11:05 <hjulle> [hoist.hoist] It has the type: hoist :: (Monad m, MFunctor t) => (forall a. m a -> n a) -> t m b -> t n b. I'm guessing that the type checker has some trouble with the forall?
11:06 <merijn> hjulle: how so?
11:07 <hjulle> <hjulle> Why does "hoist.hoist$generalize" give an error, while "hoist$hoist$generalize" works fine? (functions from https://hackage.haskell.org/package/mmorph-1.0.9/docs/Control-Monad-Morph.html)
11:07 <merijn> hjulle: oh, I missed that
11:07 <merijn> hjulle: Ok, so that forall uses RankN types which aren't inferrable.
11:07 owickstrom joined
11:07 kamyar joined
11:07 <merijn> hjulle: So GHC can't infer the type of "hoist.hoist"
11:08 <merijn> hjulle: $ works because there's a hack in the typechecker specifically for RankN types so that $ works
11:08 <merijn> hjulle: You could make it work by writing "let foo :: ...; foo = hoist . hoist in ..." if you write an explicit type for foo
11:08 <hjulle> But i assume that it is impossible to make the same hack for (.)?
11:09 <merijn> hjulle: I'm not sure if it's impossible, but it's certainly undesirable. Even the $ is kinda undesirable, tbh
11:09 <* hackage> validationt 0.2.0.0 - Straightforward validation monad. Convenient solution for validating web forms and APIs. https://hackage.haskell.org/package/validationt-0.2.0.0 (typeable)
11:09 <hjulle> (Without first making RankN types inferrible)
11:09 <hjulle> What bad stuff does the $ hack cause?
11:09 <merijn> hjulle: When I said "RankN isn't inferrable" I didn't mean "GHC can't do it", I meant "It's theoretically impossible"
11:10 <hjulle> Aha, oh.
11:10 <merijn> hjulle: The special case of Rank2 can, in theory, be inferred, but the implementation is horrifically difficult.
11:10 <merijn> Anything higher than Rank2 is impossible
11:11 xall joined
11:11 <merijn> hjulle: It's not so much that it causes bad stuff for programmers, but more of a "no one really knows whether this hack somehow subtly breaks the underlying type theory"
11:11 ExcelTronic joined
11:11 <hjulle> That sounds serious
11:12 mschristiansen joined
11:12 <phadej> also you want inference to be predicatable
11:12 <phadej> what can be inferred and how
11:12 <phadej> and higher order inference would "indistinguishable from magic"
11:13 <hjulle> merijn: Can I make a generic hoist2 f = hoist (hoist f) by specifying explicit generic types for the different hoists?
11:13 augur joined
11:14 <merijn> hjulle: Yes
11:14 <merijn> at least, that should be possible, afaik
11:15 LAZAR joined
11:15 henriksod joined
11:15 jaspervdj joined
11:16 <torstein> Assume that I have two strict Maps. Is there a way to get the triple (inBoth, justA, justB) faster than doing a union and two differences?
11:17 <LAZAR> How would I handle JSON fields in Aeson which can be multiple types? Like age = 1, age = "1"
11:18 <torstein> * i meant an intersection and two differences
11:18 <quchen_> LAZAR: Use the Alternative instance of the JSON parser. age <- parseNumber <|> parseString
11:19 `Guest00000 joined
11:20 <quchen_> LAZAR: In other words, write a parser for each »form«, and then <|> them together.
11:22 <phadej> torstein: i don't think so. the time is probably dominated by building new spines for the resulting maps
11:22 jedws joined
11:22 <phadej> as you cannot share much there
11:23 <phadej> so well implemented classify :: [(k, a)] -> [(k, a)] -> ([(k, a)], [(k, a)], [(k, a)]) for ascList's might be about as fast
11:23 cpennington joined
11:24 SkyPatrol joined
11:25 <Alex______> If you want to compare two lists, and you want to output an error message if they are not equal. And you don't care about the return value if they ARE equal. What would an appropriate return value be? Do I have to classify one?
11:25 jer1 joined
11:25 <Alex______> For example: checkLists :: [a] -> [a] -> (return value?)
11:25 <nohTo> Alex: ()
11:26 <Akii> Bool? ^^
11:26 <ph88^> hey guys, here with conduit exception handling https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#g:7 i noticed that catchC let's it be the same result r but tryC changes r to (Either e r) how can i handle r do i need to do runConduit first ?
11:27 <nohTo> () has exactly two values, undefined and () which seems to be perfect for this job
11:27 louispan joined
11:27 <nohTo> But now I'm really curious why you prefer an error over False :-D
11:28 <ph88^> are you talking to me ?
11:28 <phadej> to Alex______
11:29 <muesli4> An all-quantified type is probably even better, since it only has one value: undefined.
11:29 locallycompact joined
11:30 <muesli4> *Correction: Generically constructible value. ;)
11:30 ziyourenxiang joined
11:30 sepp2k joined
11:33 jer1 joined
11:33 im0nde joined
11:35 kritzcreek joined
11:35 xall joined
11:36 locallycompact joined
11:37 locallycompact joined
11:37 Levex joined
11:38 locallycompact joined
11:40 locallycompact joined
11:41 tj_ joined
11:42 locallycompact joined
11:44 filterfish joined
11:44 takle joined
11:46 sgronblo joined
11:47 jer1 joined
11:49 dni joined
11:49 Yuras joined
11:50 xall_ joined
11:50 <quchen> Reminds me of GHC’s »the« function.
11:51 <quchen> https://hackage.haskell.org/package/base-4.9.1.0/docs/GHC-Exts.html#v:the
11:51 JeanCarloMachado joined
11:51 JeanCarl1Machado joined
11:53 umren joined
11:53 juanpaucar joined
11:54 CoolerZ joined
11:54 <CoolerZ> is there something above a CLR parsing table?
11:55 xall joined
11:56 <CoolerZ> CLR(1) isn't even used LALR(1) is used due to memory constraints
11:56 kamyar joined
11:57 <osa1> what was the syntax to load a test-suite into stack repl?
11:57 selthas joined
11:57 mohsen_1 joined
11:58 cretiq joined
11:58 Gloomy joined
11:59 fortruce joined
12:01 anemecek joined
12:02 mschristiansen joined
12:04 <* hackage> ngx-export 0.3.0.0 - Helper module for Nginx haskell module https://hackage.haskell.org/package/ngx-export-0.3.0.0 (lyokha)
12:06 Elhamer_ joined
12:06 jer1 joined
12:08 nohTo joined
12:08 Alex_______ joined
12:09 Levex joined
12:09 tromp joined
12:10 xtreak joined
12:10 cschneid_ joined
12:11 Elhamer joined
12:11 jerbome joined
12:11 oish joined
12:12 <Benzi-Junior> hey, I am working on a webpage using happstack and blaze using the happstack crashcourse as a guide but I can't figure out where in the process you are supposed to fit IO operations e.g. read in a file add a html header to it and use the result as a response
12:12 <quchen> angerman: Oh, you’re the author of cabal-doctest
12:12 <quchen> Thanks!
12:13 <quchen> angerman: I wonder how this translates to Stack though, have you tried to run »stack doctest«
12:13 acertain joined
12:13 <angerman> quchen: no I have not.
12:13 <angerman> quchen: also not, this is not new-doctest :( And it requires a recent doctest build, which hasn't been released yet :-(
12:14 mohsen_1 joined
12:14 <angerman> quchen: and as phadej correctly pointed out, it does not solve all doctest requirements projects might have, so some additional work is needed.
12:14 <quchen> Pity! Running doctest right now almost requires a makefile
12:15 mohsen_1 joined
12:15 <angerman> quchen: basically waiting for sol to merge https://github.com/sol/doctest/pull/159 and provide a release :(
12:16 guardianx joined
12:17 xall_ joined
12:17 ziyourenxiang joined
12:17 <angerman> quchen: based on https://github.com/sol/doctest/issues/155#issuecomment-297595210, I hoped that the time from PR to release would be shorter. In all fairness though, my own PR was rejected on quality grounds by sol, and he took it upon himself to write the PR #159.
12:17 jgt1 joined
12:18 <quchen> Polish your PRs a bit more then, eh? :-s
12:18 nohTo joined
12:19 kamyar joined
12:20 <angerman> quchen: well, I'm content with his PR, it subsumes mine and improves on it substantially. I just wish, it had already been merged and a new doctest version released.
12:21 asm_ joined
12:21 <angerman> quchen: and before you wonder who wrote the cross compilation on raspberry pi posts... that's also me.
12:22 <quchen> Yyyyouu!
12:22 <quchen> I gave up on the Raspi a couple of years ago, but I might come back to it eventually :-)
12:22 <EvanR> closely watching that
12:22 <angerman> quchen: let me blow you mind... cabald-dcotest AND the cross compilation posts are related....
12:23 <quchen> This just in, Doctest only works on ARM now
12:24 <angerman> lol... no :)
12:24 <angerman> And well, while it's rpi focused right now, I'll come around to android and ios later (writing posts).
12:24 <angerman> after all it's mostly the same.
12:24 <Alex_______> Can you not end a line with: error "adsf" ? It always gives me a parse error on the next line
12:25 <EvanR> lpaste your particular code
12:25 cpup joined
12:25 oisdk joined
12:25 <Alex_______> If (a == b) then error "hello"
12:25 <angerman> EvanR, quchen: would you be interested in binary distributions of, say the Raspbian Jessie SDK (including arm-linux-gnueabihf-ghc)?
12:26 <liste> Alex_______: there's no else
12:26 <liste> > if 0 == 0 then error "wow!" else ()
12:26 <EvanR> you cant end an if without an else
12:26 <lambdabot> *Exception: wow!
12:26 acertain joined
12:26 <Alex_______> Oh okay, haskell noob here. Thanks
12:26 <angerman> > (when (0 == 0)) error "wow!"
12:27 <lambdabot> *Exception: wow!
12:27 <EvanR> angerman: probably. i have a 32G SD card coming in the mail right now
12:27 <quchen> angerman: Right now – not really. I have so many things to do, and Raspi would just be a hobby thing for dead time. And my dead time already has to be distributed between Factorio and Haskell.
12:27 <EvanR> and i was worried about the work necessary to get all this haskell to work
12:27 leat joined
12:27 jer1 joined
12:27 <EvanR> factorio, very important
12:28 <EvanR> i know a new version is out ;)
12:28 <angerman> EvanR: ha. It's just following those two posts :D I'm thinking about preparing bindists after next week. As I want to focus on TH next week, and that would need to be included in the bindist :)
12:28 <mschristiansen> Hey, I would appreciate a better way to get GHC on RPI
12:28 <mschristiansen> currently compiling with GHC 7.6
12:29 <mschristiansen> Tried setting up a cross-compiler, but couldn't get everything working.
12:29 <EvanR> angerman: will it include cabal installed everything in hackage? ;)
12:29 cdepillabout joined
12:29 <EvanR> prior
12:29 <mschristiansen> A cross-compilation toolchain in a docker image would also be great!
12:29 <sbrg> mschristiansen: there's an article on /r/haskell about rpi cross-compilation
12:29 <sbrg> worth a look
12:29 <angerman> sbrg: yea, I wrote that :D
12:30 <sbrg> angerman: sweet! thanks!
12:30 <angerman> EvanR: no, it will not.
12:30 <* sbrg> is also going to be running haskell on rpi
12:30 <sbrg> so that was some good timing :)
12:30 <hvr> quchen: "dead time" sounds so dark
12:30 <angerman> mschristiansen: why would you need a docker image?
12:30 <cdepillabout> I'm seeing intermittent segfaults when using doctest (being called from stack). Has anyone else seen something like this? I'm not sure how to go about figuring out why it is going on.
12:30 <quchen> hvr: Yes, it’s usually dark when I write Haskell or have robot armies build factories to scale the factory so I have more time to write Haskell.
12:31 <angerman> quchen: factories? java much?
12:31 <sbrg> FactoryFactoryFactoryProducerFactory
12:31 <EvanR> except in factorio, thats literally what it is
12:31 <quchen> angerman: I have factory factories, but no factory factory factories, so it’s not real Java.
12:32 <sbrg> factorio is great
12:32 <sbrg> spent way too many hours on that game
12:32 mattyw joined
12:32 bjz joined
12:33 <angerman> sbrg: you are welcome (re: the rpi posts)
12:33 danthemyth joined
12:33 <angerman> quchen: I can tell by the lack of Abstract and Enterprise :)
12:33 <sbrg> :) hoping to set up some home automation stuff on rpis. it's going to be glorious!
12:33 burtons joined
12:33 <quchen> angerman: I have lots of concrete.
12:34 jutaro1 joined
12:34 <angerman> quchen: safty helmets?
12:34 crobbins joined
12:36 sdothum joined
12:36 <hjulle> An AbstractConcreteEnterprise would theoretically produce concrete.
12:37 darlan joined
12:39 cioran89 joined
12:39 xall joined
12:41 acertain joined
12:43 fotonzade joined
12:45 guampa joined
12:45 <Alex_______> Hello, I am trying to check if my graph is an acyclic graph. If someone could take a look I'd be thankful https://pastebin.com/UUFdPB2L
12:47 davr0s joined
12:47 oisdk joined
12:47 <LKoen> Alex_______: do you know how to do a depth-first search?
12:48 jer1 joined
12:48 <mschristiansen> wrt docker image rpi toolchain: would be an easy way to distribute a working cross compilation toolchain
12:48 Sh4rPEYE joined
12:49 Sh4rPEYE joined
12:49 <Alex_______> LKoen: I haven't tried, but I read that if the toplogical sort fails. There is an acyclic graph. So I thought I could apply it to that instead of doing it in another way
12:49 jao joined
12:49 <Sh4rPEYE> Hey. I'm doing the "Monad challenges" from mightybyte and I have trouble setting their MCPrelude up in VSCode. The thing is - the code works (with their custom functions from MCPrelude), but VSCode keeps telling me that it 'Failed to load interface' and refuses to typecheck or autocomplete anything.
12:49 <Sh4rPEYE> http://mightybyte.github.io/monad-challenges/
12:50 <mschristiansen> a dockerfile also helps making a long list of bash commands reproducible
12:50 e14 joined
12:52 DragonWolf joined
12:52 <merijn> So, anyone using hdevtools + syntastic?
12:53 <liste> merijn: me
12:53 Snircle joined
12:53 acertain joined
12:53 <exarkun> mschristiansen: I am jumping right in the middle here but Nix + Haskell would seem to be an interesting combination. Nix has some tools for building Docker images (though they're fairly primitive - then again, so are Dockerfiles)
12:54 <merijn> liste: Ever had issues with hdevtools not working on a file (benchmark, test, etc.) if it was marked unbuildable/not configured?
12:54 <angerman> mschristiansen: it would basically be like the current ghc bindists or the NDKs that google provides for Android. Docker would confine it to Linux, where it can perfectly fine work on macOS and windows native. Maybe someone will turn it into a docker container, but I do not see the benefit of doing it yet.
12:54 klottie joined
12:55 eklavya joined
12:55 <klottie> why can't we pattern match f (x:xs) (x:ys) = ... ? Or is there a workaround?
12:56 <opqdonut> you can
12:56 <liste> merijn: sorry, no.
12:56 <opqdonut> > let f (x:xs) (y:ys) = (x,y) in f [1,2,3] [True,False]
12:56 <lambdabot> (1,True)
12:56 <merijn> liste: I figured out the solution already, I just need some testers :p
12:57 fendor joined
12:57 xall joined
12:57 juanpaucar joined
12:58 zariuq joined
12:58 <liste> merijn: oh, I see. I mostly use stack though these days, but let's try it on a non-stack project :)
12:59 <merijn> liste: Basically, I extended the syntastic hdevtools checker to support specifying hdevtools flags in a file local to your project, so you can specify per project flags (such as enabling specific cabal flags in a project)
12:59 miguelq joined
12:59 <miguelq> Hello?
12:59 <klottie> I want to match only if heads of two lists are the same.
13:00 <liste> klottie: you need a guard for that
13:00 <liste> > let f x y | x == y = "yep"; f _ _ = "nope" in f 5 5
13:00 <lambdabot> "yep"
13:00 miguelq joined
13:01 bjz_ joined
13:01 <klottie> allowing the code I've written would be a good language feature imo.
13:01 <klottie> thank you btw.
13:02 <mschristiansen> angerman, exarkun: A nix expression for a cross compilation toolchain would be great as well, used to run NixOS but setting that up is beyond my skills
13:02 <liste> klottie: there's two problems with that: it adds an Eq constraint implicitly, and doesn't make clear which value the variable refers to then
13:03 cdg joined
13:03 <mschristiansen> angerman: Where is the things you have done for RPI cross-compilation?
13:03 gspia joined
13:03 <liste> hello miguelq :)
13:03 <angerman> mschristiansen: https://medium.com/@zw3rk
13:04 <mschristiansen> angerman: great. Will have a look now
13:04 <* hackage> hpqtypes-extras 1.3.0.0 - Extra utilities for hpqtypes library https://hackage.haskell.org/package/hpqtypes-extras-1.3.0.0 (MikhailGlushenkov)
13:05 rcschm joined
13:05 <angerman> while I do appreciate nix, (and docker to some degree), if I can get things to work without needing either, I prefer it that way. Adding nix on top or docker, is always an option for those who need it. But I prefer not forcing tech on someone unless without absolute need.
13:05 eschnett joined
13:07 twomix joined
13:08 jer1 joined
13:09 kuribas joined
13:10 <maerwald> angerman: people always tend to recommend their favorite toys
13:11 kamyar joined
13:11 <angerman> maerwald: alrighty then, I'll make it require emacs :)
13:11 <maerwald> that sounds familiar :P
13:12 <tfc[m]> feeble emacs user!
13:12 <mschristiansen> certainly _NOT_ a fan of docker
13:12 <mschristiansen> :-)
13:13 <mschristiansen> ... but it's sometimes useful
13:13 darlan joined
13:15 `Guest00000 joined
13:16 <tabaqui> I have Context object from library tls (1.3.8 v) and want to pass it into forked haskell process
13:16 <tabaqui> like ctx <- TLS.handshake sock
13:16 <tabaqui> forkProcess (someFunction ctx)
13:16 xall_ joined
13:16 chlong joined
13:16 <EvanR> you will need to serialize it then
13:17 fizruk joined
13:17 jathan joined
13:17 <tabaqui> it seems so
13:17 iAmerikan joined
13:17 <tabaqui> hmm, ghc never guarantees that forkProcess correctly shares resources, right?
13:17 <EvanR> if it can be placed in a compact region, then that region can be sent to another of the same ghc-compiled program, and used there
13:17 sampuka joined
13:18 <EvanR> forkProcess is not going to share any mutable memory
13:18 <EvanR> that you can use at least
13:18 <tabaqui> how can I check this?
13:19 <EvanR> look at this https://downloads.haskell.org/~ghc/master/libraries/html/compact/Data-Compact.html
13:19 ilyaigpetrov joined
13:19 <EvanR> this feature is like... god
13:19 <tabaqui> God?
13:19 <EvanR> but its only in brand new ghc
13:19 <tabaqui> 8.0.2?
13:19 fbergmann joined
13:20 `^_^v joined
13:21 <EvanR> "It is GHC 8.2 only"
13:21 oisdk joined
13:21 <EvanR> https://github.com/ezyang/compact
13:22 <EvanR> thinking about it, its probably saner to serialize it if possible and sent it normally
13:22 <ertes-w> exarkun: nixpkgs' dockerTools isn't that primitive… you can do pretty much everything with it, and it's much more tolerable than docker's Dockerfile approach
13:23 dolio joined
13:23 <erisco> what is a lib that has lists with inductive length?
13:23 <exarkun> ertes-w: It's a lot slower and generates images that are a lot bigger
13:23 <tabaqui> I doubt https://hackage.haskell.org/package/tls-1.3.10/docs/src/Network-TLS-Context-Internal.html#Context
13:23 <exarkun> ertes-w: Apart from that I like it
13:24 kwantam1 joined
13:24 <exarkun> ertes-w: I made some attempts to write something better but my Nix skills aren't that hot
13:24 <ertes-w> exarkun: you might be running an ancient version of nixpkgs, which used to create qemu images
13:24 <erisco> guess that'd use smart constructors too which is kinda gross
13:24 <exarkun> ertes-w: Oh? Did that go away? I didn't know that. Yes, the version I used used qemu.
13:24 <ertes-w> exarkun: try again with a recent version, and you will find that it is MUCH faster than docker =)
13:25 <exarkun> ertes-w: That's really good news. I have this in my CI system to build some Docker images that I still update and use so I'll definitely check out the newer version.
13:26 lambdageek joined
13:26 <exarkun> (I think I pinned the CI to a particular version of nixpkgs to avoid it breaking from upstream changes)
13:26 GGMethos joined
13:26 <mschristiansen> ertes-w: now you've also convinced me to give it another shot
13:26 <ertes-w> exarkun: one final off-topic note: if you use runAsRoot, it will still create a qemu image where it can execute your script… solution: don't use runAsRoot
13:26 <exarkun> ertes-w: Does it come with another solution for the shadow setup stuff that seemed to be 99% of the motivation for runAsRoot?
13:27 <ertes-w> exarkun: /join #haskell-offtopic
13:27 spacecadetbrown joined
13:28 tomphp joined
13:29 etehtsea joined
13:29 locallycompact joined
13:29 jer1 joined
13:29 ij left
13:30 <erisco> for the purposes of indexing a vector it'd be nice to have a conversion from n % m to Fin m
13:30 <erisco> because although it doesn't always make much application sense it is an easy thing to get
13:31 <erisco> whereas constructing the needed Fin otherwise can be... impractical
13:32 xall joined
13:32 <ventonegro> idris?
13:32 uglyfigurine joined
13:32 TheFuzzball joined
13:32 <erisco> it'd be easier in Idris but still onerous
13:32 mmachenry joined
13:33 <ventonegro> sorry, I thought you were talking about idris
13:33 <erisco> yes, I don't actually want it to wrap around, but it isn't the end of the world if it does
13:33 <erisco> not a difficult bug to correct
13:34 sternmull joined
13:34 <tabaqui> EvanR: what about Socket or Handle: can any of them be passed to forked process?
13:34 mantasg joined
13:35 ystael joined
13:36 <erisco> I am actually not sure what to do about this
13:39 kamyar joined
13:39 zariuq joined
13:39 meba joined
13:40 rafaz joined
13:40 <erisco> I guess an Integral to N conversion and a divmod :: Nat n -> Nat m -> (Fin (S n), Fin m)
13:40 <ertes-w> tabaqui: sockets can be passed, if you disable the FD_CLOEXEC flag
13:41 <ertes-w> tabaqui: Handle is a haskell resource and shouldn't be passed… you should always pass the underlying FD
13:41 dsh joined
13:41 <ertes-w> be sure to use hFlush appropriately before you do
13:41 oisdk_ joined
13:41 <erisco> so annoying... =\
13:41 <* hackage> amqp 0.15.0 - Client library for AMQP servers (currently only RabbitMQ) https://hackage.haskell.org/package/amqp-0.15.0 (HolgerReinhardt)
13:42 <ertes-w> tabaqui: https://hackage.haskell.org/package/unix-2.7.2.1/docs/System-Posix-IO.html#g:6
13:42 im0nde joined
13:43 <tabaqui> ertes-w: so I take Socket, get underlying Handle, get underlying FD and pass FD into forked process
13:43 <tabaqui> then child should construct Socket back?
13:43 MoronMan joined
13:44 <ertes-w> tabaqui: no, a Socket is already more or less a pure FD
13:45 <ertes-w> :t Network.Socket.fdSocket
13:45 <lambdabot> network-2.6.3.1:Network.Socket.Types.Socket -> Foreign.C.Types.CInt
13:45 <Myrl-saki> http://lpaste.net/8824495426188083200
13:45 <ertes-w> tabaqui: ^
13:45 <Myrl-saki> Can anyone help with this mess? lmao
13:45 <ertes-w> tabaqui: you also need to unset the CloseOnExec flag
13:46 <ertes-w> otherwise the socket will be lost as soon as you exec
13:46 tomphp joined
13:46 <tabaqui> ok, looks fine to me, thanks
13:47 xall joined
13:47 <ertes-w> tabaqui: note that you can send sockets to other processes via unix sockets
13:47 <ertes-w> personally i try to avoid give FDs to execed processes
13:47 tefter joined
13:47 <ertes-w> *giving
13:48 <ertes-w> IMO ideally you don't share your FDs at all and use well-defined interfaces instead, but long-bearded unix enthusiasts might disagree =)
13:49 <lyxia> Myrl-saki: you don't need "go", just define three clauses for tallPos and tallSize
13:49 kamyar joined
13:49 skeuomorf joined
13:50 <EvanR> the whole FD thing is an interface
13:50 jer1 joined
13:50 <ertes-w> EvanR: you could say that, but you quickly find yourself specifying FD numbers, and as much as i like the s6 suite, that's one of my number one complaints =)
13:50 <Myrl-saki> lyxia: Yeah, doing that now.
13:51 <Myrl-saki> lyxia: Thanks.
13:51 <ertes-w> EvanR: i don't like anything stringly typed, but the typical number-based non-sense of traditional unix i find even worse
13:51 <tabaqui> ertes-w: actually, I want to establish ssl session, check fast client private key and if all goes well, then interact with client in dedicated process
13:51 <Myrl-saki> lyxia: I'm also pondering with cleanliness vs precision.
13:51 <Myrl-saki> lyxia: (w`div`2,) . (`div` length xs) <$> zipWith const [0,h..] xs
13:51 <Myrl-saki> lyxia: I could write that as a single iterate, but it wouldn't be clean.
13:51 <Myrl-saki> s/clean/precise/
13:52 <tabaqui> TVar HashMap contains registered keys so I cannot forkProcess for each accepted socket
13:52 <tabaqui> and I cannot pass ssl session to process in ghc 8.0.2
13:53 xall_ joined
13:54 zero_byte joined
13:55 kmels joined
13:55 <lyxia> Myrl-saki: try list comprehension
13:56 <lyxia> Myrl-saki: isn't a <$ b <$ c = a <$ c
13:56 FreeBirdLjj joined
13:56 FjordPrefect joined
13:56 <erisco> I need more Nat or Fin theorems... I imagine there is a library stuffed with them somewhere
13:56 <Myrl-saki> lyxia: Yep, fixed now.
13:57 tomphp joined
13:57 TheFuzzball joined
13:57 <Myrl-saki> lyxia: On second thought, list comprehension would be better.
13:57 justinfokes joined
13:57 <Myrl-saki> Parallel list comprehensions are <3
13:57 CurryWurst joined
13:58 <Myrl-saki> lyxia: Which would be better. `floor` post process, or `div` everything?
13:58 <erisco> I don't know what is coming over me but this is frustratingly overkill
13:59 nickager joined
13:59 <erisco> but I am barred from using Vec at all because I can't index it then
13:59 <Myrl-saki> tallPos (_:xs) = [(w`div`2, h' `div` length xs)| _ <- xs | h' <- [0,h..]]
13:59 reliability joined
13:59 <lyxia> Myrl-saki: stick with integers if you can
14:00 <Myrl-saki> lyxia: Oh. Right. I forgot that repeated addition in FP is evil af. lmao.
14:00 <Myrl-saki> lyxia: Thanks.
14:00 jerbome_ joined
14:00 <sshine> Myrl-saki, huh? :)
14:00 Aruro joined
14:00 <Myrl-saki> :t iterate
14:00 <lambdabot> (a -> a) -> a -> [a]
14:01 <Myrl-saki> I was thinking of doing something along the lines of `iterate (+ (h/length xs)) 0`
14:01 <Myrl-saki> (Doesn't typecheck, I know.)
14:01 nighty-- joined
14:02 <glguy> lyxia: I'd expect <$ to be left associative, so that equality wouldn't hold
14:02 juanpaucar joined
14:03 <lyxia> oh, okay. But I meant it in the context of Myrl-saki's code, where there are explicit parentheses anyway
14:04 <sshine> > uncurry (/) $ foldl' (\(total,n) i -> (total+i,n+1)) (0,0) [1..10]
14:04 <lambdabot> 5.5
14:05 <lyxia> It makes sense to make it left associative now that you mention it.
14:05 mada joined
14:05 piyush-kurur joined
14:05 juanpaucar joined
14:05 fortruce joined
14:06 coot____ joined
14:06 <sshine> I seem to have come into the middle of a conversation.
14:06 <sshine> ignore me.
14:06 saussure joined
14:07 SkyPatrol_ joined
14:07 rickygee joined
14:09 rockfordal joined
14:10 eacameron joined
14:10 alx741 joined
14:10 jer1 joined
14:10 NoCreativity_ joined
14:11 jason85 joined
14:12 guest3783 joined
14:12 aarvar joined
14:13 zero_byte joined
14:14 oisdk joined
14:15 Rodya_ joined
14:15 xall joined
14:16 <tabaqui> c'mon guys
14:16 iomonad joined
14:16 <tabaqui> :t fdSocket
14:16 <lambdabot> error: Variable not in scope: fdSocket
14:16 <tabaqui> handleToFd :: Handle -> IO Fd
14:16 <tabaqui> fdSocket :: Socket -> CInt
14:17 klottie left
14:19 <merijn> Poll: Should everything just derive Typeable on the off chance someone might need it?
14:21 inad922 joined
14:21 rkazak joined
14:21 gcross joined
14:22 jerbome_ joined
14:23 nickager joined
14:24 FreemanXiong joined
14:24 fotonzade joined
14:25 <merijn> bleh, TravisCI doesn't have GHC 8 yet?
14:25 <glguy> merijn: deriving typeable is a no op
14:25 jason85 left
14:26 <merijn> glguy: Well, I need to annotate things with Typeable or use AutoDeriveTypeable, which only works on newer GHCs :)
14:26 <glguy> newer GHC always derive it, no extension
14:27 <glguy> but for old GHC sure
14:27 <lyxia> not deriving it will encourage people to upgrade :)
14:27 uglyfigurine joined
14:27 <glguy> I like driving Data, Typeable, and Generic for types where I imagine someone might need it later
14:30 Gloomy joined
14:30 renzhi joined
14:30 <merijn> ...
14:30 kamyar joined
14:30 <merijn> Travis is dumb
14:31 <merijn> I specify GHC 7.10 and it ends up interpreted as 7.1
14:31 jer1 joined
14:31 <glguy> that is why I won't use YAML
14:31 <merijn> Anyone know how to fix that?
14:31 <glguy> use hvr's scripts to build on Travis
14:31 <liste> merijn: does it accept "7.10" ?
14:31 mohsen_ joined
14:31 <merijn> liste: No clue how I would find out
14:31 <liste> in quotes
14:32 <glguy> yes you need quotes, but hvr has a script that generated a multi GHC build script for you using a PPA with all the ghc versions available
14:32 halogenandtoast joined
14:32 <merijn> glguy: What's the advantage of that?
14:33 <glguy> it's all advantage, what do you mean?
14:34 <merijn> glguy: I mean, compared to adding 2 quotes and being done with it, what do I gain by figuring out how his stuff works? :)
14:35 <glguy> caching and building on multiple ghcs
14:35 <merijn> I'll have a look tomorrow
14:35 <glguy> and not jacking around as much to get Travis working
14:35 <glguy> https://travis-ci.org/glguy/th-abstraction/builds/227211273 example
14:36 saussure joined
14:39 tomphp joined
14:39 seangrove joined
14:39 Boomerang joined
14:41 <merijn> glguy: But how did you set that up? :)
14:41 Kreest_ joined
14:41 mizu_no_oto joined
14:42 psychicist__ joined
14:43 sphinxo joined
14:43 <glguy> github.com/hvr/multi-ghc-travis
14:45 MarioBranco joined
14:46 phaji_ joined
14:47 raichoo joined
14:48 dmcampos_ joined
14:48 coot____ joined
14:48 Boomerang joined
14:49 _sras_ joined
14:51 <_sras_> When using Swagger, how can I make a ToSchema instance of a type match with the ToJSON instance of the same?
14:51 spacecadetbrown joined
14:52 ChristopherBurg joined
14:53 <fizruk> _sras_: if you derive both with corresponding options then they should match
14:53 wagerlabs joined
14:54 Luke joined
14:54 HarveyPwca joined
14:54 <wagerlabs> Good day! What replaces configEvery and and configMaxFail in the modern QuickCheck?
14:54 <fizruk> _sras_: also you can test that they match with validateToJSON
14:55 <_sras_> Yes. But is there no way to derive it directly from a ToJSON instance. There is this function that does something simialr "sketchSchema :: ToJSON a => a -> Schema", but I am not sure how to make a `Schema` into a `Declare (Definitions Schema) NamedSchema` that the ToSchema instance required
14:55 jer1 joined
14:56 MarioBranco joined
14:59 <fizruk> _sras_: well, you could do pure (Named Nothing (sketchSchema sampleValue))
14:59 SpinTensor joined
14:59 <fizruk> _sras_: if you're going to use sketchSchema you won't need Declare effects
14:59 <fizruk> _sras_: but sketchSchema can't do things like recursive schemas and I think sum types
14:59 ciniglio joined
15:00 <sphinxo> How should I be reading binary files?
15:00 Elhamer_ joined
15:01 iAmerikan joined
15:01 <liste> @hackage binary
15:01 <lambdabot> http://hackage.haskell.org/package/binary
15:01 <liste> @hackage cereal
15:01 <lambdabot> http://hackage.haskell.org/package/cereal
15:01 <liste> (why is 0.9.0.0 in grey on the first page)
15:02 Rodya_ joined
15:02 <sphinxo> ( I'm going to be using it with harpy to do some dissassembly )
15:03 <liste> sphinxo: ^ those 2
15:03 <sphinxo> ahh ok
15:03 fotonzade joined
15:03 <sphinxo> I already have something to parse the binary, I'm just wondering how to open the file
15:04 <lyxia> wagerlabs: configMaxFail more or less corresponds to maxDiscardRatio
15:04 <sphinxo> Should I be using text/bytestrings/lazy bytestrings?
15:04 <liste> sphinxo: bytestrings
15:04 <liste> text is... text. not binary
15:05 <wagerlabs> lyxia: Thanks! Is configEvery needed anymore?
15:05 Gloomy joined
15:05 <sphinxo> right, that makes sense lol
15:06 <liste> sphinxo: maybe also use "pipes", "conduit" or "streaming" for streaming without lazy IO
15:07 <sphinxo> ahh interesting
15:07 <sphinxo> thanks
15:07 Gloomy joined
15:07 jerbome_ joined
15:08 cschneid_ joined
15:08 urodna joined
15:11 <lyxia> wagerlabs: it seems to produce a string to print for every test case... I think such functionality is mostly hidden now.
15:11 <wagerlabs> lyxia: Got it, thanks!
15:12 Itkovian joined
15:12 osa1 joined
15:14 fotonzade joined
15:14 augur joined
15:14 rickygee joined
15:14 pja joined
15:14 jer1 joined
15:14 halogenandtoast joined
15:15 oisdk joined
15:16 dunecat joined
15:16 takle joined
15:19 Gloomy joined
15:20 Gurkenglas joined
15:21 fendor joined
15:21 dm3 joined
15:21 CoderPuppy joined
15:23 raynold joined
15:23 oisdk joined
15:25 flatmap13 joined
15:26 hackebeilchen joined
15:27 kamyar joined
15:30 theelous3 joined
15:31 kamyar joined
15:32 jmelesky joined
15:33 lc_ joined
15:34 oisdk joined
15:35 jer1 joined
15:35 andreypopp joined
15:36 sleffy joined
15:36 jluttine joined
15:36 jdt joined
15:38 LAZAR joined
15:38 <LAZAR> What is the preferred way to parse JSON, Aeson or Parsec?
15:38 cpup joined
15:40 sz0 joined
15:40 <lyxia> aeson
15:40 <exarkun> I'm using Aeson because I read somewhere online that someone said it was better
15:40 <exarkun> But then later I read that you shouldn't use TemplateHaskell and Aeson does
15:41 <shapr> I like aeson: https://github.com/shapr/tmuxmarta/blob/master/src/Lib.hs
15:41 <WarmCookie> Aeson uses autoparsec. If you parse JSON with parsec, you'll endup rewriting a poorer aeson library :/
15:41 <shapr> and I like using template haskell in there
15:41 <exarkun> hi shapr
15:41 ziocroc joined
15:41 Luke joined
15:41 <shapr> oh hai exarkun! Got any more hard drives I can destroy for you?
15:41 <shapr> Are you still in Boston?
15:41 <lyxia> exarkun: aeson also has Generics support
15:41 Hi-Angel joined
15:41 <exarkun> I moved north and stopped buying hard drives
15:42 <shapr> SSDs now?
15:42 <shapr> And Canada?
15:42 kamyar joined
15:42 <exarkun> _almost_ Canada but not quite
15:42 <exarkun> probably should have gone the extra 50 miles, would have made a big difference
15:42 {emptyset} joined
15:42 <shapr> Like, your back yard is in Canada?
15:42 <shapr> oh, 50 miles
15:42 <sphinxo> What is a nice ( and hopefully performant ) way to go through a list [A,A,C,B,A,B,B,B] and replace [A,A] with [C,B]
15:42 <shapr> exarkun: Are you writing neat stuff in Haskell?
15:42 <exarkun> come visit sometime (after we build a house though)
15:43 <exarkun> shapr: Trying to!
15:43 <WarmCookie> exarkun: {-# LANGUAGE TemplateHaskell #-} import Data.Aeson.TH; import GHC.Generics; data Foo deriving Generics; instance ToJSON Foo
15:43 <shapr> exarkun: Are you coming to HacBoston in July?
15:43 <WarmCookie> exarkun: Saves you a lot of redundant code :)
15:43 <shapr> LAZAR: did you see my github link?
15:43 <exarkun> shapr: with questionable results, https://github.com/LeastAuthority/s4-wormhole-convergence-agent/blob/haskell/Receive.hs
15:43 <exarkun> shapr: I didn't know about HacBoston! I have a trip to Maine in July though, might be tough.
15:43 <shapr> oh neat, magic wormhole client in Haskell?
15:44 msko joined
15:44 <exarkun> https://wiki.haskell.org/Hac_Boston does not look useful.
15:44 <exarkun> shapr: yea
15:44 <shapr> very cool
15:44 <shapr> I just started using magic wormhole a month or so ago
15:45 <exarkun> I can't find any web presence for hacboston 2017
15:45 <exarkun> shapr: cool me too
15:45 <shapr> yeah, we need to work on a web presence.
15:45 <shapr> I also need to nail down the venue
15:45 <sphinxo> What is a nice ( and hopefully performant ) way to go through a list [A,A,C,B,A,B,B,B] and replace [A,A] with [C,B] ?
15:45 conal joined
15:45 <tabaqui> I've opened named pipe in ReadMode and use ByteString.Lazy.hGet on it
15:45 <exarkun> I have an application server that's going to use magic wormhole to deliver account details as part of a signup process
15:45 <shapr> sphinxo: pattern matching?
15:45 <tabaqui> and receive exception hPutStr: illegal operation (handle is not open for writing)
15:46 <tabaqui> how can it even possible?
15:46 xall joined
15:46 <sphinxo> shapr: the thing is the list might look like [B,B,B,A,A]
15:46 <shapr> sphinxo: have you done pattern matching on lists?
15:46 ziocroc joined
15:46 <sphinxo> yes
15:46 <shapr> sphinxo: you can match on multiple elements
15:46 <sphinxo> Yeah I know
15:46 <exarkun> WarmCookie: http://www.stephendiehl.com/posts/production.html has a section about TemplateHaskell
15:46 <exarkun> WarmCookie: that's really all I know about the subject
15:47 <shapr> exarkun: want to write an article for The Monad.Reader about lessons learned while writing a magic wormhole client?
15:47 <WarmCookie> exarkun: You don't need to know more than that to use Aeson's TH / Generics.
15:47 <sphinxo> shapr: the sequence [AA] I want to match on could be anyway through the list
15:47 <sphinxo> not just the first 2 elements
15:47 <lyxia> WarmCookie: the TemplateHaskell pragma and the Data.Aeson.TH are unused in your example
15:48 <WarmCookie> lyxia: Oh, strange, I remember needed both. Maybe my cases were more involved.
15:48 <shapr> sphinxo: right, so I'd recursively walk the list and pattern match on those two elements.
15:48 ArchaicLord joined
15:48 dabukalam left
15:48 <exarkun> shapr: I have trouble writing about things as I'm learning them and I have trouble believing the things that I already know are interesting enough to write about
15:49 <WarmCookie> lyxia: Oh nevermind, I was mixing lenses in there too :P
15:49 <shapr> huh, I keep stream of consciousness notes and questions while I'm coding, and then later I'm able to turn those into something more structured.
15:49 <mivael> > [A,A,C,B,A,B,B,B] -- sphinxo, it does not look like a valid list btw
15:49 <lambdabot> error: Data constructor not in scope: Aerror: Data constructor not in scope:...
15:49 thimoteus joined
15:49 <shapr> exarkun: I think the second part is rarely true, but I don't know how to convince you of that.
15:49 <exarkun> shapr: I have a text file full of such things from the last project I worked on. It's probably doomed to sit there until someone smashes the ssd it's sitting on.
15:50 _mu_ joined
15:50 <shapr> exarkun: write them up?
15:50 <shapr> exarkun: or you could write up something and send it to the editor of The Monad.Reader?
15:50 <exarkun> that project wasn't Haskell-y
15:50 <shapr> This magic wormhole client looks Haskell-y
15:50 <exarkun> so it's a lot of stuff about buggy Python libraries
15:50 <shapr> ha
15:50 <exarkun> yea, this project is pretty Haskell-y
15:51 <exarkun> shapr: this is my first Haskell project
15:51 <shapr> even better!
15:51 <shapr> lessons learned! challenges encountered!
15:51 <tabaqui> oh, damn, ImplicitParams...
15:52 <shapr> I need to get all the TMR websites updated so people don't send submissions to ezyang.
15:52 <exarkun> shapr: okay I'll start taking notes
15:52 bjz joined
15:52 <shapr> exarkun: yes please!
15:52 <exarkun> huh ezyang, I know that name
15:52 <* shapr> hops excitedly
15:53 <exarkun> I think he was a Twisted GSoC student maybe?
15:53 <shapr> ezyang: Turns out the most recent presenter at Atlanta Functional Programming went to high school with you.
15:53 kwantam1 joined
15:53 <shapr> ezyang does many things
15:53 <exarkun> oh he's here
15:53 Thra11 joined
15:55 oisdk joined
15:55 igniting joined
15:55 <vimalloc> Big noob here. Is it possible to have a basically opposite of the Maybe bind (>>=)? Something where if a 'Just x' exists, it just keeps passing that value through, but if it is Nothing it returns the result of a different function?
15:55 darlan joined
15:55 <geekosaur> :t fromMaybe
15:55 <lambdabot> a -> Maybe a -> a
15:56 jer1 joined
15:56 <geekosaur> > fromMaybe 5 (Just 2)
15:56 <lambdabot> 2
15:56 `^_^v joined
15:56 <vimalloc> awesome, thx guys
15:56 <geekosaur> well, ok, it loses the Just, but then that would happen anyway
15:56 <tabaqui> I dunno, is it expected behavior with ImplicitParams
15:56 <tabaqui> you can do such thing
15:57 <tabaqui> foo :: (?a :: Type) -> b
15:57 <tabaqui> foo = let ?a = something in ...
15:57 <tabaqui> and ?a from function signature will be used in body
15:57 <tabaqui> (instead of compile error of course)
15:57 <erisco> My brain just exploded
15:58 <APic> kkk
15:58 <APic> Shall i call the Ambulance?
15:58 <APic> Eris ♥
15:58 <tabaqui> it was usual bug, I named variable with the same name and forgot about it
15:58 <shapr> Hail Eris!
15:59 argent0 joined
15:59 oisdk joined
16:00 Elhamer joined
16:01 kamyar joined
16:01 Sonolin joined
16:02 ixxie joined
16:02 <ongy> the compiler should tell you, when you shadow something
16:03 Rodya_ joined
16:03 takle_ joined
16:06 oisdk joined
16:06 zariuq joined
16:07 uglyfigurine joined
16:07 Computist joined
16:08 pgiarrusso joined
16:08 cpup joined
16:08 <tabaqui> hm, that is true..
16:09 <* hackage> zm 0.2 - Language independent, reproducible, absolute types https://hackage.haskell.org/package/zm-0.2 (PasqualinoAssini)
16:09 <tabaqui> *note to use -Wall -Werror in all projects
16:09 oisdk joined
16:09 `^_^v joined
16:10 <* hackage> dhall 1.3.0 - A configuration language guaranteed to terminate https://hackage.haskell.org/package/dhall-1.3.0 (GabrielGonzalez)
16:10 descender joined
16:12 <orion> ^ that's a really neat project
16:13 dm3 joined
16:13 dni joined
16:13 etehtsea joined
16:14 takle joined
16:14 <Myrl-saki> Oh wait what.
16:14 <Myrl-saki> You can't curry type synonyms?
16:14 igniting joined
16:15 nilof joined
16:15 <glguy> Myrl-saki: That's correct. They don't introduce distinct types, so it doesn't make sense to leave them partially applied.
16:15 tomphp joined
16:16 <mauke> if you have 'type Foo a = ...', then you can't have bare Foo without applying it to something
16:16 <glguy> so if you've got something like: type MySyn a b = SomeType a Int b
16:16 <mauke> but sometimes you can get away with 'type Foo = ...'
16:16 <glguy> Then reduce it to: type MySyn a = SomeType a Int
16:16 CoderPuppy joined
16:16 jer1 joined
16:17 <* hackage> roc-cluster 0.1.0.0, roc-cluster-demo 0.1.0.0 (NCrashed): https://qbin.io/yp580ndx
16:17 <Geekingfrog> orion: did you use dhall for some application ?
16:19 radvendii joined
16:19 <srk> I'm interested in that as well, possibly with nix integration
16:21 zargoertzel joined
16:21 sssilver joined
16:22 oisdk joined
16:23 <orion> Geekingfrog: I did. I use it to configure my NFC-reading-door-unlocking program on my Raspberry Pi.
16:24 <ongy> orion: do you have something unclonable?
16:26 <orion> unclonable?
16:26 <ongy> something that someone that just walks 20cm past you can't copy from your key
16:27 <orion> Unfortunately it isn't.
16:27 <ongy> and you trust it with your door? :)
16:28 <orion> At the time the system was constructed, NFC on the Pi was in its infancy.
16:28 <ongy> "on the pi" that side shouldn't be to bad, the main problem is your key
16:28 <orion> Well, and the NFC reader.
16:29 <orion> It needs to support whatever protocol is being used.
16:29 <ongy> I'm not that familiar with NFC, can't you just treat it as byte stream?
16:30 takle joined
16:30 MindlessDrone joined
16:30 oisdk joined
16:31 takle joined
16:31 <orion> No. NFC is a complicated mess of standards, and a lot of things are specified in hardware.
16:32 <ongy> urgh
16:32 <orion> https://en.wikipedia.org/wiki/ISO/IEC_14443
16:33 <ongy> well, I can't tinker with my door enough to do such things, but I wouldn't go with anything that can't run a proper crypto protocol...
16:34 baldrick2 joined
16:34 WhereIsMySpoon joined
16:34 <ongy> partially because I know the people at our security chair, and I wouldn't be surprised if some of those collected any and all nfc/rfid card data they can sniff
16:34 <WhereIsMySpoon> How do I find the source of functions like !! ?
16:35 <WhereIsMySpoon> bit difficult to google lol
16:35 <ongy> @index (!!)
16:35 <lambdabot> GHC.OldList, Data.List, Prelude
16:35 oisdk joined
16:35 <ongy> look in Data.List
16:35 DataComputist joined
16:35 <WhereIsMySpoon> i got this
16:35 <WhereIsMySpoon> https://hackage.haskell.org/package/base-4.3.1.0/docs/src/Data-List.html
16:35 <WhereIsMySpoon> but genericIndex is an overloaded version?
16:35 <WhereIsMySpoon> so it isnt the same
16:36 <WhereIsMySpoon> plus im using prelude anyway..not data.list
16:36 isBEKaml joined
16:36 lin__ joined
16:36 <geekosaur> what?
16:36 <ongy> WhereIsMySpoon: https://github.com/ghc/ghc/blob/master/libraries/base/GHC/List.hs#L857 that's a bit of guesswork from where you are, it's GHC.List (which may or may not be obvious) and then search for that file
16:36 <MarcelineVQ> the @index thing is a command to the bot
16:37 jer1 joined
16:37 <WhereIsMySpoon> ok that definition makes no sense to me :P
16:37 <WhereIsMySpoon> can someone walk me through it, please? :)
16:39 Aruro joined
16:39 takle joined
16:39 <geekosaur> if you want to track this down yourself, you start at the haddock for the library providing the function (here https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/base-4.9.1.0/Prelude.html or as appropriate for the base in your ghc version)
16:39 <geekosaur> and, what is confusing about this definition?
16:40 <WhereIsMySpoon> so the first line is fine
16:40 <WhereIsMySpoon> then xs !! n | n < 0
16:40 <geekosaur> oh, looking again there's several metaconfusions (like, USE_REPORT_PRELUDE)
16:40 <WhereIsMySpoon> im just ignoring the metacode
16:40 <WhereIsMySpoon> so im used to doing stuff like myFunc [] = error “empty list”
16:40 cloudhead joined
16:40 <WhereIsMySpoon> and enumerating the conidtiions like that
16:41 <WhereIsMySpoon> or case xs of // [] -> error “empty”
16:41 <geekosaur> right. first line rejects negative indices, second rejects any index against an empty list
16:41 takle joined
16:41 <WhereIsMySpoon> i get that it rejects them, but how
16:41 <WhereIsMySpoon> why is xs first ,then !!, and whats with the “n | “
16:41 sssilver joined
16:41 <geekosaur> that is a guard
16:42 <geekosaur> patterns cannot test values, they test structure
16:42 <geekosaur> (specifically, which constructors are present)
16:42 glyph1 joined
16:42 <geekosaur> so if you want to check if you have a negative number, you must use a guard, which is a boolean condition
16:42 <geekosaur> so we bind the index to n and then use the guard to test if that index is negative
16:43 <geekosaur> the rest of it: you define functions as prefix (func foo bar = ...) and operators as infix (foo <**> bar = ...)
16:43 <geekosaur> because that is how you use them.
16:43 <Aruro> geekosaur: constructors can be values
16:43 lknows joined
16:43 baldrick2 left
16:44 <geekosaur> they can; but you can;t match a bunch of them all in one swoop, like negative numbers vs. the horrid hack that lets you pretend numbers are constructors
16:44 takle joined
16:44 fotonzade joined
16:45 <WhereIsMySpoon> im sorry im still hung up on the “xs !! “ bit, does that mean “on the condition there’s a list given”
16:45 <geekosaur> WhereIsMySpoon, also, just as you can change those uses (func `foo` bar instead of foo func bar; (<**>) foo bar instead of foo <**> bar), you can do the same in definitions
16:45 ompaul joined
16:45 <geekosaur> no. you are defining an infix operator called (!!)
16:45 <WhereIsMySpoon> i get tha
16:45 <WhereIsMySpoon> t
16:45 <WhereIsMySpoon> oh
16:45 <WhereIsMySpoon> i see
16:46 <geekosaur> you use it as an infix, so you *define* it as an infix. 'xs !! n' here is defining operator !! with parameters xs on the left and n on the right
16:46 <Aruro> WhereIsMySpoon: did you read some books on haskell sytax? its really very primitive and easy
16:46 takle_ joined
16:46 <WhereIsMySpoon> Aruro: im trying to follow lyah and do some haskell exercises
16:46 <WhereIsMySpoon> and the third exercise was to make an elementAt function
16:47 <WhereIsMySpoon> OH
16:47 <WhereIsMySpoon> that |
16:47 <WhereIsMySpoon> i think is confusing in that place
16:47 <geekosaur> as I said, that is a guard
16:47 <WhereIsMySpoon> shouldnt it be xs !! n then on the next line the |
16:47 <geekosaur> you can do that but don't have to
16:47 <WhereIsMySpoon> or have the guard n < 0 on the next line
16:47 <WhereIsMySpoon> gah
16:47 eklavya joined
16:47 <WhereIsMySpoon> that confused me :D
16:47 jaspervdj joined
16:48 <Aruro> yeah its more readable too
16:48 <Aruro> WhereIsMySpoon: have some alternative sources like haskell report , that you dont feel trapped in lyah
16:48 <Aruro> everything is really defined in like 20 pages of text
16:48 takle joined
16:49 <WhereIsMySpoon> ok so
16:49 <geekosaur> you can jam everything on one line xs !! n | n < 0 = error "negative index" | n == 0 = error "too large" | ...
16:49 <geekosaur> and yes, that does get unreadable in the general case, but in cases like this one it generally comes down to individual tastes
16:51 `^_^v joined
16:51 <WhereIsMySpoon> i think this all makes sense now
16:51 oisdk joined
16:51 <WhereIsMySpoon> so if you need to make a check on something that is being applied to something else in the function, you need to put a guard on it
16:51 takle joined
16:51 <Aruro> WhereIsMySpoon: also xs !! n syntax is confusing, (!!) xs n = something might sound better
16:51 <WhereIsMySpoon> so you can put a condition next to it
16:51 t7 joined
16:52 <WhereIsMySpoon> Aruro: doesnt matter to me :)
16:52 <WhereIsMySpoon> but ok
16:52 iAmerikan joined
16:57 fendor joined
16:58 <geekosaur> btw it might help to read "|" as "such that" or "where" (although the latter doesn't work well for some uses of "|", and also can be confused with the keyword "where")
16:58 jer1 joined
16:58 zachk joined
16:58 <geekosaur> I also prefer "such that" because it better fits the formal-math slant of Haskell
16:58 <geekosaur> (in the sense of code-as-notation)
16:59 ragepandemic joined
16:59 oisdk joined
16:59 kradnl joined
17:00 <Aruro> WhereIsMySpoon: did you read this ? :) http://learnyouahaskell.com/syntax-in-functions
17:01 carlomagno joined
17:02 saml joined
17:02 <saml> is there EDSL for orchestrating rabbitmq jobs?
17:02 <saml> let's say you have 20 different rabbitmq workers. you want to send message to worker B when worker A finishes with result
17:03 <saml> sounds like monad
17:04 `^_^v joined
17:04 <zachk> you put the rabbitmq stuff in the Process monad from cloud haskell, though I am not sure thats exactly what you want
17:04 <zachk> you could put
17:05 <saml> i guess it's more of a DAG (Makefile)
17:06 <saml> tasks depend on each other.. so I write a DAG declarative way and magic happens. messages start flowing through rabbitmq and workers start receiving and emitting messages
17:06 MarioBranco joined
17:06 oisdk joined
17:06 <vimalloc> If I'm reading this right, it looks like mplus is defined as <|>. In my code, is there a convention to use `mplus` or `<|>` (in the maybe monad specifically, if that matters)
17:06 <saml> it's like shell (bash). but each command is rabbitmq worker
17:06 <LAZAR> Someone has an idea how to parse a json object to a abstract data type? see this snippet: http://lpaste.net/355624
17:07 sssilver_ joined
17:07 <saml> @src mplus
17:07 <lambdabot> Source not found. I am sorry.
17:07 trism joined
17:07 <saml> @type (<|>)
17:07 <lambdabot> Alternative f => f a -> f a -> f a
17:07 <vimalloc> I found it searching in here: http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Base.html#mplus
17:08 afarmer joined
17:08 <saml> mplus = (<|>) -- yup
17:08 <vimalloc> is one considered more readable or more common to use?
17:09 <saml> i tend to mix things. sometimes function.. some times binary operator
17:09 <lyxia> I use <|>
17:09 <geekosaur> mplus is MonadPlus, <|> is Alternative which is more general but also a decade or so newer
17:09 oisdk joined
17:09 <saml> if you are expressing alternative <|> is good (I see a lot in Parsec)
17:10 mizu_no_oto joined
17:10 <vimalloc> thanks :)
17:10 <LAZAR> someone here has experience with aeson?
17:12 <glguy> LAZAR: Always ask your actual question
17:12 <geekosaur> they did
17:12 <geekosaur> [17 17:06:44] <LAZAR> Someone has an idea how to parse a json object to a abstract data type? see this snippet: http://lpaste.net/355624
17:12 <glguy> My comment stands
17:13 <LAZAR> geekosaur: i just wonder if you can do stuff like this at all
17:13 <geekosaur> LAZAR, so what you do is give User a FromJSON instance
17:13 seagreen joined
17:14 <LAZAR> geekosaur: you mean something like instance FromJSON User where parseJSON = withObject "user" $ \o -> do name <- o .: "name" mail <- value .: "mail"
17:14 <geekosaur> yes
17:15 <LAZAR> makes sense
17:15 <geekosaur> and then it will be used when you ask it to handle a User
17:15 <geekosaur> (it is already doing this, in fact, but using the FromJSON instance for String which is trivial)
17:17 <LAZAR> geekosaur: but how do i call the parse then inside Entry?
17:17 mmachenry joined
17:17 drcode joined
17:18 drewbert joined
17:18 acertain joined
17:18 <geekosaur> hm, actually I think what you have there is slightly wrong... but I don't normally do this stuff :/
17:18 Swizec joined
17:18 <lpaste> glguy pasted “Fixes for haskell.vim” at http://lpaste.net/355625
17:18 acertainkind joined
17:18 jer1 joined
17:19 dfeuer joined
17:19 juanpaucar joined
17:20 juanpaucar joined
17:20 HKei joined
17:20 <geekosaur> LAZAR, right, you have a bug / thinko there, you want `o .:` everywhere you have `value .:`
17:22 oisdk joined
17:22 <geekosaur> as for the other, you just do the .: like you were. (.:) will know that it is being asked to parse a User and look up the appropriate FromJSON instance
17:22 <geekosaur> just like when you ask it to parse a String value and it looks up `instance FromJSON String where`
17:22 simukis_ joined
17:24 niteria joined
17:24 ragepandemic joined
17:25 <LAZAR> geekosaur: no, the JSON is actually nested, this is an example: https://pastebin.com/ERfLFmLF
17:25 <geekosaur> yes, it is nested, that;s why it delegates
17:26 <geekosaur> "oh this is a String, recurse on FromJSON String" "oh this is a User, recurse on FromJSON User" ...
17:26 xall joined
17:27 <geekosaur> also possibly confusing youy: in most languages, the result type can't be used to pick an "overloaded method". in Haskell, the result type *can* be used to pick a typeclass instance
17:27 <geekosaur> so if you use (.:) to read a User, the implementation for User will be used
17:27 <LAZAR> geekosaur: You are right and its actually easy! npmUser <- value .: "_npmUser" does the trick if the User has an approriate FromJSON instance
17:28 <geekosaur> yep
17:29 <tabaqui> I can pass any *simple* haskell object into forkProcess action as argument, right?
17:29 acfoltzer joined
17:30 cschneid_ joined
17:30 ludat joined
17:30 flatmap13 joined
17:30 <tabaqui> *simple* means "is union or multiplication of any enums and *basic* haskell data"?
17:30 GGMethos joined
17:30 <tabaqui> *basic* means chars and ints
17:30 kradnl joined
17:30 Luke joined
17:30 <geekosaur> I have no idea what you are asking
17:30 <geekosaur> :t forkProcess
17:30 <lambdabot> error: Variable not in scope: forkProcess
17:31 <geekosaur> whoops, right
17:31 <tabaqui> System.Posix.Process
17:31 {emptyset} joined
17:31 <geekosaur> :t System.Posix.Process.forkProcess
17:31 <lambdabot> IO () -> IO System.Posix.Types.ProcessID
17:31 <tabaqui> I have "foo :: Int -> [Char] -> Enum -> IO ()"
17:31 <geekosaur> you pass it an IO action. if that is a function with parameters, you can just pass those parameters
17:32 <geekosaur> forkProcess clones the entire process memory; it does not serialize data and pass it around
17:32 flatmap13 joined
17:32 <geekosaur> that is only needed if you are also replacing the process memory image (e.g. with executeFile)
17:32 al-damiri joined
17:32 cpennington joined
17:33 <tabaqui> I don't call "exec"
17:33 <geekosaur> exactly
17:33 Sheogorath joined
17:33 <tabaqui> but I want pass, f.e HashMap String String or smth other
17:33 <geekosaur> so there is no serialization needed and therefore no restriction on what data you can use in the subprocess
17:33 <tabaqui> maybe it contains enumerates
17:33 <ReinH> LAZAR: you should read this tutorial https://artyom.me/aeson
17:33 <tabaqui> sounds logical
17:33 <ReinH> It covers all of your questions.
17:33 <tabaqui> thx
17:34 <geekosaur> but this also works both ways: since it cloned the memory image, changes made in the child are not visible in the parent
17:34 <geekosaur> you *would* need to explicitly serialize and pass back data. there's nothing like Chan for processes; that only works for threads, which share the same memory image
17:35 connrs joined
17:35 <tabaqui> that's fine
17:35 pylbrecht joined
17:35 replay joined
17:36 oish joined
17:37 mtg joined
17:38 takuan joined
17:39 jer1 joined
17:40 <LAZAR> Ummm anyone has an idea how to parse a List using Aeson?
17:40 <sbrg> LAZAR: did you read the tutorial mentioned above?
17:41 <ReinH> It covers that question too.
17:42 <ReinH> in fact, decoding a list is one of the first examples.
17:42 <LAZAR> sbrg: ReinH It mentions that Vectors can do that
17:43 <ReinH> https://artyom.me/aeson#very-basic-decoding-and-encoding
17:44 <ReinH> It's literally the first example of decoding in the tutorial.
17:44 <ReinH> So please actually read the tutorial.
17:44 <LAZAR> ReinH: Well I mean parsing lists of abstract data types, not primitives
17:44 freusque joined
17:45 <LAZAR> ReinH: Also i cant really translate the ghci examples to FromJSON instance
17:45 jutaro joined
17:46 <ReinH> decode json :: Maybe [Foo] will decode a list of Foos, where Foo is a datatype with a FromJSON instance.
17:46 <ReinH> Ok, what about all of the examples that aren't in ghci?
17:46 jutaro joined
17:46 <ReinH> Please actually read the tutorial.
17:47 <WarmCookie> What could've been Haskell alternatives for ad-hoc polymorphism other than type classes? I'm interested in a general ideas that are not even necessarily seen in other popular languages.
17:47 tromp joined
17:47 <erisco> anyone using reflex on Windows for web dev?
17:47 kradnl joined
17:47 Rodya_ joined
17:47 <WarmCookie> Bonus points if it's not text-based :P
17:48 fizruk joined
17:48 <ReinH> WarmCookie: type-directed name resolution a la Idris or Agda
17:49 <ReinH> records
17:49 <WarmCookie> For example, I've ported the idea of ADTs to a Flow-Based language as components that lets you do pattern matching and whose outputs are each of the cases in a sum or product type.
17:49 <ReinH> modules
17:50 <WarmCookie> Now I'm interesting in giving that flow based language a type system that goes beyond parametric polymorphic and introduce maybe some form of type hierarchy / ad-hoc ness.
17:51 <WarmCookie> ReinH: How would this translate to a flow-based system (if you're familiar with those) ?
17:51 Levex joined
17:51 <shapr> data flow language?
17:51 <geekosaur> LAZAR, I think you're still tripping over result type polymorphism
17:51 <ReinH> F# has an inlining feature that can be used for ad hoc polymorphism
17:52 <geekosaur> you dont need to pass a parameter to tell it what to do like in languages where only parameters can be used to select a polymorphic variant
17:52 <WarmCookie> shapr: Components with inputs and outputs. Components communicate via messages which is more or less your control-flow.
17:52 <ReinH> Maybe you want row types?
17:52 Wizek__ joined
17:52 <ReinH> idk
17:53 <ReinH> I wouldn't reach for ad hoc polymorphism first if I were designing a type system.
17:53 <WarmCookie> ReinH: I don't know. I'll just absorb and research all the name dropping you're doing c:
17:53 <ReinH> It's too... ad hoc.
17:53 carlomagno joined
17:53 <ReinH> WarmCookie: well, you asked for examples :p
17:53 asthasr_ joined
17:54 albel727 joined
17:54 <ReinH> Subtyping or row polymorphism might be more to your liking
17:55 <ReinH> which are subtly different (explained nicely at https://cs.stackexchange.com/questions/53998/what-are-the-major-differences-between-row-polymorphism-and-subtyping)
17:55 augur joined
17:56 Bassetts joined
17:56 <WarmCookie> So far I have this nice editor that lets you create components. These have input and output ports. Then you build an application out of such components, connecting the ports of interests. It's quite similar to Erlang so far; but there's no textual representation. I added a mechanism to define types (even parametric ones) and check types (it's not very sophisticated).
17:57 <WarmCookie> ReinH: So then the question was "should I start grouping types", if so, I probably want them to have common interfaces to work with values of such types...
17:57 <WarmCookie> And that where the visual model breaks a little.
17:58 <ReinH> right, you want the type of square holes for square pegs to fit in
17:59 <WarmCookie> That's not a bad analogy.
17:59 jer1 joined
17:59 hybrid joined
18:00 <_sras_> What is the local pragma to suppress orphan instance warnings?
18:00 laplacian joined
18:01 <Tuplanolla> It's `{-# OPTIONS -fno-warn-orphans #-}`, _sras_.
18:01 <geekosaur> ...depending on definition of "local"...
18:01 <geekosaur> there is in general no way to suppress warnings per occurrence
18:01 <WarmCookie> ReinH: So the input of components would have constraints of what types are allowed and what aren't. And you could make arbitrary group of types.
18:01 <Tuplanolla> That one's translation-unit-local.
18:02 <geekosaur> ...yet
18:02 afarmer joined
18:02 <ReinH> structural subtyping + parametric polymorphism might be an interesting point in the design space.
18:02 <WarmCookie> ReinH: From then on, a module could supply a user with all the components that would be needed to work with values of such types.
18:02 <ReinH> the structure of the output must match the structure of the input
18:02 asm_ joined
18:02 <ReinH> or at least a sub-structure must, and the rest of the structure is discarded
18:03 <WarmCookie> Mhm. I still want to leave the job to the user to combine the right blocks to manipula such structure though.
18:03 <WarmCookie> Kinda like we have to wrap/unwrap newtypes in haskell.
18:03 uglyfigurine joined
18:03 <WarmCookie> It's annoying, but it's principled.
18:03 <ReinH> e.g., an output of Point3D { x, y, z : Double } to an input of Point2D { x, y : Double } could either drop z or be a type error.
18:04 matrium joined
18:04 darlan joined
18:04 castlelore joined
18:04 <WarmCookie> Oh... that's substructural typing right?
18:04 <ReinH> structural subtyping
18:04 <WarmCookie> Or structural subtyping I think? I
18:04 <WarmCookie> I keep mixing both :P
18:04 robotroll joined
18:04 <ReinH> Point2D is a subtype of Point3D
18:05 AlphaAtom joined
18:05 <ReinH> or do I have that backwards? All Point3Ds are also Point2Ds.
18:05 BlueRavenGT joined
18:05 <WarmCookie> I get where you're going either way.
18:05 <ReinH> my brain can't seem to figure out which way the <= points today.
18:05 cyborg-one joined
18:06 `^_^v joined
18:06 <WarmCookie> How limited is structural subtyping?
18:06 <ReinH> structural subtyping with parametric polymorphism subsumes row typing with parametric polymorphism
18:07 Rodya_ joined
18:07 <ReinH> structural subtyping can be a bit more expensive than nominal typing
18:08 baldrick1 joined
18:08 <ReinH> It basically incurs the equivalent of Java's interface problems, where field lookups are no longer constant time.
18:08 <ReinH> Haxe is an interesting language with structural subtyping http://haxe.org/
18:09 <WarmCookie> Will check that too.
18:09 SkyPatrol joined
18:09 <matrium> hi, I'm using attoparsec to parse a text file. What's the best practice to ensure that a sequence is consumed entirely and the last char has a certain property? E.g. the last char can not be a dot "liftA2 (<>) (pack <$> many (char '.' <|> pnChars)) (singleton <$> pnChars)"
18:09 <ReinH> Ocaml also has a sort of weird implementation of structural subtyping
18:09 jmelesky joined
18:10 <matrium> the given example will just consume one single char
18:10 <WarmCookie> ReinH: I have a feeling doing the implementation will bother me and make me change my mind.
18:10 <Tuplanolla> Use `eof`, matrium?
18:10 <WarmCookie> ReinH: But I'll still give it a look.
18:10 <shapr> exarkun: silly question, why'd you choose Haskell for this magic wormhole client?
18:11 <WarmCookie> ReinH: Much appreciated. Thanks for the brainstorming :)
18:11 <ReinH> WarmCookie: this might be interseting http://www.dtic.mil/dtic/tr/fulltext/u2/a512414.pdf
18:11 <matrium> Tuplanolla: its not the end of the file. it's just a chunk inbetween
18:11 <ReinH> I don't know the authors but CMU is usually a source of reputable research.
18:11 <Tuplanolla> Oh, huh.
18:11 pylbrecht joined
18:11 fnurglewitz joined
18:11 <LAZAR> someone has an idea why Aesons encode espaces all "s?
18:11 <exarkun> shapr: because I've put off learning Haskell for too long and this was the next small, self-contained component that arose for the larger project
18:12 ystael joined
18:12 <shapr> exarkun: that makes sense, thanks
18:13 <shapr> exarkun: learned anything interesting? thoughts on Haskell and/or ecosystem?
18:14 nothingnew joined
18:14 mmn80 joined
18:14 <exarkun> shapr: Learning Haskell itself is interesting. :) And I still have a _long_ way to go on that.
18:14 psychici1t__ joined
18:14 leat joined
18:14 <exarkun> shapr: Of the ecosystem, so far, I'm a bit disappointed with the quality of library documentation.
18:15 <shapr> exarkun: soft docs like tutorials?
18:15 <shapr> or hard docs like what a bit of code actually does?
18:15 <exarkun> shapr: I think the hole could be filled satisfactorily in a number of ways.
18:15 <exarkun> shapr: A lot of libraries don't include any usage examples, nor API docs, not any form of prose laying out the big picture.
18:16 <exarkun> shapr: When all three of those are missing, it's kind of a sad time.
18:16 <shapr> so you'd like to see more big picture docs on how to use a particular library?
18:16 <exarkun> shapr: Maybe the situation is better in Haskell where one _can_ learn a lot of useful stuff from type signatures... but I'd still rather have some form of docs.
18:16 asthasr joined
18:16 <exarkun> Sorry I meant "nor any form ..."
18:17 <exarkun> shapr: Any of the three would be welcome
18:17 <Tuplanolla> What do you call a library with complete and comprehensive documentation?
18:17 <sbrg> exarkun: yeah, unfortunately that's way too common. the types do help a lot, but having to dig through the entire library to find the "entry point" is still a hassle
18:17 <Tuplanolla> A book.
18:17 <exarkun> Tuplanolla: system metaphor failure
18:17 pera joined
18:18 dni joined
18:18 Rodya_ joined
18:18 <geekosaur> LAZAR, becuase that's what you need to do when it's in a string. somehow I think we're now on the reverse of the original problem: you want to stitch JSON together manually by generating chunks and slamming them together, instead of using ToJSON instances
18:18 <shapr> Most common problem I have with Haskell libs is figuring out which ones are still actively maintained and/or recently updated.
18:19 takle joined
18:19 dni joined
18:19 <shapr> I'd like to see the hackage section list ordered by most recently updated
18:19 <shapr> and maybe even a sparkline of updates over the past year
18:20 <exarkun> it's tricky
18:20 <exarkun> sometimes it's old because it's done and works
18:20 <shapr> Yup, I use some of those.
18:20 jer1 joined
18:20 <LAZAR> geekosaur: well i thought the toJSON instances would handle parsing stuff to a normal Json?
18:20 oish joined
18:21 kamyar joined
18:21 <geekosaur> maybe you should explain exactly what you are doing that you don't want strings to be escaped. the only thing I can think of is manually blatting stuff into JSON --- but that is what ToJSON instances do for you, and they don't generate garbage the way manually slapping stuff together can
18:22 Levex joined
18:22 <shapr> exarkun: what about reverse dependencies? count of recent updates/uploads that depend on this library?
18:22 <LAZAR> geekosaur: I have a Json file which I read and modify and create a new one
18:23 Gloomy joined
18:24 <exarkun> shapr: I don't know what the solution is. How about API documentation coverage %, a place to put a link (or hackage-hosted?) to prose documentation, a place to put a link to a CI system?
18:24 <exarkun> shapr: maybe all of the above
18:24 cschneid_ joined
18:24 <shapr> hm, those are good ideas
18:25 mmachenry joined
18:25 slack1256 joined
18:25 <geekosaur> right, the aeson way is you deserialize the json to haskell adts, update those, and generate new json
18:25 <exarkun> GitHub, DockerHub, etc let people put "stars" on projects. I think that's _probably_ bs... but who knows.
18:26 <exarkun> I don't have a Hackage account so I don't know how that would work
18:26 <Myrl-saki> :: (a -> b) -> (a,a) -> (b,b)
18:26 <geekosaur> it sounds to me like you want a regex-style solution, just edit the json in place. which is nice and simple until you hit a case where it's impossible to create a regex that will change only and exactly what you want to change. which will happen specifically because json is nested
18:26 <geekosaur> (it's the same problem as trying to parse html with regex, in fact)
18:26 takle joined
18:26 <Myrl-saki> I'm thinking of using `join (***)
18:26 <shapr> exarkun: do you want a hackage account so you can upload your mw client?
18:27 <Myrl-saki> @pl join (***)
18:27 <lambdabot> join (***)
18:27 <Myrl-saki> Welp.
18:27 <geekosaur> exarkun, shapr: hackage 2 was supposed to add stuff like this
18:27 <Myrl-saki> @pl (\(x,y) -> (f x, f y))
18:27 <lambdabot> f *** f
18:27 <geekosaur> I don't know where/why that is stalled
18:28 <geekosaur> oh, it's not, it;s there. did you see the "votes" field?
18:28 <exarkun> shapr: I'm sure I'll get there eventually... but I guess my point was more that the proportion of anonymous to authenticated Hackage use is probably very high compared to systems like GitHub and DockerHub
18:28 <geekosaur> (which leads to the next problem: a feature is useless if nobody knows about it or it otherwise isn't used)
18:28 <exarkun> shapr: Maybe the ability to star projects would motivate millions of Haskell users everywhere to create Hackage accounts?
18:28 iAmerikan joined
18:28 psychicist__ joined
18:29 <Myrl-saki> @pl join (***) fromIntegral . (width_ScreenSize &&& height_ScreenSize)
18:29 <lambdabot> join (***) fromIntegral . (width_ScreenSize &&& height_ScreenSize)
18:29 <james999> geekosaur: exactly. or if you google for a feature, it says the feature works on your system, then you try the feature and it's not there.
18:29 <geekosaur> Myrl-saki, @pl can only remove points you declare with a lambda
18:29 <exarkun> geekosaur: Oh yea I do see "votes".
18:29 <Myrl-saki> I'm kind of stupid.
18:29 <Myrl-saki> That's `on` + liftM2.
18:29 <geekosaur> because it has no way of knowing whether width_ScreenSize there is a point or a library function
18:29 dylanj_ joined
18:29 jer1 joined
18:29 <Myrl-saki> Oh wait no. It's postprocessing.
18:30 <exarkun> geekosaur: There's a lot of 0 vote projects. :/
18:30 <geekosaur> yes, that was my follow-on
18:30 <Myrl-saki> geekosaur: Ah, thanks.
18:30 <geekosaur> [17 18:28:30] <geekosaur> (which leads to the next problem: a feature is useless if nobody knows about it or it otherwise isn't used)
18:30 <exarkun> ah, yea.
18:30 RegEchse joined
18:30 <geekosaur> hackage 2 kinda slipped in without much fanfare, I expect few people have noticed that field buried below the fold
18:30 <geekosaur> it'd work better up at the top
18:31 <exarkun> If there were a hackage view that sorted by vote count, that might encourage more people to vote
18:31 <exarkun> (but I'm certainly of mixed feelings about whether that kind of popularity contest is actually a good thing)
18:32 <sphinxo> I want an pointer sized, unsigned integer type, is this Word?
18:32 takle joined
18:33 <WarmCookie> sphinxo: You want WordPtr from Foreign.Ptr.
18:33 <WarmCookie> >> "An unsigned integral type that can be losslessly converted to and from Ptr. This type is also compatible with the C99 type uintptr_t, and can be marshalled to and from that type safely."
18:33 <sphinxo> ahh ok, I don't need it to be convertable to Ptr
18:33 <sphinxo> just the same size
18:33 <Tuplanolla> Do we have a foreign type for `bool` btw?
18:33 <WarmCookie> sphinxo: Why the same size as a pointer then?
18:34 slack1256 joined
18:34 <WarmCookie> Tuplanolla: bool in C is actually a macro for _Bool is is degined to be an integer with a minimal width.
18:35 <WarmCookie> *which is specified
18:35 dm3 joined
18:35 <vimalloc> I'm having trouble finding good data about this on google, maybe someone could link me to an article? Behind the scenes, how does haskell handle syscalls? Does it wrap glibc? Or is that stuff hard coded in the compilier? Is there an interface for performing your own syscalls?
18:35 <Tuplanolla> What's that then, WarmCookie?
18:35 <vimalloc> (asking purely out of curiosity)
18:36 <shapr> geekosaur: so hackage 2 is what's online now?
18:36 <geekosaur> yes'
18:36 darlan joined
18:36 <WarmCookie> Tuplanolla: Where I'm going is that you don't need a seperate representation. Whatever's the machine word size works.
18:36 <sphinxo> WarmCookie: well I've been told to generally use something pointer sized when dealing with container sizes or indexing, maybe this doesn't apply to haskell
18:36 <Tuplanolla> Oh, I see.
18:37 <shapr> vimalloc: strace a binary?
18:37 <geekosaur> sphinxo, in a certain sense it does not. because pretty much everything in Haskell is represented via a pointer anyway
18:38 <sphinxo> ahh
18:38 <geekosaur> vimalloc, that's the Foreign Function Interface https://www.haskell.org/onlinereport/haskell2010/haskellch8.html#x15-1490008
18:38 <vimalloc> shapr: Wouldn't strace just show that they syscall was happening? Not how it was called in haskell?
18:38 <Tuplanolla> Why does `sizeof (bool)` produce `1` though, WarmCookie?
18:38 <vimalloc> (my strace foo is not the strongest)
18:38 <vimalloc> geekosaur: thanks!
18:39 <shapr> vimalloc: A handy ghc program I have links to libc.so.6, I just ran ldd on it.
18:39 tristanp joined
18:39 <geekosaur> there are a very few syscalls implemented as compiler primitives, but most things even in base are done via FFI
18:39 <WarmCookie> Tuplanolla: Implementation specific. One byte fits the criteria of an integer with a width >= than 1 bit.
18:39 ixxie joined
18:40 dual joined
18:40 <geekosaur> Tuplanolla, pretty much what WarmCookie just said. some platforms will use a machine word, others will use a (char), etc. there are arguments for and against each approach
18:40 <Tuplanolla> So which Haskell type corresponds to the right choice?
18:41 <geekosaur> (the argument against (char) is you can't trivially convert code that relies on the old K&R convention that a boolean is an (int) that is either zero or nonzero)
18:41 <Myrl-saki> @pl (\x -> sample sizesE >>= (\s -> foo . bar s))
18:41 <lambdabot> const ((foo .) . bar =<< sample sizesE)
18:41 <WarmCookie> Does Haskell FFI has a int_leastN_t ?
18:41 <Myrl-saki> @pl (\x -> sample sizesE >>= (\s -> foo . bar s $ x))
18:41 <lambdabot> (sample sizesE >>=) . flip ((foo .) . bar)
18:42 <geekosaur> which is kind of a bletcherous convention, but sadly there's a *lot* of ancient code in existing in-house codebases
18:42 qwerkus joined
18:42 halogenandtoast joined
18:43 sleffy joined
18:43 <mauke> geekosaur: what's an example of a syscall that's built into the compiler?
18:44 <geekosaur> I'm thinking of STM primops
18:44 <geekosaur> hm, maybe not STM, at that. I think there are primops whose implementations involve OS level mutexes though
18:45 <mauke> wouldn't those still go through libc?
18:46 tbelaire joined
18:46 <geekosaur> somehow I thought when I said "... compiler primitives, but ... via ffi", I was talking about that distinction, not direct kernel call vs. libc
18:46 oish joined
18:47 <hexagoxel> is there some prettier alternative to using "case () of" to obtain a where-block that has access to bindings from do-notation?
18:48 araujo joined
18:48 qwerkus left
18:48 <hexagoxel> i don't like the order that using let would bring.
18:48 flatmap13 joined
18:48 tromp joined
18:49 flatmap13 joined
18:49 <Myrl-saki> @pl (\x -> sample sizesE >>= (\s -> pure . foo . bar s $ x))
18:49 <lambdabot> (sample sizesE >>=) . flip (((pure . foo) .) . bar)
18:50 zzz joined
18:51 <Myrl-saki> @pl (\x -> (\s -> foo . bar s $ x) <$> sample sizesE)
18:51 <lambdabot> (<$> sample sizesE) . flip ((foo .) . bar)
18:51 oisdk joined
18:51 <Myrl-saki> There's still a flip. :|
18:52 zv joined
18:52 <glguy> you're not actually supposed to put the output of @pl into source files generally
18:52 <Myrl-saki> glguy: I... actually do..
18:53 <glguy> oops!
18:53 <Tuplanolla> It's not too late to stop.
18:53 <* geekosaur> 's rule of thumb is, if he needs to use @pl to pointfree something, it should not be done pointfree
18:53 <sbrg> ^
18:53 <sbrg> Myrl-saki: every time you do, a kitten dies
18:53 <sbrg> stop killing kittens
18:53 <maerwald> geekosaur++
18:53 <WarmCookie> hexagoxel: Not really... maybe digustings fix \case ?
18:54 rkazak joined
18:54 <maerwald> @pl is just a funny toy, not an actual tool
18:55 <Clint> it's useful for learning things
18:55 <maerwald> never learned anything from it
18:55 <Clint> maybe you asked it the wrong questions
18:56 <maerwald> the output is mostly just weird and overcomplicated, because the algorithm is not very smart
18:56 <geekosaur> also there are very few cases where a pointfree expression can't be replaced by an appropriate lambda
18:56 epsilonhalbe joined
18:56 <geekosaur> probably there are none,
18:56 <geekosaur> s/,//
18:56 jer1 joined
18:57 <WarmCookie> hexagoxel: I actually have an idea. Is there a first-order function that tells you if a pattern is matching?
18:57 <Tuplanolla> There was a really good pointfree deduction involving a function and a list a few days back.
18:57 Cassiopaya joined
18:57 <Tuplanolla> Does anyone remember it or do I have to go dig it up?
18:57 <Clint> clearly you should dig it up
18:58 <WarmCookie> hexagoxel: Someone made fist-class-patterns, this might be overkill for what you want :P
18:58 zargoertzel joined
18:58 <WarmCookie> hexagoxel: I was thinking -XMultiWayIf or something.
18:58 <WarmCookie> case () of is a common idiom :/
18:59 <kadoban> geekosaur: When I was new it would occasionally tell me sane things that I didn't know (that weren't horrors)
18:59 <EvanR> MultiWayIf is way better
18:59 <EvanR> for bools
18:59 guest` joined
19:00 <geekosaur> I did say rule of thumb, not natural law >.>
19:01 Gurkenglas joined
19:01 <kadoban> Right. I just mean that it's probably only a rule of thumb once you get past the beginning stages. Meaning I wouldn't be surprised if it's a useful tool for beginners.
19:01 drewbert joined
19:01 <Tuplanolla> @pl \ f g (x, y) -> (f x, g y) -- bimap
19:01 <lambdabot> flip flip snd . (ap .) . flip flip fst . ((.) .) . flip . (((.) . (,)) .)
19:02 <Tuplanolla> It wasn't exactly that, but it was as good.
19:02 <kadoban> That's impressively horrible
19:03 <Myrl-saki> lol
19:03 <hexagoxel> WarmCookie: good ideas, but i don't seem how they help. "where" on MultiWayIf does not seem to work, and LambdaCase does not actually help with the additional indentation.
19:03 <sbrg> no one read that incantation aloud. i'm pretty sure you'll summon some beast from the depths of hell
19:03 <kadoban> Hah
19:04 <WarmCookie> hexagoxel: Mhm. I liked the challenge but I'm not finding much that could be exploited.
19:04 <EvanR> oops, why didnt you say something sooner
19:05 Luke joined
19:06 <hexagoxel> WarmCookie: I'll just have to convince enough people that "where on do-statements" would make for a completely useful and warranted extension.
19:06 kamyar joined
19:06 iAmerikan joined
19:07 <athan> I think `where` could be useful for any expression, not just definitions, but that's just me
19:07 <WarmCookie> hexagoxel: I'm tempted to agree on one point: Not because of its necessity, but because I like the idea of capturing the environment and still being able to define the function elsewhere than within that do block.
19:08 <athan> like `\x -> x * second where second = 100000`
19:08 Wizek__ joined
19:08 <WarmCookie> hexagoxel: But wouldn't one argue that you should just pull off that logic into it's own top-level function and pass arguments? Or improve the monad that you're working with?
19:08 <athan> it'd just be a flipped `let .. in`
19:08 drewbert joined
19:08 Gloomy joined
19:09 albertus1 joined
19:10 xplat joined
19:10 cioran89 joined
19:12 qwertydvorak joined
19:12 argent0 joined
19:13 juanpaucar joined
19:13 <geekosaur> now half expecting someone to propose exactly that...
19:14 <geekosaur> (in <expr> let <bindings>, as expression syntax instead of part of declaration syntax like where)
19:14 <Tuplanolla> I can only imagine the parse errors.
19:14 oisdk_ joined
19:14 <WarmCookie> Maybe the type in question could have some helper monadic function that lets you perform an arbitrary amount of actions and pass the arbitrary amount of results to another monad where these would be readily accessible.
19:14 jer1 joined
19:15 <Tuplanolla> > let x = in w let w = 42 in in z let z = y
19:15 <lambdabot> <hint>:1:9: error: parse error on input ‘in’
19:16 zariuq joined
19:16 dm3 joined
19:16 <Tuplanolla> Good luck with that.
19:16 <geekosaur> Tuplanolla, I think that would actually work. but a lot of people not used to thinking of "let" as inducing layout would be in for a surprise
19:16 <WarmCookie> Actually nevermind, has to be some extension, the boilerplate in my test is getting huge already.
19:16 <Tuplanolla> It probably would, but I'm not sure if that's a good thing, geekosaur.
19:17 <geekosaur> (we already have the case you are thinking about; consider let inside do, when written as a one-liner --- you need braces to disambiguate)
19:17 juanpaucar joined
19:18 davr0s joined
19:18 qapla_org joined
19:18 kamyar joined
19:18 <hexagoxel> WarmCookie: i am rather opposed to the notion of lifting everything to the top-level. Locality is good, it adds structure, clears up the relation of different bindings.
19:18 <geekosaur> and considering how often that catches people by surprise (including me sometimes even though I know better), yes, it could get "interesting". but I think this case ends up being easier to cope with because, while there is no actual parse ambiguity in this case, there is a reduce/reduce conflict in the do+let case
19:19 <WarmCookie> hexagoxel: Add more modules c:
19:19 <geekosaur> it would certainly pose a comprehensibility roadblock though
19:19 <geekosaur> if abused.
19:19 pgiarrusso joined
19:19 jmelesky joined
19:19 <geekosaur> (fle flip side of that one is lots of things can be abused that way. I mean, we were just talking about pointfree :)
19:19 <WarmCookie> in .. do ..
19:19 <WarmCookie> in do { f <- foo; bar } let bar = baz f
19:20 <WarmCookie> in .. let .. sorry.
19:21 <WarmCookie> That's just (>>=), but the idea is that you're sharing the scope now, right?
19:22 <WarmCookie> You'd have access to `f` and everything else.
19:22 yellowj joined
19:22 <* WarmCookie> becomes dry.
19:23 ragepanda joined
19:23 <WarmCookie> The best option so far was `where` on the `do` block :P
19:24 Kuros` joined
19:24 ystael joined
19:24 qwertydvorak joined
19:25 conal joined
19:26 saurabhnanda joined
19:26 dni joined
19:28 afarmer joined
19:29 <saurabhnanda> just broadcasting this here for larger circulation - https://www.reddit.com/r/haskell/comments/6bqxva/techempower_again_something_is_wrong_please_help/
19:30 <shapr> exarkun: well, you've convinced me to sign up for S4
19:31 baldrick1 joined
19:32 chaosmasttter joined
19:32 <exarkun> shapr: haha >:)
19:32 bvad joined
19:32 <exarkun> shapr: Do you want me to tell you when the wormhole-based thing is deployed so you can appreciate that experience? :)
19:32 <erisco> one comment on the Interwebs that pertains to my error... no solutions https://www.reddit.com/r/haskell/comments/64r5on/realworldreflex/dg5no10/
19:33 <shapr> exarkun: yes please! I assume that's the magic folder new product?
19:33 <exarkun> shapr: It's at least highly correlated
19:35 mtg joined
19:35 flatmap13 joined
19:36 sternmull joined
19:36 jer1 joined
19:36 <geekosaur> erisco, that's a warning, and I don't see an error from you in scrollback?
19:39 <erisco> yeah you're right it is just a warning
19:40 dylanj_ joined
19:41 TCZ joined
19:42 <geekosaur> anyway that is a complaint from the new checker and I think at this point its termination is subject to the halting problem
19:43 <erisco> the error is src\Gen2\Linker.hs:354:42: error: Couldn't match type `[Char]' with `ByteString'
19:44 yqt joined
19:44 <geekosaur> oh, how does that relate to what you linked?
19:45 <geekosaur> anyway that one looks like something changed type, *or* you need OverloadedStrings somewhere
19:45 <geekosaur> *or* a missing pack
19:45 <erisco> OverloadedStrings is on https://github.com/ghcjs/ghcjs/blob/ghc-8.0/src/Gen2/Linker.hs#L354
19:46 <erisco> will have to take some older revisions I guess...
19:47 <orion> What does the Coroutine Monad give me that Cont doesn't?
19:47 <hexagoxel> WarmCookie: if you can bear the horrors of my non-top-leveling, the code i was talking about is https://github.com/lspitzner/brittany/blob/dev/src/Language/Haskell/Brittany/Backend.hs#L340
19:48 ski joined
19:49 <hexagoxel> you'd have to add like 8 arguments in total to different functions if you were to pass the four bindings manually.
19:52 dm3 joined
19:53 cioran89 joined
19:53 pie_ joined
19:54 dm3 joined
19:54 ccomb joined
19:55 <geekosaur> erisco, so that points to readNodeSettings and whatever it returns, which appears to be a record with a nodeProgram field. at a guess, that changed type
19:55 xall joined
19:56 ziocroc joined
19:56 Cassiopaya joined
19:56 Itkovian joined
19:57 jer1 joined
19:59 cross joined
19:59 <geekosaur> orion, at a guess, an interface that is at least slightly less likely to fry your brain
19:59 oisdk joined
20:00 dopey_ joined
20:00 <geekosaur> at a quick glance, assuming this is http://hackage.haskell.org/package/monad-coroutine-0.9.0.3/docs/Control-Monad-Coroutine.html#t:Coroutine, it looks closer to the Icon coroutine interface than the rather raw interface Cont gives you
20:00 yogsotot_ joined
20:00 cioran89 joined
20:00 <orion> Icon?
20:00 <geekosaur> also, its even simpler generator special case
20:00 buttbutter joined
20:00 <geekosaur> https://www2.cs.arizona.edu/icon/
20:01 juanpaucar joined
20:01 jrahmy_ joined
20:01 <geekosaur> which has two coroutine interfaces: generators, which are very heavily used, and a more general interface using the @ operator to yield values to and from coroutines
20:02 <geekosaur> the latter gets mind-bending but not nearly as bad as using raw Cont
20:02 <geekosaur> for me, at least...
20:03 <geekosaur> I suppose it will depend on how you learned coroutines. my path went through Icon so I find those easier to work with. Cont might make folks who first encountered them in Scheme happier, or something
20:06 <orion> My first experience with coroutines was with monad-coroutine.
20:06 Destol joined
20:06 ikke joined
20:06 Drift joined
20:06 <orion> Do you suspect that it's possible (in a clean way) to make an MTL style transformer for Coroutine?
20:07 Kuros` joined
20:08 eazar001 joined
20:09 <geekosaur> not generally possible, no. take a look at the weave and merge functions, which at least hint at the problem
20:09 augur joined
20:09 fotonzade joined
20:09 <geekosaur> hm, actually Coroutine is _already_ a monad transformer.
20:10 Drift left
20:10 <geekosaur> you just have to use great care when two are nested
20:11 <erisco> sad... now ghcjs-boot fails... I hate compiling things
20:11 <geekosaur> mmm, bitrot
20:11 yogsotot_ left
20:12 augur joined
20:13 cdg joined
20:13 <erisco> it downloads a boat load of submodules and then patches them, but a patch fails
20:14 <orion> geekosaur: What do you mean by "already"? I would have expected to see a CoroutineT Monad.
20:14 <geekosaur> orion, Coroutine has an "m" and its runCoroutine gives you a result in m
20:15 <geekosaur> instead of a standalone Coroutine and a CoroutineT over a monad m, you get the CoroutineT but it;'s named Coroutine. and the other is Coroutine Identity
20:15 m` joined
20:15 <orion> hm
20:16 <geekosaur> which is more or less the same thing mtl2 did with State becoming StateT over Identity, but making you create the over-Identity version yourself instead of providing one
20:16 coot____ joined
20:16 cioran89 joined
20:16 twanvl joined
20:16 juanpauc_ joined
20:16 <mojjo> anybody knows, what `#ifdef USE_REPORT_PRELUDE` means in the GHC.List source?
20:17 bigos joined
20:17 jer1 joined
20:17 <geekosaur> the Haskell Language Report specifies implementations for a number of things. if, when building ghc, you have that defined, you get those Report-specified definitions
20:17 <geekosaur> if you don't define that, you get versions that are optimized for how ghc works
20:18 <geekosaur> also, they act as documentation for the behavior (specifically: strictness) that optimized versions must match
20:18 Silox| joined
20:20 <geekosaur> (over the years, a number of optimized implementations of various functions have had to be rewritten because their strictness differed, meaning that programs that are legal per the Haskell Report diverge in ghc when that optimized version is used)
20:20 <orion> geekosaur: But, I can't compose it with, say, StateT, unless I have a MonadState instance for Coroutine.
20:20 lc_ joined
20:20 <geekosaur> that;s not the same as not having a transformer
20:21 <orion> Ok, good point.
20:21 <geekosaur> it has a transformer, if that transformer doesn't provide MonadState, that's a hint that MonadState cannot be provided reliably
20:21 dylanj_ joined
20:22 ertes joined
20:22 u__ joined
20:22 <orion> Is it possible that the author was just lazy?
20:22 mr_sm1th joined
20:22 <geekosaur> possible but not very likely
20:23 <geekosaur> I am wondering what a MonadState instance does when you perform certain operations on a Coroutine
20:23 <orion> https://github.com/centromere/cacophony/blob/master/src/Crypto/Noise/Internal/Handshake.hs#L55
20:24 <geekosaur> in particular you might think about how pogoStick and bounce interact with state
20:24 <geekosaur> the answer there is, you need to specify the exact behavior. which is what the thing you linked to does
20:24 <erisco> looks like Haste is worlds easier to get installed... but there are almost no libs for it
20:25 <geekosaur> a different user of Coroutine might need different behavior, so it is able to specify that instead of having one rammed down its throat and no good way to get rid of it / change its behaviro
20:25 kamyar joined
20:25 <geekosaur> and, in the general case, you can only specify what MonadState should do if you know what the Coroutine(s) involved do
20:26 <geekosaur> there are no laws to specify that it must do <x>; there can't be
20:26 LHoT10820 joined
20:27 <geekosaur> in a certain sense, this also is why MonadBaseControl exists; you can't define a law saying exceptions always must be handled <x> way, you need to define a MonadBaseControl instance saying what to do
20:27 cioran89 joined
20:28 <geekosaur> but as this is a simpler situation, instead of a MonadStateControl type thing, it just makes you make the MonadState yourself that does what you need
20:28 augur_ joined
20:30 darlan joined
20:30 coot____ joined
20:31 <orion> geekosaur: But, is the fact that I had to declare an orphan instance indicative of bad design?
20:31 <geekosaur> no
20:31 <geekosaur> in this case, it is indicative of a problem that nobody can solve for you
20:32 <geekosaur> if that was not clear from what I already said, then I'm not sure how to get it across that not all problems are amenable to "<x> is always the right solution to this particular situation"
20:32 <orion> Ok.
20:32 cioran89 joined
20:32 <orion> Thank you.
20:33 pie_ joined
20:34 tomphp joined
20:34 davr0s joined
20:34 <geekosaur> note that in this case, you will always be specifying some state under your control and as long as you define your MonadState instance over that state type, the instance will not be orphan
20:35 <geekosaur> (because if you do not control that state type then you cannot say how to handle that state in all cases, which is precisely why there is no canned MonadState instance)
20:35 dalek_ joined
20:38 pie_ joined
20:38 jer1 joined
20:38 blym joined
20:40 nickager joined
20:40 pie_ joined
20:42 danthemyth joined
20:44 tomphp joined
20:45 athan joined
20:48 tromp joined
20:49 caumeslasal joined
20:49 sleffy joined
20:50 setzer joined
20:50 umren joined
20:51 tomphp joined
20:58 jer1 joined
20:58 mizu_no_oto joined
20:58 MolluskEmpire joined
20:59 ChaiTRex joined
21:00 JoshS joined
21:01 phyrex1an joined
21:01 iAmerikan joined
21:01 leat joined
21:03 <eacameron> Is there a go-to library for storing hashed/salted passwords in Haskell?
21:04 juanpaucar joined
21:04 ertes joined
21:05 dm3 joined
21:05 jrahmy_ joined
21:06 juanpaucar joined
21:06 preyalone joined
21:07 abroz joined
21:07 juanpaucar joined
21:07 happy0 joined
21:07 unsymbol joined
21:08 marr joined
21:08 tomphp joined
21:09 bjz joined
21:11 Rodya_ joined
21:11 kamyar joined
21:12 louispan joined
21:13 nicootto joined
21:14 <zomg> Wouldn't you usually store those in a database?
21:14 <zomg> unless I'm misunderstanding something :P
21:15 inad922 joined
21:15 obadz joined
21:15 <eacameron> zomg: Right, but I want to hash them in Haskell before storing them in a db
21:16 <eacameron> I think cryptonite looks like a good option. It has convenience functions for storing passwords with BCrypt
21:16 <torstein> What does this error msg mean? trahs: fd:5: hGetLine: end of file
21:16 <torstein> So trahs is name of module; the EOF part is all right, but "fd:5"?
21:17 MolluskEmpire joined
21:17 electrostat joined
21:19 <Tuplanolla> The format is `executable: file:line: function: message`, torstein.
21:19 jer1 joined
21:23 pgiarrusso joined
21:23 spacecadetbrown joined
21:25 <HKei> do I need to do anything special to get Liquid Haskell to read specifications for instances of classes with multiple parameters?
21:25 meliora joined
21:26 <HKei> I have a class Indexed c i a | c -> i, c -> a where (!) :: c -> i -> a
21:27 yojo joined
21:27 <HKei> and {-@ instance Indexed (Vector a) Int a where (!) :: v:(Vector a) -> {i:Nat | i < vlen v} -> a @-}
21:28 <HKei> but I get a parse error on the "a" after Int
21:29 kadoban joined
21:31 pwnz0r joined
21:32 yojo left
21:33 jmiven joined
21:33 zargoertzel joined
21:34 anodium joined
21:34 tabaqui joined
21:34 `^_^v joined
21:35 reliability joined
21:37 uglyfigurine joined
21:39 jer1 joined
21:40 akhov joined
21:40 fotonzade joined
21:40 saussure joined
21:42 kadoban joined
21:42 xcmw joined
21:48 `^_^v joined
21:50 pie_ joined
21:53 hiratara joined
21:56 `^_^v joined
21:56 Wuzzy joined
21:58 Itkovian joined
21:58 lc_ joined
21:58 TCZ joined
21:59 mstruebing joined
22:00 jer1 joined
22:01 Itkovian joined
22:02 lc_ joined
22:03 <Gurkenglas> Requesting "ConduitM i o m (Either e ()) -> Conduit i m (Either e o)"
22:03 `^_^v joined
22:06 zero_byte joined
22:06 cioran89 joined
22:08 <Gurkenglas> Oh. ph88^, instead of "(tryC $ CB.sourceFile input)", try "handleC (yield . Left) (mapOutput Right $ CB.sourceFile input)"
22:08 meliora left
22:10 cheater joined
22:12 juanpauc_ joined
22:12 SkyPatrol_ joined
22:13 kadoban joined
22:16 louispan joined
22:16 bigos joined
22:17 Qommand0r joined
22:17 Wizek__ joined
22:18 e14 joined
22:20 SCHAPiE joined
22:21 mmachenry joined
22:23 Itkovian_ joined
22:23 anuxivm joined
22:24 uglyfigurine joined
22:24 jer1 joined
22:27 oisdk_ joined
22:28 deech joined
22:28 cheater joined
22:29 <deech> Hi all, is there any way to get 'stack build' to output the same thing as 'cabal build'. I'm trying to time the compilation of one component. I've tried 'stack build -v' and 'stack build --cabal-verbose' and neither seem to work.
22:30 saussure joined
22:31 hiratara joined
22:36 JeanCarloMachado joined
22:36 JeanCarl1Machado joined
22:40 <juanpauc_> deech: `stack build mycomponent`?
22:41 Rodya_ joined
22:41 lc_ joined
22:42 halogenandtoast joined
22:43 vgrocha joined
22:45 jer1 joined
22:48 sigmundv__ joined
22:49 sgronblo joined
22:49 zzz joined
22:50 tromp joined
22:52 Wizek joined
22:52 Levex joined
22:54 acidjnk22 joined
22:57 stef204 joined
22:57 davr0s joined
22:58 metaporia joined
22:58 sleffy joined
23:02 zachk joined
23:02 zachk joined
23:03 augur joined
23:03 <rightfold> Is there a flag I can set that makes GHC warn about "as" imports without "qualified"?
23:03 <torstein> Is this the a decent way of doing infinite read-eval loops? "handle (\(SomeException _) -> return ()) $ fix $ \loop -> do; line <- hGetLine r; case line of .."
23:04 <torstein> Seems a bit clumsy
23:05 <kadoban> rightfold: You could probably add that to hlint as a rule maybe.
23:05 jer1 joined
23:06 Voldenet joined
23:06 Voldenet joined
23:07 hololeap joined
23:07 <rightfold> Thanks.
23:08 <hololeap> are monoids in haskell supposed to be commutative as well?
23:08 lambda_foo joined
23:08 cschneid_ joined
23:08 nnplv joined
23:08 <hpc> they don't need to be
23:09 <hpc> > "trivial " `mappend` "example"
23:09 <lambdabot> "trivial example"
23:09 zachk joined
23:10 nnplv joined
23:10 zachk joined
23:11 afarmer joined
23:11 thimoteus joined
23:12 zachk joined
23:12 <Myrl-saki> Is there a catEithers?
23:13 {emptyset} joined
23:13 ericsagnes joined
23:13 <Myrl-saki> Oh. rights.
23:14 NoCreativity joined
23:20 louispan joined
23:20 abroz joined
23:21 mjora7 joined
23:21 rickygee joined
23:22 _mu_ left
23:23 lambda-11235 joined
23:24 juanpaucar joined
23:24 yellowj joined
23:25 ixian joined
23:26 jer1 joined
23:27 <mjora7> I've been looking up a bunch of Yesod tutorials and they all seem to mix frontend stuff in with the backend (like rendering templates). Isn't that a dated style of development? I was under the impression that completely separating the backend and frontend into almost two distinct programs was the more modern way to get (especially if you're using something like Vue, React, Angular, whatever). Am I being misled?
23:28 <Gurkenglas> torstein, if it's infinite you can use forever instead
23:31 mkoenig joined
23:31 <Sonolin> mjora7 I think they list it that way in the tutorials for simplicity's sake
23:32 <Sonolin> I'm sure there's a way to separate them (but that's where my knowledge ends, sorry)
23:32 eschnett joined
23:32 mero joined
23:32 exferenceBot joined
23:33 cjay joined
23:33 tromp joined
23:33 hamishmack joined
23:33 davr0s joined
23:33 louispan joined
23:33 <mjora7> Sonolin: Yeah I can see that.
23:33 <mjora7> Sonolin: Do you use Yesod or something else?
23:34 cschneid_ joined
23:35 afarmer_ joined
23:35 theDon_ joined
23:35 JPohlmann joined
23:36 mxf joined
23:36 markus1189 joined
23:36 markus1199 joined
23:37 reliability joined
23:38 NoCreativity joined
23:38 darjeeli1 joined
23:38 Nicmavr joined
23:40 <Sonolin> I don't use any Haskell web frameworks
23:40 <Sonolin> except for messing around with Servant
23:40 Wizek_ joined
23:40 saussure joined
23:40 ludat joined
23:40 <Sonolin> which is great for API-level stuff
23:42 Rodya_ joined
23:43 <Axman6> I would be separating things like you said if I were doing any front end dev, and probably using something like servant-js to produce the API automatically
23:43 varuaa joined
23:44 <Axman6> we use servant for all out web services, but none of my ones have a dedicated frontend
23:44 <mjora7> Ok that went a bit over my head.
23:45 mbw joined
23:45 xcmw joined
23:47 jer1 joined
23:48 <mbw> Could somebody please explain to me what https://www.stackage.org/haddock/lts-8.14/array-0.5.1.1/Data-Array.html#v:ixmap is supposed to be used for? I would presume it is some kind of index space transformation, but the documentation isn't clear to me. Looking at the source, it seems to be calling array. So wouldn't that just create a new array if I used unboxed arrays, which are supposed to be strict in
23:48 <mbw> their elements?
23:49 Hi-Angel joined
23:49 Rotaerk joined
23:49 <mbw> What I would actually like to do is safe a 4-dimensional array as a 1-dimensional one, making use of some symmetries.
23:52 drcode joined
23:53 Kestrel-029 joined
23:54 alveric3 joined
23:54 nakal_ joined
23:54 cpennington joined
23:56 cables joined
23:57 YongJoon joined
23:58 e14 joined
23:58 halogenandtoast joined
23:58 infinity0_ joined
23:58 obadz joined
23:58 infinity0_ joined