<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 jbiesnecker joined
00:00 <iqubic> wait, so the previous value of the state is overridden with put.
00:01 <sophiag> iqubic: often you want to get the state and then modify it somehow before calling put. you can also just call modify which applies a function to the existing state and then puts it
00:01 <robkennedy> naushadu: Of course I can ignore the (one?) function that targets persistent. But where is that dependency coming from?
00:01 <iqubic> Alright. I kinda get states, but not really.
00:02 nbro joined
00:02 <sophiag> iqubic: think about it like you have a variable you're mutating...except since we don't do that you have to get the old one and then put a new different one in its place. that simple
00:03 <sophiag> it's really all in the name :)
00:03 wlemuel joined
00:04 <erisco> nbro, I typed up a parser for you, keeping everything simple, but lpaste is borked
00:05 <sophiag> lpaste is borked? i just used it
00:05 <erisco> 502 for me
00:05 <naushadh> robkennedy: I've retained the hierarchy from upstream. there are separate hackage/stackage libs for each database backend though the source code is all in one place (sub dirs for each backend).
00:06 <iqubic> lpaste works for me.
00:06 <erisco> did you try pasting something though?
00:06 <nbro> erisco: I actually wrote the parse but not for your grammar and in Scala..
00:06 <erisco> ah it is back again
00:06 eacameron joined
00:06 <erisco> nbro, here you go http://lpaste.net/354303
00:07 <naushadh> robkennedy: I'm sorry, I'm don't understand which function or dependency you're referring to.
00:07 <erisco> note that it does not accept spaces
00:07 <erisco> I'd recommend tokenising first to fix that
00:07 <iqubic> I just wrote a stateful stack implementation.
00:07 <iqubic> And it is really stupidly simple.
00:07 <sophiag> lpaste is always super slow...
00:08 <iqubic> Wait, is a 2-tuple a monad?
00:08 <erisco> oh I am missing parseExp4 _ = Nothing at the end there, let me add that in
00:09 Welkin joined
00:09 <iqubic> how do I unbind variables in GHCi?
00:09 <erisco> :r is one way, or you can overwrite them
00:09 Durbley joined
00:10 <nbro> erisco: thanks a lot for all your help, I will have a look at it and try to understand why my implementation based on your grammar actually was working
00:10 eacamero_ joined
00:10 <nbro> the thing is, I’m learning Scala, Haskell, Compilers, etc, at the same time
00:10 <nbro> lol
00:10 <nbro> not because I want to
00:10 darjeeling_ joined
00:11 <erisco> I never appreciated the rate at which university crams materials down your throat
00:11 <erisco> I just wanted to slow down and think about a topic for a while
00:11 <nbro> since I’m of the idea that we should stick to learn one language for a while before trying to move to another..
00:13 eacameron joined
00:13 <jayjam124> how do you define data that can be shared between threads?
00:13 <nbro> even though Scala is quite is to pick up once you know a little bit of Haskell, but you end up not being as productive as you would like
00:13 <nbro> *quite easy
00:15 Welkin joined
00:15 <iqubic> So alright, I just defined a function: "let test a = do put a; modify (+1); get;
00:15 albel727 joined
00:15 <iqubic> and now I can't run that function at all
00:16 <erisco> iqubic, a better format for some of your "it doesn't work" questions would be to pastebin what you're trying to run along with the error ghci gives you
00:17 <sveit> Two intero questions: 1) is there a way to add necessary import statements without jumping to the top of the file, then jumping back? Detection of the relevant import would be nice too.
00:17 jbiesnecker joined
00:17 ddere joined
00:18 dan_f joined
00:18 <lpaste> iqubic pasted “State Testing” at http://lpaste.net/354305
00:18 <iqubic> Yeah, so that's the output from ghci.
00:18 <iqubic> It isn't working
00:19 <iqubic> It might be a type error of sorts, I suppose
00:19 eacameron joined
00:19 Rodya_ joined
00:20 <Koterpillar> you have to give initial state
00:20 <erisco> when you print something in the REPL it uses the Show instance
00:20 mekeor joined
00:20 <erisco> so since you've tried to print something with the type a0 -> a0, it has looked for Show (a0 -> a0) and didn't find it
00:20 <erisco> because we can't print functions in Haskell
00:21 <iqubic> I have to give an itial state even though it gets overriden?
00:21 <sveit> 2) is there a way to get types of functions (esp. imported ones) even when the code doesn't compile?
00:21 <Koterpillar> iqubic: yes, because you can't guarantee it is
00:21 <erisco> this is just the wrong way to think about the problem here iqubic
00:21 <iqubic> What is the right way to view the problem?
00:21 <erisco> run this :t execState $ test 1
00:22 <Sornaensis> :t execStateT
00:22 <Welkin> this is haskell, not javascript
00:22 <lambdabot> Monad m => StateT s m a -> s -> m s
00:22 <Welkin> it's different
00:22 <erisco> you see the type of that is Num a => a -> a
00:22 <Sornaensis> sveit: yea you can tell GHC to defer errors and it will type check
00:22 <iqubic> Yeah.
00:23 <iqubic> I can't print something of type a -> a
00:23 <erisco> that's right
00:23 deepfire joined
00:23 <sveit> Sornaensis: is there a way to tell intero to do that? Or the vanilla haskell-mode?
00:23 <Welkin> you *can*
00:23 <Welkin> you just need to define a Show instance for it
00:23 <Welkin> but then you decide what it looks like as a String
00:24 <iqubic> I have to give an itial state so that the function get a type of num a => a
00:24 <erisco> yeah but the Show Nazis will descend upon you
00:24 <iqubic> Why do I have to supply an intial state if that just gets overriden?
00:24 <erisco> because that is what the type is
00:24 <iqubic> Alright then. Fair enough
00:25 <Welkin> what do you mean overriden?
00:25 <Welkin> there is no over-riding in haskell
00:25 <Koterpillar> iqubic: here's a function from Int to Int: f _ = 10
00:25 <Welkin> State is just a nicer way of passing around data
00:25 <geppettodivacin> jayjam124: Usually you use either an MVar or a TVar. These are storage locations to put mutable data, and it can be accessed safely by many threads at once.
00:25 <Koterpillar> iqubic: it ignores its argument, but you can't call it without one
00:25 <erisco> > runState (put 1) undefined -- in this sense, Welkin
00:25 <lambdabot> ((),1)
00:25 argent0 joined
00:25 <Welkin> you have an initial State value that gets *replaced* with a new one when you make any "changes" to it
00:26 plutoniix joined
00:26 <erisco> iqubic, your question is like asking why you need to pass another argument to const 0
00:26 <iqubic> Now, can someone give me a situation in which a state would be used, so I can have practice with states
00:26 <erisco> iqubic, the answer is because that is what the type says
00:26 eacameron joined
00:26 <Welkin> iqubic: you'll never use it
00:26 <Welkin> I never have
00:26 <iqubic> Why not Welkin?
00:27 <Welkin> I used it as an exercise to make a small game, but ST is better for that anyway
00:27 <erisco> yeah I can't say I've used it either =\
00:27 <Welkin> Reader is very useful
00:27 <Welkin> learn about that one
00:27 <Welkin> and Writer too
00:27 <erisco> but then again I haven't written any large or product oriented Haskell programs
00:27 <erisco> and I suspect it becomes more relevant there
00:27 andyhuzhill joined
00:27 Kundry_Wag joined
00:27 <iqubic> I understand Writer fairly well.
00:27 plutoniix joined
00:28 <erisco> well at least Reader becomes more relevant, so you can pass your configuration around
00:28 <erisco> maybe a video game example where you have a game state
00:28 <Welkin> I suppose State is helpful for making a toy game in haskell
00:29 <Welkin> then you will quickly switch to using ST
00:29 <Welkin> for web apps, it's not useful at all
00:29 <Welkin> all of your state is stored in a database anyway
00:29 <iqubic> What is ST?
00:29 <Welkin> it's like State, but it lets you mutate inside of it
00:29 <erisco> State for daredevils
00:30 <Welkin> State Thread
00:30 jbiesnecker joined
00:30 <Welkin> ST is very cool
00:30 <iqubic> Wait, can't you mutate the variable in state?
00:30 <Welkin> no
00:31 <Welkin> State is just a nice way to pass around immutable state
00:31 <Welkin> you could do the same thing by explicitly passing around your data in every function
00:31 <iqubic> But doesn't modify change the data in a state?
00:31 <erisco> that is the implementation of State, of course, just passing around the state as an argument
00:31 <Welkin> no
00:31 <Welkin> it replaces it
00:31 <iqubic> Ah. I see
00:32 <erisco> iqubic, (+1) 1 does not change the value of 1 to 2
00:32 <erisco> iqubic, so similarly for modify
00:32 <Welkin> ST is still pure, but allows mutation inside
00:32 <iqubic> Right, it creates a new state.
00:33 <Welkin> http://research.microsoft.com/en-us/um/people/simonpj/papers/lazy-functional-state-threads.ps.Z
00:33 <Welkin> the best intro paper on ST
00:33 <Welkin> and my favorite haskell paper so far
00:33 <rotaerk> oo, he researches principals
00:34 <Welkin> https://www.microsoft.com/en-us/research/publication/lazy-functional-state-threads/
00:34 <Welkin> previous link isn't working right
00:34 <Welkin> pdf: https://www.microsoft.com/en-us/research/wp-content/uploads/1994/06/lazy-functional-state-threads.pdf
00:34 <iqubic> Alright, how can I demonstrate my understanding of the writer monad.
00:34 <Welkin> iqubic: create a logger
00:35 <Welkin> you can use it to, for example, log moves made in a game
00:35 <iqubic> What does a logger do?
00:35 <Welkin> like hangman
00:35 <Welkin> it logs data
00:35 abhiroop joined
00:35 <iqubic> Alright. What functions do I need to implement?
00:36 <Welkin> you want to write your own Writer implementation? Or you want to use Writer?
00:36 <Welkin> either way, figure out what you want to do with it
00:36 nbro left
00:37 <iqubic> I want to use the Writer.
00:37 cpup joined
00:38 whaletechno joined
00:38 <iqubic> I want to make sure I know the Writer well enough to use it.
00:39 dan_f joined
00:39 <rotaerk> iqubic, maybe make an arithmetic expression evaluator that also lists every step of reduction
00:39 <Welkin> LYAH has a good explanation here http://learnyouahaskell.com/for-a-few-monads-more#writer
00:39 carlosda1 joined
00:40 <c_wraith> writer is rarely used in practice. it's a good illustration, but it's only the correct choice to actually use in very rare cases.
00:40 <iqubic> I'll write myself an RPN calculator that keeps a log of the things it's doing.
00:40 <iqubic> c_wrait, why do you say writer is only rarely used?
00:41 <sophiag> you can almost always use applicatives instead of Writer
00:41 <c_wraith> because it frequently is very bad for memory use.
00:41 <rotaerk> hmm, how are applicatives substitutable for Writer?
00:42 <iqubic> But I want to have a String of output created as my RPN calculator goes along.
00:43 <sophiag> rotaerk: usually you're just using Writer as a monoid so you can do that with just by calling Const on an applicative
00:43 jbiesnecker joined
00:45 benl23 joined
00:45 argent0_ joined
00:46 <rotaerk> ah
00:46 <sophiag> glad that made any sense because i didn't explain it very well :)
00:48 <rotaerk> I don't fully grasp it, but it gave me enough information that I'll get there if I think about it
00:50 <sophiag> i would recommend reading essence of the iterator pattern for an intro to applicative style. it uses one example that's very familiar and simple and contrasts monadic and applicative style
00:50 <Welkin> sophiag: is that the title of the paper? Could you provide a link?
00:50 <sophiag> it's actually helped me understand the monad hierarchy in general as a beginner
00:50 <sophiag> sure, one sec
00:51 keep_learning joined
00:51 <sophiag> Welkin: https://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf
00:51 contiver_ joined
00:51 umib0zu joined
00:53 robertkennedy joined
00:53 nighty-- joined
00:55 <iqubic> So, is the Writer Monad important to understant?
00:56 <jle`> important as in you'll use it often?
00:56 <jle`> not really
00:56 <sophiag> iqubic: if you understand monads in general there's really not much to it
00:56 <jle`> important as in insightful?
00:56 <jle`> maybe
00:56 <sophiag> as mentioned, i find it's mostly used with monoids. it's very important to understand monoids
00:57 <iqubic> What the point of a monoid?
00:57 <sophiag> oh boy
00:57 <sophiag> have you read lyah?
00:57 <jle`> oh boy
00:57 <jle`> http://ozark.hendrix.edu/~yorgey/pub/monoid-pearl.pdf
00:57 <iqubic> I have read all of LYAH.
00:57 <jle`> monoids are one of the most beautiful structures that we talk about often in haskell
00:57 <sophiag> they talk about monoids plenty in lyah...
00:58 <iqubic> I know that a monoid are really great for taking a whole bunch of values, and turning them into a single value
00:58 <jle`> monoids are great cause they do it in a principled way that's easy to analyze and optimize
00:58 <jle`> but the Monoid typeclass is also great because it lets you abstract over it polymorphically
00:59 <Sornaensis> :t foldr
00:59 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
00:59 zcourts joined
00:59 <iqubic> Wait, not everything can be folded over? Why is that?
00:59 <jle`> iqubic: if you want a fun Writer challenge, try using Writer with forM_/mapM_/traverse_/for_ to collect all of the items in a Traversable into a list
01:00 <jle`> iqubic: what do you mean not everything can be folded over?
01:00 keep_learning joined
01:00 rah1 joined
01:01 <iqubic> the foldl function has a type constraint of foldable t
01:01 <jle`> that's because foldr/foldl are methods of the Foldable typeclass
01:01 <iqubic> Ah. I see.
01:02 <jle`> sort of like how (+) is a method for the Num typeclass, etc.
01:02 <iqubic> Yeah, I see
01:02 <jle`> if you want to use (+) with a type, you have to write a Num instance for it
01:02 <iqubic> Yeah, I get it now.
01:02 <jle`> well, my answer is actually a bit handwavey
01:02 <jle`> the real answer is that yes, it's not possible to write a meaningful Foldable instance for every type
01:03 <iqubic> So how would one get started with the forM_ and Writer monad challenge?
01:03 <jle`> forM_ :: (Foldable t, Monad f) => t a -> (a -> f ()) -> f ()
01:03 <jle`> so if you use it with Writer
01:04 <sophiag> jle`: do you have a minute to help me figure out this error that's driving me nuts? http://lpaste.net/354300
01:04 <jle`> forM_ :: Foldable t => t a -> (a -> Writer ??? ()) -> Writer ??? ()
01:04 <iqubic> You'd need to get the results one by one as thery were found
01:04 <jle`> yes, but can you accumulate all of the results in a way that you can extract them after the traversal is finished?
01:04 mda1 joined
01:05 Rodya_ joined
01:05 <iqubic> I don't think *I* can.
01:05 <jle`> we are basically re-implementing toList :: Foldable t => t a -> [a]
01:05 vaibhavsagar joined
01:05 <geekosaur> sophiag, I have a feeling you're still barking up every wrong tree you can find, but you are trying to apply unwrapJust to a function
01:05 <jle`> but using forM_ and Writer
01:05 <geekosaur> you might have wanted to apply it to the result of applying the function
01:05 <sophiag> geekosaur: every wrong tree? i'm almost done with this whole program :)
01:05 <jle`> iqubic: forM_ sequences your (a -> f ()) to every item in the Traversable, one-by-one
01:06 <jle`> *in the Foldable
01:06 <iqubic> Sure, what do I do with that though?
01:06 <jle`> iqubic: and we know that a 'Writer' action is an action that accumulates a thing
01:06 <sophiag> geekosaur: but yeah, my problem is with just one half of the type
01:06 <geekosaur> come to think of it, it's *possible* that you just wanted (.) instead of ($)
01:06 <jle`> iqubic: so, we just use (a -> Writer [a] ()) to accumulate the 'a' that we see into a list
01:06 <iqubic> But what is the type of the writer we need.
01:07 <jle`> oh i accidentally gave away the answer
01:07 <jle`> you're accumulating all the a's into a list
01:07 <iqubic> It's fine.
01:07 <geekosaur> but I don't think the types line up for that
01:07 <jle`> so the accumulating type is [a]
01:07 <sophiag> geekosaur: ?
01:07 <iqubic> but why is the other part of the writer an empty tuple?
01:07 conal joined
01:07 <jle`> well, Writer has to return something
01:07 <jle`> but we don't care about what it returns
01:07 <jle`> so it can be anything w/e
01:07 <jle`> (a -> Writer [a] Whatever)
01:07 <jle`> we only care about it for its effects
01:08 <iqubic> Ah.
01:08 <sophiag> geekosaur: the issue is the functions are of type Val -> Maybe Val so i just need to unwrap the result
01:08 <jle`> iqubic: if you use forM/mapM/for/traverse, the results are actually all collected
01:08 <geekosaur> sophiag, you are unwrapping *the function itself*
01:08 <iqubic> So why not just use that?
01:08 <jle`> iqubic: well, all we care about here is the accumulated accumulator
01:08 <jle`> the result isn't useful for this challenge
01:09 contiver joined
01:09 <iqubic> Ah. I see.
01:09 <geekosaur> you presumably want to apply the function to each item in the list, then unwrap that
01:09 <sophiag> geekosaur: but it's not all wrapped in Maybe...otherwise what i'm doing would work
01:09 <geekosaur> no
01:09 <jle`> iqubic: it is admittedly not a challenge that utilizes every aspect of Writer
01:09 <jle`> but it might help you become more familiar with it :)
01:09 <geekosaur> you are confusing ($) (immediate application) with (.) (compositon)
01:09 <sophiag> i understand the difference, but not how composition would make sense in this case
01:09 andyhuzhill joined
01:10 <sophiag> it's not type
01:10 <sophiag> oops
01:10 <jle`> btw there's actually a separate type, Writer-Where-We-Don't-Care-About-The-Result, too, that people oftne use instead of Writer for this situation
01:10 <iqubic> jle` what does tell do?
01:10 <jle`> so Writer is overkill for this, but it's fun
01:10 <geekosaur> you are trying to unwrap the function produced by (getReqConstraint y), *then* apply it to the thing in the list
01:10 <sophiag> Maybe Require a
01:10 <jle`> iqubic: 'tell x' is a Writer action that accumulates x into the accumulator
01:10 <geekosaur> because that's what using ($) means
01:10 <iqubic> Is that what we want to do here jle`>
01:10 a3Dman joined
01:11 <geekosaur> if you want to apply the function produced by (getReqConstraint y) to the thing in the list and then unwrap that, you use composition
01:11 <jle`> iqubic: yes, you can use tell to acucmulate the stuffs you see into the accumulator
01:11 <sophiag> yes, and i understand the problem with that. but composition doesn't make sense to me either
01:11 <sophiag> that would imply Maybe [Require a]
01:11 <sophiag> i have to use the getter first
01:11 <iqubic> I assume tell uses mappend to do the accumulation though.
01:12 <jle`> iqubic: yes, when you sequence multiple tells, the things you tell are mappended together
01:12 <iqubic> Or not.
01:12 <geekosaur> sophiag, I can't see how the types could work together at all, and suspect you are really confused
01:12 <jle`> 'tell x >> tell y' is 'tell (mappend x y)'
01:12 <geekosaur> in particular, you are talking about Require but there is no Require here
01:12 <geekosaur> there is MultiList hjere
01:12 <jle`> or, written nicer if you use (<>) = mappend:
01:12 <jle`> tell x >> tell y = tell (x <> y)
01:12 <geekosaur> as the error message says
01:12 <sophiag> geekosaur: y is of type Require...
01:13 <geekosaur> that doesn't matter
01:13 <iqubic> yeah, but tell doesn't have a type constraint of Monoid
01:13 <jle`> yes, you don't need a MOnoid constraint to tell anything
01:13 <jle`> but you need a monoid constraint to sequence tell's
01:13 <sophiag> right, because i called the getter on it
01:13 <geekosaur> (getReqConstraint y) is fine, the Require is not the problem
01:13 <sophiag> right
01:13 <geekosaur> but it gives you a Val -> Maybe Val
01:13 <sophiag> right
01:13 <iqubic> You don't need the monoid constraint??? Why not?
01:13 <geekosaur> it does not give you a Maybe anything, so you cannot unwrapJust it
01:13 <jle`> iqubic: well, you never need to do any monoiddy stuff with it
01:13 <sophiag> exactly...that's the question i'm asking
01:14 <geekosaur> you have to *apply that function* to get a Maybe
01:14 <jle`> iqubic: the monoidy stuff only happens when you sequence together tell's
01:14 <sophiag> and i don't see how compositon solves it
01:14 <jle`> > runWriter (tell 123)
01:14 <lambdabot> error:
01:14 <lambdabot> • Ambiguous type variable ‘w0’ arising from a use of ‘show_M616952825319...
01:14 <lambdabot> prevents the constraint ‘(Show w0)’ from being solved.
01:14 <jle`> heh
01:14 <geekosaur> it makes sure the list value is applied to the funtion returned by getReqConstraint
01:14 <benzrf> heh
01:14 <jle`> why
01:14 <iqubic> Why is it that the newtype declaration of State and Writer look very similar?
01:14 <jle`> :'(
01:15 <benzrf> iqubic: how so
01:15 cpennington joined
01:15 <jle`> iqubic: well
01:15 <geekosaur> if you use $, then it applies unwrapJust to the function and then tries to apply the result of that to the list item
01:15 <jle`> the relationship is kind of complicated
01:15 <iqubic> newtype Writer w a = Writer { runWriter :: (a, w) }
01:15 <sophiag> geekosaur: the function returned is passed to filter...
01:15 <geekosaur> ...
01:15 xaturn joined
01:15 <Axman6> @unmtl Writer [Int] ()
01:15 <geekosaur> no, it is not
01:15 <lambdabot> ((), [Int])
01:15 <iqubic> newtype State s a = State { runState :: (a, s) }
01:15 <jle`> wait um not really
01:16 <iqubic> AM I wrong?
01:16 <benzrf> iqubic: no that's incorrect
01:16 <jle`> newtype State s a = State { runState :: s -> (a, s) }
01:16 <geekosaur> the function returned is passed to unwrapJust, because *that is what $ means*
01:16 <iqubic> Ah, I am wrong
01:16 <geekosaur> it means exactly "apply this"
01:16 <sophiag> geekosaur: i KNOW that
01:17 <geekosaur> if you do, then there is clearly something else you do not
01:17 <sophiag> if i remove it and do "unwrapJust $ filter p xs" then it still doesn't work
01:17 <sophiag> yes, i asked a question
01:17 <iqubic> jle' how do I make the forM_ work with a writer?
01:17 <sophiag> if i knew how to do this i wouldn't be on irc asking a question
01:17 <geekosaur> and I gave you an answer and got an argument
01:17 <jle`> iqubic: it already works with Writer
01:17 <iqubic> It does?
01:17 <jle`> iqubic: forM_ takes an (a -> f b) function, for any Monad f
01:17 <iqubic> so what's the challenge then?
01:17 <jle`> iqubic: so you can just give it an (a -> Writer [a] ()), to do our job
01:17 <jle`> iqubic: well, you need to write the function
01:18 <sophiag> my question wasn't "why isn't this working?" it was "how can i make this work?" you gave me answer that does not work
01:18 <jle`> use forM_ + Writer to write toList
01:18 Lyraz joined
01:18 <iqubic> I'll try that.
01:18 <geekosaur> because it makes no sense which is what I also said earlier
01:18 <sophiag> composition makes even less ense
01:18 <geekosaur> but your attempts to tell me what you think it is doing are also wrong
01:18 <sophiag> *sense
01:18 shterrett joined
01:18 <jle`> iqubic: remember that forM_ 'runs' the (a -> f b) on every item inside the Foldable, and sequences the resulting 'f b's together
01:19 <sophiag> ok, i'd welcome an explanation. i was under the impression i'm calling filter. why am i not?
01:19 <jle`> iqubic: so you want to give it a (a -> Writer [a] ()) that "adds the a to the accumulator"
01:19 <iqubic> And how would I do that?
01:19 nomicflux joined
01:20 SimpleL joined
01:20 <geekosaur> you are calling filter, with a nonsense expression
01:20 <jle`> well, 'tell :: w -> Writer w ()'
01:20 <jle`> iqubic: so 'tell x' will add x to the accumulator
01:20 <sophiag> which expression? the predicate?
01:20 <geekosaur> yes
01:20 <iqubic> What is the type singnature of the toList function I want to write?
01:20 <sophiag> right. that's what i'm trying to solve
01:20 <jle`> toList :: Foldable t => t a -> [a]
01:21 <sophiag> i've deleted the unwrapJust about 20 minutes ago, fyi
01:21 <jle`> but first, write something like accumulateItems :: Foldable t => t a -> Writer [a] ()
01:21 <geekosaur> and no, I think I'm done with the discussion because what you have doesn't make sense at all, if you fix the ($) you are still left with it wanting to use a MultiList as a Val
01:21 <iqubic> what would accumulateItems do?
01:21 <geekosaur> and I'm not particularly interested in analysiung the whole program to figure out if that even makes sense
01:21 <jle`> it would traverse through all of the items in the Foldable, tell-ing each of those items into the accumulator
01:22 obadz joined
01:22 <jle`> and the end result will be a Writer [a] () that contains all of the items in the Foldable
01:22 eacameron joined
01:22 <sophiag> uh...you could have just not answered me in the first place instead of 20 minutes leading up to "i don't care"
01:22 <MarcelineVQ> sophiag: What do you have currently?
01:22 <jle`> using mapM_ :: Foldable t => (a -> Writer [a] ()) -> t a -> Writer [a] ()
01:22 <iqubic> Yes. I got that.
01:23 <iqubic> How do I tell a whole bunch of things together?
01:23 <jle`> so you can probably write it as accumulateItems = mapM_ (\x -> ?????)
01:23 <jle`> well, you can just tell them one-at-a-time
01:23 <iqubic> I'll try that.
01:23 <jle`> and 'mapM_' is what ties it all together
01:23 <sophiag> MarcelineVQ: http://lpaste.net/354300
01:24 <jle`> mapM_ "does the thing" for all of the items in the Foldable
01:24 <geekosaur> I did care, before you ignored "the types don't work and I can't tell what you are trying to do" to argue about how composition wasn;'t 100% the fix
01:24 eazar001 joined
01:24 <jle`> so if "the thing" is "tell the item into the accumulator", then it'll do that for every item in the accumulator
01:24 abhiroop joined
01:24 <jle`> *it'll do that for every item in the Foldable
01:24 <iqubic> Well, my first attempt has the wrong type signature.
01:24 <MarcelineVQ> sophiag: filter takes a predicate that results in Bool, did you perhaps mean to use isJust or something similar after applying getReqConstraint y?
01:24 <jle`> feel free to paste it :)
01:25 <Sornaensis> @info join
01:25 <lambdabot> join
01:25 <Sornaensis> @src join
01:25 <lambdabot> join x = x >>= id
01:25 <iqubic> accumulateItems = mapM_ (\x -> tell x)
01:25 <jle`> very close
01:25 <iqubic> accumulateItems :: (Foldable t, MonadWriter w m) => t w -> m ()
01:25 <jle`> but remember our Writer is acumulating [a]
01:25 <jle`> but x is :: a
01:25 eacamero_ joined
01:25 <sophiag> MarcelineVQ: will that work? it's of type Val -> Maybe Val
01:25 <iqubic> Ah, I see what to do.
01:25 <jle`> we are accumulating a list, but you're "telling" an item
01:26 <jle`> iqubic: also you might be using 'tell' from mtl, instead of 'tell' from transformers
01:26 <jle`> tell from mtl generalizes "telling" to many different types, not just Writer
01:26 <iqubic> How do I tell which one I am using?
01:26 <jle`> so the type signature will be more polymorphic than you might expect
01:27 <jle`> did you import Control.Monad.Writer, or Control.Monad.Trans.Writer ?
01:27 <jle`> either one works for this exercise, though
01:27 <MarcelineVQ> sophiag: that depends how you write it, you can supply the Val to getReqConstraint first and then use isJust or compose the functions. e.g. , (\x -> isJust (getReqConstraint y x)) (isjust . getReqConstraint y)
01:27 <jle`> just letting you know why your type signature looks different than what we expected
01:27 <iqubic> I am using Control.Monad.Writer
01:27 <jle`> it's because 'tell' in mtl is generalized to work for all sorts of different types, not just Writer
01:27 <jle`> yeah, that's tell from mtl
01:27 <jle`> no big deal though, both will work
01:27 hoo2636 joined
01:27 <iqubic> tell :: MonadWriter w m => w -> m ()
01:27 <sophiag> wait, isJust makes no sense whatsoever to call on a function
01:27 <iqubic> That's the version of tell I am using.
01:28 <jle`> yeah, both versions work fine. just explaining the type signature is all
01:28 <sophiag> no, there's no case in which isJust makes sense
01:28 <MarcelineVQ> I'm not, I'm applying it to the result of fully applying getReqConstraint
01:28 dsh joined
01:28 <sophiag> so to filter?
01:28 <MarcelineVQ> and I suspect what you had originally was equivalent to (isJust (getReqConstraint y) x
01:28 <iqubic> so jle` how do I accumulate a list of item with a writer?
01:28 <MarcelineVQ> which would have been that problem
01:28 <sophiag> no
01:28 <MarcelineVQ> * (isJust (getReqConstraint y)) x
01:28 <jle`> iqubic: well, if you have Writer w, then you can accumulate something into it with tell :: w -> Writer w ()
01:29 <sophiag> iJust is not fromJust
01:29 chocopuff joined
01:29 <jle`> iqubic: so you have Writer [a] here, so you can use tell :: [a] -> Writer [a] ()
01:29 <sophiag> isJust would delete the entire function i'm using
01:29 <MarcelineVQ> :t isJust
01:29 <lambdabot> Maybe a -> Bool
01:29 <MarcelineVQ> filter takes a predicate that results in a Bool
01:30 <iqubic> I can't seem to get this to work properly. What am I missiing?
01:30 <jle`> can you paste what you're trying to do?
01:30 <iqubic> jle`: I can't figure out what is wrong.
01:30 <jle`> write your (a -> Writer [a] ())
01:30 <sophiag> isJust $ Just (\x -> x == 0) is the same as isJust $ Just (\x -> /= 0)
01:30 <jle`> using tell
01:30 <jle`> (\x -> tell ???)
01:30 <sophiag> both return True
01:30 <iqubic> let accumulateItems = mapM_ (\[x] -> tell x)
01:31 <sophiag> hence the function does not matter
01:31 <jle`> iqubic: the function takes single items
01:31 <iqubic> but that's wildly wrong
01:31 <jle`> maybe you meant accumuateItems = mapM_ (\x -> tell [x])
01:31 <iqubic> I did.
01:31 <jle`> yes let's go with that
01:31 <iqubic> But that's still wrong
01:31 <jle`> it is? :o
01:31 dsantiago joined
01:31 <Koterpillar> sophiag: but can't you use the result of filter?
01:31 <MarcelineVQ> sophiag: Perhaps what I'm suggesing doesn't fit your problem, it's hard to tell, but that doesn't change how filter works so let's step back, how are you intended to provide filter with a Bool?
01:32 <MarcelineVQ> *intending
01:32 <jle`> iqubic: it should be right
01:32 <sophiag> just look at the types
01:32 peterbecich joined
01:32 <sophiag> i'm passing it a *function*
01:32 <sophiag> the return type is a Maybe Bool
01:32 <jle`> > mapM_ (\x -> tell [x]) (S.fromList "hello world")
01:32 <lambdabot> error:
01:32 <lambdabot> • Ambiguous type variable ‘m0’ arising from a use of ‘show_M427790427465...
01:32 <lambdabot> prevents the constraint ‘(Show (m0 ()))’ from being solved.
01:32 <iqubic> See, that's why it's not working.
01:33 <Koterpillar> sophiag: I must have missed your paste, mind showing again?
01:33 <jle`> > mapM_ (\x -> tell [x]) (S.fromList "hello world") :: Writer [Char] ()
01:33 <lambdabot> WriterT (Identity (()," dehlorw"))
01:33 <sophiag> Koterpillar: http://lpaste.net/354300
01:33 <sophiag> i suspect i can solve this by combining MultiList and Val somehow
01:33 <jle`> iqubic: it does work, you just needed to give it a type signature so it knows what instance of MonadWriter you want heh
01:33 <jle`> it's because we're using the generic mtl version
01:33 <iqubic> Ah.
01:33 hucksy joined
01:33 <jle`> so 'tell' works polymorphically for a bunch of different types
01:33 <jle`> we want Writer, so, yeah
01:34 <Koterpillar> sophiag: are you sure you don't want catMaybes or similar?
01:34 <iqubic> How do I get GHCi to accept this function as a thing?
01:34 <sophiag> i don't know what that is
01:34 <Koterpillar> :t catMaybes
01:34 <lambdabot> [Maybe a] -> [a]
01:34 <Koterpillar> :t mapMaybe
01:34 <lambdabot> (a -> Maybe b) -> [a] -> [b]
01:35 <jle`> iqubic: accumulateItems :: Foldable t => t a -> Writer [a] (); accumulateItems = mapM_ (\x -> tell [x])
01:35 <jle`> and once you have a Writer, you can get the log out of it
01:35 <sophiag> but that's not what i want
01:35 <jle`> execWriter :: Writer w a -> w
01:35 <sophiag> (a -> Maybe a) -> (a -> a)
01:35 <jle`> execWriter should really be called extractAccumulator
01:35 <jle`> but w/e
01:35 <sophiag> it's a *function*
01:35 <jle`> what a weird name
01:36 <Koterpillar> sophiag: what do you want?
01:36 <sophiag> (a -> Maybe a) -> (a -> a)
01:36 <sophiag> anyway i can just deal with that after
01:36 <sophiag> i need to deal with the other error first
01:36 <Koterpillar> that function can't exist
01:36 <Koterpillar> what would it return on const Nothing?
01:37 <glguy> :t \f x -> fromMaybe x (f x)
01:37 <lambdabot> (t -> Maybe t) -> t -> t
01:37 <Koterpillar> oh, sorry, I'm wrong... but it's not fully defined by that signature
01:37 <jle`> anyway gotta run!
01:37 jbiesnecker joined
01:37 <jle`> good luck!
01:38 <Koterpillar> sophiag: this is really one error
01:38 <sophiag> glguy: i think that might work...fiddling with it now
01:39 d762b440__ joined
01:40 shterrett joined
01:40 carlosda1 joined
01:41 <sophiag> i really think i need to link my data types somehow
01:41 <MarcelineVQ> "<sophiag> the return type is a Maybe Bool" What has that return type?
01:41 <vaibhavsagar> jle`: thanks again for your help yesterday! I got it to work and it was almost exactly how you described it: https://github.com/vaibhavsagar/hakyll-website/blob/b3a6879dcbc43d314a148ffd73271e8672e181d7/site.hs#L96-L103
01:41 <sophiag> i tried going one way, but probable makes more sense to include Val in MultiList
01:43 hucksy_ joined
01:44 Kundry_Wag joined
01:45 <sophiag> i was thinking if i add a data constructor to MultiList like "VList [Val]"
01:47 takle joined
01:48 marsam joined
01:49 icedev joined
01:50 a3Dman joined
01:50 <sophiag> MarcelinVQ: ah, finally got it half right :p
01:52 filterfish_ joined
01:53 <sophiag> MarcelineVQ, glguy: this is what i was referring to. now i just need to deal with the Maybe. it *seems* like fromMaybe should work, but it's not currently
01:53 <sophiag> oops: http://lpaste.net/354300
01:54 systemfault joined
01:56 Supersonic112_ joined
01:57 <sophiag> all i need to do is unwrap the Maybe that returns after applying filter, but that's not working with any of the sensible functions :(
01:58 umib0zu joined
01:59 <Koterpillar> sophiag: \val -> val == BoolVal True
01:59 <Koterpillar> like that?
01:59 conal joined
01:59 juhp joined
02:00 hucksy joined
02:00 takle joined
02:00 <glguy> sophiag: Well, getReqConstraint y :: Val -> Maybe Val. but you need something :: Val -> Bool
02:00 <sophiag> well if i compose unwrapJust (function i wrote that's like a better fromJust) with getReqRequest then i get the most sensible error message at least. it wants Val -> Bool and gets Val -> Val. except Val can be a Bool...so not sure how to unwrap *that* part
02:00 <sophiag> glguy: exactly
02:00 <glguy> sophiag: so write a function with that type
02:01 <glguy> Do you not know about case expressions?
02:01 <Koterpillar> sophiag: \val -> val == Just (BoolVal True)
02:01 <sophiag> they are...they're just wrapped in this Val data type for parsing purposes
02:01 <sophiag> glguy: of course
02:01 mkoenig joined
02:01 peterbecich joined
02:02 <glguy> If they're "wrapped in this Val data type" , you can get at them with a case expression
02:02 <sophiag> maybe i can change unwrapJust to unwrap Val as well...
02:03 <sophiag> glguy: yup, that's what i'm trying now
02:03 louispan_ joined
02:06 <sophiag> um, doesn't Data.Bool come with a data constructor for Bool?
02:06 <Koterpillar> two of them
02:06 <sophiag> i'm getting not in scope...
02:06 <sophiag> oh, wait
02:06 <Koterpillar> they are named (drum roll) True and False
02:06 <sophiag> yeah
02:06 <sophiag> lol
02:07 des_ joined
02:07 <sophiag> um, i need to use the type constructor like a data constructor
02:07 <Koterpillar> a type constructor?
02:07 <sophiag> Bool
02:07 <Koterpillar> sophiag: unwrapThatThing (Just (BoolVal True)) = True; unwrapThatThing _ = False
02:07 <sophiag> ah ok
02:07 <Koterpillar> (also, why?)
02:08 <sophiag> to fix this fucking function :p
02:08 <sophiag> it's complicated why it's like this...i'm parsing asts recursively
02:08 <sophiag> it may be a bit hacky and i'll refactor, not sure
02:08 <Koterpillar> I mean in particular, why did you need the type constructor?
02:09 <sophiag> i don't. i'm doing the obvious thing you just told me to
02:09 <sophiag> and fixed...
02:09 Edith joined
02:10 <sophiag> but i didn't even get to asking the serious question :p
02:10 <sophiag> ok, so here's the working function: http://lpaste.net/354300
02:10 takle joined
02:11 <sophiag> it seems that does actually match every element in each list with every element in the other, right? although perhaps poorly from an efficiency standpoint?
02:11 <sophiag> because that's what i need, not just by index like map
02:11 <sophiag> i feel like this branching recursion is a hacky way to do it tho
02:13 <sophiag> Koterpillar: does that make sense?
02:14 exferenceBot joined
02:15 peterbecich joined
02:15 <Koterpillar> sophiag: sorry, I'm missing the larger context. What I answered before didn't require any actual understanding of your types, I'm reading them now
02:16 <sophiag> oh, what i'm asking now doesn't require you to think about that
02:16 <sophiag> it's just i need to match every element in both lists against one another
02:17 <sophiag> that's why i'm recursing twice, but not sure if there's a better way. it seems kind of hacky and inefficient
02:17 <Koterpillar> I can see that your recursion isn't symmetric
02:18 <sophiag> right
02:18 pavonia joined
02:18 <Koterpillar> and I'm a bit worried that you're calling eval xs [y] from eval xs (y:ys)
02:19 hexagoxel joined
02:19 <sophiag> am i?
02:19 <Koterpillar> I'm ignoring the filter statement
02:19 <sophiag> it's from eval (x:xs) (y:ys)
02:20 <Koterpillar> eval a@(x:xs) r@(y:ys) = if ... then do ... eval xs [y]; eval [x] ys
02:20 <sophiag> whether or not there's a match it tests that first element against every one in the other list
02:20 <sophiag> but for both
02:20 <Koterpillar> note that [y] is y:[]
02:20 infinity0 joined
02:20 <sophiag> hmm?
02:20 <sophiag> it does look weird how i had to wrap the heads in lists like that
02:21 <Koterpillar> oh, sorry, you are recursing
02:21 <Koterpillar> ignore that
02:21 <Koterpillar> afk
02:22 urodna joined
02:23 <sophiag> i still have an error i haven't worked out so i could just focus on solving that and put this off until i've actually tested it
02:23 mrjake joined
02:23 takle joined
02:24 infinity0 joined
02:24 mazeinmaze_ joined
02:26 infinity0 joined
02:27 a3Dman joined
02:27 <sophiag> here's what i'm dealing with: http://lpaste.net/354311. it's pretty obvious why there's an error trying to call eval there given the type, but i'm unsure whether this is even a sound way to structure it... regardless i need to not pass the _whole_ ast to the state functions, but just the lambda and list types and also parse out tags if they're included to call different constructors
02:27 <sophiag>
02:28 <sophiag> err, actually they should select for those types for me
02:28 Lyraz joined
02:28 <sophiag> i think parsing the tags is more complicated since they have the same types as what i'm using for the case analysis in general
02:29 <sophiag> i probably need to add them before the existing ones and just use an additional Var with a variable
02:29 <sophiag> i think i can handle that, but unsure how to fit eval in there :/
02:29 infinity0 joined
02:30 <sophiag> OR i use totally separate versions of evalString for each and the choice operator...
02:31 Swizec joined
02:32 infinity0 joined
02:33 abhiroop joined
02:35 infinity0 joined
02:36 lifter joined
02:36 perrier-jouet joined
02:38 takle joined
02:40 <sophiag> ok, what's the deal with the term "Squiggolers?"
02:40 peterbecich joined
02:40 a3Dman joined
02:41 carlosda1 joined
02:41 Destol joined
02:42 sh0rug0ru joined
02:42 <sveit> i upgraded LTS versions in my global stack config, and have some local projects listed in that global config as well. Now i can't get them to load into ghci. When I run "stack ghci --package LOCALPACKAGE" the output is some configure/build steps but then i can't load the relevant modules
02:42 <sveit> is there some cache I need to delete?
02:43 jbiesnecker joined
02:45 Kundry_Wag joined
02:46 takle joined
02:47 <glguy> sveit: I don't know if there's a stack command for it, but when stack breaks I wipe out the ~/.stack/snapshots/
02:48 <sveit> glguy: i was hoping to avoid that :)
02:49 <glguy> Oh, I misunderstood your problem
02:49 <glguy> I misread it as upgrading your OS somehow (I just installed Ubuntu LTS Desktop in a VM today)
02:50 Sh4rPEYE joined
02:50 eazar001 joined
02:51 sleffy joined
02:52 takle joined
02:53 Sh4rPEYE joined
02:55 falafel joined
02:56 jbiesnecker_ joined
02:57 xtreak joined
03:00 Argue__ joined
03:01 takle joined
03:02 riot_grrrl joined
03:03 <vaibhavsagar> sveit: how do you make your local projects accessible globally?
03:03 riot_grrrl left
03:04 a3Dman joined
03:04 vwker joined
03:05 teggi joined
03:07 wagle joined
03:10 barrucadu joined
03:11 jbiesnecker joined
03:11 Micamo joined
03:12 takle joined
03:13 alecbrick joined
03:13 <Axman6> sveit: #haskell-stack might be more helpful
03:13 safe joined
03:13 <Axman6> (though with longer response time usually)
03:18 jbiesnecker joined
03:23 eklavya joined
03:24 Goplat joined
03:24 takle joined
03:26 kirillow joined
03:27 felixsch__ joined
03:28 cyborg-one joined
03:32 worch joined
03:33 Jesin joined
03:35 takle joined
03:38 sleffy joined
03:39 Chobbes joined
03:42 abhiroop joined
03:42 Micamo joined
03:44 <sveit> vaibhavsagar: you put them as packages in the global stack.yaml
03:44 takle joined
03:44 <sveit> on windows the file is in AppData/Roaming/stack/global-project
03:44 otto_s_ joined
03:45 justan0theruser joined
03:47 peterbecich joined
03:50 xtreak joined
03:51 brynedwardz joined
03:53 worch joined
03:53 pera joined
03:54 vwker joined
03:54 Netwolf joined
03:56 takle joined
03:58 MP2E joined
04:01 micro_ joined
04:01 xall joined
04:04 a3Dman joined
04:05 Swizec joined
04:16 a3Dman joined
04:16 ichor joined
04:17 sleffy joined
04:19 eacameron joined
04:25 takle joined
04:25 aglorei joined
04:26 eklavya joined
04:28 conal joined
04:29 Xanather joined
04:30 eacameron joined
04:30 augur joined
04:32 nwf joined
04:32 raycoll joined
04:33 arctictern joined
04:33 ebzzry joined
04:34 conal joined
04:35 <arctictern> Is there a way to define an Eq instance for a function? E.g. (this is from the Haskell Programming book)
04:35 <arctictern> newtype Combine a b = Combine (a -> b)
04:35 <arctictern> instance Eq (Combine a b) where
04:35 <arctictern> (==) (Combine f) (Combine g) = undefined
04:35 <arctictern> I want to somehow say that f and g always give the same result for any input. But that seems impossible to express, since that would require an infinite amount of checking(?)
04:36 a3Dman joined
04:36 <geekosaur> only possible when inputs and outputs are of bounded types (there's even a set of packages for this on hackage: universe and its dependents)
04:37 BartAdv joined
04:37 eacameron joined
04:37 pikhq joined
04:38 <arctictern> In that case, is there a way to check equality besides listing out every possible input?
04:39 <Koterpillar> you get to decide what equality means
04:39 <Koterpillar> but to satisfy the laws and get anything meaningful out of it... you'll be limited with above
04:39 <arctictern> Equality in the sense that: a == b => f a == f b
04:40 <Koterpillar> then you have to check that for all inputs
04:40 <arctictern> Yea I guess it's impossible to check that
04:40 <arctictern> (if infinite input)
04:40 <Koterpillar> you can't do anything else with f other than applying it
04:41 <arctictern> gotcha
04:41 <arctictern> thanks
04:41 <EvanR> are cis 194 notes still around?
04:42 fakenerd joined
04:42 <EvanR> arctictern: you could express this with dependent types
04:43 JoshS joined
04:43 carlosda1 joined
04:43 <EvanR> (isnt a = b => f a = f b clear from f being a function)
04:43 krazedkat joined
04:43 <EvanR> @where cis 194
04:43 <lambdabot> I know nothing about cis.
04:43 eacameron joined
04:44 <EvanR> o_O
04:44 <arctictern> oh sorry mean g b
04:44 <EvanR> you mean for all x . f x = g x
04:44 <Koterpillar> there's an implied "for all a"
04:44 <arctictern> i'm not familiar with dependent types. is there a high level explanation you can give, or should I just read up
04:46 takle joined
04:46 chrisdotcode joined
04:46 <Koterpillar> I can take a guess: if you limit the type of functions, you'll be able to reduce the domain of a
04:46 <Koterpillar> for example, instead of forall a b. a -> b, require forall a b. Bounded a => a -> b
04:47 <Koterpillar> sorry, instead of concrete a and b
04:48 Kundry_Wag joined
04:50 <geekosaur> http://hackage.haskell.org/package/universe-reverse-instances-1.0/docs/Data-Universe-Instances-Eq.html
04:50 _sras_ joined
04:51 <_sras_> Is there a way to limit the length of a String field in the target type, in a FromJSON instance?
04:51 <geekosaur> @where cis194
04:51 <lambdabot> http://www.seas.upenn.edu/~cis194/spring13/
04:52 vlatkoB joined
04:52 <vaibhavsagar> _sras_: you can `take len decoded` in a manually written instance
04:52 Levex joined
04:53 abhiroop joined
04:54 yellowj joined
04:55 <_sras_> vaibhavsagar: But it wont result in a parse failure, right?
04:55 <arctictern> geekosaur thanks. In context of the problem I was being a bit stupid, it suffices to use quickcheck to generate random inputs
04:56 Elsi joined
04:56 Deadhand joined
04:56 abrick joined
04:57 <glguy> testing random inputs isn't sufficient to write a reasonable Eq instance for functions
04:57 MarioBranco joined
04:57 <vaibhavsagar> _sras_: it shouldn't, I think `take` is total
04:58 <ezyang> "unless they're polynomials!"
04:58 <vaibhavsagar> unless your input is not a string
04:58 <vaibhavsagar> in which case you'd get a parse failure anyway
04:58 <vaibhavsagar> so using `take` shouldn't cause a parse failure when no parse failure would have occurred otherwise
04:59 <_sras_> vaibhavsagar: What if I do a check like `(length $ take maxLength+1 input) == maxLength + 1` and throw an error if it is True?
05:00 mzf joined
05:00 Jeanne-Kamikaze joined
05:00 abhiroop joined
05:00 <vaibhavsagar> _sras_: you can `fail` with an error in that case if you want
05:00 <vaibhavsagar> can you tell me a bit more about the use case?
05:01 a3Dman joined
05:01 takle joined
05:01 <jle`> is there any library that lets me generate Num instances using Generics
05:01 DataComputist joined
05:01 ebzzry joined
05:02 <_sras_> vaibhavsagar: I am getting this object from a web request, and I want the parsing of this object to break if this particular string is larger than a certain length..
05:02 <glguy> jle`: I don't know, but I can help if you start implementing it yourself
05:02 jchia joined
05:02 <glguy> I'm guessing you intend to support product types where all the fields themselves have Num instances
05:03 <jle`> yes that is basically it
05:03 <jle`> i have a lot of those and it's been getting tiring implementing Num/Fractional/Floating for all of them
05:03 <jle`> i see this package https://hackage.haskell.org/package/generic-deriving but it doesn't even have Num
05:03 <Koterpillar> it's not hard to write
05:03 <glguy> You'll just need 4 instances, M1, :*:, K1, U1
05:04 <Koterpillar> glguy: do you know why are they named like that?
05:04 <jle`> Koterpillar: it's just that they are boilerplate, that's all
05:04 <jle`> and i have several dozen
05:04 <Koterpillar> jle`: I meant the Generic instances
05:04 <jle`> oh yeah, yes, it's not that hard
05:04 <glguy> Metadata, * for product, K for constant, U for unit
05:04 <jle`> which is why i'm surprised that it's not done yet
05:04 <Koterpillar> glguy: "Metadata" is _already_ better than M1
05:05 dec0n joined
05:05 <Koterpillar> I know what they mean, and I've read the paper (looks beautiful, too), but it's a barrier
05:05 abhiroop joined
05:05 <jle`> it looks like the names of the types in in GHC.Generics were designed to be especially opaque
05:05 <glguy> The hard part is just learning to think in those terms, the words are the easy part
05:05 <jle`> despite not being that difficult
05:05 <glguy> the instances get long enough with 2 character names
05:06 peterbecich joined
05:06 <EvanR> i noticed for slick implementations like stuff, they like to use single letter ctors where possible, to make typing the implementation code easier
05:06 <Koterpillar> glguy: what about Rec0?
05:06 <Koterpillar> glguy: why is Rec0 a type synonym through K1?
05:06 <glguy> They used to have a special case for recursive occurences
05:07 <Koterpillar> in the library?
05:07 <Koterpillar> or just in the paper?
05:07 <vaibhavsagar> _sras_: yes, I think that will work
05:07 <glguy> In the library, but now there's just one version of K1 generated
05:07 <jle`> im going to make the package i guess
05:07 <glguy> It lingers for backward compatibility
05:07 <Koterpillar> heh, ok.
05:07 <jle`> i spent a while searching through hackage for 'numeric' and 'generics' but didn't find anything
05:08 <Koterpillar> jle`: to be sure, I searched for GNum and Num' but they look unrelated
05:08 takle joined
05:08 <glguy> jle`: Be a pro, generate the instances using generics
05:08 <glguy> all the method definitions are going to be boring mechanical!
05:08 <vaibhavsagar> _sras_: maybe this section of Artyom's Aeson tutorial will help: https://artyom.me/aeson#more-interesting-choices
05:09 Edith joined
05:09 <jle`> glguy: yea,h i'm going to make a package with them
05:09 <glguy> Oh, nevermind, just make 3 class methods
05:09 <glguy> one for lifting binary operators, one for unary, one for nullary perhaps
05:10 <jle`> is the best way to do this to make a GNum typeclass
05:10 <jle`> is that just to avoid having a naked constraint on Rep
05:10 <glguy> Yeah, make a new typeclass. the methods will be different from Num anyway
05:11 <jle`> what methods should i expect it to have?
05:11 <EvanR> generate Generic instances using generics?
05:11 <glguy> liftOp2 :: (forall a. Num a => a -> a -> a) -> f p -> f p -> f p
05:11 <Koterpillar> jle`: mirror Num
05:11 <jle`> ah.
05:11 <Koterpillar> ooh
05:11 <jle`> that's probably better.
05:11 <Koterpillar> glguy: nice
05:11 <glguy> jle`: or make Num a parameter of your class
05:11 <jle`> then i could write instances for Floating/Fractional/Num as well
05:11 <jle`> using only that one typeclass
05:12 <glguy> and then you can reuse it for Floating, Fractional, etc
05:12 <jle`> ...i could even derive Monoid too
05:12 <jle`> or any other typeclass where all of the functions are of the form ... -> a
05:13 <jle`> but i think Num/Fractional/Floating/Monoid/Semigroup are the only ones in base
05:13 <jle`> but now is the hardest part...
05:13 <jle`> picking a name for the package
05:14 <vaibhavsagar> acme-number?
05:14 <Koterpillar> genumeric
05:14 <jle`> generics-lift
05:14 <jle`> then people can use it to implement their own typeclasses too
05:14 <Koterpillar> why not make a PR for an existing one?
05:14 <jle`> since this pattern can be used to easily implement Num/Fractional/Floating/Monoid/Semigroup
05:14 <jle`> what existing one?
05:15 <Koterpillar> generic-deriving or whatever you found
05:16 <glguy> Hmm, fromIntegral is going to be hard to fit neatly into the generic deriving class
05:16 takle joined
05:16 <jle`> fromIntegral would just be lift0
05:16 <glguy> what type would that have?
05:17 <glguy> Oh, I guess we'll be able to do: fromIntegral x = lift0 (fromIntegral x)
05:17 <glguy> I had started doubting myself :)
05:21 Destol joined
05:22 hybrid joined
05:22 lifter joined
05:22 MarkusH1 joined
05:23 ner0x652 joined
05:23 thunderrd joined
05:23 <jle`> not sure if should make it as a PR or as a new package
05:24 <glguy> step 1, try it out
05:24 f-a joined
05:24 <jle`> good call
05:24 Rodya_ joined
05:24 <f-a> hello, in my cabal file (for an executable) I put a bunch of "other modules". Do I need them? Or can I erase them safely? (same for tests)
05:25 <jle`> f-a: do you mean do you need to put those modules there?
05:25 <jle`> or are you asking if you need those modules at all
05:25 <f-a> first one, jle`
05:26 <jle`> it's good practice to list them if you use them, i believe
05:26 geppettodivacin joined
05:26 <jle`> i think cabal warns you if you don't
05:26 <kadoban> f-a: Generally you can't erase them safely, assuming they're used. AFAIK, every module you have should be in exposed-modules or other-modules for some component
05:26 <f-a> okie dokie
05:26 <kadoban> I believe if you do it wrong you end up with wacky linker errors in some pattern that I've yet not been able to decipher.
05:27 Vaelatern joined
05:29 codesoup joined
05:29 alecbrick joined
05:29 <f-a> also what happened to hackage download numbers
05:29 <f-a> did we finally make it big :P
05:30 Khisanth joined
05:30 whiteline joined
05:31 Jackoe joined
05:31 <lpaste> glguy pasted “some generics” at http://lpaste.net/354316
05:32 <glguy> jle`: I want to figure out how make that generic so it works over operations of arbitrary arity next...
05:32 <jle`> my gut says that that isn't possible
05:33 <jle`> but i won't stop you
05:33 <dmj`> "arbitrarity"
05:34 takle joined
05:34 cur8or joined
05:34 <dmj`> Maybe something with ConstraintKinds and type families
05:36 <glguy> But we've got so many extensions now, everything should be possible!
05:36 <jle`> hm
05:36 fakenerd joined
05:36 <jle`> i suppose it might be possible with some Printf-type magic
05:37 MP2E joined
05:37 osa1 joined
05:37 <glguy> I suspect we'll need more magic than Printf
05:38 <Koterpillar> what if you curry it all?
05:38 <Koterpillar> instead of a -> a -> a -> a, use a type-level list as the only argument: (a, (a, (a, ()))) -> a
05:38 xall joined
05:38 <jle`> hm. yeah you can write a generic curry using HList
05:40 geekosaur joined
05:42 treehaqr joined
05:42 Levex joined
05:42 <jle`> actually it would definitely be nice to have a version with arbitrary arity
05:42 takle joined
05:43 <dmj`> @package poly-arity
05:43 <lambdabot> http://hackage.haskell.org/package/poly-arity
05:43 <dmj`> think athan was doing something similar a while ago
05:43 carlosda1 joined
05:43 alecbrick joined
05:44 <EvanR> lisp eat your heart out
05:44 <glguy> yeah, that's basically what I'm working with now, but with a Nat instead of a list
05:46 cur8or_ joined
05:47 <mikeplus64> i have a complicated quickcheck property where two of the generated parameters depend on another -- is there a nice way to get them included in the output? i'd rather not resert to just 'print'
05:47 <glguy> I'm running into cases I've told people on this channel that they can't avoid :)
05:49 safe joined
05:49 <mikeplus64> so i have something like: testProperty "asdf" (\dep -> do x <- genThing dep; y <- genThing (f x dep); return (f x (f y dep) === f (commute x y) dep)
05:50 <EvanR> https://pbs.twimg.com/media/C8QejJ1VoAAQgDE.jpg
05:50 uglyfigurine joined
05:51 <mikeplus64> where i'd like 'x' and 'y' to be included in the output somehow without just print'ing them (because the output might get very confusing for a large test suite ran in parallel ... maybe tasty is magic though)
05:52 <mikeplus64> oh, durr, forAll. crisis averted
05:53 quchen joined
05:53 f-a left
05:54 lifter joined
05:55 <jle`> EvanR: love it
05:55 ThomasLocke joined
05:55 ThomasLocke joined
05:55 meandi_2 joined
05:56 takle joined
05:56 peterbecich joined
05:56 igniting joined
05:56 <dmj`> EvanR: so much truth in that
05:59 <Squarism> anyone know if theres any work done on creating a platform agnostic runtime for haskell? Like what is available for java? Or is that concept dated now that docker and likes are maturing?
05:59 sypwex joined
06:00 lifter joined
06:00 <EvanR> jle`: dmj` on the twitter post i got this from, the bottom 4th is cut off
06:00 <EvanR> i only realized the punchline after opening in a new tab
06:00 <EvanR> i was like... what and then i got it
06:01 <MarcelineVQ> :>
06:01 <EvanR> down with transformers!
06:01 <dmj`> EvanR: was it from Cale? :)
06:02 dmiles joined
06:02 <Koterpillar> Squarism: there's eta
06:02 <EvanR> dmj`: data Matt where
06:03 mbuf joined
06:04 insitu joined
06:04 <Squarism> Koterpillar, i knew about that. I thought there would be lots of compromises reusing jvm - not that i know about the details.
06:05 plutoniix joined
06:05 hurkan joined
06:05 raichoo joined
06:05 <jle`> glguy: it all works, nice https://github.com/mstksg/generics-lift/blob/master/src/GHC/Generics/Numeric.hs
06:05 <jle`> ty for the help
06:05 <dmj`> EvanR: related: https://pbs.twimg.com/media/CypY7B1W8AAvqwl.jpg
06:06 <jle`> now i'm going to spend my time figuring out how to generalize the arity, but for no practical benefit
06:06 <jle`> just another day in haskell
06:06 plutoniix joined
06:06 <glguy> jle`: :)
06:06 <EvanR> hahahhahhaa
06:06 <cocreature> jle`: you just need to claim you’re doing it for science, then it seems really important
06:08 <jle`> how many hours have i sunk for 'science'
06:08 Gurkenglas joined
06:08 <jle`> i suppose i could harvest imaginary internet points if i distill it into a blog post
06:08 Itkovian joined
06:08 a3Dman joined
06:08 takle joined
06:09 ragepandemic joined
06:15 Gurkenglas_ joined
06:15 juri_ joined
06:15 MoALTz joined
06:17 harfangk joined
06:18 razi1 joined
06:18 Gurkenglas_ joined
06:19 arctictern joined
06:19 kosorith joined
06:19 takle joined
06:22 ogrady joined
06:26 Rodya_ joined
06:28 insitu joined
06:29 Destol joined
06:30 kritzcreek_ joined
06:30 sw1nn joined
06:31 uglyfigurine joined
06:32 takle joined
06:33 jhrcek joined
06:34 {emptyset} joined
06:34 <abhiroop> has anybody encountered this error: "Haskell process command errored with: (error "Unexpected response from haskell process.")" while working in haskell mode in emacs
06:35 ubsan_ joined
06:39 Jin__ joined
06:39 sw1nn joined
06:40 Rainb joined
06:41 Gloomy joined
06:41 govg joined
06:41 juhp joined
06:44 thunderrd joined
06:44 carlosda1 joined
06:45 baldrick joined
06:46 kaeluka joined
06:46 sw1nn joined
06:46 takle joined
06:48 jgertm joined
06:48 fxg joined
06:51 <Gurkenglas_> abhiroop, http://haskell-channel-logs.blogspot.de/2017/01/haskell-channel-featuring-zennist.html
06:52 dni joined
06:52 <abhiroop> I saw this
06:52 alfredo joined
06:52 <abhiroop> It says there might be an issue with the cabal file
06:53 <abhiroop> My cabal file looks like this: https://github.com/rahulmutt/codec-jvm/blob/master/codec-jvm.cabal
06:53 thc202 joined
06:53 <abhiroop> Does anybody see any issue in this?
06:53 Salih joined
06:54 DataComputist joined
06:54 <Gurkenglas_> *summons ertes*
06:54 free_beard joined
06:55 DataComputist joined
06:55 geppettodivacin joined
06:55 DataComputist joined
06:55 insitu joined
06:55 DataComputist joined
06:56 Itkovian joined
06:57 DataComputist joined
06:58 <jle`> why is Floating so huge
06:59 guest4541 joined
06:59 <jle`> it has 18 methods
07:01 rootnode joined
07:02 benl23 joined
07:02 <jle`> if your type implements sqrt then it also has to implement hyperbolic arctangent
07:02 <cocreature> jle`: well how do you split them up reasonably?
07:03 <jle`> there is no good answer
07:03 <jle`> ;_;
07:03 <cocreature> 12 of those 18 methods are just the trygonometric functions so these belong in one class
07:03 <cocreature> I guess you can argue that exp, log, sqrt, (**), logBase could go in a separate class
07:04 <cocreature> but I’m not sure if that would actually enable more instances
07:04 mda1 joined
07:04 Micamo joined
07:04 xtreak joined
07:05 fly_ joined
07:05 <jle`> i don't think it would, that i know of
07:06 <jle`> but i was just speaking from the perspective of the burden of writing the instances
07:06 takle joined
07:06 xtreak joined
07:06 albertid joined
07:07 uncertainty joined
07:08 <cocreature> fair enough
07:08 <cocreature> hm, I don’t think I’ve ever written an instance of Floating
07:08 mattyw joined
07:09 raichoo joined
07:09 slomo joined
07:10 HugoDaniel joined
07:10 <jle`> Floating is similar to Num/Fractinal in that all its methods are '-> a'
07:10 <jle`> er, '.. -> a'
07:11 <jle`> so it can be implemented for all Applicatives using pure/fmap/liftA2/etc.
07:11 Aruro joined
07:11 detrumi joined
07:11 uglyfigurine joined
07:12 PennyNeko joined
07:13 slomo joined
07:13 insitu joined
07:14 quchen joined
07:14 guiben joined
07:15 jgt joined
07:16 vlatkoB joined
07:16 govg joined
07:17 fizruk joined
07:18 takle joined
07:18 numeo joined
07:18 Vivek joined
07:19 irishsultan joined
07:20 ventonegro joined
07:20 connrs joined
07:22 andyhuzhill joined
07:22 freusque joined
07:24 <glguy> jle`: still up?
07:24 <jle`> i am
07:25 mstruebing joined
07:25 <lpaste> glguy annotated “some generics” with “some progress” at http://lpaste.net/354316#a354320
07:26 <glguy> I need to do the logic to curry/uncurry those V n a -> a operations still
07:26 <jle`> well, if it compiles, then let's ship it
07:26 <jle`> oh i see
07:26 uglyfigurine joined
07:26 <glguy> and I'm reproducing some of the machinery that Data.Functor.Rep gives you
07:26 takle joined
07:27 guiben joined
07:27 <glguy> I think that these types might change too much for that to work out directly
07:27 <glguy> but it feels quite related
07:27 eazar001 joined
07:28 Rodya_ joined
07:29 <jle`> where is Data.FUnctor.Rep ?
07:29 <glguy> http://hackage.haskell.org/package/adjunctions-4.3/docs/Data-Functor-Rep.html#t:Representable
07:30 Yuras joined
07:30 <glguy> Instead of : tabulate :: (Rep f -> a) -> f a
07:31 freusque joined
07:31 <glguy> I want tabulate' :: (Rep x a -> a) -> x
07:31 <glguy> index :: f a -> Rep f -> a ---> index' :: x -> Rep x a -> a
07:31 juhp joined
07:32 <glguy> correction: I want tabulate' :: (forall a. Rep x a -> a) -> x
07:33 carlosda1 joined
07:33 <jle`> ah hm
07:34 mattyw_ joined
07:36 dcoutts_ joined
07:36 zeroed joined
07:38 baldrick joined
07:38 milky joined
07:39 jasondockers joined
07:39 <jasondockers> Any suggestions on how to set up a Haskell environment on Windows?
07:40 Yuras joined
07:41 <Gurkenglas_> jasondockers, https://docs.haskellstack.org/en/stable/README/
07:42 abhiroop_ joined
07:42 <jasondockers> Gurkenglas_, thanks. I actually didn't know about that site.
07:42 biglama joined
07:43 eacameron joined
07:43 ebzzry joined
07:43 filterfish joined
07:43 eklavya joined
07:44 carlosda1 joined
07:44 filterfish_ joined
07:44 augur joined
07:45 augur joined
07:48 unK_ joined
07:50 Kundry_Wag joined
07:51 danm joined
07:51 uglyfigurine joined
07:51 <Aruro> jasondockers: do u have possibility to install linux?
07:51 eacameron joined
07:52 oish joined
07:53 <jasondockers> Aruro, I'd rather not. I would have to run a VM which is significantly slower than using the host operating system (windows 10)
07:53 <jasondockers> though I thought windows 10 could execute elf files?
07:54 <Aruro> jasondockers: most haskellers are on linux, just saying
07:54 abhiroop joined
07:54 dni joined
07:54 <jasondockers> given the support for other operating systems, I'm not surprised
07:54 <jasondockers> but I'm not using it seriously, so less than perfect support should be alright
07:55 filterfish joined
07:56 freusque joined
07:56 mceier joined
07:57 peterbecich joined
07:57 <jasondockers> the language syntax in the REPL is the same as when compiling it, right? I could have sworn I read that the syntax is slightly different, which seems odd to me
07:58 <Aruro> same
07:58 <Aruro> in ghc 8
07:58 <Aruro> had some mandatory let statements before, not anymore
07:58 <glguy> That's not to say that you can paste a .hs file line by line into GHCi and expect it to work
07:58 louispan joined
07:59 <jasondockers> okay, thanks.
07:59 <Aruro> jasondockers: you should load file in ghci, ghci MyWindowsHopes.hs
07:59 takle joined
07:59 <Aruro> or with :l command
07:59 <jasondockers> alright
08:00 <jasondockers> okay, for the time being I'll just run from the command line and edit with visual studio code. heh
08:01 <Aruro> some editors have haskell syntax coloring
08:02 <Aruro> maybe even notepad++
08:03 raichoo joined
08:03 t0by joined
08:03 t0by joined
08:04 <jasondockers> visual studio code has syntax highlighting support and it is apparently aware of the compiler with an extension
08:04 <jasondockers> visual studio code != visual studio
08:05 <Aruro> nice nice
08:06 uglyfigurine joined
08:06 filterfish joined
08:08 <glguy> jle`: *Derive> genericOpN @Num @('S ('S 'Z)) (+) (1,2.3) (4,5.6) -- (5,7.8999999999999995)
08:09 <jle`> glguy: nice :O
08:09 <jasondockers> Aruro, https://marketplace.visualstudio.com/items?itemName=UCL.haskelly
08:09 cloudhead joined
08:10 <lpaste> glguy annotated “some generics” with “more curry” at http://lpaste.net/354316#a354321
08:10 mtesseract joined
08:10 benl23 joined
08:11 <Disavowed> Evening all. Likely another stupid question: is there a way to view the source for a function from within ghci? Something similar to Clojure's (source <function_name>), if anyone is familiar.
08:11 <Aruro> jasondockers: actually pretty much same ide support at on linux, very nice
08:11 <Aruro> as*
08:12 <glguy> Disavowed: There is not.
08:12 <Aruro> Disavowed: not, haskell does not like looking.
08:12 <Aruro> sadly.
08:12 Swizec joined
08:12 <glguy> Source code is typically linked in the generated haddock documentation, however
08:12 <Aruro> @source map
08:12 <lambdabot> Unknown command, try @list
08:13 <Aruro> @list
08:13 <lambdabot> What module? Try @listmodules for some ideas.
08:13 <Aruro> uhh, there is some simplistic source command in lambdabot
08:13 <Disavowed> Aruro: I believe you! Thank you for trying.
08:13 <Disavowed> glguy: TIL Haddock. Thank you
08:14 <kadoban> @src print
08:14 <lambdabot> print x = putStrLn (show x)
08:14 <Aruro> there^
08:14 <Disavowed> Ah nice!
08:14 eacameron joined
08:14 <Aruro> @src foldr
08:14 <lambdabot> foldr f z [] = z
08:14 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
08:14 <kadoban> lambdabot's @src command is pretty crappy though honestly. It just reads from a custom text file, so it's both missing a ton and full of lies
08:14 <Aruro> true
08:14 <Aruro> but would be nice to have it in ghci
08:15 <Aruro> especially for beginners
08:15 lep-delete joined
08:15 <jasondockers> maybe you should get rid of it if it has the potential to be misleading
08:16 <glguy> It's useful for explaining how simple operations work
08:16 Croniamental joined
08:16 <Phyx-> 08:51:47 < Aruro> jasondockers: do u have possibility to install linux? <-- I wish people would stop with this useless arrogant pointless advice
08:16 <Aruro> Phyx-: what is arogant? that i want him to use free things people actually contribute to?
08:17 <Aruro> or that u want to sell stuff?
08:17 <glguy> Right? Obviously the answer is a mac
08:17 <kadoban> It's not useless or arrogant. A VM is a valid solution. The linux/unix/whatever tooling for haskell seems to be much better tested and well used.
08:17 <kadoban> It's not language wars nonsense, typically, it usually appears to be an attempt at practical advice.
08:17 Mortomes|Work joined
08:17 <jasondockers> I would use Linux based on advice from Aruro and others if it were in a professional setting. but it's just for recreation.
08:17 <kadoban> er OS wars nonsense I meant
08:18 <brynedwardz> I'm on Windows 10 at work and do all my development through an Arch Linux guest vm
08:18 <jasondockers> I use every mainstream OS :) -- they are all terrible in unique ways
08:18 dni joined
08:18 <brynedwardz> ^
08:18 <Phyx-> brynedwardz: that's great for you. But if someone asks how to set up haskell on Windows, answer the question for windows or don't answer
08:19 <brynedwardz> Phyx-: Of course!
08:19 <Phyx-> "install linux" is dismissive of all those who work on improving haskell on Windows
08:19 <brynedwardz> I agree, to each their own
08:19 <kadoban> Phyx-: Now who's arrogant? Nobody can answer except the way you want them to?
08:19 <Phyx-> if you have a specific complaint about the tooling on Windows, report it. don't passively aggresively say install another OS
08:19 cfricke joined
08:19 richi235 joined
08:20 <jasondockers> kadoban, this new place I work at actually lets you use any OS and any language (decided at the beginning of a new project) based upon what fits the best for the given problem. assuming the learning curve isn't absurd for those involved. it's kind of nice.
08:21 <kadoban> jasondockers: That does sound like a nice policy. I've been stuck in ... weird combinations of tools before because of IT rules :-/
08:21 <jasondockers> kadoban, well, we have to use different computers to read our emails :)
08:22 sphere joined
08:22 merijn joined
08:22 Wizek joined
08:22 <kadoban> Heh, different from the dev machines? I guess that's reasonableish
08:23 Wizek_ joined
08:23 <jasondockers> yes
08:23 takle joined
08:23 <Aruro> Phyx-: there is nothing wrong with trying to convert people to open world. its your right to defend tooling on windows. nobody is against haskell on windows.
08:25 augur joined
08:26 systadmin joined
08:27 a3Dman joined
08:27 uncertainty joined
08:28 stphrolland joined
08:28 pdgwien joined
08:28 <stphrolland> merijn: i'm blocking on the last part of your execrise on MyStateT. I don't succeed to write the (>>=) operator. I find no way to escape from the m monad. I find ways to have some sort of m(MyState s m b) stuff. But I find no way to only have MyStateT. On Hoogle there's something interesting: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a), that would invert the encapsulation order between t and m...
08:29 <stphrolland> but that would need to bring the constraint Traversable, which I think is not the aim of the exercise.
08:29 <stphrolland> Do you have any clue or indication of what I must search so has to complete the exercise on writing the bind operator for MyStateT, where is the trick ?
08:29 fendor joined
08:29 HugoDaniel joined
08:29 <merijn> stphrolland: Can you lpaste what you have so far?
08:30 <stphrolland> yep
08:30 systadmin joined
08:31 uglyfigurine joined
08:31 biglama joined
08:32 <stphrolland> http://lpaste.net/354324
08:33 <stphrolland> I wanted to have inspiration from the (<*>) implementation, but nothing sparkles
08:33 <merijn> stphrolland: btw, you can simplify your version of modify :)
08:33 <stphrolland> merijn: with bind ?
08:33 <merijn> bind and/or fmap :) "fmap f get >>= put"
08:33 <merijn> The let is kinda redundant
08:34 <merijn> You could also write "newVal <- f <$> get; put newVal"
08:34 <merijn> stphrolland: You also shouldn't have to qualify the 'return' on line 13/16
08:34 <merijn> just "return" instead of Control.Monad.return
08:35 <stphrolland> I think it was in reaction to the compiler, but I will try it again without
08:36 <merijn> stphrolland: You could also simplify the Functor, I think
08:36 <stphrolland> okay, I will search for a short version
08:37 redeemed joined
08:37 <lpaste> merijn pasted “Simplified” at http://lpaste.net/354325
08:37 <merijn> It's basically the same, but avoids introducing a lot of names with one use
08:38 <osa1> anyone know a portable fork() in some library? I have a GUI app and I want to fork it on startup to be able to detach it from the running shell
08:38 jaspervdj joined
08:38 <merijn> osa1: Define portable
08:38 <merijn> osa1: POSIX?
08:38 <osa1> merijn: that's portable enough
08:38 <osa1> well
08:38 <osa1> fork() is already POSIX, right?
08:39 <osa1> so maybe I should just fork()
08:39 <osa1> I can't even find a wrapper though
08:39 <stphrolland> merijn: yes, I clearly prefer your shorter version with <$>
08:39 <merijn> osa1: System.Posix.Process in unix?
08:40 rcat joined
08:40 <merijn> stphrolland: Pretty sure you can similarly simplify your <*> (honestly, I can't read it well enough to check at the moment ;))
08:40 <stphrolland> merijn: understood, but it helped me decompose the problem in steps, each steps a change of type needed for the result
08:41 <osa1> merijn: thanks
08:41 marr joined
08:41 xtreak joined
08:41 <merijn> stphrolland: Sure, I write plenty of messy code like that, but I recommend seeing if you can simplify after getting it working, by just refactoring little bits at a time
08:42 <stphrolland> okay, anyway the <*> is based on the use of Control.Monad.ap so as to have the (a->b) function operate on the inside of the MyState m s a to be transformed
08:42 rcat joined
08:42 <merijn> stphrolland: i.e. my version of functor was basically: 1) replace fmap with <$> in mbs 2) inline mas into mbs 3) inline mbs into fsMbs 4) inline fsMbs into line 27 using a lambda :)
08:42 <stphrolland> okay, i clean the code and repaste it
08:44 uglyfigurine joined
08:45 <merijn> stphrolland: Ok, so first hint: Suppose we replace the result of line 61 with: "= MyStateT $ \s -> do" which Monad is the do block working in?
08:46 <stphrolland> m
08:47 paemlm joined
08:47 <jasondockers> is standard ML far different from Haskell's syntax to a beginner?
08:48 Claudius1aximus joined
08:48 <merijn> stphrolland: Right, and what's the type of fsMas? :)
08:48 azahi joined
08:49 <merijn> jasondockers: It is rather different, yes. You could probably *read* Haskell reasonably easily, but don't expect to write it as easily :)
08:49 <stphrolland> MyStateT s m a
08:49 <merijn> stphrolland: Ah, is it?
08:49 <jasondockers> merijn, okay.
08:49 <stphrolland> no it's pattern matched sorry
08:49 <merijn> jasondockers: So you already know ML?
08:49 <jasondockers> merijn, more or less
08:49 <merijn> @where tutorial
08:49 <lambdabot> http://www.haskell.org/tutorial/
08:49 <stphrolland> s -> m(a,s)
08:50 <merijn> jasondockers: The Gentle Intro (not commonly thought of as gentle :p) was written when most people came from (S)ML, so it explains Haskell via comparison to ML. So it's probably a better starting point than the "Haskell from imperative" books
08:50 <jasondockers> okay
08:51 <merijn> stphrolland: Right, so if you think about about the two types you just named, can you figure out how you might fit those together? :)
08:51 <jasondockers> I just need to learn enough to translate SML into less-than-passable Haskell for the moment :)
08:51 <jasondockers> merijn, thanks
08:51 <jasondockers> I learned some haskell a while ago but forgot all of it
08:51 Kundry_Wag joined
08:52 <jasondockers> then I found SML to be a nicer language, but it's kind of a toy
08:52 <jasondockers> imho
08:52 <jasondockers> not nicer, but easier
08:52 <stphrolland> my first thought is to write MyStateT $ \s -> do a <- fsMas
08:52 <stphrolland> I have to play a bit with the idea
08:52 <merijn> stphrolland: Well, fsMas is a function, so you need to apply it to something to get an 'm' you can use with do notation
08:53 <stphrolland> the s
08:53 <stphrolland> it was a typo: MyStateT $ \s -> do a <- fsMas s
08:53 <stphrolland> but it is still improsoned in m ?
08:53 <merijn> jasondockers: Well, Haskell has grown a bit crufty over time, so I'd say it's probably less elegant than SML, but SML hardly has real world libraries. Ocaml is more practical, but not any less crufty than Haskell and awful syntax :)
08:53 <merijn> stphrolland: Well, remember this:
08:54 <merijn> @undo do { a <- fsMas s; foo a }
08:54 <lambdabot> fsMas s >>= \ a -> foo a
08:54 <merijn> :t (>>=)
08:54 oish joined
08:54 <lambdabot> Monad m => m a -> (a -> m b) -> m b
08:54 ph88^ joined
08:54 <jasondockers> merijn, I still wish my pseudo language I write on paper and use on whiteboards actually compiled. the nice thing about it is that the syntax changes to suite the given problem as I personally find intuitive :p
08:54 <Athas> jasondockers: Coq can do that!
08:54 antoine9298 joined
08:55 <Athas> merijn: I find some parts of SML, like equality types, much more nasty than anything in Haskell.
08:55 freusque joined
08:55 <Athas> Haskell 2010 isn't really less elegant than SML I think, but full Glasgow Haskell clearly is.
08:55 Phyx- left
08:55 <merijn> stphrolland: So, if you can somehow turn faMSsb from 'a -> MyStateT s m b' into 'a -> m ?', you can use >>= to get 'a' "out" of the 'm' :)
08:56 <jasondockers> was haskell invented in scotland?
08:56 <stphrolland> yep, but inside the do only
08:56 <merijn> Athas: Haskell2010 is still a bit messy, Num hierarchy stays a bit ugly, the Prelude is a bit dated nowadays
08:57 <stphrolland> if I apply it the function a -> MyStateT m s b, my result will still be inside the m monad of the do notation ?
08:57 zeroed joined
08:57 zeroed joined
08:57 <merijn> stphrolland: Well the entire 'do' block will result in some 'm ?', so, can you somehow turn a 'm ?' into 'MyStateT s m ?' :)
08:57 mmn80 joined
08:58 <stphrolland> and then use join ?
08:58 <merijn> stphrolland: Yes, so you need to get rid of that MyStateT for a bit and later rewrap the entire 'm' block back into MyStateT
08:58 cobreadmonster joined
08:58 <merijn> stphrolland: You mean use join on "MyStateT s m (MyStateT s m b)"?
08:58 _sras_ joined
08:58 shesek joined
08:58 <stphrolland> yep, so as to reduce two levels of the monad
08:58 <Athas> merijn: it's elegant, just not very practical.
08:59 <Athas> And SML is worse in that regard.
08:59 <merijn> stphrolland: Sadly, no, since 'join' is implemented using >>= :)
08:59 <stphrolland> ha...
08:59 <merijn> stphrolland: You can use 'join' on 'm' (I don't remember whether that's needed, though)
08:59 peterbecich joined
08:59 <stphrolland> well I will play with your indication a moment, I come back after exploring the thing
08:59 laz joined
09:00 <merijn> stphrolland: You might be able to make things less messy by changing the datatype to "data MyStateT s m a = MyStateT { runMyStateT :: s -> m (a, s) }"
09:00 ub joined
09:00 <merijn> stphrolland: That gives you "runMyStateT :: MyStateT s m a -> (s -> m (a, s))", which makes unwrapping less of a hassle (you can avoid having to introduce pattern matches
09:01 <stphrolland> clearly
09:01 insitu joined
09:01 <merijn> stphrolland: Also, syntax note: you can define operators using infix notation which looks (completely biased personal opinion) better
09:01 <merijn> So '(<*>) (MyStateT fsMfabs) (MyStateT fsMas) = MyStateT $ fsMbs' can also be written:
09:02 <merijn> 'MyStateT fsMfabs <*> MyStateT fsMas = MyStateT fsMbs"
09:02 abrick joined
09:02 <stphrolland> less parenthesis... :-°
09:03 bennofs joined
09:03 <merijn> And similarly "MyStateT fsMas >>= faMSsb = "
09:05 zero_byte joined
09:09 jgertm joined
09:10 mpickering left
09:10 uglyfigurine joined
09:11 a3Dman joined
09:11 codebam joined
09:16 ClaudiusMaximus joined
09:16 yellowj joined
09:17 ebzzry joined
09:19 <merijn> GHC8 (or at least, hdevtools using GHC8) seems *a lot* slower than it was with 7.10
09:20 obadz joined
09:20 <jophish_> Is it possible that -XTypeFamilies could cause my code to not typecheck
09:20 systadmin joined
09:20 coot joined
09:20 <jophish_> well, it's happening :)
09:20 JagaJaga joined
09:20 bennofs1 joined
09:20 Iceland_jack joined
09:21 Claudius1aximus joined
09:21 <merijn> Any alternatives for hdevtools with decent vim support that are faster?
09:22 <cocreature> jophish_: type families implics things like MonoLocalBinds iirc so it definitely seems possible
09:22 <cocreature> *implies
09:23 <jophish_> merijn: I've been using hdevtools with neovim without an issue fwiw
09:24 <jophish_> I've found ghc-mod to be much slower, and can't seem to find any alternatives
09:24 <merijn> jophish_: Takes about a second or so to typecheck a file or report a type
09:24 <MarcelineVQ> ghc-mod is pretty slow when combined with stack, for me at least
09:24 <merijn> Even though I have hdevtools options set to "-O0 -fno-code" which used to be blazing fast before
09:25 <jophish_> merijn: how are you using it, hdevtools does like recompiling everything from scratch if the options change
09:25 <jophish_> is it still as slow when you run it from the terminal
09:25 <jophish_> (after the first run)
09:25 Argue_ joined
09:26 <merijn> I'm just using vim-hdevtools and syntastic
09:26 <jophish_> cocreature: that would make a lot of sense, thanks!
09:26 ClaudiusMaximus joined
09:26 <brynedwards> This does async syntax checking for neovim and vim 8 https://github.com/w0rp/ale
09:26 <cocreature> jophish_: tbh I’ve never thought about why TypeFamilies has to imply MonoLocalBinds
09:26 <merijn> jophish_: I'm not changing options in my cabal file or anything, just editing files and saving them with syntastic running on every file safe and vimhdevtools running it to query a type
09:26 <jophish_> hmm, NoMonoLocalBinds didn't fix things
09:26 <jophish_> I suppose I could just add a signature
09:27 <merijn> jophish_: It's pretty instant from the terminal
09:27 <cocreature> I’m not sure if you can just overwrite this. there is probably a reason why TypeFamilies turns that extension on
09:27 feynhat joined
09:27 <jophish_> merijn: one sec, I think I know what it is
09:27 <merijn> jophish_: Oh, no
09:27 <merijn> In the terminal it's also slow if I save between runs
09:28 <jophish_> yeah, I know, trying to find the issue
09:28 <jophish_> https://github.com/hdevtools/hdevtools/issues/33
09:28 <jophish_> I bet that vim saving is passing an absolute path
09:29 Rodya_ joined
09:29 <merijn> jophish_: That doesn't explain why it's always slow after a save
09:29 <jophish_> to debug this I used something like `#!/usr/bin/env bash; echo "hdevtools called with: $@" >> some-log`
09:30 <merijn> jophish_: if saving uses an absolute path I would still expect it to be fast...
09:30 <jophish_> merijn: probably because when you save, syntastic is calling hdevtools with /home/merijn/file.hs
09:30 <merijn> Because it's not alternating
09:30 <merijn> jophish_: So? That issue says if you *switch* but if syntastic always uses full path that doesn't switch
09:30 <jophish_> hmm, you've got a point
09:31 <jophish_> sorry, I send my penultimate message before reading your preceding one
09:31 abhiroop_ joined
09:32 <merijn> Almost seems like it's reconfiguring cabal every run or something
09:32 ragepandemic joined
09:32 uncertainty joined
09:33 <jophish_> might still be worth logging the calls to hdevtools, I don't know how syntastic works and it could be doing something fishy
09:33 <jophish_> is it slow if you call it from the cli and just `echo ' ' >> File.hs` between hdevtools runs
09:34 <merijn> jophish_: Except hdevtools is *also* slow if I run it from the CLI if I save the file in between
09:34 Edith joined
09:35 <jophish_> are you running it on the cli with the same arguments syntastic uses?
09:36 <merijn> Yes, but even without it's slow on every save
09:36 <jophish_> hmm, and reloading in ghci is fast?
09:36 <merijn> And I'm sure it wasn't when I was using GHC7.10
09:37 <merijn> And the old version of hdevtools I had
09:38 <merijn> GHCI is faster than hdevtools when reloading although still a bit slow
09:38 fxg joined
09:38 <bennofs> merijn: I think hdevtools reloads too much, it clears the package db stack in between or somehting like that
09:38 <merijn> bennofs: I'm not using stack
09:39 <merijn> bennofs: But I think it's reconfiguring cabal or something on every run or something silly like that
09:39 <bennofs> merijn: i did not mean stack, I meant package-db stack as used in GC
09:39 <bennofs> s/GC/GHC
09:41 <merijn> bennofs: It just seems odd I'm the only person to notice this/there's no issue yet? Because it's making hdevtools borderline unusable
09:41 <bennofs> merijn: i didn't know that many people use hdevtools?
09:42 <vaibhavsagar> I <3 hdevtools
09:42 <merijn> bennofs: Well, the only alternative I'm aware of is ghc-mod, which is 10fold slower and this intero business, but that seems to have no support outside stack/emacs?
09:42 <bennofs> why does there need to be ghc-mod., intero and hdevtools :/
09:43 <merijn> bennofs: Well what else?
09:43 <bennofs> merijn: oh why is ghc-mod so much slower? perhaps that a problem with the vim backend, because it supports persistent server mode nowadays as well
09:43 <MarcelineVQ> intero is quite different, it leverages ghci in an interesting, way in fact ghci has commands in it now for editor integration that are quite interesting, and some more coming in the next ghc release iirc
09:43 <merijn> bennofs: I haven't used ghc-mod in a while, tbh, so maybe they solved that
09:44 mattyw joined
09:44 <bennofs> MarcelineVQ: yeah well it uses a fork of ghci that adds some commands
09:44 <merijn> MarcelineVQ: Yes, I know it's based on the ghcid stuff to avoid this "tool hardbuild against GHC" issue
09:45 <bennofs> i don't think it has any connections with ghcid
09:45 <bennofs> in fact, I think it hardbuilds a different version of the backend for each project (stack snapshot) depending on ghc version
09:45 <merijn> bennofs: I'm just annoyed by the fact that there's been an order of magnitude regression in speed that makes a for me important tool basically unusable :\
09:45 shterrett joined
09:45 Itkovian joined
09:46 <bennofs> merijn: it's probably fixed some other issue though
09:46 <bennofs> merijn: iirc, you can make the GHC API fast but sometimes incorrect or slow but without stale caches
09:46 locallycompact joined
09:46 <MarcelineVQ> bennofs: possibly merijn meant ghci-ng rather than ghcid, or both
09:46 <merijn> I like iteratively filling in typed holes, if I need to wait 2 seconds at every refinement that slows me down A LOT
09:46 <merijn> MarcelineVQ: oh, yes ghci-ng
09:46 <bennofs> merijn: also, have you changed your GHC version in between?
09:47 <merijn> bennofs: I moved from 7.10 to 8, which is the only reason I touched it in the first place
09:48 <bennofs> merijn: GHC 8 may be slower. Another reason could be, though not sure if they've changed it, but I remember hdevtools having problems when you run 'cabal configure' after adding deps, it would still pickup the old ones or something like that (if they changed it, then perhaps that check is costing perf?)
09:48 <merijn> bennofs: That's the problem, the regression could be anywhere and it's impossible to troubleshoot
09:48 <bennofs> merijn: do you know when you've last used the well-perfoming hdevtools=?
09:49 juhp joined
09:50 uglyfigurine joined
09:50 <merijn> bennofs: I'm using "-O0 -fno-code", my project is less than 1k lines and the file I'm working on is only 200 lines. So I refuse to believe GHC8 takes over a second to typecheck that
09:50 <bennofs> merijn: https://github.com/hdevtools/hdevtools/commit/1d21b8d225183c6654a93ae2901f60009d91bbc6 looks like it may cause something like this
09:51 <bennofs> perhaps it disables -fno-code or something
09:51 xtreak joined
09:51 <bennofs> merijn: is needsTemplateHaskell graph true for your project?
09:52 Kundry_Wag joined
09:52 <merijn> no true, but I had one file with TemplateHaskell enabled (oversight, since I wasn't using it) so let's see if that helps
09:53 <merijn> ok, now querying the type is near instant
09:54 ub joined
09:54 abhiroop joined
09:54 <merijn> I think I might still be suffering the issue jophish_ Pointed out
09:54 twanvl joined
09:54 <bennofs> merijn: I think TemplateHaskell forces disabling of -fno-code
09:54 <merijn> If I only safe it's fast, if I only query types it's fast, but alternating is slow
09:54 <merijn> s/safe/save
09:55 <merijn> So I suspect they use differing relative/absolute paths
09:56 <bennofs> merijn: there may be something else here
09:56 <bennofs> merijn: perhaps GHC mod uses some differing flags for query type/type checking
09:56 <bennofs> forcing cache invalidation when switching
09:56 <merijn> bennofs: no, both have the exact flag setup for hdevtools
09:57 <bennofs> merijn: but hdevtools changes GHC.log_action for example
09:58 <merijn> bennofs: I don't understand what you mean?
09:58 insitu joined
09:59 <bennofs> merijn: hdevtools may use different DynFlags for check/query, thus invalidating GHC's cache
09:59 <bennofs> merijn: that would be a problem with hdevtools code
09:59 <bennofs> i'm not 100% sure what things cause GHC to re-compile
09:59 lithie joined
10:00 <merijn> bennofs: Sure, but given the fact this is 2 different vim plugins using the same tool AND a documented issue about switching between relative and absolute paths resulting in slowdown, that seems like the most likely first thing to check
10:00 <bennofs> hmm yeah ;)
10:01 peterbecich joined
10:02 wedens_ joined
10:06 lc_ joined
10:07 mattyw joined
10:08 fotonzade joined
10:16 <stphrolland> merijn: I think I got it. Many thanks for your guidance. If you have any complementary remarks, I am eager of them. My final code is: http://lpaste.net/354327 with simplified <*>, and my version for >>=.
10:17 exferenceBot joined
10:23 oisdk joined
10:24 mtesseract joined
10:25 augur joined
10:27 wires_ joined
10:27 ebzzry joined
10:29 bollu joined
10:29 <bollu> can I generate out STG from GHC? I'm trying to understand what "id" would look like in STG
10:30 eacameron joined
10:30 louispan joined
10:30 <jasondockers> wow, the definition of quicksort is so terse and readable compared to C :p
10:30 <bollu> jasondockers: it's not actually quick sort though
10:31 <bollu> jasondockers: in the sense that it is not in-place
10:31 locallycompact joined
10:31 <jasondockers> bollu, what's the runtime complexity?
10:31 <mniip> jasondockers, quadaratic
10:31 <mniip> because pivot
10:31 <jasondockers> that's not quicksort!
10:31 <mniip> it is
10:32 <jasondockers> on the average
10:32 <mniip> vanilla quicksort has quadratic worst case
10:32 <mniip> yeah no, average n log n
10:32 <jasondockers> I mean, is it quadratic on average?
10:32 <mniip> no
10:32 <mniip> n log n average, quadratic worst case
10:32 [scrooge] joined
10:32 <jasondockers> so the only difference between this quicksort and "real" quicksort is that it isn't in-place?
10:33 <mniip> sort-of
10:33 <bennofs> bollu: try -ddump-stg
10:34 wires joined
10:34 ixian joined
10:34 <bollu> bennofs: thanks!
10:35 <quchen> bollu: If you want to understand STG, I don’t think reading GHC’s output is an easy starting point.
10:36 <bollu> quchen: I want to see how "id" is encoded
10:36 tabaqui1 joined
10:36 <quchen> bollu: This might be more helpful, https://github.com/quchen/stgi/
10:36 <bollu> quchen: because, in haskell, "id x = x"
10:36 <bollu> quchen: I looked into using it, but I'm not sure how to feed it haskell input
10:36 <bollu> quchen: I love STGi though :)
10:36 <quchen> You feed it STGi input, it’s independent of GHC
10:36 <quchen> But it has its own Prelude, which includes the id function
10:36 <bollu> quchen: yes, but I want to know how to *write* id in stg
10:37 <bollu> ooh, OK
10:37 <quchen> https://github.com/quchen/stgi/blob/master/src/Stg/Prelude/Function.hs#L52
10:37 <quchen> This is the STG language version of it, it’s not much of a difference compared to Haskell.
10:37 <bollu> quchen: if you can explain this to me: in the STG grammar, https://www.dcc.fc.up.pt/~pbv/aulas/linguagens/peytonjones92implementing.pdf
10:37 <quchen> You can write a program using it to see how it looks in memory though
10:38 <quchen> I chose *not* to use the syntax from the 1992 paper and go for a more readable, Haskell-like syntax. The translation to 1992 syntax is straightforward though.
10:38 <bollu> quchen: an "expr" cannot have something "simple" on the RHS right? it has to be function application, construction, or some primitive
10:38 <bollu> quchen: so I don't understand *how* \x -> x is legal
10:38 <quchen> I write \(x y) a b =>, 1992 writes {x y} \u {a b} ->
10:39 <quchen> Hmm? What’s »simple«?
10:39 <bollu> quchen: like, in Haskell, I would say "id x = x"
10:39 <bollu> but in the STG case, it looks like I have to "apply" it to something?
10:40 <bollu> or am I mis-understanding the STG grammar for Expr?
10:40 ziocroc joined
10:40 <quchen> The RHS of all STG definitions is a »lambda form«, which is a function of free variables, bound variables, an update flag, and the body
10:41 <quchen> The body is an expression, which is the usual case/let etc. https://github.com/quchen/stgi/blob/master/src/Stg/Language.hs#L175
10:42 <quchen> bollu: ^
10:42 insitu joined
10:42 <bollu> quchen:
10:42 <bollu> yes
10:43 <bollu> quchen: but look at the grammar of Expr in the paper, there is no way to simply specify something without applying it
10:43 <bollu> unless you consider "x" as 0 application or something
10:43 <bollu> in "id x = x", what sort of Expr is the THS?
10:43 <bollu> RHS*
10:43 <quchen> Oh, yes, that’s x applied to nothing
10:43 <bollu> ah, OK
10:43 <quchen> There’s no difference in STG
10:43 <bollu> that's what I was wondering
10:44 <bollu> quchen: also, how do you know what the final state is?
10:44 <bollu> the paper mentions nothing about termination :)
10:44 <quchen> The semantics of function evaluation in STG is »push all arguments, enter the value«.
10:44 <quchen> bollu: The final state is when there are no further state transitions possible :-)
10:44 <mniip> jasondockers, a more conventional qsort will look slightly differently
10:45 <quchen> The paper says »machine halts when it runs out of rules to try« somewhere
10:45 <bollu> quchen: ahh, I missed that, ty
10:45 <jasondockers> mniip, I've only seen / written qs in C and Python, so I'm unsure how it would look in a FP language
10:45 MindlessDrone joined
10:46 <quchen> bollu: I think just reading my README.md could be very helpful, even if you don’t want to play around with STGi itself
10:46 <quchen> jasondockers: It looks fairly similar
10:46 <bollu> quchen: yep, I'd read it before, I think I should read it again
10:46 <lpaste> mniip pasted “qsort with nlogn worstcase” at http://lpaste.net/354328
10:46 <mniip> jasondockers, ^
10:46 <jasondockers> oh
10:46 <quchen> bollu: In particular, have a look at the »map« code example
10:47 <quchen> Proper Quicksort in Haskell uses in-place updates using ST, so it’s the same mess of index-pointer-juggling as in C
10:48 <jasondockers> ah, okay. thanks for the link. I don't think it'd be a great use of time to try to dissect / read it right now. but I'll bookmark it and come back
10:49 <jasondockers> actually, I think it makes sense
10:49 <mniip> jasondockers, are you familiar with median of medians
10:49 <quchen> I’m not sure this is n*log(n).
10:49 <quchen> But maybe it’s just terrible constants.
10:49 <mniip> quchen, split is linear and !! is dominated by qsort
10:50 <mniip> sure, terrible constant
10:50 <jasondockers> mniip, no, I haven't used that pivot selection before.
10:51 nighty-- joined
10:51 <mniip> well, I'm not familiar with other pivot selection algorithms which give a logarithmic worst case
10:51 <quchen> mniip: I’m not even sure ordinary naive-haskell-quicksort is n*log(n), since list concatenation likes to introduce additional factors.
10:51 <mniip> excuse my ignorance if there's a simpler one
10:52 <quchen> Like foldl (++) [] xs isn’t linear, for example.
10:52 <merijn> bennofs: Quick check (and lunch) later: hdevtools and syntastic are indeed switching between absolute/relative paths
10:52 <jasondockers> mniip, what would the complexity of randomly selecting a pivot be?
10:52 <mniip> quchen, ++ is linear yes
10:52 <bennofs> merijn: I'm suprised though that this invalidates ghc's caches
10:53 <jasondockers> I thought random pivot selection was like "amoritized" n log(n)
10:53 <mniip> jasondockers, random pivot is nondeterministic
10:53 <merijn> bennofs: I'm not sure it does, could just be a hdevtools bug
10:53 Kundry_Wag joined
10:53 <mniip> arguably you can "find" a quadratic worstcase still
10:53 <jasondockers> mniip, right
10:54 <jasondockers> (I'll just look at the book on my table instead of bothering this channel
10:54 <mniip> I think any pivot that doesn't exxplicitly try to be bad will give you an average n log n
10:54 <mniip> heh
10:55 cpennington joined
10:57 sphere joined
10:58 Levex joined
10:59 FjordPrefect joined
10:59 <jasondockers> yeah, that's pretty much my understanding too
11:00 <mniip> quchen, if we pretend that all operations are strict, http://mathb.in/136315
11:01 <mniip> no wait
11:02 peterbecich joined
11:03 <mniip> ah right I messed up
11:03 <mniip> I shouldn't use qsort in median of medians but rather quickselect
11:04 vandenoever joined
11:04 Rainb joined
11:04 <vandenoever> how can i tell stack to build on multiple cores? it doesnt seem to be doing that
11:05 jmcarthur joined
11:05 <lyxia> stack -j4
11:06 <cocreature> it should default to building in parallel iirc
11:06 Kundry_Wag joined
11:06 <cocreature> https://github.com/commercialhaskell/stack/blob/9f794e129954f458a8fcf98e0bb2d5fbc209920a/src/Stack/Types/Config.hs#L325
11:07 jgt joined
11:07 space-marmot joined
11:07 <lpaste> mniip revised “qsort with nlogn worstcase”: “qsort with nlogn worstcase” at http://lpaste.net/354328
11:07 <mniip> jasondockers, ^
11:08 asthasr joined
11:08 zeroed joined
11:08 <jasondockers> mniip, so it's theta(n log n)?
11:08 systadmin joined
11:08 <quchen> I don’t believe it until I see a proof.
11:08 CurryWurst joined
11:09 <quchen> It looks at least quadratic to me, due to nested (++) calls.
11:09 <mniip> quchen, can you believe that if qselect is linear then qsort is nlogn
11:09 <jasondockers> mniip, yes, please write a proof and peer review it :p
11:09 <mniip> oh but
11:09 jaspervdj joined
11:10 <merijn> mniip: I agree with quchen that repeated ++ will kill your log n
11:10 <mniip> Blum et al (August 1973). "Time bounds for selection"
11:11 <quchen> Even if qselect is O(1), heck – O(0), you could still get quadratic concatenation.
11:12 <quchen> ((a ++ b) ++ c) ++ d <- quadratic
11:12 ljc joined
11:12 <mniip> if a..d have O(N) length sure
11:13 uncertainty joined
11:13 <mniip> quchen, ok, look
11:13 systadmin joined
11:13 <jasondockers> If it was O(0) wouldn't that kill all of us? Just thinking of energy and the lorentz factor.
11:13 al-damiri joined
11:14 <jasondockers> please don't write O(0) algorithms
11:14 chef_excellence[ left
11:14 <mniip> quchen, qselect(N) = pivot(N) + \\(N) + 2filter(N) + qsort(aN) + qsort((1-a)N) + ++(N)
11:14 <mniip> \\(N) = O(N)
11:14 <mniip> ++(N) = O(N)
11:14 <mniip> filter(N) = O(N)
11:14 <mniip> pivot(N) = O(N)
11:15 <mniip> qselect(N) = qsort(aN) + qsort((1-a)N) + O(N)
11:15 <merijn> mniip: qsort is O(n log n) because it's in place so you don't actually do ++ in any imperative implementation
11:16 <jmcarthur> lol, I've been using splittable random number generators for years and I only just now realize that the split function might as well just be an implementation of Random for PRNGs.
11:16 <mniip> oops
11:16 <mniip> s/qselect/qsort/
11:16 <mniip> merijn, right
11:16 <mniip> but out functional implementation is still nlogn
11:17 <mniip> so
11:17 <mniip> qsort(N) = qsort(aN) + qsort((1-a)N) + O(N)
11:17 <jasondockers> or would a O(0) time just mean it happened backwards in time? since velocity > c?
11:18 <mniip> by Akra-Bazzi, we have p=1 and c=1
11:18 <quchen> O(0) means you get it at no cost. Or something.
11:18 <mniip> qsort(N) = Theta(x (1 + int 1/n))
11:18 <mniip> qsort(N) = Theta(N (1 + int 1/N)) *
11:19 <mniip> = Theta(N log N)
11:20 <mniip> quchen, are you convinced?
11:21 <mniip> Mohamad Akra, Louay Bazzi: On the solution of linear recurrence equations. Computational Optimization and Applications 10(2):195–210, 1998.
11:21 <jmcarthur> Ah... random /= split due to the polymorphism in the prng
11:21 jgt joined
11:21 gk_1wm_su joined
11:22 fakenerd joined
11:22 <jmcarthur> Sort of a bummer. The idea of generating independent PRNGs from a PRNG seems more elegant to me than the idea of a splittable PRNG.
11:22 <quchen> mniip: The issue is not the recursive structure of qsort (which is n*log(n), sure), but your use of (++) to concatenate the two sorted halves.
11:22 <mniip> quchen, I included the cost of ++
11:22 <mniip> in the computation
11:23 <quchen> Which part was that?
11:23 <mniip> ++(N)
11:23 <quchen> Hmm.
11:23 <jmcarthur> The concatenation is already paid for by the filtering.
11:24 <mniip> you can plop on arbitrarily many linear things in every iteration of qsort
11:24 gk_1wm_su left
11:24 fotonzade joined
11:26 <mniip> merijn, and qsort is n log n not because of that
11:27 <mniip> because it divides into proportional parts and conquers in linear time
11:27 <mniip> any algorithm that does that will be nlogn due to master theorem/akra-bazzi
11:27 <quchen> Okay, I change my vote to »probably convinced«, and will not contradict you anymore. :-)
11:28 <tabaqui1> is there any community statistics?
11:28 <tabaqui1> ya' know gender, age, race
11:28 <mniip> race?
11:28 <tabaqui1> medium income, country
11:29 <mniip> not sure race would corelate in any kind of significant way
11:29 <mniip> quchen, hooray there goes my first peer rewier
11:29 <mniip> review
11:29 <quchen> We usually sign up with our street address and our skin tone on IRC, sure.
11:29 <quchen> mniip: Hehe.
11:30 <quchen> mniip: »Some guy on the internet was OK with my proof« ;-)
11:30 <tabaqui1> mniip: no way, just want to compare
11:30 <mniip> some guy on the #haskell
11:30 <merijn> Whoo!
11:30 <merijn> Some quick patches later hdevtools is an order of magnitude faster and usable again!
11:30 Rodya_ joined
11:32 shterrett joined
11:32 unK_ joined
11:33 freusque joined
11:34 <lyxia> We don't like data races too much around here.
11:34 MindlessDrone joined
11:34 <jmcarthur> Is there a good existing implementation of something allowing to construct records using labelled fields with Applicative?
11:35 <merijn> jmcarthur: You can construct records without record syntax
11:35 <jmcarthur> Of course, but I want the labelled arguments.
11:35 <merijn> Not that I'm aware of, then
11:35 <cocreature> jmcarthur: do notation and ApplicativeDo?
11:35 <jmcarthur> Thanks.
11:35 <jmcarthur> cocreature: Then I just have to invent intermediate names for everything.
11:36 <hexagoxel> and RecordWildcards, probably
11:36 <cocreature> ^ that
11:36 <merijn> Maybe SHE can help?
11:36 fendor joined
11:36 <jmcarthur> Ooh, RecordWildcards, I forgot I could do that.
11:36 <merijn> I think SHE has idiom brackets
11:36 <mniip> who is she
11:36 <merijn> mniip: You mean what :p
11:36 <merijn> mniip: Strathclude Haskell Extensions
11:36 <cocreature> is SHE still a thing?
11:36 <merijn> *Strathclyde
11:36 <jmcarthur> Ah, but then I can't use NamedFieldPuns to match on a record in the same function.
11:36 <merijn> cocreature: No clue :)
11:37 <jmcarthur> In this case I can get away with it, but in general I can't.
11:37 <cocreature> looks like the version on hackage was last updated 2011
11:37 <cocreature> so not particularly active :)
11:38 <jmcarthur> Yeah, idiom brackets seems like it would be the right solution for this, but I'm not interested in adding a preprocessor step. :(
11:38 <lyxia> that would be a good addition to https://github.com/dramforever/each
11:38 <mniip> that would make a fine addition to my collection *
11:39 <lyxia> Idiom brackets as quasiquotes
11:39 <lyxia> mniip: :)
11:39 <jmcarthur> Yeah, something along the lines of Idris' bang syntax (what lyxia's each thing looks like to me) would also work well for me.
11:40 freusque joined
11:41 <jmcarthur> (it so happens I have a monad this time, which of course is the only bang syntax could work)
11:41 <jmcarthur> *the only way
11:41 <lyxia> hmmm it may already support it
11:42 <jmcarthur> I wonder... can bang syntax ~subsume idiom brackets? It seems like there could be an ApplicativeDo-like treatment for bang syntax.
11:43 winter_ joined
11:44 <quchen> Edwin said that bang syntax is a fairly simple addition and well-defined, and probably suitable for Haskell.
11:45 systadmin joined
11:46 <jmcarthur> Of course we would need a different concrete syntax, and whatever we come up with is likely to be pretty noisy. :\
11:46 <jmcarthur> Still better than not having it, I think.
11:48 <jmcarthur> Idris has a lot of nice syntax sugar.
11:51 fotonzade joined
11:51 bjz joined
11:53 mada joined
11:54 mstruebing joined
11:55 sdothum joined
12:00 dec0n joined
12:01 teggi joined
12:02 mlkj joined
12:03 HoierM joined
12:03 Levex joined
12:04 peterbecich joined
12:05 cloudhead joined
12:05 nomicflux joined
12:06 NeverDie joined
12:06 sypwex joined
12:08 stphroland joined
12:09 sypwex joined
12:10 spatial joined
12:11 yoneda joined
12:11 FjordPrefect joined
12:13 <piyush-kurur> in the context of https://www.reddit.com/r/haskell/comments/63cka9/beware_of_numeric_type_classes/. Is it possible to make GHC warn about potential incorrect usage of numerals.
12:13 moongazer joined
12:14 <merijn> piyush-kurur: The main way is to avoid using stupid instances of Num :)
12:14 moongazer joined
12:15 <piyush-kurur> merijn: yes I agree
12:15 HugoDaniel joined
12:15 <merijn> You could annotate every literal with a type to avoid that sorta thing ever happening
12:16 <Iceland_jack> piyush-kurur: If you wanted, you could define impossible instances
12:16 <piyush-kurur> merijn: It would be good if the compiler can warn it
12:16 moongazer joined
12:16 <Iceland_jack> instance Int ~ Bool => Num (a -> b)
12:16 <Iceland_jack> Or: instance TypeError (Text "FUNCTIONS != NUMBERS") => Num (a -> b)
12:17 moongazer joined
12:17 <piyush-kurur> Iceland_jack: where should this be included?
12:18 <piyush-kurur> I mean in your own library so that we are protected from upstream authors
12:18 <Iceland_jack> idk
12:18 ccomb joined
12:19 <spatial> http://lpaste.net/354330 In this code segment I read and write to an IOArray. The array is returned from 'nextvalue' after that. Is that how it is done ?
12:19 <spatial> The IOArray has the written values when it is returned. Right ?
12:20 _sras_ joined
12:20 <lyxia> you don't need to return the array, it mutates
12:21 <spatial> I am returning so that other functions write their values.
12:22 <lyxia> other function can just take the same reference you passed to this function
12:22 nemesit|znc joined
12:22 <lyxia> just like in every other language
12:23 <spatial> Ok. If I return it and send it as a parameter it works too. Right ?
12:23 <systadmin> ello
12:23 <_sras_> is there any way to add validation (using digestive functors) to the `FromJSON` instances that are implemented using genericParseJson function?
12:23 <spatial> array <- nextvalue .... and then send array as parameter.
12:24 moongazer joined
12:24 <lyxia> It's unnecessary. Unnecessary things confuse people.
12:24 PennyNeko joined
12:25 <lyxia> _sras_: what kind of validation
12:25 the_2nd joined
12:25 moongazer joined
12:25 <the_2nd> Attoparsec's "double" parser allows signs for doubles
12:25 <the_2nd> I want "+3.0" to fail, how can I achieve this?
12:25 CurryWurst joined
12:25 <_sras_> lyxia: string fields does not exceed a certain length etc...
12:26 <lyxia> _sras_: you can just compose with a function that does the validation
12:30 <_sras_> lyxia: The parseJson function now looks like this `parseJSON = genericParseJSON defaultOptions`. So compose with another function, (Parser a -> Parser a)?
12:31 fendor joined
12:31 Rodya_ joined
12:31 fakenerd joined
12:32 SimpleL joined
12:32 Kundry_Wag joined
12:33 <the_2nd> or how can I make attoparsec fail on certain input?
12:33 mda1 joined
12:33 Wuzzy joined
12:33 biglama joined
12:34 <lyxia> spatial: by your logic, why aren't you writing "a <- writethevalue a ..."? (s', a') <- nextvalue ... a s; continue s' a' is equivalent to s' <- nextvalue ... a s; continue s' a which is simpler.
12:34 <lyxia> the_2nd: lookahead?
12:35 <lyxia> _sras_: or Value -> Value, depending on the actual check you want to do
12:36 eacameron joined
12:37 <spatial> lyxia: I understand. Just that when I learnt to use IOArrays I was mislead. Just determining if my logical flow is wrong if I do what I am doing. Will improve later.
12:39 <spatial> lyxia: I also couldn't refactor this properly. http://lpaste.net/354331 Here conditions dictate what is being written.
12:39 jathan joined
12:40 <spatial> So I started returning and passing IOArrays
12:40 JeanCarloMachado joined
12:40 insitu joined
12:41 <cocreature> spatial: I think you have some misconceptions if you believe that returning an IOArray solves some problem in your code
12:41 <the_2nd> lyxia, http://lpaste.net/9055646679113400320 ?
12:42 <cocreature> spatial: are you familiar with IORefs?
12:42 cpup joined
12:43 <spatial> cocreature:Know about them but haven't used. As I mentioned not making it more functional lead me down the wrong path.
12:43 <cocreature> spatial: return an IOArray that is passed to you as a parameter is about the same as returning the same filename that you get as a parameter
12:43 <the_2nd> lyxia, my parser seems to work, thanks
12:44 <cocreature> spatial: the function could of course have written to that file but returning the file name doesn’t help with anything
12:45 <spatial> cocreature: Hope you don't mean http://lpaste.net/354331 breaks the logic because I am returning it.
12:45 _sg joined
12:45 Micamo joined
12:45 <cocreature> spatial: it doesn’t break the logic, it’s just not useful. so since you are still doing it I think you have some misconceptions that I’m trying to clear up :)
12:45 <cocreature> spatial: also you should really start by splitting that function up in smaller parts
12:46 shesek joined
12:46 <spatial> Exactly. That is what I should do.
12:46 Argue_ joined
12:47 tabaqui1 joined
12:47 <spatial> Somehow I believed IOArrays cannot be global. Are they ?
12:47 eacameron joined
12:48 <spatial> I started using the State monad and thought any state is managed only like that.
12:49 <cocreature> spatial: think of it like a file: if you have access to the filename you can write to it and read from it. but the filename doesn’t change so you don’t need to return it from a function that writes to that file. an IOArray is similar: you can write to it but that will actually modify the array. the reference (~ the filename) still points to the same place so you don’t need to return it
12:49 <the_2nd> spatial, just an example for state updates (older version, far from perfect, could provide newer one) : https://github.com/I3ck/HGE2Ddemo/blob/master/src/StateTransform.hs#L74
12:50 <cocreature> the_2nd: that’s exactly what you don’t need to do with IOArrays …
12:50 <spatial> Oh! You mean pass by reference.
12:52 eacameron joined
12:55 <spatial> In languages like Java a filename is an object and guarded from concurrent modifications by threads.
12:56 <cocreature> that doesn’t change the fact that returning the filename is not helpful
12:56 cpennington joined
12:57 xall joined
12:58 <spatial> I meant the concurrent modification of IOArrays is not possible in Haskell. Right ?
12:58 eacameron joined
12:58 robkennedy joined
13:02 i5um41ru joined
13:02 sypwex joined
13:03 gienah joined
13:05 eacameron joined
13:05 peterbecich joined
13:06 atk joined
13:07 fendor joined
13:09 zgrepc joined
13:10 mekeor joined
13:11 vektorweg1 joined
13:12 eacameron joined
13:12 <quchen> spatial: It doesn’t need to be I think.
13:12 <quchen> Depends on the particular implementation.
13:13 <quchen> I’m pretty sure IOVector isn’t guarded against concurrent modification.
13:13 cpennington joined
13:13 jophish joined
13:15 marcopullo joined
13:15 KongWubba joined
13:17 eacameron joined
13:17 chlong joined
13:17 ilyaigpetrov joined
13:18 <ilyaigpetrov> is haskell as good for writing async code as, e.g., nodejs? Let's say I want to write a proxy server
13:19 <merijn> ilyaigpetrov: Much better, I'd say
13:20 <the_2nd> ilyaigpetrov, now go ask the node channel ;)
13:20 <ilyaigpetrov> merijn: ok, so package/async is the way I guess
13:21 theelous3 joined
13:21 <merijn> ilyaigpetrov: (GHC) Haskell has lightweight threads, so instead of writing async code using callbacks, you'd just use 1 thread per task and write regular blocking code for each thread.
13:22 <merijn> ilyaigpetrov: When a thread blocks on IO it just gets suspended and another thread is run until IO has finished
13:23 Micamo joined
13:24 <merijn> This whole "async/promises/futures/etc." is basically just hacks to workaround crappy language restrictions
13:24 <merijn> Hell, even Go, the most backwards language in several decades got lightweight threading right
13:25 <fendor> backwards language?
13:26 vektorweg11 joined
13:26 <merijn> fendor: Go ignores every single development and discovery in programming language research since the 60s. There's literal languages invented in the 60s that are more modern than Go
13:26 Micamo joined
13:27 eschnett joined
13:27 <ph88^> when i have many documents and many groups how do i encode a many to many relationship in haskell ?
13:28 <ph88^> data Rel = Rel Int Int ?
13:29 <quchen> Ignoring language development doesn’t *have* to be bad though. Just think about »let’s not have subtyping polymorphism everywhere«.
13:30 Sose joined
13:30 <merijn> fendor: See http://cowlark.com/2009-11-15-go/
13:30 <the_2nd> fendor, quchen https://groups.google.com/forum/#!topic/golang-nuts/f32UN1TYiAI
13:30 <merijn> quchen: I'm not saying you should have *everything*
13:30 <merijn> quchen: But when you pick up literally nothing, maybe it's time to question what you're doing
13:30 <quchen> merijn: Sure, I got what you said, I merely wanted to augment it a bit.
13:32 uncertainty joined
13:32 Rodya_ joined
13:32 dfeuer joined
13:33 <merijn> Man...recursive types are a pain...I figured this System F_ω would be a time saver, having the same representation for types and expressions...turns out it just makes my type checker confusing >.<
13:33 <the_2nd> fendor, no generics, no overloading. everything has to be defined for all types explicitly
13:34 <merijn> the_2nd: Generics are too hard and confusing for programmers!
13:34 burtons joined
13:34 <fendor> thanks for your explanations!
13:34 <fendor> ill read your links
13:34 <quchen> merijn: Your two last statements combine in a funny way :-þ
13:34 <merijn> quchen: Not really, generics have been working for ages >.>
13:35 jstolarek joined
13:35 <the_2nd> merijn, If you like re-inventing the wheel, go for go
13:35 <the_2nd> ;)
13:36 <* quchen> tries reinventing wheels in Agda, but has trouble proving what »round« is
13:36 <merijn> quchen: :)
13:36 <KongWubba> cowlark is REALLY interesting!! thx for the link
13:36 danthemyth joined
13:37 <merijn> quchen: My problem is that I have "data Expr a = ... | Pi String (Expr a) (Scope String Expr a) | ..."
13:37 ystael joined
13:37 <merijn> quchen: Since Expr represents both types and values my type annotations are just another Expr
13:38 <merijn> Now, I typecheck by substituting variables with their type, so I get "Expr Type" unfortunately, since type is itself an 'Expr a' with potential variables I get "newtype Type = Type (Expr Type)" and it all gets very confusing
13:41 hdeshev joined
13:41 <Philonous> I wonder what it is about Haskell that attracts so much sneering and contempt. Or do all languages attract sneering and contempt and I'm just not seeing it?
13:41 <merijn> Philonous: In what sense?
13:42 <Philonous> merijn, Well, I regularly see articles like this: http://www.virtuouscode.com/2017/04/04/the-pretentious-haskell-phase/
13:42 umib0zu joined
13:42 `^_^v joined
13:42 cwnqsg joined
13:42 <Iceland_jack> Philonous: Haskell is neat, it can go to your head at first
13:43 wei2912 joined
13:43 MarioBranco joined
13:43 <merijn> Philonous: I think that's more projection of the author
13:44 <Philonous> Well yes, it's certainly not a well-founded criticism of Haskell (it's not a criticism at all - just sneering), but Haskell seems to attract this kind of response in a way other languages don't
13:45 Big_G joined
13:45 meba joined
13:45 <merijn> Philonous: because Haskell is: 1) well-known, 2) attracts an enthusiastic community, and 3) is VERY different from existing languages
13:45 <Philonous> merijn, Isn't that same true for e.g. prolog or ML?
13:46 <merijn> Philonous: Lisps have about the same mindshare and enthusiastic community, but it's still rather similar to imperative languages
13:46 ChristopherBurg joined
13:46 <merijn> Philonous: naah, I think prolog and ML have a fraction of the mindshare Haskell has
13:46 rgucluer joined
13:46 rgucluer left
13:46 <merijn> The average JS programmer has never heard of prolog or ML, but they have probably heard about Haskell and "monads"
13:47 <Iceland_jack> gonads..
13:47 <ystael> Philonous: I think there's a number of people out there who hear Haskell advocacy, and what they hear -- regardless of whether it's what's being said -- is "I use Haskell because I'm smarter, and if you were smarter you would use Haskell too"
13:47 <Philonous> Maybe you're right and I'm just typical-minding here.
13:48 <merijn> ystael: Which is of course wrong, because we're all using Haskell 'cos we're dumb :)
13:48 <Philonous> If I was smart I'd need no type checker.
13:49 <ystael> merijn: To quote Michael Gira of Swans: "I know that, and you know that. But our purpose is to tell _everybody_ that."
13:49 Micamo joined
13:49 nbro joined
13:49 <Philonous> (I guess that's what you meant)
13:49 was kicked by dibblego: nbro
13:50 alanb99 joined
13:50 Aruro joined
13:50 kav joined
13:51 mreider joined
13:52 fxg left
13:52 <quchen> merijn: People who want to badmouth languages are going to do that. For other languages, people often find easy targets, such as your »Go has ignored all progress« or »Javascript callback hell« or »C unsafety«.
13:53 TheEpsylon joined
13:53 <merijn> I can badmouth Haskell just as easily :p
13:53 fractalsea joined
13:53 sea_wulf joined
13:54 <quchen> There are lots of valid criticisms of Haskell, but that reqiures learning a language. You can say, without learning Go, that the lack of parametric polymorphism is nonsense. In Haskell you have historical accidents (String, for example), but nothing completely terrible.
13:54 <quchen> And in particular, completely obviously terrible.
13:54 <merijn> newtype wrapping for instance selection is a pain, Num is a mess, the redundant Prelude functions after AMP mess up everything, the binary operations leave to be desired, Text/BS/String is a mess :)
13:54 <quchen> Records are awkward, sure.
13:55 <merijn> Haskell's messes are just less disastrous as the rest :p
13:55 <ystael> The Haskell community _is_ claiming a position of high social rank, in the sense that most software people regard "smart" as a positive value, and the Haskell community regards the language as possessing a high "smart rating" compared to other languages in common use.
13:55 <tdammers> Haskell's biggest problem IMO is the learning curve
13:55 <dibblego> I use haskell because I'm not smart.
13:56 <merijn> dibblego: You seems to have about 7 minutes of lag ;)
13:57 cyborg-one joined
13:58 Edith joined
13:58 <ilyaigpetrov> I want to learn haskell because I heard it's the best way to learn functional programming
13:58 <ilyaigpetrov> purely functional language
13:58 acarrico joined
13:58 <merijn> ilyaigpetrov: I would agree, since I only know of, like, 4 purely functional languages and Haskell is the only mainstream one of them :)
13:59 <Philonous> Have you people seen the paper on the new typed reflection mechanics? It's pretty neat: "Have you seen the paper on the new typed reflection mechanics? It's pretty neat: https://www.microsoft.com/en-us/research/publication/typed-reflection-in-haskell/
13:59 <Iceland_jack> It is
13:59 <Philonous> Errr, miss-paste :(
14:00 harfangk joined
14:00 <quchen> > cycle "Have you seen the new paper about recursion? It’s pretty neat: "
14:00 <lambdabot> "Have you seen the new paper about recursion? It\8217s pretty neat: Have you...
14:01 <rotaerk> hmm, a good chunk of intelligence is intellectual responsibility ... I'd say haskell *is* for smarter people, and using it does require a certain amount of perseverance. you don't need type checking and the other language features because you're "dumb" but because you're not god
14:02 ebzzry joined
14:02 <rotaerk> the main problem is when people turn it into a social-status issue in the first place ... like you have no right to advocate the language, or you're just an annoying evangelist who thinks he knows better than them
14:03 <ilyaigpetrov> why this room is more popular than ##javascript (1200 members)?
14:03 uncertainty joined
14:03 Jackoe joined
14:03 <rotaerk> (and you really *do* know better than them; they just can't accept that)
14:03 katychuang_ joined
14:04 Croniamental joined
14:04 <Philonous> Heh, I could have sworn I found the paper on reddit, but I can't seem to find the tread any more
14:04 <ilyaigpetrov> Philonous: chrome://history...
14:04 <Aruro> rotaerk: even without type checking haskell still will be better, just because its easier to write
14:05 <ystael> rotaerk: I think my point is that there are some people for whom it can't _not_ be a social status issue, because you're implicitly threatening the hierarchy they've invested in developing their position in
14:05 <rotaerk> yes, people become "expert beginners"; they really don't know all that much but they think they know it all, and you're threatening this delusion
14:06 <quchen> Aruro: I disagree. I wrote a good amount of STG, which is pretty much untyped (and desugared) Haskell, and it’s an awful experience.
14:06 <Aruro> well writing 1km long cases can not be fun, but you get what i mean :)
14:07 peterbecich joined
14:07 <rotaerk> the main downside to haskell is that there's quite a learning curve, and having prior experience in other languages doesn't really put you at much of an advantage
14:07 <Aruro> abstraction simply better in haskell, if there will appear new language will better abstractions i will switch first day.
14:07 <Aruro> with*
14:07 <rotaerk> and people just don't want to have to learn anything difficult
14:07 eklavya joined
14:08 <c_wraith> The funny thing is, all that knowledge from other languages turns out to still be useful when using haskell. Just not while learning it.
14:08 MindlessDrone joined
14:08 <rotaerk> yea
14:09 <Aruro> come on, people learn difficult stuff. like ugly c++ is easy to learn
14:09 <Aruro> in fact majority of stuff people learn is ugly difficult stuff
14:09 <rotaerk> C++ isn't really conceptually difficult; it's fairly simple conceptually, just with a minefield of gotchas
14:09 <Aruro> so!
14:10 <opqdonut> rotaerk: some of the new stuff like move semantics are conceptually difficult too
14:10 <Logio> one big part is probably that many programmers eschew math on principle, and Haskell has a very "mathy" way of putting things
14:10 <opqdonut> IMO
14:10 <rotaerk> ah
14:10 <c_wraith> I actually think Haskell is a simpler language than most, in terms of number of things you need to know to use it. It's just that the things you need to know contain a lot of things you don't need to know in other languages.
14:10 <* rotaerk> hasn't touched C++ in over a decade.
14:10 <opqdonut> yeah
14:10 <eschnett> C++ has so many trees that it’s difficult to see the forest
14:10 Kreest__ joined
14:10 <Itkovian> shapr first Haskell thingie in a loooong time :)
14:10 <eschnett> for example, templates can (in principle) take other templates as arguments, but no one does this, at least not in the standard library
14:10 <shapr> yay! what is it?
14:11 lordcirth joined
14:11 <merijn> eschnett: "no one does this" <- hah, I wish
14:11 moongazer joined
14:11 <eschnett> the haskell equivalent would be to write “Functor f” as a constraint — quite common
14:11 <merijn> eschnett: You clearly haven't seen some of the atrocities I've committed: https://github.com/merijn/GPU-benchmarks/blob/master/TemplateConfig.hpp
14:11 <eschnett> merjin: do you have an example? i’m struggling with this (not the concept, the gotchas)
14:11 <rotaerk> c_wraith, eh, at its core haskell is simple, but it's got quite the ecosystem of abstractions, and that ecosystem grows over time
14:12 <rotaerk> people who work in other languages don't tend to build conceptually difficult abstractions
14:12 <merijn> lines 151-158 and 195-204 amongst others
14:12 simukis_ joined
14:12 <eschnett> “template<typename,typename,typename,typename...> class BaseConfig”: nice!
14:12 contiver joined
14:12 <rotaerk> although you *can* build conceptually difficult abstractions elsewhere, it's just not usually done
14:12 <c_wraith> rotaerk: but that isn't language complexity. There's nothing in Haskell as complicated as inheritance, for instance.
14:13 <merijn> You know you're doing something right when your template signature is 10 lines long :)
14:13 <eschnett> yes, it’s not done because it’s too difficult to see the forest when you try and do so, because there are too many trees in C++
14:13 <quchen> ?hackage sessions merijn
14:13 <lambdabot> http://hackage.haskell.org/package/sessions merijn
14:14 <merijn> quchen: Yeah, but GHC has better type inference
14:14 dsh joined
14:14 <Aruro> imo CT scares a lot of people from simple language of haskell
14:14 <merijn> quchen: I have to wrute atrocities like "ecltype(warp_dispatch<Warp>::work(0,0).kernel)"
14:14 <eschnett> here is my atrocity: https://gist.github.com/eschnett/5e6d9b166ac53888a4b6783975bb8ab6 (foldr in C++)
14:15 <eschnett> only 8 lines, though…
14:15 <merijn> eschnett: Nice :)
14:15 MindlessDrone joined
14:15 Micamo joined
14:16 Xanather joined
14:17 <rotaerk> c_wraith, in practice, it's not the complexity of the language that matters, but the complexity of idiomatic use of the language
14:17 <rotaerk> which draws on a lot of those abstractions
14:19 systadmin joined
14:20 <cocreature> we can’t even get strings right so how can this language be good for anything? ;)
14:20 <rotaerk> most programmers I know don't even want to learn the language they use beyond what they have to... some C# programmers I know don't even know what generics are
14:20 fosskers joined
14:20 <cocreature> ups I haven’t scrolled down, nvm
14:20 <rotaerk> so I can see why people just don't gravitate towards haskell
14:21 <Aruro> sorry but life spend coding in c++ and in haskell is two different lifes
14:21 coltfred joined
14:21 <Aruro> they dont gravitate because cant
14:22 chipmadness joined
14:22 <Aruro> its same why we dont use electric cars
14:22 <chipmadness> why does this not work? removeNonUppercase x = filter isUpperSpace x where isUpperSpace = isUpper x || isSpace x
14:22 <rotaerk> because isUpperSpace is a Bool, not a Char -> Bool
14:22 <rotaerk> and you're applying it to x
14:23 <Aruro> :t filter
14:23 <lambdabot> (a -> Bool) -> [a] -> [a]
14:23 <merijn> Also, 'x' is a list and you're applying isUpper to it
14:23 ptek joined
14:23 <rotaerk> err eyes didn't track the fgilter
14:23 vektorweg1 joined
14:23 cdg joined
14:24 ClaudiusMaximus joined
14:24 shwouchk joined
14:25 xpkill22 joined
14:25 <chipmadness> how do you suggest to remove all uppercase letters in a string and ignore the spaces
14:25 mib joined
14:25 <Philonous> > let f x = filter isUpperSpace x where isUpperSpace x = isUpper x || isSpace x in f "ABc Def"
14:25 <lambdabot> "AB D"
14:26 <Aruro> chipmadness: removeNonUppercase x = filter isUpperSpace x where isUpperSpace c = isUpper c || isSpace c
14:26 <Philonous> You where missing the parameter to isUpperSpace
14:26 plutoniix joined
14:26 <chipmadness> LOL thanks Philonous
14:26 <Philonous> Also, not shadowing the outer parameter helps with legibility, yes
14:27 <Aruro> chipmadness: did u read what compiler told u?
14:27 <brynedwards> > filter (not . isLower) "ABc Def"
14:27 <lambdabot> "AB D"
14:28 plutoniix joined
14:28 obadz joined
14:28 <Aruro> > isLower ' '
14:28 <lambdabot> False
14:28 <Philonous> > (filter (not . isLower) "123", filter (\x -> isUpper x || isSpace x) "123")
14:28 <lambdabot> ("123","")
14:29 vektorweg11 joined
14:29 <brynedwards> ops
14:29 <Aruro> > isUpper ' ' && isUpper '1'
14:30 <lambdabot> False
14:30 okami joined
14:31 <Iceland_jack> > all isUpper " 1"
14:31 <lambdabot> False
14:31 Micamo joined
14:31 <Aruro> same for lower
14:32 drninjabatman joined
14:33 <fendor> > isUpper ' ' || isLower ' '
14:33 <lambdabot> False
14:33 Jackoe joined
14:33 <fendor> lol
14:33 <Aruro> yeah, filtering cases preserves spaces
14:33 <Aruro> and numbers
14:33 <fendor> > (isUpper $ toUpper ' ') || (isLower $ toLower ' ')
14:34 <lambdabot> False
14:34 <fendor> more lol
14:34 _sras_ joined
14:35 marsam joined
14:35 HarveyPwca joined
14:36 vektorweg1 joined
14:36 Jackoe joined
14:36 cpup joined
14:36 Guest37211 joined
14:36 carlomagno joined
14:37 <_sras_> Is there a version of Data.Map that does not require Eq, Ord instances for keys, but instead accept a function :: (Ord realKey) => (key -> realKey) for calculating the actual keys?
14:37 <merijn> _sras_: Not really, but you can newtype the key type to provide your own Ord/Eq
14:39 <_sras_> merijn: Yes. can do that...
14:39 tobhe joined
14:39 <_sras_> But was looking for something easier...
14:39 Jackoe joined
14:39 <vaibhavsagar> _sras_: can you use Data.HashMap?
14:40 <_sras_> vaibhavsagar: Yes.
14:40 al-damiri joined
14:40 <_sras_> vaibhavsagar: Can HashMap do this?
14:41 {emptyset} joined
14:41 <vaibhavsagar> it doesn't require an Eq or Ord instance
14:41 crobbins joined
14:41 kaichao[m] joined
14:41 <vaibhavsagar> but your key type has to be Hashable
14:41 <vaibhavsagar> which you can define on your own if you need to
14:42 kaichao[m] left
14:42 kaichao[m] joined
14:42 etehtsea joined
14:42 Ch0c0late joined
14:42 <vaibhavsagar> actually, that's not 100% correct, you do need an Eq instance
14:43 <_sras_> vaibhavsagar: looks like it needs Eq instance for keys...insert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
14:43 <vaibhavsagar> but if you don't have that I can't imagine any hashtable working for you
14:43 <_sras_> vaibhavsagar: Can you tell me why?
14:43 systadmin joined
14:44 <mnoonan> _sras_: how else would you handle hash collisions?
14:44 <opqdonut> it's for hash collisions
14:44 <Philonous> _sras_, In case of hash collision, keys need to be compared to find the actual one
14:44 <merijn> Isn't implementing Hashable about as much work as just newtyping?
14:44 <opqdonut> of course you could just have a custom Eq instance that compares the hash code :P
14:44 Lord_of_Life joined
14:44 <_sras_> merijn: But I don't have to change the exsisting code that uses this function...
14:45 <mnoonan> newtyping has the annoyance of un-newtyping whenever you want to pull something out of the map
14:45 <vaibhavsagar> you can derive Hashable and Eq
14:46 <_sras_> mnoonan: I can guarantee that there wont be hash collisions, I mean, for the data set and hashing function I have.
14:47 <vaibhavsagar> if you have a hashing function, then you've done 90% of the work for a Hashable instance :)
14:47 <_sras_> vaibhavsagar: I don't want Eq instance because a sensible Eq instance for this particular data type in a global context might cause a performance hit.
14:47 <cocreature> _sras_: but HashMap has to work for any hashing function and data set. so it has to require an Eq constraint even if it’s not used in your specific usecase.
14:47 <vaibhavsagar> _sras_: as someone pointed out above, compare hashes for equality
14:47 etehtsea joined
14:47 alecbrick joined
14:48 <_sras_> Yes. I understand.
14:48 levex_ joined
14:49 <vaibhavsagar> or you could allocate a giant array and index it using your hash function, that way you can avoid having to implement Eq, Hashable, or Ord instances by implementing your own hashtable :D
14:50 <phz_> is there some kind of TH to query the name of the current cabal project?
14:50 Argue__ joined
14:50 <phz_> the `name` field
14:52 <phz_> https://hackage.haskell.org/package/cabal-file-th
14:52 <phz_> maybe this?
14:53 <vaibhavsagar> that looks perfect
14:53 Micamo joined
14:53 <jayjam124> is there a way to fix indentation errors quickly in Notepad++?
14:54 <cocreature> phz_: somewhat recent versions of cabal define a "CURRENT_PACKAGE_KEY" cpp macro but I’m not sure what exactly that contains
14:54 <phz_> is there any documentation about that somewhere cocreature?
14:54 <phz_> sounds promising
14:55 <cocreature> phz_: https://cabal.readthedocs.io/en/latest/developing-packages.html?highlight=CPP#conditional-compilation explains that it’s defined but at least for myself there is not enough information to say what it actually contains :)
14:55 <cocreature> just trying it out is probably the easiest solution :)
14:56 uncertainty joined
14:56 kuribas joined
14:56 <phz_> hm, anyway
14:56 <phz_> how can I use a Q Exp as a function?
14:57 <phz_> https://hackage.haskell.org/package/cabal-file-th-0.2.4/docs/Distribution-PackageDescription-TH.html#t:PackageIdentifier
14:57 eazar001 joined
14:57 <phz_> oops
14:57 <phz_> https://hackage.haskell.org/package/cabal-file-th-0.2.4/docs/Distribution-PackageDescription-TH.html#g:1
14:57 <phz_> packageVariable
14:57 <phz_> I thought it was something like
14:57 <phz_> ($packageVariable …)
14:57 ncl28 joined
14:57 <phz_> maybe it’s $(packageVariable …)
14:57 <phz_> yep
14:58 <jayjam124> http://puu.sh/vaa56/3d8d48ca37.png does anyone see any indentation errors with the highlighted code?
14:59 <cocreature> jayjam124: the lines in a "do"-block need to be aligned
14:59 <jayjam124> parse errors on line 36
15:00 <cocreature> also I’m not sure if you can use {} around a do block without using ; but that might work
15:00 <jayjam124> so how do you mean cocreature?
15:00 <athan> How did lambdabot know when hackage had a package uploaded? Is there a way to register 3rd party services for pinging?
15:00 <cocreature> jayjam124: e.g. everything that belongs to the do block started in line 35 needs to line up with "i <- …" in line 35
15:00 igniting joined
15:01 <cocreature> athan: iirc there is an rss feed that lambdabot used
15:01 <cocreature> or rather hackagebot
15:01 MindlessDrone joined
15:01 conal joined
15:02 <jayjam124> http://puu.sh/vaaie/3662b296e0.png like this cocreature?
15:03 <cocreature> jayjam124: no "let newguesslist = …" doesn’t align with "i <- randomRIO …"
15:03 Salih joined
15:03 <cocreature> they need to start in the same column
15:03 soLucien joined
15:03 <jayjam124> http://puu.sh/vaalI/4db8ef3c2a.png LIKE THIS?
15:03 <jayjam124> sorry caps my bad
15:04 chlong joined
15:04 erisco joined
15:04 <cocreature> jayjam124: yep that looks like it might work. if not try removing { and } around the do block or add ; after each line in the do block
15:05 <cocreature> I’ve never used {} in a do block so I’ve no idea if it works without ;
15:05 marvin2 joined
15:05 bjz joined
15:05 okami left
15:05 fendor joined
15:05 <jayjam124> yeah that worked, ty
15:06 guampa joined
15:06 ChaiTRex joined
15:07 hucksy joined
15:08 cmsmcq__ joined
15:08 peterbecich joined
15:08 Itkovian joined
15:11 macivy joined
15:12 wraithm joined
15:12 beanbagula joined
15:12 Rodya_ joined
15:13 beanbagula joined
15:13 uglyfigurine joined
15:15 umib0zu left
15:15 jao joined
15:16 contiver joined
15:16 fakenerd joined
15:16 fakenerd joined
15:17 araujo joined
15:17 araujo joined
15:17 _sg joined
15:19 richi235 joined
15:20 raichoo joined
15:21 SpaceGazebo joined
15:21 bjz joined
15:22 etehtsea joined
15:24 urodna joined
15:27 <jayjam124> hi
15:28 <jayjam124> so I was working on this game: http://puu.sh/vabxY/95b4f19802.png
15:28 Micamo joined
15:28 <jayjam124> https://pastebin.com/ZBbgELtz
15:28 infinity0 joined
15:29 <jayjam124> but I'm sure I've done the main bulk of the program but nothing pops up when I run "main" in GHCI?
15:29 <jayjam124> and compile it, so wtf?
15:30 codesoup joined
15:31 whiteline joined
15:31 osa1 joined
15:31 osa1 joined
15:32 Salih joined
15:32 <mniip> I feel like I've seen this before
15:32 <mniip> jayjam124, well I don't see any output in your program
15:33 <jayjam124> I think showStr has something to do with that right?
15:33 <mniip> right
15:33 <mniip> but it's not called anywhere
15:33 <jayjam124> my prof provided me that
15:33 <jayjam124> it was a template so you fill in the gaps
15:33 <cocreature> then maybe you should try using it :)
15:34 infinity0 joined
15:34 Lord_of_Life joined
15:35 chlong joined
15:35 umib0zu joined
15:36 skeet70 joined
15:36 <jayjam124> I'm pretty sure I have to call showStr and pass in the generating numbers?
15:37 Micamo joined
15:39 <jayjam124> yeah or no?
15:40 mthek joined
15:40 <cocreature> jayjam124: you can pass a string to "showStr" and it will be printed to stdout. I don’t know what you want to print, that’s up to you :)
15:41 <jayjam124> well I mean I'm generating random numbers
15:41 litchblade joined
15:41 <jayjam124> fuck this is confuisng
15:42 Lord_of_Life joined
15:43 <jayjam124> ok
15:44 Itkovian joined
15:44 eklavya joined
15:44 <jayjam124> yeah idk
15:44 Micamo joined
15:44 <jayjam124> not sure how to print this stuff out
15:44 <cocreature> what exactly do you want to print?
15:45 <cocreature> showStr "hello world" will print hello world
15:45 <jayjam124> yes
15:45 <jayjam124> I mean in the program brief it says at the end I need to output the number of removed digits and the number of guesses
15:45 <jayjam124> that should be simple
15:45 <jayjam124> but I'm not sure how to output the interaction for the user to use my game
15:46 <jayjam124> but you need something to you know, allow the user to interact with it
15:47 <jayjam124> it's tying it into my professor's template which is the hard part
15:47 <jayjam124> because my prof doesn't want it changed too much from his :(
15:48 kirillow joined
15:48 alanb99 left
15:50 fizruk joined
15:53 fendor joined
15:54 James123 joined
15:55 <James123> Can someone give me some hints on how this works: head >>= (. tail) . (:) . toUpper ? It convert the first letter of a string to uppercase, but it seems a bit confusing...
15:56 mda1 joined
15:56 jmelesky joined
15:57 contiver joined
15:58 pera_ joined
15:59 <glguy> First let's deobfuscate it slightly:
15:59 <glguy> ?unpl head >>= (. tail) . (:) . toUpper
15:59 <lambdabot> (\ a0 -> ((:)) (toUpper (head a0)) (tail a0))
15:59 PatrickRobotham joined
15:59 <glguy> It's using the instance Monad ((->) e)
16:00 <glguy> (\ a0 -> ((:)) (toUpper (head a0)) (tail a0)) === (\a -> toUpper (head a) : tail a)
16:00 MindlessDrone joined
16:01 <glguy> > ((f :: Expr -> Expr) >>= (g :: Expr -> Expr -> Expr)) x
16:01 <lambdabot> g (f x) x
16:01 <glguy> When you are using this monad instance, (f >>= g) x = g (f x) x
16:02 <glguy> I needed some type annotations on f and g because they're overloaded in lambdabot
16:02 w4and0er96 joined
16:02 ortmage joined
16:02 erisco_ joined
16:02 WarmCookie joined
16:02 dpower joined
16:03 ludat joined
16:03 Micamo joined
16:03 <James123> glguy: thank you, now it makes sense :)
16:04 doomlord joined
16:04 <Sornaensis> :t runConT
16:04 <lambdabot> error:
16:04 <lambdabot> • Variable not in scope: runConT
16:04 <lambdabot> • Perhaps you meant one of these:
16:04 bennofs joined
16:04 <Sornaensis> :t runContT
16:04 <lambdabot> forall k a (m :: k -> *) (r :: k). ContT r m a -> (a -> m r) -> m r
16:05 _sg joined
16:06 Sonolin joined
16:06 SpaceGazebo joined
16:06 WarmCookie_ joined
16:06 DataComputist joined
16:07 leif_erikson503 joined
16:08 SpaceGazebo joined
16:08 beanbagula joined
16:08 SpinTensor joined
16:10 peterbecich joined
16:11 boombanana joined
16:14 cfricke joined
16:15 sophiag joined
16:15 SpinTensor joined
16:19 Unhammer joined
16:19 cschneid_ joined
16:21 KongWubba joined
16:24 raycoll joined
16:24 trism joined
16:25 <obiwahn> http://paste.debian.net/926126/
16:25 <obiwahn> what could be missing
16:25 contiver_ joined
16:26 burton___ joined
16:27 <ClaudiusMaximus> import Data.Monoid
16:27 Natch joined
16:28 mib joined
16:28 mkoenig joined
16:28 <ClaudiusMaximus> they're in Prelude since recent base, so I guess you're trying to compile new code with older ghc
16:29 silver joined
16:29 <tolt> I saw a package a while ago that I can't seem to find... It gives functions for getting information on when you compiled a program
16:30 <tolt> Does anyone know what package I'm thinking of?
16:30 <obiwahn> ah ok
16:30 BlueRavenGT joined
16:31 <obiwahn> what is the strategy to reproduce a build on some other system?
16:31 Micamo joined
16:31 yellowj joined
16:31 dni joined
16:32 <ClaudiusMaximus> tolt: https://hackage.haskell.org/package/gitrev perhaps?
16:32 marr joined
16:32 <tolt> ClaudiusMaximus: I found that but I thought it was information about cabal/time
16:32 _ashbreeze_ joined
16:34 <obiwahn> is there something like npm
16:34 abrick joined
16:34 <glguy> jle`: https://glguy.net/~pi/lift-nary-operator/Derive.html#v:genericOpN
16:34 <geekosaur> obiwahn, that's generally what stack is for
16:34 <obiwahn> System.IO.Temp - i use hoogle but it is still not clear to me what is missing here
16:35 <glguy> genericOpN @Num @('S ('S 'Z)) (+) (1.2, 3) (4.5, 6) -- (5.7,9)
16:35 arctictern joined
16:35 <glguy> (just cleaned up from last night)
16:36 <obiwahn> https://github.com/Eelis/cxxdraft-htmlgen
16:38 Micamo joined
16:38 meghnath joined
16:41 amazon4BTC joined
16:41 HarveyPwca joined
16:41 <amazon4BTC> hey im trading $250 amazon giftcards for $60 in bitcoin pm me fam
16:41 was kicked by glguy: offtopic
16:41 meghnath joined
16:41 <NeverDie> Could anyone help me return an Int from this function?
16:41 <NeverDie> sumArray = fromMaybe 0 . fmap (sum . init . tail . sort)
16:42 <NeverDie> Keeps returning `Maybe Int` if I do `sumArray = fmap (sum . init . tail . sort)`
16:42 jaspervdj joined
16:42 <NeverDie> Where I just want this: sumArray :: Maybe [Int] -> Int
16:42 fakenerd joined
16:43 <tabaqui1> how can I convert two arbitrary real numbers?
16:43 contiver joined
16:43 <glguy> :t maybe 0 (sum . init . tail . sort)
16:43 <lambdabot> (Ord b, Num b) => Maybe [b] -> b
16:43 <bennofs> :t fromMaybe 0 . fmap (sum . init . tail . sort)
16:43 <lambdabot> (Ord c, Num c) => Maybe [c] -> c
16:43 <tabaqui1> I'm looking at Double type
16:43 <tabaqui1> and cannot see any convertion alike (Float a) => Double -> a
16:43 <tabaqui1> or a -> Double
16:44 <glguy> tabaqui1: realToFrac
16:45 <tabaqui1> glguy: thanks!
16:45 alecbrick joined
16:46 litchblade joined
16:46 <tabaqui1> I've lost in default numeric types
16:46 <tabaqui1> ah, frac is not a subclass of real
16:47 <NeverDie> @glguy: How can I make it work with less than 2 elements?
16:47 <lambdabot> Unknown command, try @list
16:47 <glguy> NeverDie: You'd have to define what it means to work with fewer than 2 and add a case for that
16:49 <glguy> neverdie (Just xs@(_:_:_)) = ...; neverdie _ = 0 -- perhaps
16:49 mib joined
16:49 Rodya_ joined
16:50 <NeverDie> glguy: Hmm, I don't get it.
16:51 <glguy> You'll have to be more specific.
16:51 <NeverDie> glguy: sumArray (Just xs@(_:_:_)) = x?
16:52 <glguy> with 'x' replaced with the actual definition
16:52 vektorweg1 joined
16:54 Levex joined
16:54 <NeverDie> glguy: As in like `sumArray (Just xs@(_:_:_)) = xs`?
16:54 connrs joined
16:55 <glguy> NeverDie: That'd be a type error, wouldn't it?
16:55 <glguy> You wanted the result to be an Int
16:55 <NeverDie> Equations for ‘sumArray’ have different numbers of arguments
16:55 <NeverDie> Yeha.
16:55 <NeverDie> Yeah*
16:55 <glguy> No, they both had 1 argument
16:55 <glguy> at least as I wrote them
16:55 sleffy joined
16:56 <NeverDie> `sumArray (Just xs@(_:_:_)) = maybe 0 (sum xs)` Doesn't seem to work either lol.
16:56 <glguy> It seems like you're just guessing...
16:56 <glguy> Can you explain what this pattern means: (Just xs@(_:_:_)) ?
16:57 <NeverDie> I have no idea what it means lol.
16:58 <NeverDie> No matter what the first 3 elements are?
16:59 gillesmajor joined
17:00 abhiroop joined
17:00 <NeverDie> First time I see the @ sign in Haskell.
17:01 gillesmajor left
17:01 uglyfigurine joined
17:01 mekeor joined
17:02 <NeverDie> xs as (_:_:_) ?
17:02 Micamo joined
17:02 <Cale> Yeah, it binds the entire list to xs, and also ensures it matches against the pattern (_:_:_)
17:02 uglyfigurine joined
17:05 coot joined
17:05 Randy joined
17:05 huonw joined
17:05 <NeverDie> Cale: This is the only thing that pops into my head but it doesn't work https://ghostbin.com/paste/okdw7
17:07 sepp2k joined
17:08 locallycompact joined
17:08 Psi__ joined
17:09 solatis joined
17:10 <Cale> All the clauses of a single function definition need to have the same number of arguments
17:10 SAL9000 joined
17:10 <Cale> But also, what is the idea of this function?
17:10 sleffy joined
17:11 vlatkoB joined
17:11 <Cale> sum usually doesn't produce a Maybe result
17:11 peterbecich joined
17:12 Argue_ joined
17:12 steeze joined
17:12 ner0x652 joined
17:13 <NeverDie> Cale: It's for a codewars problem.
17:13 <NeverDie> That's the type signature they gave to work with.
17:15 Swizec joined
17:15 petrus joined
17:18 <mniip> ugh
17:18 <Cale> NeverDie: The type signature could make sense, apart from the fact that the function clearly has nothing to do with arrays
17:18 sypwex joined
17:18 <Cale> NeverDie: But I don't understand what the function is supposed to compute
17:19 <jle`> glguy: ar you planning on hackaging it
17:20 <jle`> if so then i'll just scrap mine
17:20 <Cale> NeverDie: If I was asked to write a function having that name and type, the most obvious thing I'd expect to have to write is sumArray = maybe 0 sum
17:20 <jle`> glguy: and i can submit a pr with https://github.com/mstksg/generics-lift/blob/master/src/GHC/Generics/Numeric.hs :)
17:21 <Cale> (that would be the whole definition)
17:21 Shimapan joined
17:22 <Shimapan> Hi, how do I go about creating a newtype that is transforming IO, ideally also deriving MonadIO and yet, not allowing the other modules to lift IOs into it?
17:23 <Shimapan> I essentially would like to not have the `instance MonadIO MyType` to be exported.
17:23 <Cale> Shimapan: You're asking for conflicting things
17:23 <Cale> deriving MonadIO is what allows things to liftIO
17:24 <Shimapan> Cale: It's because I want the type to have IO capabilities while not exposing it for the user. But working with a lot of monad transformers is painful so I was hoping to add MonadIO and keep the instance locally for my module.
17:24 <Shimapan> Cale: But it seems like this isn't possible.
17:24 raichoo joined
17:24 <Cale> You probably want to define a local equivalent of liftIO, e.g. io x = MyType (liftIO x)
17:24 <Cale> and then not export that
17:24 Argue joined
17:24 <jle`> that's what i have had to do
17:24 <Cale> There's no way to prevent instances from being exported
17:24 <Shimapan> Cale: Why does haskell always export instances?
17:25 <jle`> alternatively you can give your type a newtype wrapper, and then work with that type internally. and that newtype wrapper could have a MonadIO. but the best way is to probably write your own custom io-lifter
17:25 sellout- joined
17:26 <Cale> Shimapan: Instances are assumed to be globally unique conventions about how operations are implemented
17:26 <Shimapan> jle`: It's already a newtype though. So you're saying a newtype of a newtype to chose what instances are exposed and which aren't ?
17:26 <jle`> Shimapan: you have to write the instnaces for that newtype
17:26 <jle`> so you can choose what instances that newtype has
17:26 <jle`> see, for example, Sum, Product, All, And, Endo, First, Las, etc.
17:26 <jle`> from base
17:27 <jle`> (...did i forget any?)
17:27 dsh joined
17:27 <Shimapan> Am I also able to define some form of type equality or do I have to refactor the existing code for the extra newtype?
17:27 <jle`> you'd just have to unwrap and wrap it if you work with it internally
17:27 tim joined
17:27 eschnett joined
17:27 <jle`> the better solution is to just use your own internal custom io-lifter, like suggested before
17:28 <jle`> myLiftIO :: IO a -> MyType a
17:28 <Shimapan> Mhh. That's unfortunate, but at least now I have a few options. Thanks, jle` and Cale.
17:28 <jle`> coherency is an important part about what makes typeclasses usable
17:28 <jle`> so being able to hide instances would kill that
17:28 <jle`> imagine hiding an Ord instance for a type, and then getting a Set or Map oof that type
17:28 <jle`> you can then define a custom Ord instance, breaking everything
17:29 <Shimapan> I see.
17:29 <jle`> or worse, what if a module uses both modules with two different instances for Ord of a type
17:29 <Shimapan> Maybe it could be a system similar to functional dependencies, where you can say "This type isn't allowed isn't instance of class X".
17:29 <jle`> not sure i follow
17:30 ludat joined
17:30 <Cale> Shimapan: If what you need isn't a convention about how operations are implemented, then you shouldn't be using type classes
17:30 <Cale> Haskell does have first class functions which you can pass around if you want local conventions about it :)
17:30 <Shimapan> jle`: *A system that lets a module define an instance locally, and prevents other modules from declaring their own instances.
17:31 <cocreature> and if you have multiple functions that belong together, just put them in a record
17:31 replay joined
17:31 <Shimapan> jle`: Or having access to the local instance. Like a twisted version of functional dependencies but for type classes.
17:32 <Shimapan> Cale: I suppose. I simply think it's unfortunate that I can't used the existing generalization that is available to me (MonadIO) :(
17:32 peterbecich joined
17:32 <jle`> you can use it
17:32 e0d1n_ joined
17:32 <Shimapan> jle`: *Locally.
17:32 <jle`> myLift = MyConstr . liftIO :)
17:32 MindlessDrone joined
17:33 eschnett joined
17:33 <Cale> (note that I also suggested that above)
17:33 <jle`> at least, you're taking advantage of it
17:34 <Shimapan> Thanks for the talk.
17:34 <Shimapan> It's much clearer now. I'll go with the myLift approach.
17:35 <Shimapan> @karma++ jle`
17:35 <lambdabot> jle`'s karma raised to 30.
17:35 <Shimapan> @karma++ Cale
17:35 <lambdabot> Cale's karma raised to 84.
17:35 nesqi joined
17:36 mda1 joined
17:36 marcopullo joined
17:37 ystael_ joined
17:38 <jle`> no problem!
17:38 Micamo joined
17:39 <EvanR> @karma++ lambdabot
17:39 <lambdabot> lambdabot's karma raised to 34.
17:40 _sg joined
17:40 freeside joined
17:41 JeanCarloMachado joined
17:43 osa1 joined
17:43 osa1 joined
17:45 machinedgod joined
17:48 insitu joined
17:48 nick_h joined
17:49 hybrid joined
17:50 bennofs joined
17:51 Rodya_ joined
17:52 coltfred joined
17:53 itachi joined
17:55 <reactormonk[m]> I'm trying to understand Eff - I'm not sure which property allows it to reorder computations.
17:55 carlomagno joined
17:55 Edith joined
17:56 vydd joined
17:56 conal joined
17:56 bennofs1 joined
17:58 SimpleL joined
17:58 phyrex1an joined
17:58 carlomagno joined
18:00 Argue_ joined
18:01 Jenaf joined
18:01 <Jenaf> hi there! I've got some beginners Problems with data/type declaration
18:02 <Jenaf> I wanted to use simething like data RelativeCoordinates = (double,double)->MasterCoordinates
18:02 <Jenaf> but ghci doesn't want to parse that.
18:02 xall joined
18:02 meba joined
18:02 <Jenaf> Is there a way to define a type or data structure wich is a function?
18:02 osa1 joined
18:02 <glguy> Jenaf: You need to specify the value-level constructor
18:02 <glguy> data TypeConstructor = ValueConstructor (Field -> Type)
18:03 <cocreature> something like "data RelativeCoordinates = RelativeCoordinates ((double, double) -> MasterCoordinates)"
18:03 <geekosaur> or were you looking for a type alias?
18:03 <glguy> and then probably capitalize Double
18:03 <geekosaur> (which doesn't require a constructor, but is also indistinguishable from the original type)
18:03 <Jenaf> That was a type here with the lowercase Double
18:04 <cocreature> types never have lowercase names
18:04 <Jenaf> I'd rather have something more than an alias because iw ant typechecking and patternmatching help me to net get confused and spot errors
18:04 <* geekosaur> thinks "type" in that last was "typo"?
18:04 <geekosaur> (use/mention funny?)
18:04 <cocreature> oh right
18:04 <Jenaf> sorry I'm not good at using keyboards
18:05 <cocreature> Jenaf: if you want a separate type then what glguy or I showed should do the trick
18:05 <Jenaf> I definetly want it.
18:06 Argue__ joined
18:06 <Jenaf> I'm transforming between 2d coordinate systems. And using a strict typing I can reduce the ammount of unspottet errors
18:06 robertkennedy joined
18:08 <Jenaf> just making an lpaste
18:09 <Jenaf> seems like lpaste does not like me today
18:10 <Jenaf> http://lpaste.net/354339
18:10 <Jinxit> how would one write (Applicative f, Applicative g) => g (f (a -> b)) -> g (f a) -> g (f b)?
18:10 <Jenaf> here we go line 6 doesn't parse
18:11 mmn80 joined
18:11 <cocreature> Jenaf: you need a constructor name
18:11 <cocreature> newtype MyPath = MyPath [MyPathStep]
18:11 <jle`> :t liftA2 ($)
18:11 <lambdabot> Applicative f => f (a -> c) -> f a -> f c
18:11 <Jenaf> even if I use newtype?
18:11 <jle`> :t (liftA2 . liftA2) ($)
18:11 <lambdabot> (Applicative f, Applicative f1) => f1 (f (a -> c)) -> f1 (f a) -> f1 (f c)
18:11 <cocreature> Jenaf: yes
18:11 <jle`> ^ Jinxit
18:11 <Jinxit> neat, thanks
18:12 <Jenaf> then (please bear with me) does line 2 work?
18:12 <jle`> alternatively liftA2 (<*>) should work
18:12 <jle`> :t liftA2 (<*>)
18:12 <lambdabot> (Applicative f, Applicative f1) => f1 (f (a -> b)) -> f1 (f a) -> f1 (f b)
18:12 <cocreature> Jenaf: line 2 looks fine
18:12 ertesx joined
18:12 <Jenaf> I know, btu why don't I need a constructor name there
18:12 <Jenaf> ?
18:12 <jle`> but (liftA2 . liftA2) ($) reads more clear to me for some reason
18:12 t7 joined
18:13 <cocreature> Jenaf: "RelCoord" is the constructor name
18:13 <Jinxit> the latter is clearer to me
18:13 <Jinxit> but i'm not used to seeing $ outside of avoiding parenthesis
18:13 jgt joined
18:13 <Jenaf> newtype MasterCoord =(Double, Double)
18:13 <jle`> Jinxit: ($) here means 'apply the function'
18:13 contiver joined
18:13 <Jenaf> I ment that line
18:13 <cocreature> Jenaf: oh that shouldn’t work either
18:13 <pikajude> you do need a constructor name there
18:13 <pikajude> that's invalid
18:13 <jle`> Jinxit: so liftA2 ($) :: f (a -> b) -> f a -> f b
18:13 <jle`> "lift function application"
18:14 <Jinxit> oh that makes sense
18:14 <geekosaur> Jenaf, a value constructor is how haskell tracks the type. so you need it for data or newtype which give you things that behave as distinct types, but don't use it for type which gives you an alias to an existing type
18:14 <jle`> (liftA2 . liftA) ($) :: g (f (a -> b)) -> g (f a) -> g (f b)
18:14 <jle`> Jinxit: "lift function application twice"
18:14 <Jenaf> okay
18:14 <Jenaf> i think I'm getting a bit closer to actually understanding it.
18:14 <jle`> (liftA2 . liftA2 . liftA2) ($) :: h (g (f (a -> b))) -> h (g (f a)) -> h (g (f b))
18:15 <jle`> Jinxit: "lift function application three times"
18:15 <jle`> etc.
18:15 dfeuer joined
18:15 <Jinxit> yeah i see the pattern
18:15 <jle`> Jinxit: synatictically, a newtype declaration is the same as a data declaration
18:15 <jle`> * Jenaf
18:15 <jle`> Jenaf: so all the rules apply
18:15 wraithm joined
18:16 uncertainty joined
18:16 <Jenaf> Yeah I think I understood it so far.
18:16 <jle`> the extra syntactic restriction is that you must have exactly one constructor and one field
18:16 t0by joined
18:16 <Jenaf> I'll pop up again on my next blunder
18:16 <jle`> Jenaf: so if 'data' would require a constructor, so would 'newtype' :)
18:16 henriksod joined
18:17 Aruro joined
18:17 uglyfigurine joined
18:17 Destol joined
18:17 <Jenaf> would you say it's a good idea to avoid data/newtype unless you explicitely want pattern matching or type safety?
18:17 <jle`> it's a good idea to use them
18:17 <Jenaf> yay I've had a good idea!
18:18 <jle`> cause the compiler will help you write your code more nicerly
18:18 <cocreature> Jenaf: well the only reason to use “newtype” is that you gain type safety. but gaining type safety is great, so that’s a pretty strong reason to use it!
18:18 javjarfer joined
18:18 <Jenaf> thats the reason I started using it ^.^
18:18 <javjarfer> hi everyone!
18:18 <jle`> hello javjarfer !
18:18 <Sonolin> hello
18:18 <Jenaf> also I'ts always impressive how helpfull you guys 'n' Gals in here are! hanks a lot
18:18 <javjarfer> Has anyone used the (awesome) package dependent-map?
18:19 cloudhead joined
18:19 <javjarfer> Jenaf, Sonolin, hey there :)
18:19 <jle`> javjarfer: i believe i've used it
18:19 <glguy> javjarfer: If you have a real question about the package it's better to just ask that
18:19 <jle`> but even if i haven't, just ask your question :)
18:20 <javjarfer> glguy, of course I have a question, HOW did you use it xD?
18:20 <jle`> like, what sort of applications did we use it for?
18:20 <javjarfer> sorry, it was for jle`
18:21 <cocreature> iirc I’ve used it in combination with reflex
18:21 <javjarfer> jle`, it's that I have just tried to use it today, but the example from the README is broken
18:21 <augur> anyone know if its possible to use GHC to extract the types for some code?
18:22 <javjarfer> I have opened and issue just today
18:22 sssilver joined
18:22 mtesseract joined
18:23 <javjarfer> augur, well, it really should be possible because GHCI does it
18:23 <jle`> oh it looks like i used it with the singletons library to write Binary instances
18:23 <jle`> that was cute i guess
18:23 <jle`> augur: ghc-mod might be the smoothest route there
18:23 <jle`> javjarfer: what's the error for the readme code?
18:24 <augur> jle`: oh? tell me more
18:24 <geekosaur> augur, generally people wrap ghc-mod or etc., although you can use ghc-api (or wrappers like hint) or do like intero and use recent ghci (or ghci-ng if needed for an older ghc) to extract them
18:25 <javjarfer> jle`, it's detailed in this issue, https://github.com/mokus0/dependent-map/issues/15
18:25 <augur> for instance, i *believe* that liquid haskell somehow manages to do stuff like this, right? it hooks into GHC and gets Core terms, and also maybe some types somewhere/somehow???
18:25 <jle`> lambdabot uses ghci i think
18:25 Wuzzy joined
18:25 <jle`> ghc-mod hooks into ghc and abstracts over the super unstable ghc api i believe
18:25 <javjarfer> but basically it infers the tag, as being the type of the future maps parameters
18:25 <javjarfer> don't know why
18:26 uglyfigurine joined
18:26 hackebeilchen joined
18:26 <jle`> augur: a lot of editor/ide plugins use ghc-mod i believe
18:27 <jle`> javjarfer: where are you getting FooGADT from
18:27 <javjarfer> Jenaf, augur I would say that almost all of them
18:27 <javjarfer> I'm getting it from the dependent-sum package I think
18:28 <javjarfer> Could that be really the problem?
18:28 Faucelme joined
18:28 <jle`> javjarfer: from here? https://github.com/mokus0/dependent-sum/blob/master/examples/FooGADT.hs
18:28 <jle`> not sure, just trying to diagnost the problem
18:28 <javjarfer> yes
18:28 <jle`> because the behavior should depend on the types of Foo and Bar
18:28 <augur> ok i'll take a look at ghc-mod then :)
18:29 <javjarfer> jle`, yes that should be the whole point
18:29 <jle`> augur: ghc-mod uses the ghc api, so you could directly use that, i believe. but it abstracts over it and makes it a little more stable
18:29 Argue joined
18:30 <augur> okiedoke
18:31 ystael_ joined
18:31 <cocreature> augur: https://github.com/hdevtools/hdevtools/blob/master/src/Info.hs#L47 might serve as an example fo how to use the “raw” ghc api
18:32 arpl joined
18:32 abhiroop_ joined
18:33 <jle`> javjarfer: it looks like tag expects items in a functor
18:33 <jle`> and now the library parameterizes the map by that functor
18:34 <jle`> i'm not sure if this is a new change, maybe previously the functor was Identity by default
18:34 <sophiag> does anyone have time to look at this paste? there are a bunch of errors appended, but i've commented the two problem lines where i'm not sure what do: http://lpaste.net/354336
18:34 insitu joined
18:34 <jle`> javjarfer: try x = fromList [Foo :=> Identity pi, Baz :=> Identity "hello there"]
18:35 <javjarfer> jle`, yes! I tried the identity trick but I don't remember why I stopped
18:35 ccomb joined
18:35 spacedog82 joined
18:35 <javjarfer> I think that was because I didn't get a conclusion of "why I really needed it"
18:35 <jle`> i'm not sure if the readme was with a version where the f was fixed to Identity
18:35 ompaul joined
18:36 <jle`> it's because (:=>) :: tag a -> f a -> DSum tag f
18:36 <jle`> so if your tag a is 'Foo String', then the second argument shold be 'f String' for some f
18:36 ubsan_ joined
18:36 antoine9298 joined
18:38 buff3r joined
18:38 <jle`> javjarfer: i don't think the readme would have ever worked
18:38 <jle`> even in old versions
18:39 <jle`> this is why doctests are important, folks
18:39 <javjarfer> haha yes, please, listen him
18:39 <jle`> (but i should be the last one to be talking)
18:39 <javjarfer> (of course, but that wasn't the point true? :) )
18:40 <jle`> (because most of my packages have 0% test coverage)
18:40 <javjarfer> we should != I do xD
18:40 <javjarfer> jle`, okay... thanks you, I think I get the why
18:40 Zialus joined
18:40 jason85 joined
18:41 <javjarfer> but now let's make this output something xD
18:42 <javjarfer> now of course it complains that the first type is (Identity v) instead of v
18:43 jason85 joined
18:43 bodisiw joined
18:43 marsam joined
18:44 azahi joined
18:44 raynold joined
18:44 <Jenaf> is there a simple way to exclude the equality of two parameters of foo :: Foo -> Foo -> b ?
18:44 <Jenaf> like have an error or exception when that happens
18:44 Micamo joined
18:45 <Jenaf> getRelCoords (a,b) (a,b) = error("undefined relative coordinates") doesn't work
18:46 gspia joined
18:46 <cocreature> getRelCoords a b | a == b = error "undefined relative coordinates"
18:46 boombanana joined
18:47 burtons joined
18:47 lordcirth_ joined
18:47 <Jenaf> time ofr copy and paste ProgramminG!
18:48 <cocreature> Jenaf: the name for this is “pattern guard”
18:49 robkennedy joined
18:49 <cocreature> iirc it’s explained pretty well in http://learnyouahaskell.com/syntax-in-functions (search for “guard”)
18:50 <glguy> pattern guards are when you start doing: | Just x <- y
18:50 mekeor joined
18:50 abrick joined
18:50 <geekosaur> right, that's just a normal guard, not a pattern guard
18:51 <Jenaf> okay
18:51 cyborg-one joined
18:51 <Jenaf> something is broken
18:51 <cocreature> oh good point
18:51 <Jenaf> * The function `relCoord' is applied to one argument,
18:51 <Jenaf> but its type `RelCoord' has none
18:51 Hafydd joined
18:51 <Jenaf> --snip
18:51 <Jenaf> newtype RelCoord = RelCoord ((Double, Double) -> MasterCoord)
18:51 <Jenaf> --snip
18:52 <Jenaf> so something is wrong there
18:52 insitu joined
18:52 <monochrom> Please paste complete verbatim uncut code.
18:52 <Jenaf> okay
18:52 <cocreature> Jenaf: where’s the lowercase "relCoord" coming from?
18:52 <glguy> If relCoord :: RelCoord, then you can't just apply relCoord to an argument
18:52 <glguy> because its type is distinct from the type of functions
18:52 <Jenaf> where relCoord = getRelCoords start end
18:53 <Jenaf> perhaps I need to really make a constructor
18:53 <Jenaf> full lpaste incoming (with some comments)
18:53 ludat joined
18:54 jgt joined
18:54 <Jenaf> http://lpaste.net/354343
18:55 <cocreature> Jenaf: you need to pattern match to remove the RelCoord constructor before you can apply it
18:55 <javjarfer> jle`, Am I wrong if I say that the function described as addFoo cant exist as defined
18:55 soLucien joined
18:56 <javjarfer> because it needs to combine the value inside the two functors?
18:56 <Jenaf> @cocreature how to?
18:56 <lambdabot> Unknown command, try @list
18:56 TheLemonMan joined
18:57 akegalj joined
18:57 <cocreature> Jenaf: try writing a function "RelCoord -> (Double, Double) -> MasterCoord"
18:57 <cocreature> Jenaf: or alternatively just change the where clause to RelCoord relCoord = getRelCoords start end"
18:57 <Jenaf> i think I'll go for the latter
18:58 <akegalj> hey. How come there is no WSS (websockets over TLS) implementation in Haskell. Its hard to grasp that no-one had this usecase so far ?
18:58 Levex joined
19:00 <jaspervdj> akegalj: Do you want server-side or client-side?
19:00 Pssi joined
19:01 e_svedang joined
19:01 oberstein joined
19:01 <akegalj> jaspervdj: I would like to have wss between client (browser) and server (haskell server).
19:01 <akegalj> jaspervdj: can I manage this with warp-tls + wai-websockets ?
19:01 <jaspervdj> akegalj: The server in the websockets package does not support TLS (and it not meant for production)
19:02 <jaspervdj> akegalj: But yeah if you use warp+tls + wai-websockets it should work, same for snap+websockets-snap
19:02 levex_ joined
19:02 <akegalj> jaspervdj: then we have the solution. Thanks <3
19:04 albertus1 joined
19:05 dberg joined
19:06 <dberg> How does this expression work? data Expr f = In (f (Expr f))
19:06 <dberg> This is from the paper Data types a la carte.
19:07 <dberg> The example is data Val e = Val Int; type IntExpr = Expr Val
19:07 <monochrom> There are examples in the paper too, though few.
19:07 <javjarfer> jle`, okay, if you give this definition, it keeps working
19:08 <dberg> I'm having a hard time understading how the substitution would work in the data Expr definition.
19:08 <javjarfer> sorry, 'it works' "addFoo :: (Applicative f) => Foo v -> f v -> f v -> f v"
19:08 <monochrom> Expr Val is going to be boring, but a typical value is "In (Val 5)"
19:09 <cocreature> dberg: IntExpr is actually fairly boring if you look at it: in that case you have In (Val (Expr Val)) but val ignores it’s type argument
19:09 <javjarfer> it only need to be a "Type Constructor" of type * -> *
19:09 RayNbow`TU joined
19:09 darjeeling_ joined
19:09 ij joined
19:10 <monochrom> I am not sure that you should think in terms of substitution.
19:10 <javjarfer> No matter what, so of course Identity works using the Applicative interface, thanks you so much for the explanation you will be mention in the issue solving jle` !
19:10 <ij> 1. does building static pkgs with stack require just --ghc-options='-static -fPIC'? 2. Do I've to build all deps with the same flags first too?
19:12 <dberg> Ok, so given In (Val (Expr Val)), when In (Val 10) is given, the inner Expr Val is "replaced" by 5? I'm obviously missing something here.
19:12 <monochrom> Instead, Val 5 :: Val e, therefore you can specialize it to Val 5 :: Val (Expr Val), therefore In (Val 5) :: Expr Val.
19:12 mr_sm1th joined
19:12 <monochrom> Eh? You are replacing type by value. That won't help.
19:13 <javjarfer> jle`, the incredible thing about this (I don't know if you are interested in reactive systems) is that, the UNIQUE TYPE SAFE way to create a reactive system which network could be inspected and recomputed, or even parsed from a declarative schema, is using this kind of structure
19:14 oisdk joined
19:15 Micamo joined
19:16 <dberg> monochrom: that was a good explanation. thanks!
19:17 b4ff3r joined
19:17 steeze joined
19:17 bollu joined
19:19 dni joined
19:20 Knoxrgy joined
19:20 <EvanR> javjarfer: proof?
19:21 Yuras joined
19:22 <sophiag> trying asking this again. i'm unsure how to structure this parser where i use two state monads to cons input into lists and then need to pass the final state to eval when it's called. here's what i have so far, complete with the REPL boilerplate: http://lpaste.net/354336
19:22 Micamo joined
19:22 <EvanR> two state monads o_O
19:22 osa1 joined
19:22 osa1 joined
19:22 fotonzade joined
19:23 cfricke joined
19:23 Levex joined
19:23 jplasmeier joined
19:23 crunchers joined
19:24 metaphysician joined
19:24 <sophiag> EvanR: what's wrong with that?
19:24 <EvanR> is there a good reason to use two?
19:25 markasoftware joined
19:25 <sophiag> it's just simpler. particularly given how i'm calling them from parsers
19:26 <EvanR> i see you have no parsers here in the sense of parsec
19:26 <sophiag> i'm not using parsec, that's correct
19:26 <EvanR> and you do not actually use your state monads because theres no runState or similar
19:26 abhiroop joined
19:26 ragepanda joined
19:26 <Aruro> do people use ansi-wl-pprint?
19:26 <sophiag> i know. that's part of the question i asked and also noted in a comment
19:27 <EvanR> I dont see even one state monad helping here
19:27 <sophiag> i do wonder if i combined them into one parser if it would be easier to call the eval function on the state?
19:27 <sophiag> um what?
19:27 <javjarfer> EvanR, working on it! xD
19:28 coot joined
19:28 <sophiag> EvanR: there are two state monads...you can search for the word state if that helps?
19:28 <EvanR> i dont see even one state monad being a help
19:28 <EvanR> being better than not using any state monads
19:28 <sophiag> can you elaborate on what "being a help" means?
19:28 <sophiag> i need to collect a list
19:29 steeze joined
19:29 <sophiag> if by "being a help" you mean "not being called correctly" then please reference my original question
19:29 <EvanR> do you need to access the list too, within the parser?
19:29 <EvanR> no i dont
19:30 <EvanR> i am saying i have rarely seen State by itself being beneficial over regular functional programming, if ever
19:30 epsilonhalbe joined
19:30 <sophiag> monads are "regular functional programming" ...
19:30 dni joined
19:30 <EvanR> well, nevermind then, that invalidates what i said somehow
19:30 Sh4rPEYE joined
19:31 <EvanR> i think you can do this in a simple way without State
19:31 <EvanR> simpler
19:31 <EvanR> is my last attempt
19:31 Lu joined
19:32 <sophiag> how so?
19:33 morphv joined
19:33 <EvanR> for example, in an algorithm which simply collects results into a list, you can pass a list around and prepend things to it
19:33 uglyfigurine joined
19:33 merijn joined
19:33 <Knoxrgy> Hi, anybody to talk about OpenWrt?
19:34 <dolio> OpenWrt is off topic.
19:34 <sophiag> EvanR: if a parser needs to pass it to itself then that parser would have to be a state monad...
19:34 <monochrom> Or better yet, don't even pass a list around. Produce the final list right away, like map and unfoldr do. new_item : recursive_call
19:35 <EvanR> right, that is what i mean
19:35 Knoxrgy left
19:35 <EvanR> sophiag: that is not the case
19:35 <sophiag> EvanR: so you're proposing one large state monad that both handles parsing and stores two types of state is simpler than three functions?
19:36 <Aruro> he proposes function with arguments
19:36 <Aruro> no monads
19:36 leat joined
19:36 <EvanR> parsing is usually, but not necessarily a bigger pain in the ass than "state", and monadic parsing could help
19:36 <EvanR> but i dont know what language youre dealing with
19:36 <sophiag> monochrom: if you're producing the list all at once then where do you store the input as it comes into the REPL?
19:37 <EvanR> incrementally processing input from a repl is yet another task that can be decomposed
19:37 levex_ joined
19:37 <monochrom> the input is understandably a parameter. like map and unfoldr, again.
19:37 <EvanR> each stage is a separate problem, luckily
19:37 dni joined
19:38 <EvanR> iteratees, pipes, machines
19:38 <EvanR> or "regular functional programming"
19:38 cpennington joined
19:38 oberstein joined
19:38 <sophiag> EvanR: you just suggested i *recompose* three functions into one. nothing you've said here has made any sense to me whatsoever. use monads, don't use monads, write a language without parsing, etc.
19:38 <EvanR> no i did not
19:39 mattyw joined
19:39 <sophiag> monochrom: can you expound on that? you type arguments into a REPL, but don't store them in a list. where do they go?
19:39 MitchellSalad joined
19:39 <Aruro> sophiag: do u need to realize repl yourself? you could use things like haskeline
19:39 <EvanR> depending on the language parsed, you may not need to store any inputs at all
19:40 <EvanR> zero lookahead
19:40 <EvanR> or lookbehind
19:40 <sophiag> EvanR: i do.
19:40 <sophiag> Aruro: the REPL works fine
19:40 <monochrom> You saw the code of map? You saw the code of unfoldr?
19:41 <sophiag> guys, i'm really just looking for answers to the specific question i asked
19:41 <EvanR> each state of the parser can be a function, whatever data it needs to remember can be in a closure
19:41 contiver_ joined
19:41 <sophiag> EvanR: wow, it's almost like...that's exactly what i'm doing now...
19:41 darjeeling_ joined
19:41 <EvanR> it takes the next character and returns the new parser
19:41 <EvanR> or the final answer
19:41 <EvanR> or an error
19:41 sophiag left
19:42 <Gurkenglas> https://downloads.haskell.org/~ghc/7.0.4/docs/html/libraries/time-1.2.0.3/Data-Time-Clock.html how do I get the picoseconds out of a DiffTime, in order to multiply them by a factor before putting them back?
19:43 <EvanR> DiffTime and NominalDiffTime are Nums
19:43 coltfred joined
19:43 <EvanR> hmm
19:43 <monochrom> Gurkenglas, you're using GHC 7.0.4?
19:43 Levex joined
19:44 <merijn> Looks like someone needs to get Hackage-Fu :p
19:44 <EvanR> diffTimeToPicoseconds :: DiffTime -> Integer
19:44 <Gurkenglas> That's what google gave me for Data.Time.Clock and the ghci im teamviewering to here seems not to have diffTimeToPicoSeconds so Im assuming that closer than the other versions of that package I found
19:45 lithie joined
19:45 <EvanR> seems like a glaring omission from that version of the lib
19:45 <Gurkenglas> (I'm now doing all the multiplication on the picoseconds side and only making difftimes temporarily when i need them
19:46 <Gurkenglas> * - yay for lessons derived from lifting functions into monads!)
19:47 tput-- joined
19:48 meoblast001 joined
19:49 <monochrom> Gurkenglas, DiffTime is a Num instance, you can do arithmetic directly without conversion.
19:49 <Gurkenglas> monochrom, where do I get the factor? (It's between 0 and 1.)
19:49 <Gurkenglas> You shouldnt exactly be able to multiply times to get times
19:49 <EvanR> its a Num and a Fractional so you can multiply by 1/10 for example
19:49 <monochrom> Admittedly, (5 :: DiffTime) * your_DiffTime "doesn't make sense" according to physicists' dimension analysis.
19:49 Topic for
19:50 <EvanR> yeah the units are wrong
19:50 <monochrom> But it really does multiply your time by 5.
19:50 <EvanR> Gurkenglas: are you sure you dont want to use NominalDiffTime
19:51 <EvanR> so you can actually communicate with UTCTime
19:51 mtesseract joined
19:51 <Gurkenglas> Not my code, I seem to be getting a type clash between the two right now
19:52 <EvanR> you can only cross between Nominal and NonNominal by using leap second tables
19:53 slacker joined
19:53 <Gurkenglas> Ah there, NominalDiffTime is to UTCTime as vectors to points
19:53 Sose_ joined
19:53 kamog joined
19:53 <EvanR> right
19:55 NickHu joined
19:56 bollu joined
19:56 Flocks joined
19:57 arctictern joined
19:57 shesek joined
19:57 cpape joined
19:57 raycoll joined
19:57 arctictern joined
19:58 arctictern joined
19:58 <Gurkenglas> Maybe I'm going about this wrong. How do I make a thread wait for a given amount of picoseconds?
19:59 semigroup joined
19:59 arctictern joined
19:59 SpaceGazebo joined
20:00 arctictern joined
20:00 <semigroup> Is there an easy way to suppress warnings about OverlappingInstances being deprecated? -fno-warn-warnings-deprecations doesn't suppress it for me.
20:00 <geekosaur> picoseconds isn't a thing, I think. threadDelay does nanoseconds
20:00 <merijn> semigroup: You mean, besides the obvious "stop using OverlappingInstances"? :)
20:00 arctictern joined
20:01 Itkovian joined
20:02 <semigroup> merijn: Yup, I'm adding a package that uses it my build and don't want to patch it right now
20:03 <geekosaur> once debian stops shipping 7.6...
20:03 <merijn> semigroup: The only other thing I can say "have you tried checking the GHC manual?"
20:03 osa1 joined
20:03 osa1 joined
20:04 bananaboy joined
20:04 <merijn> I forget: Where do I find Fix/Mu?
20:05 <tolt> merijn: Control.Monad.Fix?
20:06 <merijn> tolt: No, that's MonadFix for mfix
20:06 <merijn> I mean the recursive functor type
20:06 <tolt> oh sorry, thought I would be quick
20:06 <tolt> Yeah
20:07 klottie joined
20:07 <merijn> Else I'll just have to define my own
20:07 thallada joined
20:08 <lyxia> http://hackage.haskell.org/package/recursion-schemes-5.0.1/docs/Data-Functor-Foldable.html#t:Mu
20:08 ft3 joined
20:08 <klottie> Can a 'where' clause consist of only a 'let in' clause?
20:08 <semigroup> merijn: Found -fno-warn-warnings-deprecations in the manual, but I guess I'm using it wrong
20:08 <merijn> semigroup: I think that's for deprecation pragmas, not deprecated pragmas
20:09 <geekosaur> klottie, no, where is kinda an upside-down let-in
20:09 <dmj`> there’s no way to pattern match on a type synonym in a closed type family… is there?
20:09 <merijn> dmj`: What makes you say that?
20:10 <dmj`> merijn: because I tried, and I get a overlapping patterns warning
20:10 <dmj`> s/a/an
20:10 ompaul joined
20:10 cdg joined
20:10 <merijn> dmj`: How much hackiness and convolution are you willing to put up with?
20:11 <dmj`> merijn: I’d be willing to try anything at this point
20:11 JoshS joined
20:11 <Gurkenglas> How did you fix that thing where you have to confirm all stdin input by pressing enter?
20:11 insitu joined
20:11 <dmj`> merijn: how much hackiness are we talking though
20:12 <lyxia> type S a = Maybe a ; type family F a where F (S a) = a ; F a = a compiles silently...
20:12 <merijn> dmj`: So I have this hacky implementation of type level `elem`, which should be trivial to turn into a type level Eq, which should let you write type level case
20:12 <merijn> dmj`: https://gist.github.com/merijn/6130082
20:12 <klottie> geekosaur: So is this invalid "foo f where let g = 5 in foo f = replicate g f"
20:12 Swizec joined
20:12 <merijn> klottie: Well, what's the point of having "let" there?
20:12 <geekosaur> klottie, yes, that is invalid. in fact it looks rather broken, redefining foo like that
20:13 <merijn> klottie: You could just write "where { g = 5; foo f = replicate g f }" directly
20:13 <geekosaur> Gurkenglas, hSetBuffering stdin NoBuffering (and I wish ghc didn't conflate that with termios...) (also, unix only; windows does something different but I don;t know details off the top of my head)
20:13 arpl left
20:13 <Gurkenglas> Ah this guy already had that but hes using windows.
20:14 <dmj`> merijn: have you tried this with synonyms
20:14 ChongLi_ joined
20:14 <merijn> dmj`: ah...no
20:14 <lyxia> dmj`: what's the type family you're having problems with
20:14 <lyxia> dmj`: I just showed an example of a type family with a type synonym.
20:14 <dmj`> lyxia: did you compile with -Wall
20:15 bollu joined
20:15 jsgrant joined
20:15 <Gurkenglas> https://ghc.haskell.org/trac/ghc/ticket/2189 around since 9 years ago, touched 2 weeks ago, last post was asking for a workaround. :(
20:15 <ij> barrucadu, Hi. Can the irc-client-1.0.0.0 receive msgs while a handler is running? I'm implementing a "bot status/multi ping" command and it doesn't work in 1.0.0.0 any more. http://sprunge.us/jQRe
20:16 <lyxia> dmj`: I did
20:16 <dmj`> lyxia: type SK a = Maybe a; type SS a = Maybe a; F (SS a) = a; F (SK a) = a; shows an overlap
20:16 <dmj`> can’t differentiate on type synonyms
20:17 <lyxia> ok that's what you meant
20:17 <klottie> merijn: geekosaur: thank you.
20:17 <lyxia> dmj`: I can't see how that could work. What is that for?
20:18 <merijn> dmj`: oh, that's what you meant
20:18 <merijn> dmj`: Well, why wouldn't those overlap?
20:19 <dmj`> lyxia: for an idea
20:19 <dmj`> merijn: they would, but I was hoping they could be treated separately with an extension or other
20:20 <dmj`> lyxia: I’m using a type family on the Generic Rep of an ADT. I’d like to treat type synonyms specially in certain cases
20:20 <geekosaur> afaik a type synonym is exactly that and cannot ever be treated specially
20:21 <dmj`> geekosaur: I see, sigh
20:21 <geekosaur> "type alias" is a better name for them
20:22 fractalsea joined
20:23 <dmj`> geekosaur: Was hoping in the same way type synonym instances lets you differentiate on type synonyms in type class, the same could be done with a family.
20:23 <dmj`> in a type class instance
20:23 <geekosaur> uh type synonym instances don't work that way in typeclasses eithger
20:23 thallada joined
20:24 <geekosaur> you can;t for example have different instances for String and [Char], all you can do with the extension is say String instead of [Char] in the instance declaration
20:24 <merijn> Yeah, TypeSynonymInstances just lets you avoid writing out the full type
20:24 abhiroop joined
20:24 <geekosaur> which is normally forbidden as a reminder that they are the same thing and *cannot* be differentiated
20:25 arctictern joined
20:25 sophiag joined
20:25 BartAdv joined
20:25 <ij> I want to make a type that has a "true type" and a "false type", both with string inside and a monoid that'd be concat on true<>true and false<>false, but with my own monoid instance code otherwise. Can I use some existing code or is this something totally new?
20:25 <codedmart> Is there a built in function to convert a Tuple to a List?
20:25 <codedmart> Can't seem to find one.
20:26 <dmj`> merijn, geekosaur: Ah, yea, my mistake
20:26 <merijn> codedmart: No, because that doesn't make sense, in general
20:27 <codedmart> I have (Word32, Word32, Word32, Word32) and I want to go to Text. So my intial thought was to convert to List then intercalate.
20:28 <merijn> codedmart: honestly, simplest would just be to write that function out
20:28 <codedmart> OK fair enough
20:28 <codedmart> Thanks
20:28 <merijn> \(a,b,c,d) -> [a,b,c,d]
20:29 nahra joined
20:30 jgertm joined
20:32 <cocreature> I’m disappointed. even lens doesn’t seem to have a function for that
20:32 <geekosaur> tuple to list? that's going to be Hard
20:33 <cocreature> geekosaur: well it exists for two tuples
20:33 <cocreature> > (1,2) ^.. both
20:33 <lambdabot> [1,2]
20:33 <geekosaur> sure, the problem is it has to be done separately for each tuple size
20:33 <cocreature> ofc
20:33 <cocreature> but lens already does that for things like _1 so I wouldn’t be surprised if something exists for this as well
20:34 NickHu joined
20:35 HoloIRCUser2 joined
20:35 <barrucadu> ij: I decided to remove the concurrency in the handlers (a little rationale here: https://github.com/barrucadu/irc-client/pull/40), so if you want to have handlers run for a while without delaying handling of future messages, you'll need to use the `fork` function exported from Network.IRC.Client.
20:37 coot joined
20:39 Kundry_Wag joined
20:39 tdfirth joined
20:42 <ij> barrucadu, Ah, thanks!
20:42 dcoutts joined
20:42 dcoutts joined
20:42 louispan joined
20:42 vydd_ joined
20:43 Jackoe joined
20:43 raichoo joined
20:43 Jackoe joined
20:44 abhiroop joined
20:46 <hexagoxel> > (1,2,3) ^.. each
20:46 <lambdabot> [1,2,3]
20:46 uncertainty joined
20:47 <hexagoxel> :t (^.. each)
20:47 <lambdabot> Each s s b b => s -> [b]
20:49 raidiant joined
20:49 presiden joined
20:49 caumeslasal joined
20:52 klottie left
20:53 Rodya_ joined
20:54 kadoban joined
20:54 HugoDaniel joined
20:54 <lyxia> codedmart: you can do this using one-liner
20:54 darkSeid_ joined
20:55 replay joined
20:55 Sh4rPEYE joined
20:56 <lyxia> codedmart: gfoldmap (For :: For ((~) Word32)) (:[]) :: (Word32, Word32, Word32, Word32) -> [Word32]
20:56 <lyxia> it's longer than \(a,b,c,d) -> [a,b,c,d] but it's polymorphic
20:56 conal joined
20:56 `^_^v joined
20:58 shayan_ joined
21:00 peterbecich joined
21:00 zaquest joined
21:02 ft3 joined
21:04 mtesseract joined
21:05 ChaiTRex joined
21:06 mrowe joined
21:07 markasoftware joined
21:07 aglorei joined
21:08 ChaiTRex_ joined
21:08 sellout- joined
21:12 twanvl joined
21:12 uglyfigurine joined
21:13 <jgt> No instance for (Monoid (R.Redis (Either R.Reply [ByteString])))
21:13 <jgt> arising from a use of ‘concatMap’
21:13 <jgt> this means I have to write the instance, right?
21:13 kadoban_ joined
21:13 <lyxia> or that a Redis is not a monoid.
21:13 mtesseract joined
21:13 <jle`> jgt: well, it depends on what you want to do
21:14 burtons joined
21:14 <jle`> usually, orphan instances aren't the answer
21:14 SpaceGazebo joined
21:14 <jgt> jle`: `ids <- ExceptT $ concatMap (\d -> R.zrangebyscore ("companies:date:" <> d) 0 99999999) (map (C8.pack . filter isDigit . showGregorian) days)` is what I'm trying to do
21:14 burtons_ joined
21:14 <jgt> I have a list of days
21:15 <jle`> looks like you want mapM, and then fmap concat, maybe
21:15 <jgt> I want to get all the values of a sorted set for each day
21:15 <jgt> yeah, maybe I want a mapM
21:15 <jle`> if you are mapping an (a -> m b), then usually yeah you want traverse or mapM
21:16 Rodya_ joined
21:17 <jle`> i'd factor out the thing you're (map (...) days) and give it its own nam
21:18 obadz joined
21:18 <jgt> yeah, that'll happen
21:18 <MarcelineVQ> jle`: did you tell me about (f <.> g) x = f <$> g x ?
21:18 <jgt> but, one thing at a time :)
21:19 <jle`> MarcelineVQ: what is <.> ?
21:19 <jle`> from 'filepath' ?
21:19 <MarcelineVQ> no that's the whole definition here, fmapped composition
21:20 <jle`> oh, yeah, i haven't seen that
21:20 <MarcelineVQ> ah dang, trying to attribute the tricks listed in my utility lib
21:20 <MarcelineVQ> maybe it was pjdelport
21:21 JuanDaugherty joined
21:22 gcross joined
21:22 arctictern joined
21:23 aib joined
21:24 ubsan_ joined
21:24 ivana joined
21:25 dberg left
21:25 a3Dman joined
21:26 Jackoe joined
21:27 Aruro joined
21:27 ccomb joined
21:29 adamisntdead joined
21:30 iqubic joined
21:30 <iqubic> How are people.
21:30 <iqubic> ???
21:30 bjz joined
21:30 <adamisntdead> I'm good how are you
21:30 <iqubic> I just learned about arrows? How often are they used in actually Haskell programs?
21:31 ft3 joined
21:31 <jle`> well
21:31 <adamisntdead> Ah never heard of them, but I am only starting out haha
21:31 <jle`> certain arrow instances are used very often
21:31 <jle`> but Arrow as a generic abstraction is not used very often in modern Haskell
21:31 <iqubic> LOL. Yeah.
21:31 <jle`> the Arrow abstraction was hot in the early 2000's, but fell out of favor when Applicative became popular
21:32 <jle`> because a lot of the problems that the arrow abstraction was meant to solve ended up being easier when addressed by Applicative
21:32 <adamisntdead> Ahh
21:32 <iqubic> jle` What does tell do again? In regrads to the writer monad?
21:32 <adamisntdead> Looked them up just there but yeah I have seen them
21:32 <jle`> but there are still some use cases where Arrow makes sense. but tehy tend to be more niche
21:33 <jle`> the vast majority of situations where the arrow abstraction used to be used for are now covered by Applicative API's
21:33 <jle`> iqubic: 'tell x' accumulates x into your accumulator
21:33 anuxivm joined
21:33 <iqubic> adamisntdead: Every time you write a function you have a line that looks like this: "int -> int -> int"
21:33 <adamisntdead> Yeah I know, I just didnt know there was a name for them
21:34 <iqubic> jle`, how does that helps us solve our forM_ challenege from yesterdat.
21:34 <iqubic> ??
21:34 <jle`> iqubic: well you can use tell to accumulate every item
21:34 louispan joined
21:34 <jle`> forM_ lets you give a (a -> Writer [a] ()) that it will run and sequence for every item in a Foldable
21:34 <iqubic> You can? how?
21:34 <jle`> so you can just give it (\x -> tell [x])
21:35 <iqubic> Can I see an example?
21:35 <jle`> and now it'll run that function and accumulate all of the x's, for every item in the Foldable
21:35 <jle`> accumulateAll :: Foldable t => t a -> Writer [a] (); accumulateAll = mapM (\x -> tell [x])
21:35 <JuanDaugherty> yello iqubic , arrows are a sideshow, like FRP and whatnot
21:35 <jle`> > execWriter (mapM_ (\x -> tell [x])) "hello")
21:35 <lambdabot> <hint>:1:44: error: parse error on input ‘)’
21:35 <jle`> > execWriter (mapM_ (\x -> tell [x]) "hello")
21:35 <lambdabot> "hello"
21:36 <JuanDaugherty> a perseveration of CT as a model of computation
21:36 <jle`> > execWriter (mapM_ (\x -> tell [x]) (S.fromList "hello world"))
21:36 <lambdabot> " dehlorw"
21:36 <jle`> > execWriter (mapM_ (\x -> tell [x]) (M.fromList [(1, 'a'),(10,'b'),(3,'c')]))
21:36 <lambdabot> "acb"
21:36 <jle`> > execWriter (mapM_ (\x -> tell [x]) Nothing)
21:36 <jle`> etc.
21:36 <lambdabot> []
21:36 ljc joined
21:37 <jle`> execWriter :: Writer w () -> w; it basically extracts the accumulator
21:37 oisdk_ joined
21:37 <jle`> it should be called extractAccumulator
21:37 <jle`> execWriter is such a weird name
21:37 <iqubic> jle` How would I define th function accumlateAll in GHCi?
21:38 <jle`> you can write it like i just wrote it
21:38 <jle`> you'd have to import Control.Monad.Writer or Control.Monad.Trans.Writer first
21:38 erisco joined
21:38 strykerkkd joined
21:38 <iqubic> I did that.
21:38 <jle`> then you're good :)
21:39 <iqubic> No, I'm not.
21:39 <jle`> what's the issue?
21:40 <lpaste> iqubic pasted “accumulateALL issues” at http://lpaste.net/354346
21:40 <iqubic> That is the issue
21:40 <jle`> you didn't write what i posted
21:40 <iqubic> I didn't?
21:40 <iqubic> What did I miss?
21:40 <jle`> if what you pasted is what you wrote
21:40 <jle`> scroll up again and see what i wrote
21:41 <jle`> it doesn't begin with 'let'
21:41 Sh4rPEYE joined
21:41 <jle`> what you wrote was only marginally related to what i wrote, heh
21:41 peterbecich joined
21:41 <jle`> you left out half of the stuff and added in extra letters lol
21:41 <iqubic> What should I put into ghci?
21:41 <jle`> what i wrote earlier
21:41 <jle`> i'll re-send it
21:42 vydd joined
21:42 <jle`> accumulateAll :: Foldable t => t a -> Writer [a] (); accumulateAll = mapM (\x -> tell [x])
21:42 <iqubic> I have no idea how to view scroll back with irssi.
21:42 <jle`> sorry, it should have been mapM_
21:42 <Aruro> does ghc have design flaws?
21:42 <iqubic> <interactive>:7:52: parse error on input ‘;’
21:43 JeanCarloMachado joined
21:43 <jle`> iqubic: what version of GHC are you using?
21:43 <SLi> Having tried to get stuff done in Haskell, I have a question. How do you avoid that which seems to happen much more in Haskell than any other language, that you have a problem, you start thinking about whether it fits nicely into some CoWeird model ("it's such a great language, I bet there's a clever way to do it") and suddenly you notice that lots of time has passed and you have no code?
21:43 <iqubic> How do I check my version of GHC?
21:43 darjeeling_ joined
21:43 govg joined
21:43 <jle`> when you load up ghci it should tell you
21:43 <jle`> but also ghc --version
21:44 <iqubic> 7.10.3
21:44 <iqubic> Is that old?
21:44 <SLi> At best it seems I manage to write some code and then spend 10 times the amount of time polishing it and making it instances of whatever :P
21:44 <jle`> SLi: it's all about self-control, really
21:44 <jle`> iqubic: it's kind of outdated, yeah
21:44 <jle`> um we can fix what i wrote to have 7.10 be happy with it
21:44 <iqubic> Can we?
21:44 <jle`> let accumulateAll :: Foldable t => t a -> Writer [a] (); accumulateAll = mapM_ (\x -> tell [x])
21:44 <Aruro> SLi: its true. haskell is very hyped, people dont think much. many pervious BIG ideas are now forgotten and considered bad
21:45 <Aruro> iteratee , arrows, uff u name it
21:45 <iqubic> How do I update my GHC version?
21:45 bollu joined
21:45 <jle`> SLi: haskell doesn't demand that you over-abstract things, but, the temptation is pretty strong in haskell
21:45 <jle`> iqubic: how did you install ghc?
21:45 <SLi> Aruro: Yeah, that's actually one part of the problem. Whenever I start looking into whether something fits, usually somebody tells me after three days that nobody uses that anymore. I wish this information was somewhere easily accessible :P
21:46 <SLi> For example, I didn't know arrows are frowned upon!
21:46 <maerwald> SLi: they are not, don't follow all hypes you come across
21:46 presiden joined
21:46 <iqubic> jle` I used the Gentoo package manager.
21:46 <jle`> it's a good idea to check the date of any articles you read
21:47 <maerwald> iqubic: emerge -avu world
21:47 <iqubic> I'll try that.
21:47 <jle`> iqubic: if you want, you can use stack to manage your ghc versions, which is cross platform.
21:47 cur8or joined
21:47 <maerwald> iqubic: the _very_ latest haskell packages are not in the gentoo tree, but in the haskell overlay sometimes
21:47 <maerwald> so you might have to add that
21:48 <maerwald> but that could blow up your depgraph as well
21:48 <iqubic> jle` I have been able to get stack to work on my gentoo machine
21:48 <jle`> ah then you can use 'stack ghci'
21:48 ebzzry joined
21:48 <jle`> and it'll load up ghci using the default resolver, which you can configure
21:48 a3Dman joined
21:48 <maerwald> since haskell packages are a mess of upper bounds, and almost no one seems to understand that upper bounds make the version selection problem np-complete, which is the reason for the so called "cabal dependency hell"
21:48 <jle`> lts-8.* resolvers all use ghc 8+ i believe
21:49 <iqubic> maerwald: I already have the Haskell overlay installed
21:49 <SLi> I never understood why people consider the upper bounds a good idea (except "don't open that can of worms").
21:49 <jle`> 7.10 isn't super out of date though, it just happened to be different in that specific example we had
21:49 <iqubic> or added rather
21:49 <iqubic> jle` what is the latest version of GHC currently out?
21:49 <maerwald> iqubic: then you should get latest ghc
21:49 <iqubic> How can I do that?
21:49 <c_wraith> 8.0.2
21:49 <maerwald> iqubic: https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
21:50 <maerwald> even 8.2.1_rc1 is there
21:50 bollu joined
21:51 <iqubic> How do I install stuff from that github branch?
21:51 <maerwald> iqubic: ?
21:51 <maerwald> sync your repositories
21:51 <maerwald> via layman or emerge
21:52 <maerwald> read the gentoo documentation
21:52 Ornedan joined
21:52 <iqubic> I have synced my repositories.
21:52 <iqubic> The latst version of GHC is not being found and added.
21:52 hiratara joined
21:52 silver_ joined
21:53 <maerwald> emerge -av1 =dev-lang/ghc-8.0.2::haskell
21:53 <iqubic> I'll do that once my world finishes updating.
21:54 <maerwald> I suspect a user error here
21:54 <maerwald> (overlays naturally are unstable arch btw)
21:54 cur8or joined
21:54 <maerwald> but that's also explained in the README
21:55 <iqubic> Yeah, I think I just need to go ahead and keyword everything.
21:57 orbifx joined
21:57 niteria joined
21:57 <maerwald> iqubic: that will be fun, only keyword */*::haskell rather
21:57 bollu joined
21:57 djapo_ joined
21:58 <iqubic> That's what I meant to say.
21:58 sanitypassing joined
21:58 <iqubic> Who here runs XMonad? Just trying to get a feel for the community.
21:58 <maerwald> there's probably a xmonad channel is there not?
21:59 <iqubic> Yeah.
21:59 b4ff3r joined
21:59 <iqubic> I just want to see how many Haskellers use XMonad. I don't actually want help with it.
21:59 <maerwald> they don't have a configuration format, so I don't like it. Learning a random haskell API vs learning a very simple config format (like i3) is a huge difference
21:59 <maerwald> so I don't want to waste my time with xmonad
22:00 ubsan_ joined
22:00 <maerwald> especially since it involves installing a lot of custom code/plugins
22:00 peterbecich joined
22:00 <iqubic> I have no problems with XMonad.
22:00 <iqubic> I don't like i3 much.
22:00 <maerwald> sure, people say the same about emacs
22:00 soLucien joined
22:01 <sanitypassing> i3 is weird after using XMonad for so long
22:01 <iqubic> I don't like emacs either. VIM ALL THE WAY.
22:01 <maerwald> it's just that it really lacks a configuration format
22:01 <byorgey> iqubic: it's hard to say how many use it. There's really no way to count.
22:01 <sanitypassing> (so long = 7-8 months)
22:01 <iqubic> sanitypassing: I have been using XMonad for a year now.
22:01 <maerwald> even though I can write haskell, I don't want to be bothered _writing_ haskell in order to configure something
22:01 <byorgey> iqubic: I use it. (I have actually used it for... 8 years maybe?)
22:01 <iqubic> I just find non-tiling WMs to be a pain in the arse
22:02 <erisco> funny when something seemingly simple, like finding dependencies, is actually complicated
22:02 <jackhill> maerwald: maybe someone will end up writing a contrib module that reads a config file ☺
22:02 <maerwald> erisco: that's because of the input
22:02 <jackhill> for the record, I'm an XMonad user
22:02 <iqubic> too much RSI from moving between the mouse and keyboard makes non-tiling WMs a pain to use.
22:02 <maerwald> erisco: and the input wrt hackage is just off all charts
22:02 bennofs joined
22:03 <sanitypassing> I use XMonad pretty much all the time; I have MATE installed in case someone needs to borrow my computer or I need to run a program that doesn't cooperate with XMonad (and I haven't found workaround yet) though
22:03 <maerwald> I guess no one bothered to read about dependency resolution problems when they started writing cabal and applying "best practices" :P
22:03 <maerwald> https://research.swtch.com/version-sat
22:03 <erisco> why bother because it doesn't sound so difficult at the outset
22:04 <maerwald> because currently the only "solution" is sandboxing or freezing states
22:04 jmiven joined
22:04 <iqubic> That's odd.
22:05 <iqubic> maerwald: I just tried emerge -av1 =dev-lang/ghc-8.0.2::haskell
22:05 <iqubic> And got this: zsh: dev-lang/ghc-8.0.2::haskell not found
22:05 <maerwald> then you haven't updated your repositories
22:05 <erisco> I am often surprised by how small features have huge implications
22:05 <maerwald> fix it
22:05 <iqubic> How?
22:05 <maerwald> read the gentoo docs
22:05 <maerwald> they have a wiki
22:06 dan_f joined
22:06 <iqubic> I have done that. It doesn't help me.
22:06 <maerwald> then ask in #gentoo, not here
22:06 <ClaudiusMaximus> that's a zsh error, not an emerge error - try 'quotes'
22:06 <monochrom> Yes, the cabal creators 10 years ago did not bother to read a December 2016 article.
22:06 <maerwald> monochrom: wrong, that was known a long time ago, there's a paper from debian
22:06 <maerwald> which is old
22:06 <maerwald> google it
22:06 <monochrom> Or Knuth's latest Fascicle 6.
22:06 <iqubic> Around what ClaudiusMaximus?
22:07 <ClaudiusMaximus> iqubic: the =...haskell i guess
22:07 <iqubic> Alright, I got it to work
22:07 <iqubic> Yeah. I assume ZSH was trying to expand the =...haskell
22:07 <iqubic> Looks like ghc 8.0.2 has a bunch of dependencies.
22:09 <iqubic> I see now why I can't get a later version of GHC.
22:10 <maerwald> iqubic: btw. there's also a #gentoo-haskell channel
22:10 bollu joined
22:10 <maerwald> where you might get more specific support
22:10 <maerwald> because what you're doing now is offtopic here
22:10 <iqubic> Yeah, I know.
22:11 <lpaste> iqubic pasted “Masked Package” at http://lpaste.net/354347
22:11 <iqubic> That's why my version of GHC is so old.
22:11 <iqubic> Looks like that's bot going to be fixed any time soon though.
22:11 <EvanR> to make a thread wait for a number of picoseconds, round to the nearest microseconds, then (if the result is less than 9 billion billion) convert to Int and use threadDelay
22:13 mtesseract joined
22:14 <iqubic> Does XMonad require any specific version of GHC?
22:15 cur8or_ joined
22:15 JuanDaugherty left
22:15 <maerwald> iqubic: https://github.com/gentoo-haskell/gentoo-haskell/blob/master/x11-wm/xmonad/xmonad-0.13.ebuild#L27
22:17 {emptyset} joined
22:17 SpaceGazebo joined
22:18 <iqubic> maerwald: what does that mean?
22:18 <maerwald> iqubic: that you need at least ghc-8.0.1
22:19 hybrid joined
22:19 <iqubic> That's can't be right. I have XMonad AND ghc 7.10.3
22:19 <iqubic> What is going on???
22:20 <maerwald> iqubic: not xmonad-0.13
22:20 <iqubic> I have xmonad-0.12
22:20 <iqubic> How can I update that?
22:21 <maerwald> you really need to go to #gentoo or #gentoo-haskell
22:21 <maerwald> you have problems with basic operations
22:21 <iqubic> Do I?
22:21 <maerwald> yes
22:23 darjeeling_ joined
22:23 ChaiTRex joined
22:23 <iqubic> How so? Why are you saying that maerwald?
22:23 allenj12 joined
22:23 <maerwald> because everything else are non-haskell issues, those are gentoo maintenance issues, which are offtopic here
22:24 <maerwald> and those are basic operations (like updating your system)
22:25 <maerwald> there are adequate channels where you can get help, as I mentioned
22:26 Flocks joined
22:26 iqubic left
22:27 <Aruro> brew was trying to complie ghc on mac, terrible experience.
22:30 bjz joined
22:31 hiratara joined
22:31 newbie37 joined
22:33 <lolisa> Hi, suppose I has a open type family, F a :: *
22:33 veyd joined
22:33 eschnett joined
22:33 <lolisa> Now, how can I achieve something like Eq a => Eq (F a)?
22:34 <veyd> Hello. I'm starting "Programming in Haskell" by Hutton, and he's instructing me to download the Haskell Platform, but I've read that Platform has been largely deprecated in favor of Stack?
22:34 <jle`> lolisa: you can't make instances of naked type families like that
22:34 <jle`> but you can wrap it in a newtype wrapper
22:34 Lu joined
22:34 <veyd> This this relevant to just starting out? Should I just go with PLatform and worry about Stack later on?
22:34 <jle`> veyd: you'll get varying opinions, and it's not uninamous
22:35 <veyd> *Is this
22:35 <jle`> but i hear that the platform includes stack these days
22:35 <jle`> if you use stack then you just need to prefix your commands with 'stack', like 'stack ghci', 'stack ghc', etc.
22:35 <jle`> i'm not really sure what the role of the platform is in the ecosystem these days, but if oyu have stack, you don't need it
22:35 <monochrom> Haskell Platform is not deprecated.
22:35 <veyd> Well I have zero experinece with
22:35 <lolisa> Yes, but are there other option? F a recursively invoke itself so wrapping it in newtype hurt alot
22:35 <veyd> with Haskell
22:35 <lordcirth> Leksah just froze while trying to do a simple find+replace in a small project
22:36 <veyd> so I'm not sure if I should deviate from the book at all
22:36 <jle`> lolisa: the newtype won't add any runtime overhead
22:36 <sm> veyd: you'll have to
22:36 xiinotulp joined
22:36 <veyd> monochrom: so you recommend I just follow the book and use Platform?
22:36 <jle`> lordcirth: newtype WrapF a = WrapF (F a)
22:36 <jle`> * lolisa
22:36 <monochrom> Yes.
22:36 <veyd> sm: why? it's the second edition that just came out in Spt. 2016
22:36 <veyd> *Sept
22:37 <jle`> lolisa: but i don't think you'll be able to write that instance
22:37 <veyd> surely it's not THAT out of date already
22:37 <jle`> even if you could have typeclass instances
22:37 <lolisa> jle`, I am maniuplating term in EDSL with finally tagless style... so they wont get erased :(
22:37 <lolisa> Yeah that's a problem
22:37 <jle`> lolisa: because 'Eq a' doesn't ensure that 'F a' is Eq
22:37 <sm> well that's true, and the instructions therein might be exceptionally robust, but I'll be amazed if you don't find some changes necessary
22:37 <jle`> such as type instance F Int = F (Bool -> Int)
22:37 <monochrom> It is OK to check out stack too on the side. But following the book is least confusing if you plan to follow it in the first place.
22:37 <lolisa> Yes. I am thinking of using some Data.Constraints trickery to make it work
22:38 <veyd> ok, last question and I'm sure you all get this all the time, but what's the best IDE for Haskell?
22:38 <lolisa> With associated type, I can add a requirement to make sure it can derive Eq
22:38 takle joined
22:38 <lolisa> But than it isnt naked...
22:38 <jle`> lolisa: the any Eq a => Eq (F a) instance would be necessarily false
22:38 <jle`> it's a lie
22:38 <jle`> because of things like what I just wrote
22:38 <sm> emacs/vim/atom/idea/vs code get the most votes currently
22:39 augur joined
22:39 <lolisa> jle`, what Iam thinking is, when you define the associated type saying F Int is F (Bool -> Int), you have to supply the instance for Eq
22:39 uglyfigurine joined
22:39 <monochrom> In fact, why involve Int in the RHS? F Int = F (Cont Bool String).
22:39 <veyd> alright, thanks everyone
22:39 veyd left
22:40 Netwolf joined
22:41 Kundry_Wag joined
22:41 <monochrom> That would require sneaking F into the original definition of Show.
22:42 jayjam124 joined
22:42 <monochrom> Perhaps don't impose this requirement on F itself. Impose on functions that involve F.
22:42 markasoftware joined
22:42 <monochrom> operation_number_1 :: Show (F a) => F a -> F a -> F a
22:43 <monochrom> (Bad example but still.)
22:43 <monochrom> Err, good example if you call Debug.Trace.trace somewhere in there! :)
22:44 <monochrom> Err, s/Show/Eq/
22:45 <monochrom> and nevermind about trace.
22:45 a3Dman joined
22:46 <lolisa> This is probably the best way to go...
22:47 coltfred joined
22:47 sanitypassing joined
22:49 augur joined
22:49 iqubic joined
22:50 <iqubic> Do I need to update to GHC 8?
22:51 Koterpillar joined
22:52 presiden joined
22:52 oisdk joined
22:53 <iqubic> Will people shun me if I don't use GHC 8?
22:53 <monochrom> No.
22:53 <monochrom> I think you worry too much.
22:53 djapo_ joined
22:54 <monochrom> Maybe two years in the future you will have to update, but there is still no hurry now.
22:54 <monochrom> Also it depends on your purpose so no one can answering accurate for you.
22:55 <iqubic> monochrom I have too many packages that still rely on GHC 7. So I can't update yet.
22:55 <monochrom> I know that many desktop computers in banks are still using OS/2 version 2.1, for example.
22:56 <monochrom> And a few small business desktops still using Windows 98 because WinFax.
22:56 dan_f joined
22:56 <dolio> They should upgrade to OS/2 Warp.
22:57 a3Dman joined
22:57 <monochrom> An acquaintance who still sticks to mIRC from 1997.
22:57 ivana left
22:58 sleffy joined
22:59 <monochrom> And therefore hates you for using UTF-8.
22:59 <Rembane> Latin-1 is the charset of IRC.
23:00 <monochrom> No, they reject all non-ascii.
23:01 fDev2179 joined
23:01 nemesit|znc joined
23:02 jao joined
23:04 alx741 joined
23:05 coot joined
23:06 alx741 joined
23:07 cheater joined
23:09 fDev2179 joined
23:12 ubsan_ joined
23:13 zero_byte joined
23:15 steeze joined
23:15 theDon__ joined
23:16 uncertainty joined
23:18 QRealm joined
23:19 markus1189 joined
23:19 markus1199 joined
23:20 nakal joined
23:20 lambda-11235 joined
23:22 cschneid_ joined
23:22 jaziz joined
23:24 jaziz joined
23:26 louispan joined
23:29 <buff3r> any alternatives to django rest framework you guys like?
23:30 <haasn> is there a way to get `criterion` to benchmark functions returning a Double and score the results for a test in the same way as the execution time? Context: I have a slow-but-correct function and a series of incremental approximations that sacrifice some precision for speed. I want to benchmark both the average execution time and the average score for each function. (lower is better for both)
23:30 <Rembane> buff3r: Take a look at servant. http://haskell-servant.readthedocs.io/en/stable/
23:30 <haasn> ah actually that would require something like Arbitrary as well
23:30 <iqubic> Why does alsamixer depend on ghc?
23:32 <iqubic> Or rather, what is dev-haskell/alsamixer?
23:33 pacak joined
23:34 skeuomorf joined
23:35 <fDev2179> iqubic, can't answer the question about dev-haskell/alsamixer, but I can say that on my Arch Linux machine, the only dependency for alsamixer is glibc.
23:36 <iqubic> Alright then.
23:37 Swizec_ joined
23:37 Welkin joined
23:40 <geekosaur> dev-haskell/alamixer would be the haskell bindings to alsamixer; unsurprisingly this requires a haskell compiler
23:40 Trendrrrr joined
23:40 <iqubic> Yeah, I know.
23:40 <iqubic> And I have packages that rely on dev-haskell/alsamixer.
23:41 <iqubic> So, it looks like GHC 7.10.3 is here to stay.
23:41 <iqubic> I have too many things that still rely on GHC 7.10.3
23:42 Kundry_Wag joined
23:43 <Welkin> have fun being left in the dust
23:44 <iqubic> Why do you say that I'll be left in the dust.
23:44 <monochrom> That was unnecessary, Welkin.
23:44 <iqubic> When was it that GHC 8 came out?
23:44 <Welkin> there exist some people (who know who they are) who won't even use anything from after typeclasses were added to haskell
23:44 <Welkin> lol
23:45 <monochrom> Welkin, again, it is unnecessary to be snark.
23:46 FjordPrefect joined
23:46 <kadobanana> iqubic: Earlyish last year, maybe June timeframe I think
23:47 <iqubic> Ah so how long will it be until packages get around to updating to GHC 8?
23:47 <Welkin> iqubic: some never will because they get abandoned
23:47 darjeeling_ joined
23:47 <Welkin> it's just the nature of progress
23:48 <kadobanana> iqubic: There's a pretty decent selection that already are, ya all will probably never be.
23:48 <Welkin> which packages are you talking about specifically?
23:48 <iqubic> XMobar.
23:48 <geekosaur> I would expect active packages to be updates already. If you;re not seeing this, and are using stack, you might want to check for more recent resolvers
23:48 <Welkin> I have ended up forking or writing my own libraries because existing ones were old (and also not written well)
23:49 <monochrom> Those actively maintained have already been updated. If you see a stale one, you can assume it is not actively maintained. You can give a nudge to the maintainer.
23:49 <kadobanana> In my limited experience, updating code to ghc8 was quite painless
23:49 <Welkin> xmonad is not actively maintained any more I don't think
23:49 peterbecich joined
23:49 <geekosaur> uh
23:49 <Welkin> or at least not actively developed
23:49 <Koterpillar> Welkin: wrong
23:49 <geekosaur> 0.13 was just released, welkin
23:49 markasoftware joined
23:49 <Welkin> really?
23:49 <geekosaur> could you cite your sources?
23:49 louispan joined
23:49 <Welkin> I thought there were no releases for 2 years
23:49 <iqubic> So how long will it be until XMobar will be updated?
23:51 <Welkin> lol
23:51 ludat joined
23:51 <Welkin> you both seem offended that I owould suggest such a thing
23:51 systemfault joined
23:51 <Welkin> I haven't tried xmonad because I couldn't get it working
23:51 <Welkin> I just settled on i3
23:52 <monochrom> No, I am fine with pointing out issues about old software. Your tone is the problem, what with all your left-in-dust and lol.
23:52 <* pacak> likes xmonad
23:53 <pacak> Updating packages to new ghc is not as hard as it seems.
23:54 <geekosaur> for xmobar you're often better off running the git version, althoygh I see no commits mentioning ghc8 compatibility (last commit was a month ago)
23:54 fDev2179 left
23:54 sanitypassing joined
23:54 sanitypassing joined
23:54 <iqubic> geekosaur: Is there a way I can XMonad without a status bar?
23:54 <geekosaur> why would xmonad require a status bar?
23:54 <Welkin> you can use xfce-panel if you want
23:55 <Welkin> or gnome-panel
23:55 <Welkin> or anything else
23:55 <geekosaur> (in particular it does not require xmobar; xmobar was inspired by xmonad, it is not part of xmonad or required by it
23:55 <Sonolin> yea I'm pretty sure it doesn't have xmobar by default
23:55 <iqubic> How can I make the change to a different status bar?
23:55 <Sonolin> implement a loghook
23:56 <Sonolin> i.e. with dynamicLogWithPP
23:56 <Koterpillar> iqubic: which bar?
23:56 a3Dman joined
23:56 <geekosaur> dynamicLog has predefined hooks for xmobar and dzen; others can be defined fairly easily by providing your own PP
23:57 <iqubic> Koterpillar: Something other than XMobar, since XMobar is not yet updated to GHC8
23:57 <Sonolin> iqubic this might help: https://wiki.haskell.org/Xmonad/Config_archive/Remi's_xmonad.hs
23:58 <Koterpillar> iqubic: there's a lot of status bars
23:58 <Sonolin> essentially you just have to start whichever bar you want, and then implement the loghook if you want some custom stuff
23:58 <Welkin> you just run it
23:58 <Welkin> o.o
23:58 <Welkin> and it appears
23:58 JeanCarloMachado joined
23:58 <Sonolin> yea that works too ;)
23:58 merijn joined
23:59 <Welkin> i3 is a reall pain in the ass to set up with all my function keys though
23:59 <iqubic> Alright, I am going to switch to dzen. Does that depend on GHC?
23:59 <Welkin> it breaks my audio