<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:00 <ertes> @let import Control.Concurrent.Async
00:00 <Eduard_Munteanu> If you're constructing the exception handler when you're creating the async, then you pretty much have everything at hand.
00:00 <lambdabot> .L.hs:49:1: error:
00:00 <lambdabot> Control.Concurrent.Async: Can't be safely imported!
00:00 <lambdabot> The package (async-2.1.1) the module resides in isn't trusted.
00:00 <EvanR> Eduard_Munteanu: so do Eq tests against all the asyncs... ok
00:01 infinity0 joined
00:01 <Eduard_Munteanu> EvanR, no, I mean if there's some data associated with an async, it can probably be associated with an exception handler too
00:01 <ReinH> EvanR: this is yet another use case for the (a,) traversable!
00:01 <EvanR> i dont see how
00:01 <ReinH> Tag your async with a label and then traverse
00:02 systemfault joined
00:02 <EvanR> how does traverse factor into this
00:02 <EvanR> waitAnyCancel :: [Async a] -> IO (Async a, a)
00:02 <EvanR> waitAnyCatchCancel :: [Async a] -> IO (Async a, Either SomeException a)
00:02 <Eduard_Munteanu> Waiting on multiple asyncs is probably just a traversal over the list of asyncs.
00:03 <EvanR> i uh...
00:03 aib joined
00:03 <Eduard_Munteanu> Oh, wait, no, it's wait*Any*
00:04 moet joined
00:04 infinity0 joined
00:04 aib joined
00:05 <ertes> :t asum . zipWith (\k c -> (,) k <$> Control.Concurrent.Async.waitCatchSTM c) [0..]
00:05 <lambdabot> (Enum a, Num a) => [Control.Concurrent.Async.Async a1] -> GHC.Conc.Sync.STM (a, Either SomeException a1)
00:05 <ReinH> Async (String, a)
00:05 <ertes> EvanR: ^ some inspiration
00:06 <EvanR> Async (String,a), it wont tell you the String if it crashes
00:06 infinity0 joined
00:07 justinfokes joined
00:07 <EvanR> trying to see if the STM makes sense
00:07 <ReinH> You end up with an IO Async(String, Either
00:07 <ReinH> Er sorry
00:07 <ertes> EvanR: and yes, i'm basically doing the ((,) a) traversal there =)
00:08 <ertes> :t asum . zipWith (\k c -> traverse (k, Control.Concurrent.Async.waitCatchSTM c)) [0..]
00:08 <lambdabot> error:
00:08 <lambdabot> • Couldn't match expected type ‘a -> f b’
00:08 <lambdabot> with actual type ‘(Integer,
00:08 <ertes> :t asum . zipWith (\k c -> sequence (k, Control.Concurrent.Async.waitCatchSTM c)) [0..]
00:08 <lambdabot> (Enum t, Num t) => [Control.Concurrent.Async.Async a] -> GHC.Conc.Sync.STM (t, Either SomeException a)
00:08 <glguy> you'd need to pair up a label with each Async, and then wait on them individually so you could tell which ones specifically failed
00:09 <ReinH> You end up with a (label, Either SomeException a)
00:09 infinity0 joined
00:09 <EvanR> oh you do the wait in another async
00:10 <EvanR> or many
00:10 <ReinH> Which tells you either which succeeded or which failed.
00:10 <ertes> that's what this code is doing: takes a list of asyncs, assigns each a unique index, then returns the first one that is stopped, along with its index… of course in practice you probably have your own data structure with indices, so the zipWith would turn into an fmap
00:10 <EvanR> i get it
00:10 <ReinH> Sorry I couldn't be more helpful, I don't have GHC on this iPad.
00:11 fotonzade joined
00:11 <Eduard_Munteanu> How about..... forM_ xs $ \x -> async $ handle (\(_ :: SomeException) -> return (Left x)) (action x)
00:11 <ReinH> "I left my GHC in my other pants"
00:11 <ertes> Eduard_Munteanu: uh, don't do that…
00:12 <Eduard_Munteanu> Nevermind, that won't work, there's no failure anymore.
00:12 infinity0 joined
00:13 <* hackage> pinch 0.3.1.0 - An alternative implementation of Thrift for Haskell. https://hackage.haskell.org/package/pinch-0.3.1.0 (abhinav)
00:14 <ertes> a few years ago i had the pleasure to work on a PHP project, where the original author had written a database abstraction based on PDO… he had turned on exceptions, and all queries were done using one particular function… i ran into some really weird bugs that were impossible to explain, so i looked into his abstraction
00:14 <Eduard_Munteanu> Hmm... there's an Ord instance for Async.
00:14 <ertes> turns out he was catching all exceptions and turning them into 'null' returns
00:15 infinity0 joined
00:15 <EvanR> nice
00:15 <ertes> Eduard_Munteanu's example reminded me of that experience =)
00:15 <EvanR> i wonder if theres a way in PHP to mask all crappy features ;)
00:17 halogenandtoast joined
00:17 <ertes> you know, on the rare occasion that PHP actually does do the right thing (using exceptions instead of null), programmers go out of their way to restore stupid
00:19 <ertes> Eduard_Munteanu: i wish more of those things had Ord instances
00:20 <ertes> IORef in particular
00:20 <ertes> but i do realise that it's difficult to have that
00:20 JeanCarloMachado joined
00:22 <Eduard_Munteanu> I wonder if that Cloud Haskell project is still alive.
00:22 <* Eduard_Munteanu> looks
00:23 <Eduard_Munteanu> They wanted a ton of stuff on serializing internal things like IORefs and such.
00:24 <ertes> they are still releasing libraries… last network-transport release is from february
00:25 halogenandtoast joined
00:25 justinfokes joined
00:25 <ertes> but i think RPC is a misguided approach to distributed concurrency, at least as the low-level abstraction
00:27 <Eduard_Munteanu> In that, ideally, code should be able to move around just like data?
00:27 sfcg joined
00:27 <ertes> in that code shouldn't move around at all
00:27 <ReinH> I never understood why they went with that approach
00:28 <Eduard_Munteanu> Hm.
00:28 <ReinH> Not only is it impossible, it wouldn't be good if it were possible.
00:28 <ertes> why not just pass JSON/BSON values around?
00:28 <ertes> a simple message-passing architecture
00:28 Destol joined
00:28 <Eduard_Munteanu> Well, you can already do that in Haskell.
00:29 <ReinH> Maybe a typed protocol would be good, but yes.
00:29 <ertes> yes, but you still need support libraries, and they actually provide one: network-transport
00:29 <ertes> distributed concurrency is not as much about communication as it is about discovery and failure tolerance
00:29 <ReinH> What you need for distributed systems are primitives like consensus and failure detection.
00:30 <ertes> yeah… cloud haskell seems to be focussing on the wrong things
00:30 <ReinH> Or gossip, etc.
00:30 <ertes> RPC is utterly hard to program, and in the end it's perhaps the least interesting component
00:30 louispan joined
00:30 <ReinH> There are a variety of cool things that could be implemented, lego blocks for building distsys
00:30 <Eduard_Munteanu> I don't think abstracting away machine boundaries is all useless.
00:31 carlomagno joined
00:31 <ertes> Eduard_Munteanu: but it is, because you have failure
00:31 <ReinH> Instead they chose to attack an intractable problem that wasn't even the right problem.
00:31 JeanCarloMachado joined
00:32 <ertes> Eduard_Munteanu: you *have to* think of RPC calls as glorified message passing anyway, because you can never assume that an RPC call actually went through
00:32 <ReinH> Something like riak-core is a much better approach
00:33 mekeor joined
00:34 <ReinH> I mean, links are one of the basic concepts in distsys, but *networks* are not.
00:35 <Eduard_Munteanu> For example, I think it would be nice if you could replace a DBMS having a query language with something that was able to answer queries written in a native language. Submit code, wait for completion, retrieve results.
00:35 <ReinH> it's just links
00:35 <ertes> Eduard_Munteanu: use a DSL
00:35 tromp joined
00:35 eacameron joined
00:35 <mekeor> what is this called?: "instance FooClass BarType where data FooType BarType = ..."
00:36 <ertes> mekeor: an associated type
00:36 Mutter_ joined
00:36 <Eduard_Munteanu> Or associated data family.
00:36 <mekeor> and what is this called?: "someFunction SomeConstructor{..} = ..."
00:36 <Eduard_Munteanu> Record wildcard.
00:37 <ertes> and what is this called? "let 2 + 2 = 5 in 2 + 2"
00:37 MP2E joined
00:38 <mekeor> #LearningVocabulary
00:38 aring joined
00:38 <ReinH> A mistake.
00:38 Rodya_ joined
00:40 <monochrom> user-definable (+)
00:41 <Eduard_Munteanu> ertes, using a DSL isn't much of an abstraction after all, and at least theoretically, serializing some closures should be tractable, so why not?
00:41 <ertes> DING DING DING! weeeeee have aye winneeeeeeeeeeeeeeeeeeer!
00:41 <EvanR> im using STM in anger add features to the program by adding more threads. without even getting the game going, i have 4 threads. with more to come. now i am paranoid that any particular thread involved with the outside world will crash
00:41 <EvanR> in order to add *
00:42 <ertes> Eduard_Munteanu: because it's difficult to separate those "some closures" from the rest in a reasonably convenient way =)
00:43 JeanCarloMachado joined
00:43 justinfokes joined
00:43 <ertes> Eduard_Munteanu: have you tried to use distributed-process? it's pure magic, worse than anything yesod has ever thrown at me in the past
00:43 <Eduard_Munteanu> Nope, I should try it.
00:44 Mutter_ joined
00:44 <EvanR> actually 6
00:45 <Eduard_Munteanu> Make every bullet a thread!
00:45 <ertes> EvanR: perhaps you're looking for a more controlled approach: coroutines instead of preemptive threads
00:46 <Eduard_Munteanu> Resolve to run on an embarassingly-parallel computer. Buy one. Realize it's much more worth mining bitcoins with it. Get rich!
00:47 urodna joined
00:47 robertkennedy joined
00:50 juanpaucar joined
00:50 jsgrant_om joined
00:50 JeanCarloMachado joined
00:51 bjz joined
00:51 sfcg joined
00:52 sfcg joined
00:53 sfcg joined
00:53 Rodya_ joined
00:53 <EvanR> ertes: im exploiting shared variables, TVars and the autokilling of threads when a sibling dies, async
00:54 <EvanR> is there something like that using pure coroutines
00:54 sfcg joined
00:54 <EvanR> Eduard_Munteanu: every bullet a thread... now that would be marketing gold
00:55 <ertes> EvanR: well, there is the good old automaton arrow =)
00:55 <EvanR> yeah i just went through 5 kinds of things like that
00:55 <EvanR> not sure if any are exactly like automaton
00:55 <ertes> one thread for each bullet would actually be a reasonable approach with that approach
00:56 <EvanR> but M i o = M (i -> (o, M i o)) kind of stuff ended up being so much more work
00:56 <ertes> wow… that sounds terrible
00:56 <ertes> one thread for each bullet would actually be a reasonable approach with that abstraction
00:57 <ertes> well, the "threads" in M are actually just M-actions
00:57 <ertes> communication between threads is done via (.) and the Applicative/Arrow combinators
00:57 <* hackage> postgrest-ws 0.3.0.0 - PostgREST extension to map LISTEN/NOTIFY messages to Websockets https://hackage.haskell.org/package/postgrest-ws-0.3.0.0 (diogob)
00:58 <EvanR> and the steps would need to be very numerous to get responsiveness
00:58 <EvanR> and most of the time they do nothing, except allocating more of the same
00:58 <EvanR> ertes: pretty skeptical
00:59 flatmap13 joined
00:59 <ertes> i think you can also have a simple Free-based approach to voluntary scheduling
01:00 <* ertes> goes to experiment
01:00 <EvanR> you can create M's from monads or whatever
01:00 JeanCarloMachado joined
01:00 <EvanR> not going to save any up front work or make it more efficient
01:01 <EvanR> i found 99% of my work was working on the communication technolo, the pipes and the messages themselves
01:01 <EvanR> rather than the actual program
01:01 justinfokes joined
01:02 Zialus joined
01:03 <EvanR> like, even if the abstractions were already made for me with a lib
01:04 <ertes> a Free-based voluntary-scheduling approach would be much more efficient and more predictable than haskell threads
01:04 <EvanR> voluntary scheduling?
01:04 moet joined
01:04 <EvanR> now it sounds like i am doing 99% of my work writing an OS
01:05 <EvanR> i do plan to make the gameplay predictable, certain stuff does not need to be deterministic, because it cant be anyway because real life
01:05 <EvanR> the stuff near IO
01:05 <EvanR> your programs scheduling by the OS is not predictable
01:06 <Cale> It is nice if you can make it deterministic beyond a given point though -- i.e. the output you get will be a pure function of the sequence of timestamped input events.
01:07 <EvanR> thought about that, but then, what real input events you getare at commpletely unpreditable times
01:08 soniku joined
01:09 <thang1> EvanR: what input events are you getting? Reading up on the convo it sounds like this is a game or something?
01:09 <EvanR> yes i went through the cool reactive pure lazy streams of timestamped occurrences
01:09 <EvanR> and it wasnt coming even close to helping me get this thing done
01:10 <ertes> EvanR: it's a form of concurrency, where each thread is in control until it 'yield's… there is no actual scheduler, but control is passed explicitly
01:10 <thang1> What if rather than timestamping things absolutely, things were timestamped relatively? (assuming this is user input?)
01:11 <EvanR> ertes: right.. so then im figuring out how to arrange my stuff to run with each other
01:11 <EvanR> i need to be thinking how everything else is using the processor
01:11 Supersonic112_ joined
01:11 <EvanR> thang1: yes youd need many levels of this for it to make any sense at all
01:12 meba joined
01:12 <EvanR> otherwise youre worrying about a global clock
01:12 <EvanR> and you really need to be able to write code for features independent of how everything else will work
01:13 <thang1> Right. I'm just thinking about fourier transforms at the moment, which is what prompted that; if you could somehow get every separate thing to behave where the timestamps are relative, you can pick out the global pattern with a FT and be able to figure out where everything connects.
01:13 <thang1> I'm not sure that's even remotely applicable to your application, however
01:14 <EvanR> example, a large number of parts wont care about time at all, so having to deal with it everywhere would be a drag
01:15 <ertes> EvanR: i'll have an example ready in a few minutes
01:15 <thang1> and the benefits would be likely negligible if you had to include all that overhead everywhere, wouldn't it?
01:15 <EvanR> thang1: input events http://lpaste.net/355491
01:15 TheAuGingembre joined
01:15 <* hackage> tmapchan 0.0.3 - An insert-ordered multimap (indexed FIFO) which consumes values as you lookup https://hackage.haskell.org/package/tmapchan-0.0.3 (athanclark)
01:16 <thang1> EvanR: and the point of async input events is to have true multiplayer working correctly, right? Without blocking the entire application to process things?
01:16 <EvanR> thats not really an issue
01:16 <EvanR> the whole thing would not be blocked in any case
01:16 <thang1> Oh, okay. What's the main goal behind adding the concurrency in, then?
01:17 JeanCarloMachado joined
01:17 <EvanR> well, you already have concurrency because of the audio callback, so its not like you can remove it completely if you watned
01:18 <thang1> Right, so basically having to deal with concurrency in one part of the program, you want to see if you can seamlessly add it in other places as well?
01:19 <EvanR> theres a lot to say about this, but im finding that its easy to add more features and components, and control lifetime of objects if they are just other threads
01:19 justinfokes joined
01:19 <EvanR> and each one can be using whatever framework it wants
01:20 <EvanR> automaton, a dumb loop, FRP, whatever
01:20 <thang1> Makes sense. Probably a very similar motivation to why game studios always end up rolling their own libraries and engines for everything :p
01:21 <EvanR> each part doesnt need to figure out how to fit into the latest experimental framework, and perhaps need to modify the framework to work
01:22 adsfasdfl joined
01:22 adsfasdfl left
01:22 <EvanR> the total amount of code collapsed in the process...
01:23 <EvanR> i still want to compare my old ways with what ertes is cooking up
01:23 theta8 joined
01:23 MarioBranco joined
01:23 nshepperd joined
01:23 {emptyset} joined
01:24 <EvanR> for the piece which plays the actual game, replayable input would be nice. but thats one of like 8 screens
01:25 the|auriscope joined
01:26 MarioBranco joined
01:27 CoderPuppy joined
01:28 systadmin joined
01:28 JeanCarloMachado joined
01:30 tommd joined
01:31 conal joined
01:33 electrostat joined
01:33 MarioBranco joined
01:33 jmcarthur joined
01:33 sdothum joined
01:33 JoshS joined
01:34 revprez_atlanta joined
01:34 JeanCarloMachado joined
01:36 tromp joined
01:36 MarioBranco joined
01:38 jedws joined
01:40 Beetny joined
01:41 slackman1 joined
01:42 zargoertzel joined
01:42 torstein joined
01:42 erikd joined
01:42 mjora7 joined
01:43 wolfsif joined
01:44 tromp joined
01:44 fred-fri joined
01:50 jer1 joined
01:51 rblaze joined
01:51 istvan joined
01:52 skwushe joined
01:52 <istvan> I have an list of "assembly" Instructions which I want to map to a bit array. Each instruction's bit array is 128 bits long. What is the best datatype to represent it?
01:53 <Lokathor> i wanna be an open source contributer
01:53 Gurkenglas joined
01:53 <Lokathor> but i also wanna eat cheesy popcorn
01:53 <EvanR> Word128 and a Bits instance probably
01:54 juanpaucar joined
01:54 <ertes> EvanR: https://gist.github.com/esoeylemez/bb2c9c69770516d8b2b229c59074212f
01:54 <EvanR> istvan: maybe https://hackage.haskell.org/package/largeword
01:55 <ertes> EvanR: this includes only the bare essentials, but you can easily add communication and management (e.g. killing) abstractions on top of this
01:56 justinfokes joined
01:56 JeanCarloMachado joined
01:56 <ertes> EvanR: for communication all you really need is (Coroutine (StateT MyChannels m))
01:56 <EvanR> how do you manage the lifetime of channels
01:56 <ertes> one way would be to bind channels to threads
01:57 <EvanR> and bind thread life time to each other, as in unix
01:57 acertain joined
01:57 <EvanR> so a couple of container metaphors
01:57 <istvan> EvanR, how do I use Bits and LargeWord?
01:57 rodlogic joined
01:58 <EvanR> istvan: theres a type in there Word128
01:58 <EvanR> look in Data.Bits docs for what you can do
01:58 <EvanR> bitwise ops
01:58 lambdamu joined
01:58 <istvan> so I can use Data.Bits to manipulate the Word128?
01:58 <EvanR> yes
01:58 <istvan> ah, perfect. Thanks!
01:59 <EvanR> ertes: and the data and indices for this is in a bunch of IntMaps ?
01:59 justinfokes joined
01:59 <EvanR> and the type safety is provided with some phantom types and ghc is convinced with unsafeCoerce?
02:00 <EvanR> does Hugs have some kind of cooperative version of its concurrency?
02:00 ertesx joined
02:00 hucksy_ joined
02:01 takle joined
02:01 halogenandtoast joined
02:01 twomix joined
02:03 <ertes> EvanR: sorry, got disconnected… the execution is split into frames, and every frame consists of running a step of the main thread, then running a step of each subthread (there is no hierarchy, just one main thread and many subthreads)
02:03 <EvanR> did you see my last questions before i ask more
02:03 <ertes> an IntMap of all threads goes into the frame, and out comes a new IntMap with updated threads
02:04 <ertes> with dead threads removed, new threads added, etc.
02:04 <EvanR> and you run this how fast?
02:04 <EvanR> sample rate is 44100 samples per second
02:05 <ertes> that's up to you
02:05 <EvanR> im having a hard time thinking this is more efficient than ghc threads
02:05 <ertes> i'd expect the main bottleneck of this to be the IntMap
02:05 erikd joined
02:06 <ertes> let me check
02:06 <EvanR> also much time would be spent sleeping between vsyncs
02:06 <EvanR> unless you are ticking time at something like 1 frame per millisecond to get responsiveness
02:06 <EvanR> mostly wasting cpu
02:07 <EvanR> with just this there doesnt seem to be much room for getting sleep
02:07 Destol joined
02:07 aarvar joined
02:08 AlexRussia__ joined
02:12 JeanCarloMachado joined
02:12 takle joined
02:13 <ertes> yes, this is cooperative multi-threading… you can't really wake up threads in response to events, although that could certainly be added as a feature
02:14 <ertes> the main feature of this approach is that communication can go via StateT, which is fast and predictable
02:14 <EvanR> its fast?
02:14 <EvanR> not sure im understand "going through StateT"
02:15 <ertes> so i just created a little fork bomb using this: recursively spawn 2^20 threads that each subtract 1 from the current state, while the main thread waits for the state to become 0
02:16 <EvanR> uh. any?
02:16 <EvanR> er, and?
02:17 <ertes> real 2.758 user 2.665 krnl 0.086 cpu% 99% mem 157m ./test
02:17 <ertes> now let me try the same with MVar and haskell threads
02:18 <EvanR> with that number of threads, it seems like were getting into some interesting and unrealistic problems
02:18 <EvanR> like with 100 threads, you wouldnt care about
02:21 <EvanR> there are a lot of missing features here, but i invite you to do all this engineering! ;)
02:21 <EvanR> i could use it as part of my program perhaps
02:22 hybrid joined
02:23 <ertes> real 12.751 user 9.543 krnl 4.143 cpu% 107% mem 2642m ./test2
02:23 <ertes> real 6.882 user 15.886 krnl 3.498 cpu% 281% mem 2076m ./test2 +RTS -N4
02:23 <ertes> EvanR: ^ RTS-based version
02:24 <EvanR> right a totally different situation
02:24 <MarcelineVQ> there's a 1m thread benchmark somewhere around here..
02:24 JeanCarloMachado joined
02:24 <MarcelineVQ> skynet
02:24 erikd joined
02:24 <ertes> i'm pleasantly surprised that the parallel version was actually faster… i did not expect that =)
02:24 <MarcelineVQ> 6s is about right
02:24 <MarcelineVQ> oh for their first test, I wonder which one matches up with what you're doing
02:25 <thang1> The math on how 15.9 seconds + 4 seconds maps into 6.9 seconds makes my brain hurt slightly
02:27 <ertes> BTW, i deliberately went with a fork bomb in both variants, because threads spawing other threads all over the place is the behaviour you would expect to see in something as dynamic as a video game =)
02:27 <ertes> forker 0 = modifyMVar_ var (pure . pred)
02:27 <ertes> forker n = replicateM_ 2 (forkIO (forker (n - 1)))
02:27 brynedwardz joined
02:27 <EvanR> i am not planning on doing as much
02:27 <EvanR> at most 100 things for managing all the moving parts
02:27 <EvanR> at a time
02:27 exferenceBot joined
02:27 <ertes> and in the cooperative variant:
02:27 <EvanR> with extended lifetimes
02:27 Cooler joined
02:28 <ertes> forker 0 = modify pred
02:28 <ertes> forker n = replicateM_ 2 (fork (forker (n - 1)))
02:28 <ertes> same thing, except using StateT for communication instead of an MVar
02:28 <EvanR> this is not the one-thread-per-bullet or one thread per mobile thing
02:28 <ertes> also no need to care about things like atomicity in a cooperative setting
02:29 <ertes> actually now i'm curious how well an IORef would do =)
02:29 takle joined
02:30 JeanCarloMachado joined
02:31 <ertes> real 5.406 user 4.827 krnl 0.584 cpu% 100% mem 2725m ./test
02:31 <ertes> real 6.558 user 16.710 krnl 3.277 cpu% 304% mem 2560m ./test2 +RTS -N
02:31 <ertes> still much worse memory, but CPU isn't looking too bad
02:32 Xanather joined
02:32 hexagoxel joined
02:32 <EvanR> i dont even know if were on the same page
02:32 <EvanR> the goal is to NOT use cpu
02:32 <ertes> EvanR: i'm just playing around
02:32 <EvanR> and be mostly sleeping waiting for the next event
02:32 <EvanR> and to be able to write code for stuff
02:33 <ertes> EvanR: one advantage of this approach compared to the automaton-based one is that it's actually possible to wake up certain threads in response to certain events in logarithmic time
02:34 <ertes> e.g. run until all threads are sleeping, but keep track of *why* they are sleeping
02:34 <ertes> then wait for events and wake up the relevant threads
02:34 <EvanR> another note, STM doesnt just provide the isolation from race conditions, it also lets you sleep until something you were looking at changes
02:35 <EvanR> thats one of two things i was saying is making this code much smaller
02:35 EricYuzo joined
02:35 <EvanR> the other one being auto thread killing
02:35 <EvanR> (and then var/chan garbage collection)
02:36 <EvanR> and i implemented a pure version of that once, basically STM
02:36 <EvanR> lots of code, and IntMaps
02:36 <ertes> GC is possible with this one, but you can't use StateT in that case… you would have to use an IORef
02:36 <ertes> i would expect this to be much faster than STM, while providing the same features
02:37 <ertes> caveat: you need to yield, and you can't take advantage of multiple cores
02:37 <* EvanR> looks at the tower of things ertes suggested
02:37 <c_wraith> it would be interesting to have a pessimistic version of STM available. Even more interesting if it could switch dynamically depending on contention..
02:37 <ertes> not saying you should do any of this, but if you did, i would expect the result to be quite decent in terms of both performance and efficiency
02:38 <EvanR> of the handful of issues i brough up, i serious dont think you addressed some of them
02:38 dfeuer joined
02:39 JeanCarloMachado joined
02:39 <ertes> EvanR: unless i missed some i think i did
02:39 takle joined
02:39 <EvanR> ill just bring up some more then
02:40 <EvanR> can you do IO ?
02:40 <Lokathor> when mixing STM and IO, the answer is to have STM produce an IO action as a result of the transaction that you then immediately run, right?
02:40 <ertes> EvanR: the example i linked has IO =)
02:40 <EvanR> so it yields waiting for that particular IO to come back
02:40 <ertes> Lokathor: at least that's the most convenient approach i have found
02:40 <ertes> :t join . atomically
02:40 <lambdabot> error:
02:40 <lambdabot> Variable not in scope: atomically :: a1 -> m (m a)
02:41 <ertes> :t join . Control.Monad.STM.atomically
02:41 <lambdabot> GHC.Conc.Sync.STM (IO a) -> IO a
02:41 <ertes> EvanR: no, it just runs the IO action
02:41 <EvanR> blocking everything?
02:41 <ertes> EvanR: yes
02:41 <EvanR> oh its StateT over IO
02:41 <ertes> yeah, basically
02:41 <EvanR> that settles it, i hate this
02:41 <ertes> not even that
02:41 <ertes> it's just IO
02:42 <ertes> StateT is already optional
02:43 <ertes> EvanR: think of conduit, iteratees, machines, pipes, etc. as special cases of this… it's just coroutines, hence the name
02:43 <* EvanR> looks at the acre of graveyard of not-IO controlled Os-like runtimes which resulted from trying to come up with an engine
02:43 sz0 joined
02:43 <EvanR> and this is all that, even more, plus IO
02:43 <ertes> the IO is optional, too
02:43 erikd joined
02:44 <EvanR> this is like the most possible work you could possibly do for a haskell program, unless someone already wrote it, and if they did, id love to see the haddock introduction explaining why
02:44 <ertes> Coroutine (State Integer) -- multiple threads acting on a shared state of type Integer
02:45 JeanCarloMachado joined
02:46 <ertes> this particular monad has no IO anywhere… the result is a pure value
02:47 <EvanR> i should make a list of all the things in IO that i would want
02:49 <EvanR> and then you say by reimplementing them all in pure code it will be faster
02:49 <EvanR> they should just get rid of IO ;)
02:50 cioran89 joined
02:50 Mibaz joined
02:51 <ertes> i would put it this way: in some applications it would be really great if you could use threading, but you probably don't want to use preemptive threading
02:51 <ertes> and haskell is the kind of language that makes it super-easy to create a cooperative threading framework =)
02:52 <thang1> Do you think someone could make a generic library for this sort of thing?
02:53 takle joined
02:53 <thang1> Because it would be great to have easy access to different types of threading, concurrency, and parllelism strategies and the more strategies that are given in nice libraries...
02:53 magiccat joined
02:54 <thang1> Or is your sort of solution too hardwired into how EvanR's game is designed, ertes?
02:54 <magiccat> hi
02:54 <magiccat> i am in a difficult situation
02:54 <magiccat> http://prntscr.com/f7kt3w
02:54 <ertes> thang1: sure… just copy/paste my code =)
02:54 <ertes> thang1: the only feature i would add is wake-up code
02:54 <magiccat> it's looked like this for almost a month and i need help
02:54 Baraius joined
02:54 <ertes> thang1: so you can have event-based thread wake-ups instead of waking everyone up every time
02:54 <MarcelineVQ> magiccat: while I find that hilarious, it's not appropriate here :(
02:55 <MarcelineVQ> @ops
02:55 <lambdabot> Maybe you meant: pl oeis docs
02:55 <MarcelineVQ> lol
02:55 <thang1> What joke is that supposed to be anyway?
02:56 <MarcelineVQ> magiccat: Did you have a question related to the Haskell programming language?
02:56 <Xnuk> @ where ops
02:56 sfcg joined
02:56 <ertes> qwhere ops
02:57 <thang1> (\q -> op q)
02:57 darlan joined
02:57 <EvanR> thang1: the code there, plus "wake up" is not nearly enough for my application. but coroutines is widely applicable to many other programs im sure
02:58 <EvanR> any free monad is really just kind of coroutine
02:58 JeanCarloMachado joined
02:58 juanpaucar joined
02:59 <EvanR> and i may not have made this point completely, something like -cooperative at the linker stage which magically made "yield" in Control.Concurrent do anything, instead of writing a towering IO replacement in pure code would make way more sense
03:00 <EvanR> i mean, link to a cooperative rts instead of the usual one
03:00 <EvanR> not that that makes things any more deterministic
03:01 <EvanR> see javascript
03:01 robkennedy joined
03:01 AlexRussia__ joined
03:02 erikd joined
03:02 robertkennedy joined
03:02 nomeata joined
03:03 Baraius joined
03:03 takle joined
03:03 <magiccat> hi all
03:04 robkennedy joined
03:05 <magiccat> Hi are any of you freenode staff?
03:06 <magiccat> there is this guy lorax that has been making sexual threats toward me
03:07 <glguy> magiccat: No, this is the wrong channel for that
03:08 <magiccat> what is the right channel?
03:08 <glguy> I don't know, but it's not this one
03:08 <pharaun> there should be an ops/support channel of sorts
03:08 <pharaun> maybe check freenode's website
03:08 <pharaun> it outta indicate then you can go there
03:09 <magiccat> ok thank you pharaun thank you very much
03:12 <magiccat> there is a man that is touching me in my naughty places when i go to soccer practice and i don't know what to do. It feels bad but i like it and i am confused, his name is lorax on this server
03:12 was kicked by glguy: offtopic
03:12 <MarcelineVQ> you need to switch the gambit when the play doens't happen
03:14 psmolen joined
03:16 Destol joined
03:19 erikd joined
03:20 ChaiTRex joined
03:20 <Lokathor> how often should one worry about StablePtr vs Ptr?
03:22 conal joined
03:22 xcmw joined
03:23 <glguy> Lokathor: These two solve different problems
03:24 <Lokathor> Foreign.StablePtr says that a normal Ptr can be moved around during garbage collection? What's that about?
03:24 takle joined
03:25 systadmin joined
03:25 <glguy> No, it isn't comparing itself to a normal Ptr
03:25 <glguy> where Ptr is from Foreign.Ptr
03:25 <Lokathor> oh
03:26 <glguy> The point is that garbage collection will move Haskell values around in memory, so it wouldn't be appropriate to ask for the memory location of any particular Haskell value
03:26 <glguy> but perhaps you wanted to pass an opaque reference to a Haskell value out to some C code via the FFI?
03:26 <glguy> You can use a StablePtr to give you something that looks like a C void*
03:27 <glguy> and then assuming you statically know what type the value was later related to one of these StablePtrs, you can dereference it and get the Haskell value again
03:28 <glguy> Ptr is useful for refering to C things from Haskell, StablePtr is useful for refering to Haskell things in from C
03:29 <* hackage> yaml 0.8.22.1 - Support for parsing and rendering YAML documents. https://hackage.haskell.org/package/yaml-0.8.22.1 (MichaelSnoyman)
03:30 juanpaucar joined
03:30 <Lokathor> glguy, hmm. Well at the moment all the pointers i need are to send Haskell data off to C, but then the C code copies it and doesn't keep the pointer
03:30 maint joined
03:30 <glguy> StablePtrs are opaque to C, so they won't help with that
03:31 <Lokathor> yeah the gl library uses Ptr anyway
03:31 <Lokathor> but i was mostly wondering what was up with the Stable variant
03:32 <c_wraith> Ptr is mostly appropriate for marshalling. StablePtr is for passing something to C that will be sent to a Haskell callback.
03:32 <EvanR> here is what i eventually came up with for the "spawn a bunch of asyncs with labels and tell me who crashed later" http://lpaste.net/355495
03:32 ^bschafer1 joined
03:32 <EvanR> since i didnt understand anyones slick traversals
03:32 <ertes> Lokathor: i more interesting question with gl is Ptr vs. storable vectors
03:33 <Lokathor> ertes, well, a storable vector can give you a Ptr to its values
03:33 <Lokathor> at least, one of those many vector types can do that
03:34 justinfokes joined
03:34 <Lokathor> the C "GLM" library doesn't seem to have a Haskell version directly, but i was pointed at the "linear" package, which seems to do similar things
03:35 <EvanR> works...
03:35 <ertes> Lokathor: yes, i'd use 'linear'
03:36 <EvanR> one day ill figure out how/why the sdl audio thread can raise an exception in the main thread, but at least it does
03:36 <MarcelineVQ> consider also `linear`
03:37 <thang1> has anyone mentioned >>linear<< yet?
03:38 <EvanR> `linear` 'linear' ′linear′ 'linear'
03:38 erikd joined
03:38 <c_wraith> > cycle "linear "
03:38 <lambdabot> "linear linear linear linear linear linear linear linear linear linear linea...
03:39 <Lokathor> c_wraith, that doesn't perpetuate the joke though
03:39 <Lokathor> gotta quote it differently each time :P
03:39 <MarcelineVQ> without knowing quite what you're after, consider hmatrix too
03:39 thebardian joined
03:40 <Lokathor> GLM is "openGL Math", it just does matrix and vector stuff, with names somewhat oriented to things you'd want to do in graphics
03:40 <Lokathor> so any of the matrix and vector things should be okay
03:40 Jeanne-Kamikaze joined
03:41 takle joined
03:41 skwushe joined
03:43 mjora7 joined
03:45 <thang1> Yeah. If it's just matrix and vector stuff you can do it all by hand, the names of the functions will just be different
03:46 ChaiTRex joined
03:47 pera joined
03:49 xiinotulp joined
03:50 <Lokathor> go go aggressive inlining and name aliasing!
03:52 LHoT10820 joined
03:52 cschneid_ joined
03:53 otto_s joined
03:54 flatmap13 joined
03:54 takle joined
03:56 <ertes> glm is also conveniently imperative, and makes it makes you pay for actual C function calls
03:57 erikd joined
03:57 darjeeling_ joined
03:59 mivael joined
04:05 thebardian joined
04:05 <wolfsif> question regarding foreign functions and unsafePerformIO:
04:05 <wolfsif> let's say you want to use some foreign function f that relies on external state
04:06 nihal joined
04:07 sgfltx joined
04:07 haroldcarr joined
04:07 <wolfsif> would it be bad practice to write a function that initializes the state, executes the call, and then cleans up the state
04:07 <wolfsif> and then use unsafePerformIO to provide a pure interface
04:08 <geekosaur> it's acceptable if the state will not be needed later
04:08 nihal left
04:08 <geekosaur> it's probaby going to lead to core dumps if you need to preserve that state for the next call (and use of unsafePerformIO will exacerbate the issue)
04:09 <wolfsif> yeah, I'm assuming the state can doesn't need to be kept around
04:10 descender joined
04:11 takle joined
04:11 haroldcarr left
04:14 filterfish joined
04:15 nihal joined
04:19 takle joined
04:19 flatmap13 joined
04:20 ozbot1 joined
04:21 mivael joined
04:23 conal joined
04:24 xcmw joined
04:24 fosterite joined
04:25 <* hackage> cabal-info 0.2.1 - Read information from cabal files https://hackage.haskell.org/package/cabal-info-0.2.1 (barrucadu)
04:25 <barrucadu> Ooh, hackagebot is back
04:26 <EvanR> different moniker though
04:27 darjeeling_ joined
04:28 takuan joined
04:28 cschneid_ joined
04:29 sav joined
04:34 juanpaucar joined
04:35 obadz joined
04:36 cschneid_ joined
04:38 Taslem joined
04:39 takle joined
04:39 cschneid_ joined
04:41 justinfokes joined
04:41 <* hackage> hookup 0.1.1.0 - Abstraction over creating network connections with SOCKS5 and TLS https://hackage.haskell.org/package/hookup-0.1.1.0 (EricMertens)
04:42 FreeBirdLjj joined
04:43 nihal left
04:44 <* hackage> irc-core 2.2.1 - IRC core library for glirc https://hackage.haskell.org/package/irc-core-2.2.1 (EricMertens)
04:46 takle joined
04:51 halogenandtoast joined
04:52 govg joined
04:54 treaki joined
04:56 justinfokes joined
04:56 roconnor joined
04:57 sfcg joined
04:58 <Lokathor> i wish vs code's haskell highlight plugin was smart enough to read quasiquote sections and then apply the correct highlighting for the quasiquoted bit
05:00 <Lokathor> wolfsif, you will probably be safe with the unsafePerformIO there, but you probably want to warn people in the docs what's going on
05:00 augur joined
05:00 itihas joined
05:00 <Lokathor> for example, if it's not actually safe to run two similar computations in parallel becaue the foreign side of things somehow clashes if you're running another copy at the same time
05:01 <monochrom> Yeah, it will be unsafe for threads.
05:02 <monochrom> But nothing you can do. It is unsafe for threads even in C or assembly.
05:04 <geekosaur> actually, in the kind of situation where the extra storage area isn't providing persistent state, it is very likely providing local thread state
05:04 halogenandtoast joined
05:04 <geekosaur> (in place of internal static variables like pre-threads C code used to use so much)
05:05 takle joined
05:05 <geekosaur> which should mean it's fine here
05:06 <monochrom> Thread-local state is actually worse because that "thread" means OS thread and how Haskell thread /= OS thread.
05:06 <thang1> whoever safe is, they're gonna get so many pings lol
05:06 <geekosaur> no, this is not TLS
05:06 <geekosaur> this relates to TLS about the same way ST relates to state
05:07 <geekosaur> er, to State
05:07 <geekosaur> you are not relying on OS thread magical storage areas, you are explicitly providing a storage area and managing it yourself in true C fashion
05:08 <ongy> well, https://aur.archlinux.org/packages/cabal-install-git/ totally didn't take way to long to set up...
05:08 <monochrom> OK, that would be a happy ending indeeed.
05:08 <geekosaur> if that's not clear, go compare a libc function without _r to on with
05:08 <geekosaur> *one with
05:09 <geekosaur> e.g. ctime to ctime_r
05:10 flatmap13 joined
05:10 slack1256 joined
05:10 {emptyset} joined
05:10 obadz joined
05:12 takle joined
05:13 meba joined
05:14 cpup joined
05:14 <thang1> ongy: what's that for?
05:15 <ongy> thang1: allows you to easily install cabal-install from current git HEAD on archlinux
05:16 <thang1> nice
05:16 <cocreature> by messing with your globally installed packages :/
05:16 <ongy> cocreature: nope :)
05:16 <thang1> I use stack right now but if I ever want to fuck with cabal manually ever again, I'll give it a shot :p
05:16 <cocreature> ongy: oh? do you just include the final binaries?
05:17 <ongy> no, I set it up in a sandbox and use a local config file + package cache. Even the cabal update doesn't touch anything (I ran it as nobody in my test-chroot)
05:19 <cocreature> I’ll stick wtih just building from the git repo myself :)
05:19 sav left
05:20 dm3 joined
05:21 <ongy> *shrug* this works, I made this primarily for myself, but I like the idea to do things "right" and give others access
05:22 takle joined
05:23 erikd joined
05:27 takle joined
05:27 eklavya joined
05:28 meandi_2 joined
05:30 codygman joined
05:30 systemfault joined
05:31 <codygman> Using lens-aeson I can easily update existing keys, but I can't figure out any way to do an "upsert" type operation. Would that break some lens law by any chance?
05:32 <cocreature> codygman: what’s an upsert operation?
05:32 jrahmy_ joined
05:32 <codygman> update if key exists otherwise insert and set
05:32 <codygman> value
05:41 <cocreature> > "{}" & _Object . at "key" %~ (\c -> case c of Nothing -> Just "newval"; Just existing -> Just (existing & _String %~ (<> "modified")))
05:41 <lambdabot> error:
05:41 <lambdabot> • Found hole:
05:41 <lambdabot> _Object :: (m0 -> Identity m0) -> [Char] -> Identity b
05:41 <cocreature> @let import Data.Aeson.Lens
05:41 <lambdabot> .L.hs:66:1: error:
05:41 <lambdabot> Failed to load interface for ‘Data.Aeson.Lens’
05:41 <lambdabot> Perhaps you meant
05:41 <cocreature> well lambdabot doesn’t like me
05:41 <cocreature> codygman: anyway I think that does what you want
05:41 Jeanne-Kamikaze joined
05:42 <glguy> over (key "thekey") (maybe defaultVal updateFun)
05:42 <cocreature> eh yeah that’s a lot better :)
05:42 <glguy> over (key "thekey") (Just . maybe defaultVal updateFun) -- to always set
05:42 <cocreature> I’m not sure why lens-aeson doesn’t include an At instance for Value. seems just as reasonable as the Ixed instance
05:43 <codygman> cocreature, glguy: Okay, thanks I'll try them.
05:43 <cocreature> ah no it isn’t
05:43 <cocreature> you can’t set if it’s not an object
05:43 alx741 joined
05:46 takle joined
05:46 Hunter1_ joined
05:50 teggi joined
05:51 flatmap13 joined
05:54 conal joined
05:57 Cale joined
05:59 atavistic joined
06:00 <atavistic> Hi, I have data Channel = Email | Message | Push
06:00 <atavistic> trying to write a FromJSON instance for this
06:01 <atavistic> my failed attempt:
06:01 <atavistic> instance FromJSON Channel where
06:01 <atavistic> parseJSON (String v) = case v of
06:01 <atavistic> "email" -> Email
06:01 <atavistic> "message" -> Message
06:01 <atavistic> "push" -> Push
06:03 osa1 joined
06:04 <atavistic> How do I wrap the return type into Parser a type
06:04 heurist joined
06:04 AlexRussia joined
06:05 shutdown_-h_now joined
06:06 <Xnuk> :t return
06:06 <lambdabot> Monad m => a -> m a
06:06 <Xnuk> use this
06:06 torgdor joined
06:07 <Xnuk> parseJSON (String v) = return $ case v of ...
06:07 takle joined
06:08 <glguy> yes, except that you'll want to not use return in the case that it's none of the three listed above
06:12 filterfish joined
06:13 tefter joined
06:15 vlatkoB joined
06:19 <orion> Does anyone know if there is a better workaround for the ApplicativeDo problem?
06:20 <orion> Specifically, I can't silently ignore the result of functions which return (). I must write "_ <- foo"
06:20 <orion> Otherwise, GHC thinks it's a Monad (instead of an Applicative)
06:21 takle joined
06:22 <mniip> you mean it uses >> instead of *>
06:23 <Cale> Don't... don't use ApplicativeDo?
06:23 <Cale> :)
06:24 <orion> Yes.
06:24 <EvanR> that does seem kind of wonky
06:25 <atavistic> Thanks Xnuk
06:25 <Cale> I don't care much for that extension anyway, since it's too hard to guess what the translation will be in a consistent fashion.
06:25 <orion> I see.
06:26 CurryWurst joined
06:28 takle joined
06:28 sproingie joined
06:29 <glguy> the extension is so limited in what it accepts that I haven't found it tricky to make sense of
06:30 <glguy> too limited regarding the _ <- requirement, but still limited
06:31 <glguy> and too convenient to dismiss outright
06:33 jer1 joined
06:33 <glguy> recent example https://github.com/glguy/irc-core/blob/v2/src/Client/Configuration.hs#L241-L278
06:34 wei2912 joined
06:35 juanpaucar joined
06:36 flatmap13 joined
06:37 erikd joined
06:38 connrs joined
06:39 Hunter1_ joined
06:40 saurabhnanda joined
06:40 iomonad joined
06:45 <ongy> but why did it become 'do' aswell and not something like 'doA' ?
06:45 takle joined
06:47 <cocreature> ongy: because that allows you to mix applicative and monadic operations and hopefully end up with something that makes as much use of the applicative operations as possible
06:47 CurryWurst joined
06:52 sternmull joined
06:53 takle joined
06:55 <EvanR> heh
06:55 <EvanR> fetchAddIntArray# = let x = x in x
06:55 <EvanR> fake source code for ghc prim ops
06:56 halogenandtoast joined
06:56 <cocreature> EvanR: let’s hope this is not the real source code :P
06:56 erikd joined
06:56 <EvanR> does this operation work properly on rpi ?
06:56 <EvanR> is the question whose answer i was looking for
06:58 sfcg joined
06:59 <ongy> looking up primops can be depressing
07:01 <EvanR> while im in here
07:01 <EvanR> in this kind of type signature
07:01 <EvanR> readArray# :: MutableArray# s a -> Int# -> State# s -> (# State# s,a #)
07:01 afarmer joined
07:02 <EvanR> is this supposed to be like the innards of an IO action or something
07:02 <EvanR> what is s ther
07:02 dm3 joined
07:04 <EvanR> the real world thing? or something like the ST thing
07:05 takle joined
07:07 <jle`> it's similar to the ST s thing
07:08 <EvanR> makeStableName# :: a -> State# (RealWorld) -> (# State# (RealWorld),StableName# a #)
07:08 <EvanR> here s=RealWorld
07:08 <EvanR> whats the difference
07:09 caumeslasal joined
07:10 <EvanR> "RealWorld is deeply magical"
07:13 takle joined
07:13 ^bschafer1 joined
07:13 soniku joined
07:14 raichoo joined
07:15 <nshepperd> readArray# can be used in an ST action
07:15 <nshepperd> makeStableName# can only be used in IO
07:16 <nshepperd> setting s=RealWorld sort of indicates that there are uncontainable side effects, i suppose
07:16 plll joined
07:17 nickolay_ joined
07:17 <EvanR> does s=anything in particular when you use ST
07:17 <Cale> no
07:18 <EvanR> gnarly
07:18 <nshepperd> runST :: (forall s. ST s a) -> a
07:18 <nshepperd> it's always forall'd
07:19 <EvanR> makes sense...
07:19 JoshS joined
07:20 augur joined
07:20 mohsen_ joined
07:20 oish joined
07:20 vlatkoB joined
07:21 takle joined
07:21 saurabhnanda joined
07:21 Baraius joined
07:21 marr joined
07:23 Vq joined
07:24 elvishjerricco joined
07:24 LuckyRawApe_ joined
07:24 elvishjerricco left
07:24 elvishjerricco joined
07:27 jutaro joined
07:29 Baraius joined
07:29 robotroll joined
07:30 darjeeling_ joined
07:31 <mniip> 1494745805 [10:10:05] <EvanR> "RealWorld is deeply magical"
07:31 <mniip> but not unlifted!
07:32 gehmehgeh joined
07:32 <EvanR> its primitive but not unlifted
07:32 insitu joined
07:32 <EvanR> cargo culted to all hell
07:32 <Lokathor> is that part of the magic?
07:32 <Lokathor> i think it's part of the magic
07:33 <EvanR> loll
07:33 <nshepperd_> RealWorld is not really that magical, is it
07:33 <nshepperd_> It's just something to put in a phantom type variable
07:33 <EvanR> watch what you write in comments it might be a religion in 3011
07:34 insitu joined
07:36 <EvanR> Question: Why @RealWorld@ - won't any instance of @_ST@ do the job? [ADR]
07:36 <EvanR> regarding makeStablePtr#
07:37 erikd joined
07:37 <Lokathor> if you didn't make it with RealWorld, it wouldn't be valid in the real world
07:37 cschneid_ joined
07:37 igniting joined
07:37 bjz joined
07:37 <Lokathor> powers granted to oneself in a phased dimension can only last within that dimension; basic superhero comic rules apply here
07:39 takle joined
07:39 <EvanR> the reasons for making makeStablePtr an IO action or ST action at all seem kind of accidental
07:39 juanpaucar joined
07:40 <Lokathor> how do you mean
07:41 <nshepperd_> I dunno, presumably there are reasons to not want any old pure code to be able to make StableNames of your values, in a way that might depend on evaluation order
07:42 <edwardk> he issue with being able to construct stablenames in pure code is that you can then detect sharing that is fabricated by compiler optimizations
07:42 <edwardk> its like lambdas in scheme being declared to always allocate a 'fresh' location so you can compare them as objects
07:43 <edwardk> it actively gets in the way of optimization if you decide to be faithful to those semantics
07:43 filterfish joined
07:43 <EvanR> you still weirdly detect things with the IO version, the stable name would have been one thing, but then you `evaluate` it and its now something else
07:44 coot____ joined
07:44 <EvanR> so it feels like IO
07:44 <dmwit> But it's in IO. ST is supposed to promise "same inputs -> same outputs". IO doesn't promise that at all.
07:44 <edwardk> you can often reason case by case through whether or not your application is sound in the presence of such extra sharing, and unsafePerformIO or unsafeInterleaveIO or whatever your way to glory
07:45 <dmwit> Wait, why are you complaining? You say it feels like IO, and its type is an IO-y one (not an ST-y one). So what's the problem?
07:45 <edwardk> but its placement in IO allows for it giving different answers under different optimization levels, etc. it acts as a universal sin-bin you have to explicitly ask to get out of
07:45 <Lokathor> "a universal sin-bin"
07:45 <EvanR> considering your program with extra sharing, interesting
07:46 <edwardk> EvanR: e.g. i use stablename based sharing for one of the reverse mode implementations in the 'ad' package. that package just gets more efficient with extra sharing, so i'm okay with it
07:46 <edwardk> same with the ersatz library, it just gets smaller formulas to send to the SAT solver
07:46 zariuq joined
07:47 <edwardk> but i had to reason about those two cases meticulously by hand
07:47 xinming joined
07:47 cryo28 joined
07:47 <edwardk> amusingly for 'ad' i initially said it wasn't possible
07:47 <edwardk> http://stackoverflow.com/a/2745560/34707
07:48 <edwardk> before shipping a library and replying a second time
07:48 danvet_ joined
07:48 <edwardk> http://stackoverflow.com/a/2842605/34707
07:48 <Lokathor> edwardk, you said in a lighting talk that you wrote gl to impress non-haskell people. Well I told the part where it auto-generates almost all of the code to a non-haskell friend, and he /was/ impressed with it.
07:49 <edwardk> =)
07:49 elvishjerricco left
07:49 psmolen joined
07:49 <LiaoTao> Excuse me, but what 'gl'?
07:49 <edwardk> its just a few modules worth of code that in aggregate produce all the docs, etc. pretty pleased with it
07:49 <edwardk> http://hackage.haskell.org/package/gl
07:49 <LiaoTao> edwardk: Thanks
07:50 saurabhnanda joined
07:50 <EvanR> i am amazed that gl and sdl2 "just work"
07:50 <Lokathor> Now i'm muddling my way through learning opengl using a c++ tutorial, and writing up the haskell version as i go as a guide to others
07:50 <edwardk> its like 4-5 modules worth of code that parse the xml specification for opengl and fetch documentation, etc.
07:50 <EvanR> unlike in C
07:50 <edwardk> EvanR: =)
07:50 <Lokathor> EvanR, sdl2 doesn't "just work" on windows :P
07:50 <EvanR> gah...
07:50 <EvanR> i am amazed they just work on OSX
07:51 <edwardk> heh
07:51 <Lokathor> gl does just work on windows though!
07:51 <edwardk> anyways OpenGLRaw borrowed back the innovations from the gl package for the most part
07:51 augur joined
07:51 <edwardk> so it is usable, even if the OpenGL package is a dumpster fire
07:52 <EvanR> right what is up with that
07:52 <EvanR> now we have two GL packages...
07:52 <EvanR> how do you throw away a dumpster
07:52 <edwardk> EvanR: Sven wants me to retire 'gl' in favor of his OpenGLRaw package. I'm not willing to give up some of the things I need that only 'gl' offers and he has moral objections to adding them to OpenGLRaw
07:53 <Lokathor> EvanR, with a bigger dumpster of course
07:53 <edwardk> but OpenGL itself is the dumpster fire. OpenGLRaw is fine
07:53 <LiaoTao> edwardk: What things?
07:53 <Lokathor> edwardk, what are the things from 'gl' that aren't wanted in 'OpenGLRaw'?
07:53 <EvanR> ok, so we have at least 3
07:54 fizruk joined
07:55 <nshepperd_> Hm, i should look at this stablename stuff in ad later. I've been using some explicit monadic stuff for reverse mode ad in neural networks, but it's pretty messy
07:55 <edwardk> there was an issue filed on one of the two projects on github that summarized why gl should die from Sven's point of view.
07:56 erikd joined
07:56 <edwardk> it looks like he did compromise and add the top level 'dangerous' booleans for each extension
07:56 <edwardk> oh i seem to recall
07:57 <edwardk> his pattern synonyms are monomorphic, which gets in the way of using them the way they are used in the actual opengl API
07:57 <Lokathor> I know there's a wiki page on the OpenGLRaw pakage's github where there's a summary of how OpenGLRaw and gl can eventually merge, but every divergence brought up is resolved with "we're doing it OpenGLRaw's way"
07:57 <Lokathor> which strikes... not of compromise
07:57 <edwardk> yeah
07:57 <edwardk> that page is what i mean
07:57 <edwardk> his 'solution" was kind of a slap in the face
07:58 <edwardk> so I've just decided to ignore it
07:58 <edwardk> OpenGLRaw may well win the war of maintenance
07:58 <edwardk> but after that I just don't care
07:58 <edwardk> i didn't write gl to merge. i wrote it so that i could write non-trivial opengl code that used OpenGL newer than 3.3. It let me write quine and a few other projects
07:59 <Lokathor> the slap in the face is the winky eomji at the end
08:00 <nshepperd_> Huh, top level booleans? I thought presence of such things would be relative to particular context, like a device
08:00 <edwardk> anyhow, it doesn't really matter if they coexist, as you can write code using both without issues
08:00 <edwardk> nshepperd_: gabriel's version had an explicit opengl context you had to pass around to all calls
08:00 <edwardk> this would be "cleaner" semantically
08:00 <edwardk> but it carries its own problems
08:01 _main_ joined
08:01 takle joined
08:01 <edwardk> the version in 'gl' can memoize that stuff
08:01 fnurglewitz joined
08:01 <edwardk> which matters a great deal if you're branching off it all over your code in something like
08:01 <edwardk> foo | gl_ARB_whatever = ...
08:01 <edwardk> that eventually just "becomes" the fast path after evaluation
08:02 _main_ joined
08:02 <edwardk> but you also get permanent overhead in each of the calls that use the ffi wrapper
08:02 <Lokathor> https://lokathor.gitbooks.io/using-haskell/content/opengl/hello-triangle.html#code-so-far it draws one whole triangle, and just begs to be rewritten with alloca, Either, and ExceptT :P
08:02 <edwardk> gl makes no apologies for the assumption that there is one opengl context for the entire program
08:02 <nshepperd_> I see
08:03 jaziz joined
08:03 <edwardk> there are also 'io' based boolean versions of all the combinators, but 'gl' is kinda screwed if you use it in multiple OpenGL contexts during the run of an application
08:03 <edwardk> as it "links" as you call
08:04 <Lokathor> more than one context? or more than one context version?
08:04 _main_ joined
08:04 <Lokathor> like could you have two windows with the same ogl context version that each had their own context?
08:04 <nshepperd_> Well, that makes sense i guess
08:04 <edwardk> https://github.com/polarina/opengl-wrangler/tree/master/Graphics has theoretical support for multiple contexts
08:05 jrahmy_ joined
08:05 <edwardk> Lokathor: depends on if the opengl version you have gives back different addresses for each context or not. nvidia plays nice
08:05 <edwardk> but it'd be perfectly within its rights to screw over the gl package
08:05 <Lokathor> oh no!
08:05 <edwardk> nvidia, amd, etc. all work
08:06 <edwardk> but if you bind one Intel context and one Nvidia one?
08:06 <edwardk> who knows
08:07 <edwardk> Lokathor: like i said, i wrote the parts i contributed to the library for me, trying to make it at least not suck _worse_ than writing c/c++ to talk to OpenGL
08:07 <edwardk> that motivates the MonadIO constraints, etc.
08:07 <Lokathor> i do like me some MonadIO
08:07 <edwardk> because without them it as just a pile of liftIO noise whenever you wrote anything non-trivial
08:08 <edwardk> which made comparison shopping haskell vs c/c++ for graphics code put us in a very bad light
08:08 <edwardk> its still not great
08:08 <Lokathor> that bad?
08:09 <edwardk> i've been debating about writing a completely pure immediate mode gui to help out with some stuff, that way you can just work with (MonadState s m, HasGui s) => ... code and spew out immediate mode button drawing/interface checks with a couple of hooks per frame
08:09 <Lokathor> Rust has that, actually
08:09 <edwardk> they have a binding to imgui
08:10 path[l] joined
08:10 <edwardk> i want a proper pure one
08:10 <Lokathor> do you mean conrod? or a different thing?
08:10 <edwardk> oh maybe they have another
08:10 mjora7 joined
08:10 <bjz> You are both right :P
08:10 <edwardk> yeah that looks kinda like what i'm getting after
08:10 takle joined
08:10 <Lokathor> conrod is 2d GUI (that looks pretty bad) built on top of piston, which is a rust graphics/game engine sort of project
08:11 <bjz> Conrod is pure Rust
08:11 <bjz> imgui is on top of a C++ lib
08:11 <edwardk> i'm looking for something more in the tradition of dear imgui/nuklear
08:11 <bjz> <3 imgui
08:11 <edwardk> nuklear at least lets you specify the 'context' you are working against.
08:11 <edwardk> which matters to me for vr
08:11 <edwardk> because my desktop refreshes at a different rate than the vr dashboard panels i need to update in 3d
08:12 <Lokathor> Once I know enough I wanna make a tile sprite library thing, so i can make a glyph grid with it, so i can emulate a terminal sort of interface
08:12 <Lokathor> built on top of just gl, if possible. the moment you touch FFI your chances of working easily on Window go out the window
08:12 <edwardk> so i want to be able to put something on the desktop and to put widgets in 3d for virtually grabbing and manipulating next to an object, and have separate mouse events, etc.
08:12 <Lokathor> Windows*
08:12 <dmwit> The lengths we go to to emulate 80's-era hardware...
08:12 <edwardk> dmwit: =)
08:13 <Lokathor> an AR overlay over a display that's already digital?
08:13 <edwardk> anyways the fact that dear imgui has one global context gets in the way of my using it for a lot of vr stuff nicely
08:14 <edwardk> and if i go it from scratch i can play around with true 3d widgets for vr use, signed distance fields for things like grabbers, etc.
08:14 <EvanR> im not emulating crap with this CRT television
08:14 <EvanR> with actual 240p video adapter
08:14 <EvanR> the spirit of the 80s is still alive
08:15 <edwardk> dmwit: you know how annoying it is to use a c64 emulator and play a game that is trying to alternate colors to get nice blending? )
08:15 <edwardk> i used to do that in a bunch of little shareware games i sold back as a kid
08:15 <Lokathor> dmwit, 1000 cores on the GPU, all of them powering nethack
08:16 <edwardk> had my little bard's tale engine that would alternate colors every frame so i could draw some (to my 13 year old eye) bad ass skeletons and stuff. =)
08:16 <ongy> my modern hardware goes great lengths to act like there's still a terminal :) and if they weren't so expensive I'd buy 1 or 2 actual terminals
08:16 <edwardk> Lokathor: there is alacritty, but darn it i want to go the next step one compute shader to do the actual text processing too, so you feed the raw input stream to the gpu and just tell it to draw after you finish
08:17 <edwardk> ongy: i have some old vt220s and what not in my mom's attic somewhere
08:17 <EvanR> who needs the cpu
08:17 <ongy> edwardk: and do syntax highlighting on the gpu? Or what would you offload?
08:17 <edwardk> they aren't all they are cracked up to be =)
08:18 <Lokathor> edwardk, i heard about alacritty, but its critical flaw is that it's not in Haskell of course :P
08:18 <EvanR> i cant seem to find the implementation of primops in the ghc source code
08:18 <Lokathor> also i'm not sure how to use it to let me build games on windows yet, so :?
08:18 <edwardk> ongy: the cursor position tracking, parsing of the escape code sequences, the whole screen emulation for the terminal so that rendering the screen becomes one compute shader pass to parse the text into changes in state, and a single draw call for a triangle that encompasses the window you want to draw
08:18 dm3 joined
08:19 <edwardk> EvanR: i do, for all this spmd-on-simd stuff i'm doing to emulate a shader style of computation on the cpu of course!
08:19 <dmwit> edwardk: Yep, I remember having trouble developing for the TI-89 with an emulator for the same reason. Four colors of gray were a luxury reserved for people with actual hardware.
08:19 <EvanR> edwardk: nice. where
08:20 <ongy> edwardk: oh so you want the terminal emulator in there, that would be cool. I was thinking vim on GPU, which would be a bit weird
08:20 <edwardk> github.com/ekmett/rts the /spmd repo had some code as well
08:20 MolluskEmpire joined
08:20 <edwardk> ongy: there is a shadertoy
08:21 <EvanR> ah rts
08:21 <edwardk> https://www.shadertoy.com/view/XsXcDN
08:21 acidjnk22 joined
08:22 <edwardk> EvanR: vec<int,avx2_8> or vec<T*,avx_4> etc. act as 8 wide or 4 wide vector types, varying<int,avx2_8> acts as one that uses a current mask for loads/stores
08:22 <edwardk> soa<int,20000,avx2_8> gives you a 'array of structures of arrays' computation model with template expressions to fuse together nice loops
08:23 <edwardk> next step is more primitive trig functions, exp, gamma, etc.
08:23 <edwardk> until i can run the kind of bayesian modeling stuff i like
08:23 <edwardk> the varying<> template acts like the shader varying keyword
08:24 <EvanR> ok
08:24 <EvanR> but where is e.g. makeStableName#
08:24 <edwardk> with auto in place, an if_( ) template that uses a varying<bool> argument, etc. it goes a long way
08:24 <edwardk> its a long way from a haskell rts =)
08:25 <edwardk> right now its a start for a runtime system for some graphics stuff that may eventually morph into a haskell compiler rts as it gathers more code from other related repositories i have lying around
08:25 <EvanR> right
08:25 <EvanR> haskel as in... what ghc has become? or standard haskell? or something else
08:25 <edwardk> i need to get my cheap fiber code integrated so i can regain coherence when branching loses it, my code for an asio thread, all the epoch stuff so this doesn't leak
08:25 <EvanR> "common haskell"
08:25 oish joined
08:26 <edwardk> whatever subset of haskell i need when i get around to it? =)
08:26 <edwardk> likely something closer to ermine's current subset
08:26 <EvanR> ah
08:26 <edwardk> haskell + polykinds, etc. the stuff that makes implementing haskell easier
08:26 <edwardk> not harder
08:26 mmn80 joined
08:26 Kreest__ joined
08:27 <edwardk> the #thc channel current gets the build bot spam for rts
08:27 kritzcreek joined
08:27 <edwardk> er currently
08:27 <edwardk> mostly because it was drowning #haskell-lens
08:27 <EvanR> what is that channel
08:27 <EvanR> 420
08:27 <edwardk> #thc is my toy "turbo" haskell compiler
08:28 <EvanR> ah
08:28 <edwardk> not much of anything right now
08:28 <EvanR> turbo haskell, common haskell, visual haskell#
08:28 <c_wraith> When's Haskell++ ?
08:29 <EvanR> (haskell++)
08:29 takle joined
08:29 <EvanR> fix (haskell++)
08:29 <edwardk> c_wraith: haskell' <- we like our math notation around here
08:29 <c_wraith> is it broken?
08:30 <edwardk> > fix ("haskell"++)
08:30 <c_wraith> I wasn't referring to math though.. I was referring to the wonderful abomination of Microsoft J++
08:30 <lambdabot> "haskellhaskellhaskellhaskellhaskellhaskellhaskellhaskellhaskellhaskellhaske...
08:30 <EvanR> the first derivative of haskell
08:30 <edwardk> ^- looks broken to me
08:30 <edwardk> c_wraith: =)
08:30 <Cale> Haskmaster 4000 Turbo
08:31 <edwardk> hey man, i just want a modern version of technojock's toolkit. i was a god with that back in the day
08:33 rockfordal joined
08:34 lep-delete joined
08:35 castlelore joined
08:38 a5729e5bdc4fcb99 joined
08:38 <EvanR> found it...
08:38 <EvanR> for x86 at least
08:38 sproingie joined
08:40 bjz joined
08:46 <ongy> let me guess, compiler intrinsics?
08:48 sproingie joined
08:48 erikd joined
08:50 takle joined
08:50 <* hackage> staversion 0.2.0.0 - What version is the package X in stackage lts-Y.ZZ? https://hackage.haskell.org/package/staversion-0.2.0.0 (debugito)
08:52 filterfish joined
08:53 Bassetts joined
08:54 iomonad joined
08:54 MolluskEmpire joined
08:56 paolino joined
08:57 dm3 joined
08:57 <ReinH> Objective Haskell?
08:57 biglama joined
08:58 juanpaucar joined
08:58 ragepandemic joined
08:59 sfcg joined
09:00 <akr[m]> Hello, can someone help me with Conduit? How can I have my application yield data to a Consumer without having to live in the Producer monad? Intuitively, I'd like to have some sort of a channel which I can write into and which then serves as the Producer
09:00 <geekosaur> visualage haskell >.>
09:01 bonz060 joined
09:02 <bonz060> Hi guys
09:02 dm3 joined
09:03 <c_wraith> akr[m]: why do you want to work that way?
09:03 <bonz060> Just starting out with haskell. What's the best book/ resources you have used to learn haskell?
09:04 <c_wraith> bonz060: https://github.com/bitemyapp/learnhaskell outlines a bunch of resources
09:05 commanderinchief joined
09:05 takle joined
09:05 <Gurkenglas> akr[m], is this for letting different threads interact? https://hackage.haskell.org/package/stm-conduit-3.0.0/docs/Data-Conduit-TMChan.html
09:05 <akr[m]> c_wraith: I'm writing a CLI client application with Brick which communicates with the server through JSON over TCP. I thought I could run this through conduits, using stuff from conduit-extra (Attoparsec using JSON parser from Aeson, and the Network conduit)
09:06 <bonz060> c_wraith: Thanks a bunch!
09:07 erikd joined
09:07 <Gurkenglas> akr[m], or even https://hackage.haskell.org/package/stm-conduit-3.0.0/docs/Data-Conduit-Async.html which creates the threads for you
09:07 phyrex1an joined
09:07 <akr[m]> Gurkenglas: okay, but I still don't see how to make it so that my entire application doesn't have to live in the Source / Producer monad
09:08 [[ExTRa]] joined
09:09 <c_wraith> akr[m]: if you use https://hackage.haskell.org/package/stm-conduit-3.0.0/docs/Data-Conduit-TMChan.html you can send things to the TMChan from anywhere in IO.
09:09 <c_wraith> akr[m]: and then a producer reads from it and sends it down the pipeline
09:11 <c_wraith> that looks like it was built against a really old version of conduit, though..
09:11 <akr[m]> I don't see what's the "API" to push stuff into the channel
09:11 <* hackage> hdaemonize 0.5.3 - Library to handle the details of writing daemons for UNIX https://hackage.haskell.org/package/hdaemonize-0.5.3 (sickmind)
09:12 <c_wraith> akr[m]: it's just a TMChan or TBMChan
09:12 <akr[m]> ah I see
09:12 <akr[m]> well, it looks like it should build with the latest conduit
09:12 <c_wraith> it does look like it should.
09:13 soniku joined
09:14 Xanather joined
09:14 fnurglewitz joined
09:14 <akr[m]> yay, it compiledd :)
09:15 <akr[m]> thank you everyone, hopefully I'll be able to connect it all together now
09:16 <EvanR> hmm ghc makes a lot of use of not String, not Text, no not ByteStrings... but two other kinds of strings: FastString and LitStr (which is basically a pointer to a C String). intrestring!
09:16 laplacian joined
09:17 thc202 joined
09:17 <torstein> does anyone know if there's hoogle integration available for (space)emacs?
09:17 knokch joined
09:24 takle joined
09:26 <EvanR> and FastStrings are built from string literals using... a primitive
09:28 sighingnow joined
09:30 Icewing joined
09:30 dm3 joined
09:31 takle joined
09:32 raichoo joined
09:32 debian0501 joined
09:34 systadmin joined
09:34 catsup joined
09:34 razi1 joined
09:35 FreeBirdLjj joined
09:35 catsup joined
09:39 sproingie joined
09:39 sproingie joined
09:39 takle joined
09:40 hvr joined
09:40 hvr joined
09:41 <Gurkenglas> akr[m], just tinkering here but since Producer b is just Proxy Void () () b, you could, according to https://hackage.haskell.org/package/pipes-4.3.3/docs/src/Pipes-Internal.html#Proxy , have the topmost provider of the consumer return values of what looks like "Respond b (Producer b) | M (m (Producer b)) | Pure r"
09:41 sepp2k joined
09:41 im0nde joined
09:42 <Gurkenglas> Which looks like ListT done right... *looks around* ah there https://hackage.haskell.org/package/pipes-4.3.3/docs/Pipes.html#v:every
09:43 <akr[m]> so the downstream from the server needs to be forwarded to a channel provided by the Brick interface
09:43 <Gurkenglas> Perhaps some library provides downstreams from a server as conduits?
09:43 epsilonhalbe joined
09:44 <akr[m]> well yeah, conduit-extra provides TCP conduits
09:44 <akr[m]> nice examples here: http://www.yesodweb.com/blog/2014/03/network-conduit-async
09:44 <Gurkenglas> *"the topmost provider of the producer" gah
09:46 sepp2k joined
09:46 takle joined
09:47 meoblast001 joined
09:49 erikd joined
09:50 <Gurkenglas> akr[m], why would your whole application have to live in Producer? Are you missing "lift :: m r -> Producer b m r" from MonadTrans?
09:51 zariuq joined
09:51 cloudhead joined
09:52 nullifidian_ joined
09:53 rcat joined
09:53 <akr[m]> uh I'm not sure
09:54 <akr[m]> I need to be able to communicate back to the server from this callback function in Brick: https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst#apphandleevent-handling-events
09:55 atavistic joined
09:59 netheranthem joined
09:59 gmcabrita joined
10:00 sfcg joined
10:01 Kreest_ joined
10:02 juanpaucar joined
10:02 takle joined
10:04 LHoT10820 joined
10:05 dm3 joined
10:07 CoolerZ joined
10:07 <CoolerZ> anyone use haskell-mode on emacs?
10:08 yellowj joined
10:10 <hvr> CoolerZ: try #haskell-emacs :-)
10:10 coot____ joined
10:11 <paolino> join #haskell-cabal
10:12 <CoolerZ> how do you enable auto-complete?
10:12 saurabhnanda joined
10:13 dfordivam joined
10:13 AlexRussia__ joined
10:13 halogenandtoast joined
10:13 smwangi joined
10:14 jer1 joined
10:16 aarvar joined
10:16 Yuras joined
10:17 serses joined
10:17 fotonzade joined
10:24 anuxivm joined
10:24 epsilonhalbe left
10:25 Raptor8m3 joined
10:26 <ertes> CoolerZ: if you use haskell-interactive-mode (and you probably will, because it's awesome), you will get GHCi-aided auto-completion automatically
10:26 <CoolerZ> ertes, i tried that it does something weird, all the text becomes read only and the syntax highlighting turns off
10:27 <CoolerZ> and a new line popsup at the bottom with lambda >
10:27 <ertes> CoolerZ: that's a different buffer, your interaction buffer
10:28 <ertes> CoolerZ: it should pop up in a new (emacs) window by default
10:28 <CoolerZ> no its in the same buffer
10:28 <ertes> are you sure? pay attention to the buffer name
10:28 <cocreature> you shouldn’t just enable haskell-interactive-mode. you should start the repl and then haskell-interactive-mode will be enabled in there
10:28 <ertes> oh, yeah
10:29 <ertes> don't enable the mode
10:29 <ertes> load your file (C-c C-l)
10:30 <CoolerZ> C-c C-l is electric C mode?
10:30 <systadmin> Emacs?
10:30 kqr joined
10:30 <ertes> CoolerZ: if you type that in a haskell buffer, it will load your file into GHCi
10:31 <ertes> "C-" is emacs' notation for "ctrl+"
10:31 <ertes> so type ctrl+c, then ctrl+l
10:32 <kqr> is it possible to define a function that has a type similar to "f :: Maybe a" and then for some specific types a it will return (Just Specific) and for all others Nothing?
10:32 <cocreature> you might need to enable interactive-haskell-mode (those names are terrible) for this to work. I don’t recall if that’s the default by now
10:32 <kqr> so essentially something that dispatches on return type
10:32 <kqr> i guess this touches on typeclasses?
10:32 <kqr> but i'm not confident
10:32 <Rembane> kqr: If you put the return type in a sum type first it is easy
10:32 silver joined
10:32 <ertes> kqr: not with that type
10:32 <kqr> Rembane, if I want to avoid that, though? heh
10:33 <cocreature> kqr: a) Maybe a is not a function b) you can make a typeclass and then make instances but if you only want it to behave differently for some types you need OverlappingInstances and it becomes slightly messy
10:33 <ertes> kqr: f :: (Typeabiel a) => Maybe a
10:33 <Rembane> kqr: I have no idea. :D
10:33 <kqr> ertes, looking at typable but not sure how to use it
10:33 <kqr> at least not for this purpose
10:33 takle joined
10:33 <ertes> kqr: you can use typeOf, and then compare
10:33 <ertes> > typeOf (Just 15 :: Maybe Int)
10:33 <lambdabot> Maybe Int
10:34 conal joined
10:34 <ertes> > typeOf (Just 15 :: Int) == typeOf (15 :: Int)
10:34 <lambdabot> error:
10:34 <lambdabot> • Couldn't match expected type ‘Int’
10:34 <lambdabot> with actual type ‘Maybe Integer’
10:34 <kqr> ertes, hm. but in this case I don't have a specific Maybe a, I want to conjure one depending on which type is expected
10:34 <ertes> > typeOf (15 :: Int) == typeOf (15 :: Int)
10:34 <kqr> ertes, i'm more and more thinking this is exactly what typeclasses do
10:34 <lambdabot> True
10:34 <ertes> kqr: yes, but you can't have a catch-all instance
10:34 <kqr> ertes, ah, true
10:35 sfcg joined
10:35 ziocroc joined
10:36 <ertes> kqr: what do you need this for anyway?
10:36 erikd joined
10:36 saurabhnanda joined
10:36 <CoolerZ> ertes, well i did C-c C-l and it told me to do C-h f haskell-mode to see how to use interactive-haskell
10:37 <CoolerZ> and from that i found interactive-haskell-mode
10:37 <lyxia> > typeRep (Proxy :: Proxy (Maybe Int)) -- You don't need a value to get a typeRep, kqr
10:37 <lambdabot> Maybe Int
10:39 <ertes> CoolerZ: yeah, you need to add the hook
10:39 <cocreature> ertes: you absolutely can with OverlappingInstances :)
10:39 <CoolerZ> and i enabled it, but it doesn't seem to do anything
10:39 <ertes> CoolerZ: hooks are buffer-local… close and reopen the file
10:41 takle joined
10:42 Wizek_ joined
10:42 <CoolerZ> ertes, i did then what?
10:43 <ertes> CoolerZ: C-c C-l
10:44 <CoolerZ> Run ‘C-h f haskell-mode‘ for instruction how to setup a Haskell interaction mode.
10:44 <CoolerZ> and that opens up a help page
10:44 <ertes> CoolerZ: note that there is a gap between writing something into .emacs and actually making it take effect… you might be in this gap right now =)
10:45 <ertes> CoolerZ: either go evaluate what you wrote, or… at this point… just restart emacs ;)
10:45 <CoolerZ> i haven't written anything to .emacs regarding haskell-mode
10:45 <ertes> how did you enable the hook?
10:45 hackebeilchen joined
10:45 <CoolerZ> what hook
10:45 LHoT10820 joined
10:46 <CoolerZ> oh actually i did add something
10:47 bennofs joined
10:49 augur joined
10:49 takle joined
10:49 tommd joined
10:50 sillyotter joined
10:50 Destol joined
10:51 <CoolerZ> ertes, https://hastebin.com/domoheroke.lisp
10:51 oisdk joined
10:51 <Gurkenglas> kqr, https://hackage.haskell.org/package/plugins-1.5.6.0/docs/System-Eval-Haskell.html#v:eval has something like that
10:51 <ertes> CoolerZ: can't see pastes on that site
10:52 <CoolerZ> ertes, http://lpaste.net/7212055598215462912
10:53 <ertes> CoolerZ: add this at the bottom: (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
10:53 <ertes> then position the point on that like and type: C-M-x
10:54 erikd joined
10:54 <ertes> then reopen the file and try to load it
10:56 Levex joined
10:56 LHoT10820 joined
10:57 <CoolerZ> ertes, what do you load it? i typed C-x C-l after reopening the .hs file
10:58 <CoolerZ> and it shows up downcase region
10:58 <ertes> CoolerZ: i'll let you figure this one out by yourself =)
11:01 takle joined
11:03 <CoolerZ> ertes, oh its C-c C-l yeah that works, it opens up the repl in a new frame
11:03 <CoolerZ> new window, not frame
11:04 <CoolerZ> i still don't get autocomplete
11:06 <CoolerZ> ertes, do you get autocomplete like it shows here? http://haskell.github.io/haskell-mode/manual/latest/Completion-support.html#Completion-support
11:06 zeroed joined
11:06 skeuomorf joined
11:06 <* dysfun> overheard someone pronounce 'GADTs' as 'gadduhts', feels uncomfortable
11:07 <cocreature> dysfun: I think it’s the standard pronounciation. I’ve heard it used by quite a lot of people
11:08 <dysfun> really? i always spell out the letters
11:08 <dysfun> but for the longest time i'd do the same for 'SQL' too
11:08 <cocreature> richard eisenberg uses it and he should know :)
11:08 <Athas> I still do that.
11:08 takle joined
11:08 <dysfun> it's richard eisenberg i'm watching
11:09 <Athas> I also feel weird pronouncing abbreviations, especially if they are not really pronouncable.
11:09 <mniip> huh
11:09 <mniip> I pronounce them just 'gedts'
11:09 <mniip> without the uh
11:09 <Athas> I guess I'm inconsistent in not spelling out NATO, but spelling out GADT.
11:09 <Axman6> "gads"?
11:09 bennofs joined
11:09 <CoolerZ> silent T
11:09 <mniip> no like I can pronounce 'dt'
11:10 <mniip> can you not?
11:10 <dysfun> my tongue doesn't know how to make that sound
11:10 _paul0 joined
11:10 <Athas> GADT is easily pronouncible in languages with soft 'd's. Sad that English is not among those.
11:10 <mniip> guess german classes have finally paid off
11:10 <CoolerZ> i keep thinking Gadgets
11:10 xanadu_ joined
11:10 <Athas> mniip: you pronounce GADT to rhyme with "stadt"?
11:11 <* dysfun> tends to pronounce 'dt' as if the 'd' was almost invisible
11:11 <ertes> CoolerZ: i get auto-complete on M-tab
11:11 <mniip> Athas, kinda
11:11 <dysfun> stadt -> 'stat', more or less
11:11 <CoolerZ> ertes, does it show the drop-down menu like in that gif?
11:12 erikd joined
11:12 nilof joined
11:12 <mniip> dysfun, Stadtstaat
11:12 <CoolerZ> ertes, also alt-tab is a reserved hot key to switch windows
11:12 <ertes> CoolerZ: no, because that requires another extension… never throught i really need it, so i'm going with the standard completions
11:12 mivael_ joined
11:12 <dysfun> mniip: no clue :P
11:13 <CoolerZ> ertes, which extension?
11:13 <ertes> CoolerZ: you can put it on a different key, but i can't give you an emacs tutorial here =)
11:15 <CoolerZ> it doesn't say that you need a new extension on the page
11:15 <CoolerZ> "haskell-mode can complete symbols, pragma directives, language extensions, and language keywords out-of-box."
11:15 <mniip> huh
11:15 <CoolerZ> false advertising
11:15 <mniip> what os do you use where alt-tab is intercepted by the os
11:15 <ertes> CoolerZ: you're expected to know that… extensions in emacs "compose"
11:16 fizruk joined
11:16 <CoolerZ> ertes, which extension though
11:16 <ertes> you choose your own completion extension (or go with the default one like me), and haskell-mode will automatically use it
11:16 takle joined
11:16 <ertes> CoolerZ: again, i can't give you an emacs tutorial here… at this point you should start learning emacs =)
11:16 <Myrl-saki> Should I use PVP or Semver?
11:16 <Myrl-saki> Just use spacemacs and be happy.
11:16 <CoolerZ> ertes, whats the name of the extension
11:17 <ertes> CoolerZ: i don't know
11:17 <CoolerZ> they don't say on the page
11:18 Dookie12 joined
11:18 <CoolerZ> this is bs you can't just put gifs of something your package doesn't do in whats supposed to a manual
11:18 Dookie14 joined
11:18 <CoolerZ> and not even mention the extension
11:18 <mniip> Myrl-saki, I prefer pve but that's just m
11:18 <mniip> e
11:19 sampuka joined
11:19 koserge joined
11:19 <Myrl-saki> mniip: Sounds like you'd be the worst DOTA 2 teammate.
11:20 <ertes> CoolerZ: i found this by searching for "emacs dropdown completion": https://www.emacswiki.org/emacs/AutoComplete
11:21 <mniip> Myrl-saki, I don't play games for the mentally challenged
11:21 commanderinchief joined
11:21 cyborg-one joined
11:21 <Myrl-saki> mniip: I feel hurt.
11:21 <mniip> apply cold water
11:21 rios joined
11:23 mekeor joined
11:23 <* Myrl-saki> spills cold water on mniip
11:24 <CoolerZ> ertes, looking at the url for those gifs, it says company-mode http://haskell.github.io/haskell-mode/manual/latest/anim/company-mode-import-statement.gif
11:24 takle joined
11:24 <CoolerZ> and i found this https://github.com/iquiw/company-ghc
11:24 <ertes> CoolerZ: something you could have done yourself instead of going: "look how nice their theme looks! but it wasn't included in this completion package! false advertising!!1111"
11:24 <CoolerZ> ertes, its not a theme
11:25 <ertes> CoolerZ: that's not the point, but anyway, this is no longer haskell-related
11:25 <CoolerZ> and its still false advertising, cause its a completely different package
11:25 <ertes> no, it's not
11:25 <ertes> … false advertising
11:25 osa1 joined
11:25 <CoolerZ> and they don't even mention the name of the extension
11:25 osa1 joined
11:27 <CoolerZ> its actually this one https://company-mode.github.io/
11:27 permagreen joined
11:27 takle joined
11:27 <bennofs> CoolerZ: company-ghc is a backend for company-mode, so you'd need both
11:28 aring joined
11:28 <CoolerZ> yeah
11:28 <dysfun> company is awesome, btw
11:28 <dysfun> by far the best option in its category, generally
11:28 <bennofs> CoolerZ: hmm, "If haskell-interactive-mode is enabled and working Haskell mode provides completions for import statements taking into account currently loaded and available packages."
11:29 SkyPatrol_ joined
11:29 <bennofs> CoolerZ: so those haskell-mode gifs probably only work if you have a REPL started via haskell mode
11:29 erikd joined
11:29 <CoolerZ> bennofs, i have that already, but it doesn't do that
11:31 bjz joined
11:32 simendsjo joined
11:32 bvad joined
11:35 <bennofs> CoolerZ: works for me, after loading a buffer into the REPL with bare bones haskell mode
11:36 <bennofs> CoolerZ: (and then writing import Data.<Alt-Tab>)
11:37 revprez_atlanta joined
11:37 <CoolerZ> bennofs, its shows a drop-down menu?
11:38 <bennofs> CoolerZ: it uses the default emacs completion framework
11:38 <bennofs> CoolerZ: if you want another completion system, install it (and haskell-mode will integrate with it)
11:38 cschneid_ joined
11:39 <CoolerZ> bennofs, thats what i am doing
11:39 sproingie joined
11:39 sproingie joined
11:40 <bennofs> CoolerZ: just saying, it "works as advertised"
11:40 <* ertes> has a deja-vu =)
11:40 <CoolerZ> bennofs, sure if you know that auto-complete is alt-tab and that it won't show a drop-down menu of suggestions
11:40 <CoolerZ> and that you need to install something entirely different
11:40 <CoolerZ> then yeah
11:41 <ertes> the virtues of trying to learn two things at once: emacs and haskell-mode
11:41 <bennofs> CoolerZ: well, but that is how *emacs* works. it works the same way for every other language mode that provides auto completion
11:41 abhiroop joined
11:42 <bennofs> CoolerZ: in emacs, you can configure how auto completion works and what backends it uses. these two are separate, so demoing a backend can be done with any way to use said backend (in this example, the frontend used was company mode, but that doesn't change anything about the features of the backend which is what the example wanted to demo)
11:42 <CoolerZ> do i just need company-mode or do i need company-ghc?
11:42 dfordivam joined
11:42 <CoolerZ> compay-ghc need ghc-mod to be installed via cabal
11:42 <bennofs> CoolerZ: if you are happy with the haskell-mode integrated completion, you only need company-mode
11:43 <bennofs> CoolerZ: company-ghc is another backend for completion based on ghc-mod (so it doesn't use the REPL powered completion that haskell-mode uses)
11:43 <bennofs> CoolerZ: if you just want what haskell-mode shows, use company-mode with the company-capf (included with company-mode) backend
11:44 <bennofs> [capf just forwards to the standard completion-at-point emacs function]
11:44 <CoolerZ> didn't someone say something about autocompletion only working if the last load into ghci was successful?
11:45 <ertes> it has a fallback to TAGS-based completion
11:45 <ertes> that requires some setup though
11:45 <CoolerZ> so is ghc-mod better?
11:45 <CoolerZ> company-ghc i mena
11:45 <CoolerZ> mean*
11:46 rios joined
11:46 <Myrl-saki> :: (a -> Bool) -> m a -> m a
11:46 <Myrl-saki> `until`, monadic version.
11:47 <Myrl-saki> Any ideas?
11:47 sdothum joined
11:47 <lyxia> Myrl-saki: https://hackage.haskell.org/package/monad-loops-0.4.3/docs/Control-Monad-Loops.html iterateUntil
11:48 <CoolerZ> oh this says to add a haskell-mode-hook for ghc-mod http://www.mew.org/~kazu/proj/ghc-mod/en/preparation.html
11:48 <Myrl-saki> lyxia: THanks.
11:48 <CoolerZ> but theres already a hook for haskell-mode
11:48 <CoolerZ> can you have multiple hooks?
11:50 juanpaucar joined
11:53 <bennofs> CoolerZ: company-mode supports multiple backends
11:53 <bennofs> CoolerZ: yes you can have multiple hooks
11:53 <ertes> Myrl-saki: that doesn't look like 'until'
11:54 <Myrl-saki> ertes: lmao
11:54 <Myrl-saki> ertes: It's kinda `until`-ish.
11:54 akermu joined
11:55 dm3 joined
11:56 abhiroop joined
11:57 ziyourenxiang joined
11:57 xanadu_ joined
11:58 <Myrl-saki> :t forever
11:58 <lambdabot> Applicative f => f a -> f b
11:59 <Myrl-saki> :t when
11:59 <lambdabot> Applicative f => Bool -> f () -> f ()
12:00 <Myrl-saki> No builtin for `Applicative f => Bool -> f a -> f ()`?
12:00 abhiroop joined
12:00 <ertes> :t void
12:00 <lambdabot> Functor f => f a -> f ()
12:00 <Myrl-saki> (I mean sur, void.)
12:00 <Myrl-saki> ertes: Too lazy to put void.
12:01 <hpc> :t guard
12:01 <lambdabot> Alternative f => Bool -> f ()
12:01 simendsjo joined
12:02 <Myrl-saki> hpc: guard is failure.
12:02 <ertes> good luck convincing GHC to cut you some slack for being lazy =)
12:02 <hpc> oh right, i was thinking of when
12:02 <Myrl-saki> ertes: :P
12:03 sfcg joined
12:03 <ertes> :t \p c -> void (runMaybeT (guard p >> lift c))
12:03 <lambdabot> error:
12:03 <lambdabot> Variable not in scope: runMaybeT :: t0 m b -> f a0
12:03 <ertes> @let import Control.Monad.Trans.Maybe
12:03 <lambdabot> Defined.
12:03 <ertes> :t \p c -> void (runMaybeT (guard p >> lift c))
12:03 <lambdabot> Monad f => Bool -> f a -> f ()
12:03 <hpc> :t \p c -> if p then c *> pure () else pure ()
12:04 <lambdabot> Applicative f => Bool -> f a -> f ()
12:04 <hpc> :t void
12:04 <lambdabot> Functor f => f a -> f ()
12:04 mfukar joined
12:04 <hpc> ah, if p then void c else pure ()
12:04 <bollu> this is #haskell-offtopic-ish: does idris have theories for linear algebra and metric spaces?
12:04 zariuq joined
12:04 <bollu> I asked on #idris, no one responded
12:04 <ertes> :t \p c -> sequenceA [ c | p ]
12:04 <lambdabot> Applicative f => Bool -> f a -> f [a]
12:04 <ertes> :t \p c -> sequenceA_ [ c | p ]
12:05 <lambdabot> Applicative f => Bool -> f a -> f ()
12:05 dfordivam joined
12:05 eklavya joined
12:05 <bollu> I want to encode some facts about polyhedra, so my choices as far as I can tell are Coq, isabelle, LEAN, and idris
12:06 im0nde joined
12:07 Itkovian joined
12:07 <Eduard_Munteanu> bollu, don't forget Agda
12:08 arawack joined
12:08 <Eduard_Munteanu> It doesn't really have anything on linear spaces, AFAIK.
12:10 Wuzzy joined
12:11 <bollu> ah, right
12:11 <bollu> Eduard_Munteanu: do there more "programming" things have linear spaces?
12:11 <Gurkenglas> Myrl-saki, should you be too lazy to put void? It tells the reader you're destroying information. What exactly are you discarding?
12:11 <bollu> Eduard_Munteanu: I need basic functional analysis: interaction between linear stuff, affine stuff, and metrics
12:12 prophile joined
12:12 <Eduard_Munteanu> bollu, you may be able to find something written in Haskell, if you don't need strict proving stuff.
12:13 ilyaigpetrov joined
12:14 eklavya joined
12:14 <bollu> Eduard_Munteanu: I do, actually
12:14 <bollu> Eduard_Munteanu: I just want to encode proofs, because I'm reading from a book that does a lot of "this follows"
12:14 <bollu> Eduard_Munteanu: and I'd like to check that I understand it correctly
12:15 <bollu> Eduard_Munteanu: (and being able to extract a correct implementation of an algorithm that is described at the end would be sweet"
12:15 <bollu> Eduard_Munteanu: so, well
12:15 <bollu> Eduard_Munteanu: I guess Coq it is?
12:15 <Eduard_Munteanu> Well, yeah, there's a whole lot more stuff written for Coq.
12:16 <Eduard_Munteanu> But usually theorem provers are a nuisance if you just want to follow a math book. Some things may be really difficult to prove formally.
12:16 angelos joined
12:16 <bollu> Eduard_Munteanu: yeah, but I want to try as an experiment, since the "end result" of the book is an algorithm that counts lattice points in polyhedra
12:16 <ertes> i used agda to really understand category theory… it was very helpful, but also an experience i wouldn't want to repeat
12:16 juanpaucar joined
12:17 <bollu> so it would be cool to show that we have a "correct" implementation of this
12:17 <ertes> agda is not much of a proof *assistant* at all
12:18 <bollu> yeah, I understand
12:18 <bollu> but, well
12:18 <bollu> so, Coq?
12:19 <ertes> bollu: coq has a large library of predefined stuff, and most of the dirty work can be done via tactics
12:19 <bollu> I see
12:19 xanadu_ joined
12:19 <bollu> ertes: are you familiar with isabelle?
12:20 commanderinchief joined
12:20 <ertes> not really… i tried it a few times, but it never worked very well
12:20 <bollu> I see
12:21 grumble joined
12:24 NeverDie joined
12:24 SkyPatrol joined
12:28 mohsen_ joined
12:31 uiop joined
12:36 <Eduard_Munteanu> ertes, lately, Agda's got some tactics too
12:36 <Eduard_Munteanu> Not as good/pervasive as Coq's, but still.
12:38 <ertes> there are other problems with agda like the ridiculously explicit treatment of universes
12:38 <ertes> my definition of Functor had six level arguments
12:39 <ertes> this is stuff i feel could easily be inferred
12:40 fosterite joined
12:40 <Eduard_Munteanu> In Coq, provey bits live in Type, which has no levels.
12:41 <Eduard_Munteanu> Or Prop, I forget.
12:42 <Eduard_Munteanu> It also helps that their levels are cumulative.
12:43 <Eduard_Munteanu> (something in Set k is also in Set (k+1))
12:43 LHoT10820 joined
12:43 wei2912 joined
12:46 mrkgnao joined
12:49 LHoT10820 joined
12:50 tommd joined
12:50 <Myrl-saki> @pl (\a x -> f x : a)
12:50 <lambdabot> flip ((:) . f)
12:50 <Myrl-saki> That's disgusting.
12:50 dejanr_ joined
12:51 acidjnk22 joined
12:51 <Taneb> Myrl-saki, the output of pl almost always is
12:52 <Myrl-saki> @pl (\ f g (x:xs) -> f x:g xs
12:52 <lambdabot> (line 1, column 26):
12:52 <lambdabot> unexpected end of input
12:52 <lambdabot> expecting variable, "(", operator, ":", "++", "<+>" or ")"
12:52 <Myrl-saki> @pl (\ f g (x:xs) -> f x:g xs)
12:52 <lambdabot> flip flip tail . (ap .) . flip flip head . ((.) .) . flip . (((.) . (:)) .)
12:52 <Myrl-saki> Okay. I give up.
12:53 <pacak> Nice flipping lambdabot!
12:53 forker left
12:53 octarin joined
12:53 <Myrl-saki> pacak: I think he's flipping me off.
12:54 hiroaki joined
12:54 <pacak> Myrl-saki: You are asking for something strange.
12:54 <Eduard_Munteanu> It should be called acrobatics.
12:54 nnplv joined
12:54 <pacak> > over _head (*3) [1..3]
12:54 <lambdabot> [3,2,3]
12:56 systadmin joined
12:56 <pacak> It's hard to tell what are you trying to do
12:59 <systadmin> hmm
12:59 <systadmin> Is there like, an alternative to getLine and readLine that asks for an integer only?
13:00 mohsen_ joined
13:01 eklavya joined
13:01 anubis88 joined
13:01 cpennington joined
13:01 twomix joined
13:01 <Tuplanolla> :t fmap readMaybe getLine :: IO (Maybe Integer) -- Like this, systadmin?
13:01 <lambdabot> IO (Maybe Integer)
13:02 <systadmin> Tuplanolla: is it like getLine but the input must be an Int?
13:02 <Tuplanolla> You have the definition right there.
13:02 nnplv joined
13:02 <systadmin> Oh
13:03 <systadmin> yeah I'm still bad at Haskell
13:03 nomeata joined
13:10 Levex joined
13:10 oish joined
13:11 NStress joined
13:11 <NStress> ★ NStress.info ★ Reliable DDoS Service ★ 175 Gbps guaranteed ★ https://www.nstress.info/
13:11 NStress left
13:11 simendsjo joined
13:12 takle joined
13:13 NeverDie joined
13:13 ragepanda joined
13:13 cpup- joined
13:14 iomonad joined
13:15 <mrkgnao> Was that a spam message right there?
13:15 Itkovian joined
13:15 <pacak> mrkgnao: Yes.
13:16 <ertes> yeah… we could set up a crowdfunding campaign to buy DDoS traffic and point it at the provider
13:16 cpup joined
13:16 afarmer joined
13:17 abhiroop joined
13:17 <pacak> ertes: This domain is hosted by cloudflare.
13:17 <hpc> lol
13:17 <pacak> (not surprised)
13:18 <pacak> Also it's currently down.
13:18 <ertes> cloudflare is a problem anyway… i wouldn't mind them disappearing =)
13:19 takle joined
13:20 doomlord joined
13:20 oisdk joined
13:21 juanpaucar joined
13:21 tsmish joined
13:21 <pacak> Too bad it's down - I wanted to write an email to cloudflare abuse...
13:22 Noldorin joined
13:23 moth joined
13:24 abhiroop joined
13:24 Elish joined
13:24 Tesseraction joined
13:24 funrep joined
13:26 <CoolerZ> type doesn't create new data constructors right?
13:26 <CoolerZ> only new type constructors?
13:26 takle joined
13:27 Levex joined
13:27 <mekeor> CoolerZ: yes
13:28 vegai left
13:30 whiteline joined
13:32 PlasmaStar joined
13:32 aarvar joined
13:35 iomonad joined
13:35 Big_G joined
13:35 nirvinm joined
13:36 <cocreature> it doesn’t create type constructors. it’s just an alias for an existing constructor
13:36 Prutheus joined
13:37 whiteline joined
13:38 wildlander joined
13:39 sproingie joined
13:40 <mniip> 1494767777 [16:16:17] <ertes> yeah… we could set up a crowdfunding campaign to buy DDoS traffic and point it at the provider <- hahaha http://tcpst.net/pfq_.png
13:41 dejanr joined
13:41 <* hackage> czipwith 1.0.0.0 - CZipWith class and deriving via TH https://hackage.haskell.org/package/czipwith-1.0.0.0 (lspitzner)
13:42 halogenandtoast joined
13:43 erikd joined
13:44 moongazer joined
13:44 oisdk joined
13:45 skeuomorf left
13:45 funrep joined
13:46 twanvl joined
13:46 insitu joined
13:46 darlan joined
13:46 nnplv left
13:47 JuanMiguel joined
13:48 nnplv joined
13:48 abhiroop joined
13:49 oisdk joined
13:49 jutaro joined
13:50 JeanCarloMachado joined
13:50 erikd joined
13:51 S1 joined
13:54 umren joined
13:54 sighingnow joined
13:55 jmcarthur joined
13:55 kqr left
13:55 bigos joined
13:56 fotonzade joined
13:57 fizruk joined
13:58 <CoolerZ> does Data.Map have a toArr function?
13:58 <CoolerZ> need to iterate over the values
13:58 <CoolerZ> actually type ItemTree = Map.Map String [Item]
13:59 <CoolerZ> need toArr :: Map.Map String [Item]
13:59 <CoolerZ> -> [Item]
13:59 sfcg joined
14:00 sfcg joined
14:01 <cocreature> :t Data.Map.elems
14:01 <lambdabot> M.Map k a -> [a]
14:01 <octarin> -quit
14:01 oisdk joined
14:02 <CoolerZ> cocreature, that would give me [[Item]]
14:02 <CoolerZ> concat?
14:03 <cocreature> :t concat . Data.Map.elems
14:03 cobreadmonster joined
14:03 <lambdabot> M.Map k [a] -> [a]
14:03 <Myrl-saki> I think this sounds stupid.
14:03 <Myrl-saki> :: Integral a => a -> [b] -> [a]
14:04 FreeBirdLjj joined
14:04 paolino joined
14:05 akegalj joined
14:06 dcoutts_ joined
14:06 funrep joined
14:07 sgflt joined
14:07 <Myrl-saki> foo n xs = (\i -> n*i `div` length xs)<$> zipWith const [0..length xs-1] xs
14:07 nullifidian__ joined
14:07 <Myrl-saki> That seems... ugly.
14:07 <Myrl-saki> :t foo n xs = (\i -> n*i `div` length xs)<$> zipWith const [0..length xs-1] xs
14:07 <lambdabot> error:
14:07 <lambdabot> parse error on input ‘=’
14:07 <lambdabot> Perhaps you need a 'let' in a 'do' block?
14:07 <Myrl-saki> :t \n xs -> (\i -> n*i `div` length xs) <$> zipWith const [0..length xs-1] xs
14:07 <lambdabot> Int -> [b] -> [Int]
14:08 <CoolerZ> i find it annoying that emacs can't just autocomplete stuff i have already typed
14:08 <Myrl-saki> @pl \n xs -> (\i -> n*i `div` length xs) <$> zipWith const [0..length xs-1] xs
14:08 <lambdabot> (`ap` (zipWith const =<< enumFromTo 0 . subtract 1 . length)) . ((<$>) .) . (. (flip div . length)) . (.) . (*)
14:08 <Myrl-saki> enumFromTo, huh.
14:08 <Myrl-saki> That might actually work.
14:09 erikd joined
14:09 <Myrl-saki> @pl \n xs -> map (\i -> i*length xs `div` n) . enumFromTo 0 $ length xs - 1)
14:09 <lambdabot> (line 1, column 72):
14:09 <lambdabot> unexpected ')'
14:09 <lambdabot> expecting digit, variable, "(", operator, "+", "-", "$", "$!", "`seq`" or end of input
14:10 <Myrl-saki> @pl \n xs -> map (\i -> i*length xs `div` n) . enumFromTo 0 $ length xs - 1
14:10 <lambdabot> (`ap` (subtract 1 . length)) . flip flip (enumFromTo 0) . (((.) . map . (*)) .) . flip (div . length)
14:11 nick8325 joined
14:11 zero_byte joined
14:11 Hithroc joined
14:12 <ertes> CoolerZ: see dabbrev
14:12 <* hackage> optparse-generic 1.2.0 - Auto-generate a command-line parser for your datatype https://hackage.haskell.org/package/optparse-generic-1.2.0 (GabrielGonzalez)
14:12 <Philonous> CoolerZ, dabbrev-expand ?
14:13 <Philonous> Oh, too late :/
14:13 coot____ joined
14:14 <CoolerZ> ertes, does that have a drop-down menu?
14:14 <CoolerZ> or do i need a extension for that
14:14 <CoolerZ> i would like it be on by default like auto complete
14:15 AlexRussia joined
14:15 <Philonous> CoolerZ, You can use dabberev as a backend for company
14:15 <CoolerZ> nice
14:16 <ertes> i actually use dabbrev and symbol completion separately, because i know which i'll need which, so i get to the desired result quicker
14:16 thunderrd joined
14:17 oisdk joined
14:18 tommd joined
14:19 <Myrl-saki> :t unfoldr
14:19 <lambdabot> (b -> Maybe (a, b)) -> b -> [a]
14:20 erikd joined
14:21 <Myrl-saki> @pl \n xs -> unfoldr (\i -> if i < (length xs) then Just (n*i `div` length xs,succ i) else Nothing) 0
14:21 <lambdabot> flip flip 0 . (unfoldr .) . flip flip Nothing . (flip .) . ap (ap . (if' .) . flip (<) . length) . ((Just .) .) . flip flip succ . (liftM2 (,) .) . (. (flip div . length)) . (.) . (*)
14:21 <Myrl-saki> This just gets worse and worse lol
14:21 <Myrl-saki> Oh wait.
14:21 <Myrl-saki> :t filterM
14:21 <lambdabot> Applicative m => (a -> m Bool) -> [a] -> m [a]
14:22 dfordivam joined
14:22 <Myrl-saki> > filterM id [Nothing, JUst 1]
14:22 <lambdabot> error:
14:22 <lambdabot> • Data constructor not in scope: JUst :: Integer -> Maybe Bool
14:22 <lambdabot> • Perhaps you meant ‘Just’ (imported from Data.Maybe)
14:22 <Myrl-saki> > filterM id [Nothing, Just 1]
14:22 <lambdabot> error:
14:22 <lambdabot> • No instance for (Num Bool) arising from the literal ‘1’
14:22 <lambdabot> • In the first argument of ‘Just’, namely ‘1’
14:25 juanpaucar joined
14:25 <Myrl-saki> @pl \n xs -> zipWith (\i _ -> i*n `div` length xs) [0..] xs
14:25 <lambdabot> join . flip flip [0..] . ((zipWith . (const .) . (*)) .) . (. length) . div
14:25 <Myrl-saki> I think I'll go with that lol
14:26 funrep joined
14:26 <CoolerZ> nice dabbrev for code works
14:28 Itkovian joined
14:29 acidjnk22 joined
14:30 oisdk joined
14:30 pikhq joined
14:32 MarioBranco joined
14:32 hust921 left
14:32 leat joined
14:32 moth joined
14:33 Dookie12 joined
14:33 Dookie14 joined
14:36 MarioBranco joined
14:36 pera joined
14:37 moet joined
14:37 kritzcreek joined
14:38 jer1 joined
14:39 eklavya joined
14:40 oisdk joined
14:40 sfcg joined
14:41 Kreest joined
14:41 cloudhead joined
14:41 laplacian joined
14:42 knokch joined
14:42 pavonia joined
14:44 smwangi joined
14:44 sproingie joined
14:44 <CoolerZ> did things change recently? on hackage it says GHC.OldList
14:45 smwangi joined
14:45 <CoolerZ> in ghci it says isUpper is from GHC.List
14:45 eklavya_ joined
14:45 nirvinm joined
14:45 <CoolerZ> oh nvm thats (!!)
14:47 nullifidian_ joined
14:47 funrep joined
14:48 tefter joined
14:54 <* hackage> GPipe 2.2.1 - Typesafe functional GPU graphics programming https://hackage.haskell.org/package/GPipe-2.2.1 (TobiasBexelius)
14:58 carvsdriver1 joined
14:59 nnplv joined
15:00 pie_ joined
15:00 <pie_> you guys know any decompilers / disassemblers written in haskell that i can look at?
15:00 Hunter1 joined
15:00 carlosda1 joined
15:01 eklavya joined
15:01 sproingie joined
15:03 <Axman6> I don't know of any
15:05 ystael joined
15:06 <pie_> found this so far but not much else https://github.com/gereeter/hsdecomp
15:07 revprez_atlanta joined
15:07 SpinTensor joined
15:07 <pie_> oh wait thats written in python
15:07 <pie_> well this is something https://github.com/search?utf8=%E2%9C%93&q=language%3Ahaskell+decompiler&type=
15:07 funrep joined
15:07 <mniip> for a second I thought you wanted to decompile haskell
15:08 <pie_> https://github.com/search?utf8=%E2%9C%93&q=language%3Ahaskell+disassembler&type=
15:08 <pie_> mniip, yeah that would be cool but not what im looking for right now xD
15:08 <pie_> in know, sorry for the link messup >P
15:08 <pie_> * :P
15:14 Goplat joined
15:15 insitu joined
15:15 SpinTensor joined
15:18 meba joined
15:18 nullifidian_ joined
15:19 pgiarrusso joined
15:21 cyborg-one joined
15:22 roconnor joined
15:24 chewzerita joined
15:24 <chewzerita> :t any
15:24 <lambdabot> Foldable t => (a -> Bool) -> t a -> Bool
15:25 MarioBranco joined
15:25 SpinTensor joined
15:27 Itkovian joined
15:28 funrep joined
15:29 dejanr_ joined
15:29 ragepanda joined
15:29 justinfokes joined
15:30 dmwit_ joined
15:30 <Gurkenglas> Myrl-saki, you'll want to have length xs outside a lambda if you want it shared: \n xs -> map (`div` length xs) $ zipWith const [0,n..] xs
15:31 L4zl0H0llf3ld joined
15:32 xcmw joined
15:33 phaji joined
15:34 chewzerita left
15:34 juanpaucar joined
15:36 jer1 joined
15:37 jcjf left
15:37 strykerkkd joined
15:40 hseg joined
15:41 kirillow joined
15:41 <CoolerZ> i am getting warnings that certain record functions(getters inside record syntax) are not used
15:41 <CoolerZ> even though they are used later in the same file
15:41 <CoolerZ> there are no error
15:41 <CoolerZ> s
15:41 kirillow joined
15:42 <hseg> Hi. I'm trying to get git-annex set up under cygwin on windows. Its dependency dns-2.0.10 doesn't build on windows, how do I tell stack to try using an older version?
15:42 carlomagno joined
15:42 <Gurkenglas> CoolerZ, paste?
15:42 <mrkgnao> hseg: have you tried changing the version in the cabal file?
15:43 <Myrl-saki> @pl
15:43 <lambdabot> (line 1, column 1):
15:43 <lambdabot> unexpected end of input
15:43 <lambdabot> expecting white space, "()", natural, identifier, lambda abstraction or expression
15:43 <mrkgnao> try stack unpack <pkg> and edit <pkg>.cabal and see?
15:43 <Myrl-saki> @pl (\i _ -> (w`div`2, i `div` length xs))
15:43 <lambdabot> const . (,) (w `div` 2) . (`div` length xs)
15:43 <Myrl-saki> Well.
15:43 <CoolerZ> http://lpaste.net/355499
15:43 <Myrl-saki> @pl (\i -> (w`div`2, i `div` length xs))
15:43 <lambdabot> (,) (w `div` 2) . (`div` length xs)
15:43 <glguy> hseg: You'd put the version you want to try in your stack.yaml
15:43 kirillow joined
15:44 <hpc> edit the stack.yaml file first
15:44 <CoolerZ> its saying item_prod and item_dot defined on line 16 are not used
15:44 <hpc> cabal constraints define what the package /can/ build with
15:44 kirillow joined
15:44 <Gurkenglas> Myrl-saki, \n -> (\l -> map (`div` l) [0,n..n*l-1]) . length
15:44 <hpc> stack.yaml defines a specific build configuration
15:44 <hpc> within those constraints
15:44 <hseg> mrkgnao: glguy: Testing that
15:44 <CoolerZ> but they are used on lines 98 and 99
15:44 <glguy> and this package passes off figuring out which versions the package can build with to you
15:44 <CoolerZ> and also in other places
15:46 kirillow joined
15:46 nirvinm joined
15:46 dejanr_ joined
15:47 <glguy> CoolerZ: Does your module have an explicit export list?
15:47 <mrkgnao> hpc: glguy: apologies, you're correct
15:47 <CoolerZ> glguy, its just that single file right now
15:47 knoch joined
15:47 <CoolerZ> theres no other files or cabal file
15:48 <glguy> CoolerZ: OK, then you're using the default module declaration of: module Main (main) where
15:48 <glguy> CoolerZ: This means that only things used by main are considered used
15:48 <CoolerZ> oh
15:48 rcschm joined
15:48 <glguy> Or rather transitively used by main
15:49 carlomagno1 joined
15:49 trism joined
15:49 funrep joined
15:49 Sh4rPEYE joined
15:50 <hseg> How, precisely, do I blacklist dns-2.0.10?
15:50 <* hackage> Villefort 0.1.0.3 - Villefort is a task manager and time tracker written in haskell. https://hackage.haskell.org/package/Villefort-0.1.0.3 (ChrisReuter)
15:50 <glguy> hseg: When you manually specify a version other than 2.0.10, 2.0.10 will be blacklisted
15:51 <Sh4rPEYE> Which formatter would you recommend/do you use? There are now many, and I don't know which one is considered the standart. Hindent, Stylish-Haskell, Brittany...?
15:52 <hpc> i personally don't use any
15:53 <hpc> i even :set paste in newer versions of vim
15:53 <Sh4rPEYE> Also, does somebody here use VSCode? I've downloaded Haskero, haskell-linter and some other small Haskell packages, but the autocompletition is still clumsy, the linter doesn't work as well as I'd like and it all seems... Weird. What are the recommended packages and settings for it to work with Haskell as nicely as possible?
15:53 Liceo joined
15:53 <Liceo> ciao
15:53 <Liceo> !list
15:53 urodna joined
15:53 Liceo left
15:53 systadmin joined
15:54 dfranke joined
15:54 <jmcarthur> I've used hindent and stylish before, but I don't use a formatter right now. They have always produced ugly formatting, IMO.
15:54 <jmcarthur> Never tried brittany.
15:54 debian0501 joined
15:55 dfranke joined
15:56 pera joined
15:57 dan_f joined
15:57 hydroacoustic joined
15:58 tommd joined
15:58 nakal_ joined
15:59 ystael joined
16:00 Mutter_ joined
16:01 debian0501 joined
16:01 ChaiTRex joined
16:04 igniting joined
16:05 acarrico joined
16:08 jsoo joined
16:09 carlomagno joined
16:09 beerdrop joined
16:10 descender joined
16:11 pgiarrusso joined
16:12 mdarse left
16:13 jsoo joined
16:13 tlee753 joined
16:14 qwertydvorak joined
16:14 <* hackage> GPipe-GLFW 1.4.1 - GLFW OpenGL context creation for GPipe https://hackage.haskell.org/package/GPipe-GLFW-1.4.1 (plredmond)
16:16 oisdk joined
16:16 <Ulrar> So I get a string containing a \n (two chars), is there a way to replace that by the actual newline character ?
16:17 Hunter1 joined
16:17 allenj12 joined
16:17 <pie_> is it possible to code assertions for parsers, like the order of operations or something, to make specification bugs less likely?
16:18 <Ulrar> In C I'd just replace by 10, but I figure there must be something more elegant
16:18 <monochrom> > read "\"hello\\nhello\\n\""
16:18 xanadu_ joined
16:18 <lambdabot> *Exception: Prelude.read: no parse
16:18 Boarders joined
16:18 <monochrom> > read "\"hello\\nhello\\n\"" :: String
16:18 <lambdabot> "hello\nhello\n"
16:18 <monochrom> But it has other requirements.
16:18 <Ulrar> You mean I should just use read on my string ?
16:19 <glguy> Ulrar: You can use 'read' if your string syntax is exactly Haskell's
16:19 <Ulrar> Well it contains text coming from IRC
16:19 <glguy> If you have something more limited in mind you'll need to write a parser for whatever the more limited set of escapes is
16:19 <Ulrar> I mean, the only thing I want to support is \n, if I get more stuff out of it fine but I don't really need it
16:19 <Boarders> at about the 11:13 mark in this talk https://www.youtube.com/watch?v=VXl0EEd8IcU&ab_channel=YOW%21Conferences the speaker says that from a semigroup you can get a monoid by freely adjoining a unit (i.e. left adjoint to forgetful functor) which he says to do via Maybe
16:20 systadmin joined
16:20 <Boarders> but an audience member loudly complains at the suggestion
16:20 <Boarders> does anyone know why?
16:20 <glguy> Ulrar: What're you making?
16:21 <monochrom> Text coming from IRC don't normally have backslash followed by n.
16:21 Xanather joined
16:21 <glguy> I see 13 occurences of \n in #haskell in my current buffer :)
16:21 <glguy> Most are lambda expressions
16:22 nnplv joined
16:22 ralu joined
16:23 <Ulrar> glguy: An IRC --> Mastodon bot
16:23 <Ulrar> monochrom: Well it does if someone actually types \n
16:23 <glguy> And what's Mastodon?
16:23 pera joined
16:23 <Ulrar> I'm trying to figure out how to get newlines on mastodon
16:23 <Ulrar> glguy: Basically twitter, but open source
16:23 <Ulrar> I don't even use it, just making that for fun
16:24 <Ulrar> And I actually have users who'd like \n to work
16:24 <glguy> You might also be interested in #haskell-irc, then
16:25 funrep joined
16:25 <glguy> There's no standard function for replacing occurences of "\\n" with "\n", you'll just need to write one
16:26 justinfokes joined
16:26 <Ulrar> Well read should do it, no ?
16:27 <glguy> No, read will be much more picky
16:27 <Ulrar> Or maybe just replace "\\n" "\n" then
16:27 <glguy> read will expect enclosing '"'s and will expect contained '"'s to be escaped
16:28 <glguy> and it will expect to be other uses of '\\' in the string to be valid Haskell escapes
16:28 <Ulrar> Ah, yeah, won't work then
16:30 NeverDie joined
16:31 xanadu_ joined
16:31 ij joined
16:31 aring joined
16:33 tomphp joined
16:34 <Ulrar> Yep, Data.Text.replace works nicely
16:34 dejanr joined
16:35 <Ulrar> A bit silly to convert from ByteString and back for that though
16:38 <cocreature> iirc there is some package that implements search & replacement for bytestring directly
16:38 <Eduard_Munteanu> I'd use attoparsec.
16:38 <cocreature> https://hackage.haskell.org/package/stringsearch
16:38 juanpaucar joined
16:38 mohsen_1 joined
16:39 ericdwhite joined
16:40 mheinzel joined
16:40 pie_ joined
16:40 pie_ joined
16:40 hybrid joined
16:40 funrep joined
16:42 seagreen joined
16:43 saurabhnanda joined
16:43 <pie_> man why is it that almost no tools have stack integration
16:44 bydo joined
16:44 tomphp joined
16:44 <ertes> like what?
16:45 ChongLi joined
16:46 <monochrom> Maybe your bar of "integration" is too high.
16:46 <hvr> pie_: it's like asking why XY isn't available for your favorite OS
16:47 <pie_> :C
16:47 <glguy> I only run FavoriteOS
16:47 <pie_> why doesnt openbsd nixos :C
16:47 <glguy> and never seem to have as many problems with XY as everyone else
16:48 justan0theruser joined
16:48 <pie_> why doesnt openbsd nixos qubes some_verified_compiler :C
16:48 meadowlark joined
16:48 <* pie_> flails helplessly
16:48 <* glguy> hands pie_ some verbs
16:49 aring joined
16:49 moet joined
16:49 slack1256 joined
16:49 <monochrom> hvr! Why aren't your Ubuntu PPAs available for iOS?! <duck>
16:49 simendsjo joined
16:49 <glguy> monochrom: I think you can download from hvr's PPAs with iOS
16:49 <hvr> monochrom: first you nede to port dpkg & debhelpers to iOS =)
16:49 <hvr> monochrom: and then convince launchpad to setup iOS builders
16:50 <monochrom> Next time I'll try Commodore 64.
16:50 <glguy> hvr: Have you thought about doing anything with your multi-ghc-travis scripts for also targeting the mac build environments?
16:51 <hvr> glguy: I think that'd be better covered by macports or homebrew or whatever the most popular one is
16:51 <glguy> Also, for rare user that doesn't know about hvr's excellent scripts: https://github.com/hvr/multi-ghc-travis
16:51 saurabhnanda joined
16:51 mk-61 joined
16:51 justinfokes joined
16:51 cloudhead joined
16:51 <glguy> hvr: I don't understand how what you're saying helps building Haskell stuff on Travis.
16:51 <monochrom> I think there are approximately half of the mac users who hate macports and the other half who hate homebrew.
16:52 connrs joined
16:52 <monochrom> So if you have an install system that uses neither, they all like you. :)
16:52 <hvr> glguy: well, you'd use the macports/homebrew commands inside .travis.yml then to install ghc/cabal; but I think you were rather talking about the script generation...
16:52 <cocreature> monochrom: you got it the wrong way around. they all hate you in that case
16:53 <monochrom> hehe
16:53 <glguy> hvr: Yes, but your script is rather reliable. I'm looking for something of hvr quality that automatically targets those homebrew commands on travis
16:53 <glguy> My script is not reliable
16:58 <ij> ertes, morning?
16:59 WhiskyRyan joined
17:01 funrep joined
17:02 dan_f joined
17:04 zeroed- joined
17:04 <torstein> Anyone familiar with Intero/haskell mode in Emacs? When I press 'o' to create a new line, it's indented whether I'm in a function or not.
17:05 caumeslasal joined
17:05 justinfokes joined
17:06 <ij> ertes, I was wondering whether you can tell me about nix+docker+stack. I haven't done enough thinking to get it set up with alpine.
17:06 kadoban joined
17:08 <ertes> ij: stack is not part of the equation, and neither is alpine, so expect rather large images
17:08 <ij> What do you mean «not part of the equation»?
17:08 <ertes> something like alpine could very well be done with nixpkgs, but it would require some engineering, i think… i don't think it has already been done
17:09 baldrick joined
17:09 <ertes> ij: stack is not used… it's a pure nix-based solution
17:09 darlan joined
17:10 <ij> Oh. That's not a problem, I guess… Does nix have like snapshots/working pkg sets?
17:10 <ertes> yes
17:10 <ij> But the images will be large…
17:10 hydroacoustic joined
17:10 <ertes> you can bring the image size down by using static linking against haskell libraries
17:10 <ertes> but they are still larger than alpine-based images
17:11 <ij> And having different build/running containers, right?
17:11 haroldcarr joined
17:11 <ertes> what do you mean?
17:11 paolino_ joined
17:13 <ij> Eh, never mind — I'm ready to try out the nix-based solution(links, IRC guidance or both?). (But did you ever have any luck creating alpine-based imgs?)
17:13 <ertes> if you're patient i can create a small example later
17:13 <ertes> like in an hour or so
17:14 <athan> would it ever be possible to "merge" two TChans?
17:14 <athan> or would you just need to create a new one with their messages, forwarded
17:14 <ij> ertes, Sure, I've been trying to get it work the last three sundays. And I've gotten nowhere.
17:16 <CoolerZ> that moment when you realize theres a much simpler way and you refactor all the code you wrote for the last hour
17:16 funrep joined
17:17 <athan> maybe if I read it, then unGet it, it will be "the same"... hm...
17:17 <Zemyla> So I have two classes, which are analagous to Functor and Foldable:
17:17 <Ulrar> So I'm trying to use what's described on https://hackage.haskell.org/package/http-conduit-2.2.3.1/docs/Network-HTTP-Simple.html for "Request", the example to make a POST
17:17 AlexRussia joined
17:17 <Ulrar> But apprently `method' is not a (visible) constructor field name
17:17 sepp2k joined
17:18 fizruk joined
17:18 <Zemyla> class AFunctor t where hoist :: Functor g => (forall x. f x -> g x) -> t f a -> t g a; class AFoldable t where foldApp :: Applicative g => (forall x. f x -> g x) -> t f a -> g a
17:18 <Zemyla> What does the Traversable analogue look like?
17:21 Ariakenom joined
17:21 <c_wraith> Ulrar: this is why documentation that isn't machine-checked can never be trusted. :)
17:21 Sheogorath joined
17:22 mada joined
17:22 <meadowlark> can documentation ever be trusted?
17:22 <c_wraith> type signatures are good documentation. They are checked.
17:22 <monochrom> Yes. My documentation can always be trusted. :)
17:22 <Sheogorath> I remember bumping into some alternative numbery class hierarchies before. Does anyone have an elegant one they could point to?
17:22 <Ulrar> c_wraith: So the doc is just wrong then ?
17:22 <Ulrar> That's nice
17:23 <c_wraith> Ulrar: yes
17:23 <c_wraith> Ulrar: to be fair, it was probably correct when it was written
17:23 <Ulrar> c_wraith: Any idea what the correct way to do a DELETE request is then ?
17:24 <lyxia> @hackage tower Sheogorath
17:24 <lambdabot> http://hackage.haskell.org/package/tower Sheogorath
17:24 <mrkgnao> Sheogorath: well, mine is under construction :/ subhask is elegant but hasn't seen any commits in a while
17:25 slack1256 joined
17:27 tommd joined
17:27 haroldcarr left
17:27 <c_wraith> Ulrar: hmm. Looks like the code in that example *should* be right..
17:27 <c_wraith> Ulrar: that's a re-export of https://hackage.haskell.org/package/http-client-0.5.6.1/docs/Network-HTTP-Client-Internal.html#v:Request
17:28 <EvanR> trusted computing documentation
17:28 oish joined
17:28 <EvanR> the vendor writes your documentation for you, for your own protection
17:28 <Ulrar> c_wraith: Do I need to do something specific to get method ? I'm importong Network.HTTP.Simple
17:29 JuanMiguel joined
17:30 <c_wraith> Ulrar: add an import of Network.HTTP.Conduit It looks like the .Simple module doesn't export all the record fields for Request
17:30 fsestini joined
17:30 Hunter1 joined
17:31 justinfokes joined
17:32 justanotheruser joined
17:32 takle joined
17:33 <Ulrar> Indeed ! That works : import Network.HTTP.Conduit (Request(method))
17:33 <Ulrar> Thanks c_wraith
17:34 gehmehgeh left
17:34 Uakh joined
17:35 MarioBranco joined
17:36 jsgrant_om joined
17:37 crave joined
17:37 funrep joined
17:37 zeroed joined
17:40 sedeki joined
17:40 <fsestini> hi! does anybody know how to specify injectivity of a type family for some (but not all) of the arguments?
17:41 Jello joined
17:41 <c_wraith> fsestini: I think you'd need to break it into pieces. One type family to cover the injective parts, one for the rest.
17:42 juanpaucar joined
17:44 Uakh joined
17:44 Uakh joined
17:45 <JelloRaptor> Does anyone have suggestions for names for a class: `Class Foo (n :: (* -> *) -> *) where; bar :: (forall v. f v -> g v) -> n f -> n g; barA :: Applicative a => (forall v. f v -> a (g v)) -> n f -> a (n g)" ?
17:45 zeroed joined
17:45 Uakh joined
17:46 <JelloRaptor> Basically, some elements in the type are stored with some functor, and you have some morphism from that functor to another, which gives you a morphism over the larger type"
17:47 grayjoc joined
17:47 dm3 joined
17:47 <JelloRaptor> So `dat (SrcLoc,) -> dat Identity` would take a dat where elements are annotated with source location and give you a dat without any annotation
17:48 <lyxia> FFunctor, for a functor in the category of functors?
17:49 flatmap13 joined
17:49 <JelloRaptor> huh, `bar` is analogous to fmap? and i have no idea what barA is analogous to.
17:49 <lyxia> barA looks like a traversal
17:50 blym joined
17:50 moet joined
17:50 <cocreature> JelloRaptor: maybe take a look at the functions in https://hackage.haskell.org/package/mmorph-1.0.9/docs/Control-Monad-Morph.html. they’re not quite what you propose but they’re close
17:52 im0nde_ joined
17:52 <JelloRaptor> huh that is really close, albeit a tiny bit more restrictive than I would like
17:54 insitu joined
17:54 fgaz-swoosh joined
17:54 connrs joined
17:55 Uakh joined
17:55 <cocreature> JelloRaptor: you got me interested. do you have an example of what you are trying to do with your more general version?
17:55 <JelloRaptor> there's also a version where (with constraintKinds) I can have a constraint tied to the morphism `forall c. (forall v. c v => f v -> g v) -> n f -> n g` though I have no idea where I'd say "this datatype can use a morphism with this set of constraints, since it only contains data using that set of constraints."
17:56 jbalint joined
17:56 jbalint joined
17:56 yellowj joined
17:56 Uakh joined
17:56 <cocreature> bar actually seems less general than hoist. I can always add a phantom type parameter and get an instance of Hoist instead I think
17:57 <cocreature> barA is more general than embed but I’m not sure if Applicative is sufficient
17:57 <cocreature> it seems very monadic to me
17:57 qwertydvorak joined
17:57 <JelloRaptor> cocreature: In this particular case dealing with a bunch of different versions of an identical data structure "an object stored as a set of constraints over its values, the same object but with symbolic variables where the constraints are implicit in the CSP monad I'm using, and the same object but with specific concrete values as returned by the SMT solver"
17:58 <cocreature> JelloRaptor: I was hoping for something a bit more concrete that shows why you need it to be more general :)
17:59 Lokathor_ joined
18:00 <JelloRaptor> cocreature: I don't *need* it to be more general :P but it's a pattern that I've wished existed in a whole bunch of other places, mostly where I want to express some notion of ambiguity in an ADT.
18:00 abbe_ joined
18:00 <ertes> ij: working on an example now
18:01 carlomagno joined
18:01 flx_ joined
18:01 inr_ joined
18:01 mauke_ joined
18:01 bollu1 joined
18:01 <cocreature> JelloRaptor: fair enough. in any case, if you want your custom typeclasses, it’s probably a good idea to name them similarly to the ones in mmorph :)
18:02 Rumia__ joined
18:02 Uakh joined
18:02 grayjoc joined
18:02 thoughtpolice_ joined
18:02 sepp2k joined
18:02 Anaxagorian_ joined
18:02 codedmart_ joined
18:02 rann_ joined
18:02 <CoolerZ> is there a function for searching for an element in a list and returning that element?
18:02 <JelloRaptor> cocreature: there's a pretty limited set of functors I want to use in each induvidual case (`Maybe`, `(Metadata,)`, `ZipList` being pretty common) but it seems like it would save a good bit of boilerplate to have a more generic structure
18:02 jfokkan___ joined
18:02 mikedlr_ joined
18:02 dan_f_ joined
18:02 nick8325 left
18:03 bweston92_ joined
18:03 marcel_ joined
18:03 <cocreature> :t find -- CoolerZ
18:03 <lambdabot> Foldable t => (a -> Bool) -> t a -> Maybe a
18:03 Randy_ joined
18:03 saurabhnanda joined
18:03 raatiniemi_ joined
18:04 turnage_ joined
18:04 athan_ joined
18:04 Uakh joined
18:04 Vq_ joined
18:04 Jaak_ joined
18:04 cjay_ joined
18:04 raek_ joined
18:04 dilinger_ joined
18:04 cheater_ joined
18:04 hyPiRion_ joined
18:04 jotrk_ joined
18:05 cow-orke1 joined
18:05 ent- joined
18:05 integral_ joined
18:05 jix joined
18:05 ChewieBe1rdy joined
18:05 jophish_ joined
18:05 M2tias_ joined
18:05 ByronJoh1son joined
18:06 sleffy joined
18:07 exarkun joined
18:07 Hunter1 joined
18:07 <fsestini> c_wraith: i’m trying what you suggested on a minimal example without success. the example is here: http://lpaste.net/835057898517168128
18:07 xcmw joined
18:07 japesinator_ joined
18:07 stefan- joined
18:07 tibbe_ joined
18:07 huonw_ joined
18:07 ambrosia joined
18:07 jtcs_ joined
18:08 x1n4u- joined
18:08 InsterRandmNick joined
18:08 <fsestini> it still cannot deduce x1 ~ A
18:08 <ertes> ij: you know what, i just had a fun idea… i'm gonna make a time lapse video of my screen while developing the thing =)
18:08 yaiyan joined
18:08 Cthalupa joined
18:08 dersquisher joined
18:08 <Profpatsch> Any takers? https://www.reddit.com/r/haskell/comments/6b2krt/can_somebody_please_document_monadbasecontrol/
18:09 zennist joined
18:09 erikm joined
18:09 zennist joined
18:09 <ij> ertes, Cool. :)
18:10 Uakh joined
18:10 defanor joined
18:11 safe joined
18:11 usr joined
18:11 akermu joined
18:11 Oliphaunte joined
18:11 Someguy123 joined
18:12 flatmap13 joined
18:12 pratch joined
18:12 Akii joined
18:13 funrep joined
18:14 ent joined
18:15 icedev joined
18:15 nille joined
18:15 KaneTW joined
18:15 PlasmaStar joined
18:16 greeny joined
18:16 anzuof joined
18:16 yushyin joined
18:16 bak joined
18:16 tabaqui joined
18:16 <CoolerZ> is there a simple way to pattern match in arbitrary places like let blocks?
18:16 swalladge joined
18:17 <CoolerZ> i end up making everything into records just so i can access the fields without pattern matching
18:17 mdarse joined
18:17 <glguy> CoolerZ: sure, you can use patterns with let
18:17 iomonad joined
18:18 hakan[m] joined
18:18 chrzyki joined
18:18 zar[m] joined
18:18 Oliphaunte joined
18:18 pellegrino joined
18:18 Naughtmare[m] joined
18:19 umren joined
18:19 tiny_test joined
18:19 aspiwack[m] joined
18:19 meba joined
18:19 TesX[m] joined
18:19 henriksod joined
18:19 nick2000 joined
18:19 jmnoz[m] joined
18:20 <CoolerZ> glguy, how
18:20 mohsen_1 joined
18:21 metaporia joined
18:21 <jmcarthur> > let (a, b) = ("foo", 42) in a ++ show b -- CoolerZ
18:21 <lambdabot> "foo42"
18:21 ph88_ joined
18:21 dejanr joined
18:22 roconnor joined
18:22 falafel joined
18:23 <CoolerZ> ok
18:23 jsgrant_om joined
18:23 hanna joined
18:24 albertus1 joined
18:26 tomphp joined
18:27 orion__ joined
18:27 revprez_atlanta joined
18:28 ckubrak joined
18:28 funrep joined
18:28 takle joined
18:28 orion joined
18:29 insitu joined
18:30 jaziz joined
18:31 bloogie joined
18:31 caumeslasal joined
18:32 <CoolerZ> glguy, can you pattern match and change control flow in let blocks?
18:32 <CoolerZ> depending on which pattern got matched
18:32 <bloogie> book recommendations for equational reasoning?
18:32 tzh joined
18:32 bennofs1 joined
18:32 commanderinchief joined
18:33 <Tuplanolla> bloogie: http://www.cis.upenn.edu/~bcpierce/sf/
18:34 takle joined
18:35 chaosmasttter joined
18:35 <bloogie> Tuplanolla: thanks, although this seems to involve Coq - can you suggest something more Haskelly? Unless Haskell isn't as great for this.
18:35 justinfokes joined
18:35 <Tuplanolla> Nope.
18:36 fgaz-swoosh joined
18:37 <bloogie> what about Bird's Algebra of Programming? anyone have anything to say about that?
18:37 <cocreature> bloogie: “pearls of functional algorithm design” shows you how to improve the performance of Haskell algorithms using equational reasoning
18:37 <* hackage> eventful-sql-common 0.1.0, eventful-postgresql 0.1.0, eventful-memory 0.1.0, eventful-dynamodb 0.1.0, eventful-core 0.1.0, eventful-test-helpers 0.1.0, eventful-sqlite 0.1.0 (jdreaver): https://qbin.io/e0bidrx
18:38 dan_f joined
18:38 <jmcarthur> CoolerZ: You can define functions using let that do that, but you can't use let like a case expression. In that case, just use case.
18:39 <* hackage> websockets-simple 0.0.6 - Simpler interface to the websockets api https://hackage.haskell.org/package/websockets-simple-0.0.6 (athanclark)
18:40 fizruk joined
18:43 sigmundv__ joined
18:43 <lpaste> Gurkenglas pasted “Warning: Code golf. The second times out, the first doesn't. What gives? I just defined Tree locally :I” at http://lpaste.net/355501
18:43 <EvanR> but you can use case like a let
18:44 <EvanR> case can do anything
18:45 <Tuplanolla> You probably want `~(N a _)` and `~(N _ a)`, Gurkenglas.
18:46 <Gurkenglas> Ah, makes sense.
18:46 <Gurkenglas> still times out
18:47 SkyPatrol_ joined
18:47 juanpaucar joined
18:47 yqt joined
18:47 theta8 left
18:47 Mibaz joined
18:48 <Tuplanolla> It's going to be less obvious then...
18:48 <Tuplanolla> Does the unfolding work as intended?
18:48 funrep joined
18:49 jimmyrcom joined
18:50 darlan joined
18:51 <Gurkenglas> The new version (even without ~) works on small cases
18:51 mmhat joined
18:53 <CoolerZ> this seems like it could be better http://lpaste.net/355502
18:53 FreeBirdLjj joined
18:53 <CoolerZ> is there a better way to right that?
18:53 <Gurkenglas> Actually, why would ~ be necessary? j always lazily returns an N
18:54 <Tuplanolla> It might not be. I didn't read it too carefully.
18:54 argent0 joined
18:54 <EvanR> Gurkenglas: its cases like that where ~ is useful
18:54 <EvanR> since you dont need to check now that it actually is an N
18:55 <EvanR> the expression returning an N doesnt need to be evaluated yeet
18:55 <Gurkenglas> Why not evaluate it? It's going to be used anyway, and soon
18:56 <EvanR> i didnt look at your code, you might be right, in which case you want ! instead ;)
18:56 <EvanR> in other situations you *must* use ~ for any progress to be made
18:56 <EvanR> due to recursion
18:57 pgiarrusso joined
18:58 connrs joined
18:58 <Gurkenglas> The unfold looks like "j s = N (f x) $ map (j . (:s)) [0..]", what differences can ~ possibly make when folding that?
18:59 <EvanR> none because the pattern is just s
18:59 oisdk joined
18:59 <* hackage> postgrest-ws 0.3.1.0 - PostgREST extension to map LISTEN/NOTIFY messages to Websockets https://hackage.haskell.org/package/postgrest-ws-0.3.1.0 (diogob)
19:00 18VAA6DNS joined
19:00 Dookie12 joined
19:00 <Gurkenglas> No, when folding. ("g [] (N a _) = a; g (x:s) (N _ a) = g s $ a !! x")
19:00 shayan_ joined
19:00 Dookie14 joined
19:01 <EvanR> it doesnt look like any tricky recursion is going on with the N
19:01 <Gurkenglas> therefore ~ and ! are irrelevant, right?
19:01 dm3 joined
19:01 <EvanR> ~ seems to be
19:02 <EvanR> whats N
19:02 <Gurkenglas> (By the way, how should I have done those two in order to not need a reverse to convert between arguments to f and g?)
19:02 <Gurkenglas> "data T a = N a [T a]"
19:04 darjeeling_ joined
19:04 systemfault joined
19:04 funrep joined
19:04 ph88_ joined
19:04 blym_ joined
19:05 <EvanR> no idea whats going on in that code
19:06 dm3_ joined
19:06 <ph88_> does someone know how to change process priority on stack ghci ? often it freezes my laptop
19:06 <EvanR> renice command?
19:06 doyougnu joined
19:07 <hexagoxel> ph88_: you sure you are not just running out of memory?
19:08 <hexagoxel> swapping makes for much nicer freezing than cpu contention ever could, in my experience.
19:08 JeanCarl1Machado joined
19:08 grayjoc joined
19:09 <hexagoxel> (and i doubt priority has much of an effect in that case)
19:09 bonz060 joined
19:09 <* hackage> eventful-sqlite 0.1.1, eventful-sql-common 0.1.1, eventful-postgresql 0.1.1, eventful-memory 0.1.1, eventful-dynamodb 0.1.1, eventful-core 0.1.1, eventful-test-helpers 0.1.1 (jdreaver): https://qbin.io/slm0ycw
19:09 <[exa]> maybe forkbombs?
19:10 <ph88_> hexagoxel, yeah it could be that i'm running out of memory .. is there a way to limit the memory that can be used ?
19:10 tomphp_ joined
19:10 <[exa]> ph88_: you might want to run htop in a terminal next to ghci to see how it dies
19:10 ziocroc joined
19:10 <EvanR> look at that beautiful hackage notification merging
19:10 <EvanR> ^
19:10 <EvanR> amazonked nomore
19:11 <[exa]> ph88_: anyway, ulimit -m <kilobytes>
19:11 <MarcelineVQ> I'd start with trying stack -j1 and see if it cuts down at all
19:11 <hexagoxel> ph88_: you can pass "+RTS -M1G" or some such as arg to ghci. no idea how to get that through stack.
19:12 Sgeo_ joined
19:12 <ph88_> oh ok
19:13 <MarcelineVQ> how are you using stack when you have the problem? are you calling it yourself or is some editor calling it for you?
19:13 {emptyset} joined
19:13 Oliphaunte joined
19:14 <ph88_> self
19:14 <MarcelineVQ> then I'd try -j1 or --jobs=1 first
19:14 Destol joined
19:15 <hexagoxel> arguments that affect stack won't do you any good when it is the ghc(i) process eating memory.
19:15 <ph88_> even when i quit ghci it keeps running in the background and i have to do kill -9
19:17 <lpaste> Gurkenglas annotated “No title” with “CoolerZ, have some refactoring. I'd use lens and State monads.” at http://lpaste.net/355502#a355503
19:17 chaosmasttter joined
19:17 <Gurkenglas> CoolerZ, if you want, I can annotate what that code would look like using lens and state monads
19:18 oakley91 joined
19:20 dan_f_ joined
19:20 ClaudiusMaximus joined
19:21 ph88_ joined
19:21 <CoolerZ> Gurkenglas, whats the @ symbol?
19:22 <Myrl-saki> Is it possible to deadlock the compiler?
19:22 <Myrl-saki> I think I just did...
19:22 <Tuplanolla> Yes, Myrl-saki.
19:22 <Gurkenglas> CoolerZ, http://stackoverflow.com/questions/30326249/what-does-mean-in-haskell
19:22 <Myrl-saki> What should I do...
19:22 <mauke_> ^C
19:22 qwertydvorak left
19:22 <Tuplanolla> That and get rid of your undecidable instances.
19:23 <Myrl-saki> I don't have UndecidableInstances in my own program.
19:23 <Myrl-saki> {-# LANGUAGE RankNTypes, OverloadedStrings, FlexibleContexts, GADTs, TupleSections #-}
19:24 insitu joined
19:24 funrep joined
19:25 <CoolerZ> Gurkenglas, won't lens and state make the code longer?
19:25 dual joined
19:26 tomphp joined
19:28 <CoolerZ> on line 2 is there a need for graph@ ? http://lpaste.net/355502#a355503
19:28 <CoolerZ> since graph is never used
19:28 msks joined
19:30 <Gurkenglas> CoolerZ, right, it was originally passed to go and I didnt check again after eliminating go
19:31 msks joined
19:32 <lpaste> Gurkenglas annotated “No title” with “CoolerZ, I guess there aren't many opportunities to sweeten lens in this one.” at http://lpaste.net/355502#a355504
19:32 <EvanR> someone explain to me the logic: why a newtype must have exactly one field and not zero ?
19:33 <Gurkenglas> afaik its because they're desugared out of existence, replaced by what they're wrapping
19:33 <EvanR> i see, they have to be based on something
19:34 <EvanR> they are purely a type, and not a type plus a real runtime plan
19:34 pgiarrusso_ joined
19:34 msks joined
19:34 fsestini joined
19:34 <Gurkenglas> They don't even add a bottom to what they wrap
19:35 <EvanR> if i want something like () though
19:36 <EvanR> (wait does that even have runtime existence)
19:36 <MarcelineVQ> > show ()
19:36 <lambdabot> "()"
19:36 <EvanR> thats in the instance for Show () ...
19:37 <MarcelineVQ> for showing a 'value' of ()
19:37 <EvanR> ok so something is passed into that function
19:37 <hexagoxel> > show (undefined :: ())
19:37 <Myrl-saki> :t for
19:37 <lambdabot> "*Exception: Prelude.undefined
19:37 <lambdabot> (Applicative f, Traversable t) => t a -> (a -> f b) -> f (t b)
19:37 <EvanR> that is funny
19:38 augur joined
19:39 <hpc> > show (error undefined :: ())
19:39 <lambdabot> "*Exception: *Exception: Prelude.undefined
19:39 <EvanR> this is preposterous
19:39 <hpc> > fix eror
19:39 <lambdabot> error:
19:39 <lambdabot> • Variable not in scope: eror :: a -> a
19:39 <lambdabot> • Perhaps you meant ‘error’ (imported from Prelude)
19:39 <hpc> > fix error
19:39 <lambdabot> "*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex...
19:39 <hexagoxel> fixed!
19:39 <EvanR> all the functions for () evaluate it?
19:39 <EvanR> to see if they crash?
19:40 <hexagoxel> the strict ones do..
19:40 <EvanR> show says "hmm... lets see if theres a (... good now checking for )" ;)
19:40 funrep joined
19:40 <hpc> i would be surprised if it's consistent, generally you don't use undefined :: () anywhere
19:40 <hexagoxel> > let f ~() = () in f undefined
19:40 <lambdabot> ()
19:41 Hunter1 joined
19:41 <EvanR> ah its whether they wrote () there or _
19:41 <EvanR> or ~()
19:41 dual joined
19:41 yellowj joined
19:42 tommd joined
19:43 Xerus joined
19:43 tomphp joined
19:44 Yuras joined
19:44 ngastyle joined
19:45 fosterite joined
19:45 dan_f joined
19:46 nshepperd joined
19:46 <* hexagoxel> now wonders if it is impossible to newtype unboxed types..
19:46 jsgrant_om joined
19:46 <glguy> hexagoxel: The topic has been discussed, but it's not presently supported afaik
19:47 ragepanda joined
19:49 Maxdamantus joined
19:49 <* hackage> threepenny-editors 0.2.0.5 - Composable algebraic editors https://hackage.haskell.org/package/threepenny-editors-0.2.0.5 (PepeIborra)
19:51 juanpaucar joined
19:52 mac10688 joined
19:54 commanderinchief joined
19:54 theelous3 joined
19:56 oisdk joined
19:56 jmcarthur joined
19:57 Iscariot joined
19:57 mekeor joined
19:58 Iscariot left
19:59 ckubrak joined
19:59 <nilof> > foldr (\x y -> print x >> y) (return ()) [1,3..99]
19:59 <lambdabot> <IO ()>
20:00 <nilof> This prints 1, 3, .. 99
20:00 <nilof> but this
20:00 hiroaki joined
20:00 <nilof> > foldr (\x y -> print x >> return () ) (return ()) [1,3..99]
20:00 <lambdabot> <IO ()>
20:00 <nilof> just prints 1
20:00 funrep joined
20:01 <nilof> I'm confused
20:01 <monochrom> This is because y is unused.
20:01 commanderinchief joined
20:03 tommd joined
20:04 <glguy> foldr (\x y -> print x >> return () ) (return ()) [1,3..99] ==> (\x y -> print x >> return ()) 1 (foldr (\x y -> print x >> return () ) (return ()) [3,5..99]) ==> print 1 >> return ()
20:05 <nilof> ah right
20:05 <nilof> it doesn't evaluate the second argument
20:06 ziocroc joined
20:06 Itkovian joined
20:06 <mekeor> i'm trying to load source code into ghci with `ghci xmonad.hs` and it fails. can i find out which package versions (of `xmonad` and `xmonad-contrib` packages) it's using?
20:07 <glguy> ghc-pkg list xmonad, for example
20:07 <mekeor> thanks
20:07 doomlord joined
20:08 <glguy> ghci something.hs doesn't load a package called something, it opens a file called something.hs, fwiw
20:08 <mekeor> yes, that's what i said or what i meant
20:09 <dmj`> nilof: in your first example you’re building up an expression, and then evaluating it (y is the ‘accumulator’ of the print expression). In your second example you’re discarding the built-up expression, printing the first number.
20:10 fizruk joined
20:10 darthThorik joined
20:10 <dmj`> :t foldr (\(x :: Int) (y :: IO ()) -> undefined)
20:10 <lambdabot> Foldable t => IO () -> t Int -> IO ()
20:10 mbrcknl joined
20:10 <glguy> In the case of foldr, it's less of a built-up accumulator than like in foldl
20:11 <glguy> the rest of the list will be completely untouched at this point
20:13 <dmj`> right, ‘y’ (better named ‘accum’) represents the chain of print x >> print x >> … etc.
20:14 mmhat joined
20:15 sellout- joined
20:15 cyborg-one joined
20:16 <glguy> It would have evaluated to that action, but wasn't evaluated. instead it's still just a foldr...
20:16 funrep joined
20:18 sellout-1 joined
20:18 <dmj`> glguy: yea, still a foldr
20:20 meba joined
20:26 chrissl joined
20:27 <ertes> nilof: http://ertes.eu/tutorial/foldr.html
20:28 Hunter1 joined
20:28 prkc joined
20:29 sepp2k1 joined
20:30 fnurglewitz joined
20:30 dual joined
20:31 Prutheus joined
20:31 p0a joined
20:32 oish joined
20:35 funrep joined
20:35 MarioBranco joined
20:35 svuk joined
20:36 <EvanR> heh... running into "the log problem"
20:37 <EvanR> top level TBQueue global time
20:38 CoderPuppy joined
20:39 oisdk joined
20:39 Oliphaunte joined
20:40 Trendrrr joined
20:41 mekeor joined
20:41 <ckubrak> I'm getting this when I'm runninig cabal install hoogle: "hoogle-5.0.12 depends on haskell-src-exts-1.19.1 which failed to install."
20:42 cpup joined
20:42 ph88_ joined
20:42 <mekeor> ckubrak: i guess we need more logs
20:43 cpup- joined
20:44 Destol joined
20:46 <ckubrak> mekeor: https://gist.github.com/574576443e843fcfad2cfaa008da48ea
20:47 <phadej> ckubrak: install happy
20:47 cpup joined
20:47 <ckubrak> ok
20:47 chrisM_1 joined
20:47 Itkovian joined
20:47 <phadej> and probably alex too
20:49 Destol joined
20:51 tommd joined
20:51 juanpaucar joined
20:51 <ckubrak> It's installing thanks
20:53 bjz joined
20:53 revprez_atlanta joined
20:53 coot____ joined
20:54 Rotaerk joined
20:54 <Rotaerk> is there something like OverloadedStrings but for single characters?
20:55 <hpc> don't think so
20:55 <Rotaerk> so that 'x' can be a Word8 instead of a Char
20:55 <hpc> ... i went to the ghc manpage to look for it and discovered i don't actually have ghc installed
20:55 <hpc> only stack
20:55 <Rotaerk> heh
20:56 <hpc> to the yum-mobile!
20:56 ericdwhite joined
20:56 <hpc> "Installing : ghc-ghc-7.10.3-51.fc25.x86_64" heh
20:56 <hpc> good old ghc-ghc
20:57 Jarl joined
20:57 <EvanR> fix ("ghc-" ++)
20:58 strykerkkd joined
20:58 <rightfold> > 'x' :: Int
20:58 <lambdabot> error:
20:58 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘Char’
20:58 <lambdabot> • In the expression: 'x' :: Int
20:59 <hpc> 7.10's manpage only contains "char" in the word "discharging", so i would assume it doesn't exist
20:59 ertesx joined
21:02 <rightfold> There is no IsChar constraint to discharge
21:04 commanderinchief joined
21:04 eschnett joined
21:06 tommd joined
21:10 <* hackage> microformats2-parser 1.0.1.7 - A Microformats 2 parser. https://hackage.haskell.org/package/microformats2-parser-1.0.1.7 (myfreeweb)
21:11 <ertes> ij: still there?
21:11 <ij> ertes, Sorta, yes.
21:12 <ertes> video is ready… let me see if i can upload it =)
21:13 <ertes> i have messed up a few parts, but it's already my second take, so i'm not gonna redo it
21:13 p0a left
21:14 biglama joined
21:14 ChaiTRex joined
21:14 <bloogie> say I want to find the index of the first True element in a sorted list of bool, is there a way more efficient than elemIndex from Data.List?
21:15 tommd joined
21:15 <ezyang> not if it's a singly linked list
21:15 <ChaiTRex> bloogie: You have to traverse the list, so probably not.
21:16 <bloogie> "probably"?
21:16 <ChaiTRex> bloogie: There might be some way that's very minimally more efficient.
21:16 <bloogie> ezyang: the standard Haskell [] is singly linked, right?
21:16 <hpc> ironically, this is one of the rare operations that's guaranteed to speed up or stay the same if the list is unsorted
21:16 <ChaiTRex> bloogie: For example, if you specialize it to Boolean.
21:16 <bloogie> hpc: speed up?
21:16 <bloogie> ChaiTRex: o_O
21:17 <bloogie> how in the world does that help?
21:17 <hpc> bloogie: because the first True is earlier in the list
21:17 <ezyang> yes
21:17 <ChaiTRex> bloogie: Specializing it to Boolean?
21:17 <ezyang> yes, sorted list is pessimal
21:18 halogenandtoast joined
21:18 <monochrom> Binary search takes linear time. :)
21:18 juanpaucar joined
21:19 dual joined
21:19 <hpc> does linear search take binary time? ;)
21:19 <monochrom> Yes! All times are binary times. :)
21:19 <* monochrom> uses base 10.
21:20 <ChaiTRex> Everyone uses base 10.
21:20 <hpc> all bases are base 10
21:20 <monochrom> \∩/
21:21 <bloogie> oh look, 10 people have now made the same joke
21:21 <hpc> bloogie: anyway, let this whole line of questioning be a lesson in knowing your data structures ;)
21:21 wolfsif joined
21:22 <hpc> as dopey as it is for every job interview ever to begin with "write quicksort and a hash table", they really are that important
21:22 <athan_> Which is smarter - MonadRec, or using TMVars and async threads?
21:23 <monochrom> What is MonadRec?
21:23 <athan_> er, wait
21:23 <athan_> MonadFix :c
21:23 <ezyang> recursive do?
21:23 <ezyang> define "smart"
21:23 <monochrom> Incomparable.
21:23 <athan_> gooder :v
21:23 <athan_> hmm, yeah I'm just thinking about this problem wrong I think
21:23 justan0theruser joined
21:24 kamyar joined
21:24 <athan_> basically, in a callback, I need access to a value that's returned. So, If the value is returned _before_ the callback is called, then I could stash it in a TMVar and block until it's available in my callback
21:25 <ij> ertes, Cool! I will take a look whenever you send it to me and when I've time.
21:25 <ezyang> anyone have a good example of when circular dependency is really useful
21:25 <ezyang> athan_: I doubt MonadFix will work for this case
21:25 <ezyang> (but I have not thought about it closely)
21:26 <hpc> ezyang: nope, they're useless
21:26 <ezyang> let he who has never written an hs-boot file cast the first stone
21:26 <hpc> he already has :D
21:27 <hpc> ezyang: consider modules A and B that are mutually dependent
21:27 <hpc> ezyang: importing A necessarily imports B
21:27 <* hackage> hexpat-lens 0.1.5 - Lenses for Hexpat. https://hackage.haskell.org/package/hexpat-lens-0.1.5 (JosephAbrahamson)
21:27 <hpc> importing B necessarily imports A
21:27 dcoutts joined
21:27 <hpc> there's no separation of concerns, so neither A or B can really be considered modules
21:28 <ezyang> well, not if they're programming against interfaces
21:28 <hpc> what else would you program against?
21:29 <ChaiTRex> hpc: Implementations.
21:29 <ezyang> I'm just saying that if A imports an interface of B, and B imports an interface of A, there is credible implementation hiding going on
21:29 <hpc> ah, that's fair
21:29 jbalint joined
21:29 jbalint joined
21:29 <hpc> i would still hesitate to call it modularity though
21:30 <hpc> but maybe that's a use for mutual imports
21:30 <hpc> i have always approached that problem from the perspective that the interface is wrong
21:31 <ezyang> Yes, this is sort of why I am asking; conventional wisdom is that you can always acylicify it
21:31 <ezyang> but I feel like in the real world things never end up so nice
21:33 kamyar joined
21:33 <athan> ezyang: Ahh wow okay I thought so. Have you figured out a better way to do this? Or is a TMVar probably the best bet?
21:34 <ezyang> athan: So, who is generating these callbacks
21:34 tommd joined
21:34 <ezyang> the first recommendation in Haskell is to take advantage of our green threads, and use blocking calls!
21:34 <ezyang> The example I am going to us is of a DB API and a logging API, where you wanted the DB to log, and the logger to log to DB
21:35 zeroed joined
21:35 zero_byte joined
21:36 Itkovian joined
21:38 <kamyar> Hello friends
21:38 Immune_ joined
21:38 silver_ joined
21:39 <kamyar> I have written a project using Persistent and POstgresql
21:39 jrm2 joined
21:39 <kamyar> Now I want to migrate to groundhog
21:39 mikecaruso1 joined
21:39 <kamyar> But I cant find a 'connection pool' sample in groundhog
21:39 <kamyar> for postgresql I mean
21:40 Sgeo__ joined
21:40 implementation_ joined
21:41 hawara joined
21:41 joeytwiddle joined
21:41 \q joined
21:41 \q joined
21:41 juanpaucar joined
21:41 barrucad1 joined
21:41 barrucad1 joined
21:41 nocookie192 joined
21:41 baroncha1lus joined
21:41 Rabbit_ joined
21:41 <hpc> ezyang: i think for that, i would factor it out by first considering that "DB" isn't an atomic concept
21:41 myrl joined
21:41 waylon531 joined
21:42 alphawaffle joined
21:42 <hpc> ezyang: and that the lower layers of that concept would have logging baked in
21:42 j_king_ joined
21:42 jameseb- joined
21:42 julmac joined
21:42 reinh1 joined
21:42 <ezyang> you mean... higher levels?
21:42 dmwit joined
21:42 vili- joined
21:42 darjeeli1 joined
21:42 Tristan-Speccy joined
21:42 nurupo_ joined
21:42 eyen_ joined
21:42 d3lxa_ joined
21:42 djanatyn1 joined
21:42 <hpc> then on top of some primitive db concept, you put the actual db interface which is logged
21:42 tumdedum_ joined
21:42 parsnip0 joined
21:42 a3f_ joined
21:42 dm3 joined
21:42 bencryption_ joined
21:42 henrytill_ joined
21:42 <hpc> and a slightly more direct interface to the low-level logging separately
21:42 xax__ joined
21:43 padre_angolano joined
21:43 zowlyfon_ joined
21:43 fizruk joined
21:43 theorb joined
21:43 oisdk joined
21:43 bsima joined
21:43 Adios joined
21:43 Yuras_ joined
21:43 <hpc> now you have logging and db somewhat modularized
21:43 sdrodge_ joined
21:43 mitchty joined
21:43 <* hackage> Villefort 0.1.0.4 - Villefort is a task manager and time tracker written in haskell. https://hackage.haskell.org/package/Villefort-0.1.0.4 (ChrisReuter)
21:43 xxpor joined
21:43 niklasb joined
21:43 niklasb joined
21:43 monochrom joined
21:45 c-rog joined
21:47 <hawara> hi guys i just wanted to thank you for helping me with my assignments last semester :-)
21:47 justinfokes joined
21:47 quuxman joined
21:49 PlasmaStar joined
21:51 <ertes> ij: sorry it took forever… i didn't expect uploading to be this complicated: https://www.youtube.com/watch?v=sR9p_aQncRo
21:52 <ertes> ij: it's not time lapse as promised, but live speed… feel free to speed it up
21:52 shoopaloop joined
21:53 hiratara joined
21:54 <bennofs1> ertes: everybody got their own little templating script :)
21:55 <ertes> bennofs1: mine doesn't do much more than cloning my skeleton repo and replacing a few things =)
21:56 mac10688 joined
21:57 <bennofs1> ertes: what's the split editor where it displays the same file twice for?
21:58 ckubrak joined
21:58 <ertes> bennofs1: the bottom one automatically jumps to the imports, and i can freely move around there… when i'm done, i just "return"
21:59 <bennofs1> ah
21:59 <bennofs1> so like emacs marks?
21:59 <ertes> yeah, basically marks without having to memorise extra key bindings =)
21:59 <ertes> except one for "return", which does some extra things: sort imports and language pragmas
22:00 bjz joined
22:01 shoopaloop joined
22:02 aring joined
22:02 sleffy joined
22:05 jutaro joined
22:06 doomlord joined
22:07 blym_ joined
22:07 aib joined
22:08 <* hackage> Villefort 0.1.0.5 - Villefort is a task manager and time tracker written in haskell. https://hackage.haskell.org/package/Villefort-0.1.0.5 (ChrisReuter)
22:09 funrep joined
22:09 dual joined
22:11 marr joined
22:12 metaporia joined
22:17 mekeor joined
22:17 <Lokathor> how paranoid should i be that a gl function that's supposed to return GL_TRUE or GL_FALSE might return something else?
22:17 funrep joined
22:18 <EvanR> o_O
22:19 <Lokathor> hey it's a fair question
22:19 <Tuplanolla> I'd let it crash at that point.
22:19 <EvanR> i would hope it would crash
22:19 <EvanR> which is the question
22:19 JoshS joined
22:19 <Tuplanolla> I mean the C kind of crash.
22:19 <EvanR> if it returns a different number, it would be interprted as TRUE right
22:20 <EvanR> since its not FALSE
22:20 <EvanR> no one would ever know
22:20 <Lokathor> fair point
22:20 mjora7 joined
22:21 meba joined
22:22 <ertes> Lokathor: if you have read the official docs or even the spec, you don't need to be paranoid at all
22:23 <Lokathor> ertes, i mean it says GL_TRUE if successful, and GL_FALSE otherwise, but the types themselves don't literally prevent another value from somehow showing up
22:23 <Lokathor> that's all
22:24 <Tuplanolla> My interpretation is that if your graphics drivers are that broken, a kernel panic would be in order.
22:24 <mekeor> Lokathor: maybe you could take a look at the code of the function and look up if it returns somethings else in some cases
22:24 <ertes> Lokathor: that's because it's a direct binding to the C API, which doesn't have the type system capabilities to support stricter return values
22:24 <ertes> Lokathor: C doesn't even have proper booleans
22:25 <ertes> that's why you need to rely on prose here
22:25 <Lokathor> ertes, i know that C doesn't have that, and i'm referring to the C docs that said that, not the gl docs
22:25 <Lokathor> mekeor, unforunately the source for opengl drivers is all closed :P
22:25 <Lokathor> that's the point after all
22:25 <ertes> Lokathor: i have found that the official OpenGL man pages are reliable… however, don't rely on the OpenGL wiki
22:26 <EvanR> my open source graphics drivers are that broken and freeze the entire system after 3 minutes :(
22:26 markasoftware joined
22:26 <* EvanR> thanks Tuplanolla
22:26 <Lokathor> https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetShaderiv.xml ertes are these ones what you mean?
22:26 <ertes> Lokathor: yeah
22:27 romank joined
22:27 <ertes> Lokathor: note that there are man pages for each OpenGL version and variant… be sure to read the ones you're actually using
22:27 <Lokathor> yeah i just noted that in the URL
22:27 <ertes> this is OpenGL 4 for instance: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
22:27 <Lokathor> doesn't seem to be 3.3 pages exactly..
22:28 <ertes> Lokathor: i have a keyword search in my browser for each variant =)
22:28 <ertes> when i type "gl glIsTexture" into the address bar, it takes me here: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
22:30 <Lokathor> https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShader.xhtml seems to be the same as before
22:30 <Lokathor> i will check for "if success == GL_TRUE" and then assume a failure otherwise, as they say
22:31 hiratara joined
22:32 hybrid joined
22:32 MarioBranco joined
22:33 araujo joined
22:33 araujo joined
22:33 Destol joined
22:34 jbalint joined
22:34 jbalint joined
22:34 <Mibaz> Is FRP a fancy functional version of the observer pattern?
22:35 <Mibaz> or is there something more that I'm missing?
22:35 <ertes> Mibaz: there is more
22:36 <ezyang> "is React a fancy version of observer pattern"
22:36 <ertes> Mibaz: FRP turns time-varying values and events into first-class pure values that you can manipulate using pure functions
22:37 ian-mi joined
22:37 <phadej> observer pattern < data-flow programming < frp
22:37 anuxivm joined
22:37 <* hackage> Villefort 0.1.0.6 - Villefort is a task manager and time tracker written in haskell. https://hackage.haskell.org/package/Villefort-0.1.0.6 (ChrisReuter)
22:38 funrep joined
22:39 <Mibaz> Ah, I see. So the two things aren't really comparable; FRP might use something similar to observer under the hood, I assume?
22:39 <Mibaz> But the goal is more
22:40 ult joined
22:41 Sgeo joined
22:42 <EvanR> theyre not comparable
22:42 <EvanR> in fact neither is very specific jargon for anything
22:44 kamyar joined
22:44 <kamyar> Hello fellows
22:44 <mekeor> hello kamyar
22:45 <kamyar> I am using groundhog
22:45 <kamyar> please help me fix this code
22:45 <kamyar> http://lpaste.net/355507
22:45 <kamyar> It is template Haskell and the error is not so clear
22:45 juanpaucar joined
22:45 <kamyar> Do I need to attach it?
22:46 <glguy> Only attach the error if you want help with it
22:46 <EvanR> if and only if?
22:47 <kamyar> I did. plz refresh
22:48 <kamyar> It is just part of error! It is very long since the code is generated by TH
22:48 Destol joined
22:50 exarkun joined
22:51 <glguy> the first line of the error suggests that this persistent package doesn't support uuids, do you know that it should?
22:52 Big_G joined
22:52 <* hackage> crdt 0.1 - Conflict-free replicated data types https://hackage.haskell.org/package/crdt-0.1 (cblp)
22:52 justinfokes joined
22:56 <Lokathor> http://lpaste.net/355509 pretty cool
22:57 srpx joined
22:57 dual joined
22:58 justinfokes joined
22:59 funrep joined
23:00 SkyPatrol joined
23:02 MasseR joined
23:03 twomix joined
23:03 blym_ joined
23:06 eacameron joined
23:07 SkyPatrol joined
23:09 slack1256 joined
23:11 blym_ joined
23:11 Levex joined
23:15 SkyPatrol joined
23:15 lambda-11235 joined
23:19 funrep joined
23:25 Shatnerz joined
23:26 rcschm joined
23:27 StoneToad joined
23:28 <* hackage> language-dockerfile 0.3.6.0 - Dockerfile linter, parser, pretty-printer and embedded DSL https://hackage.haskell.org/package/language-dockerfile-0.3.6.0 (yamadapc)
23:38 theDon_ joined
23:39 JeanCarloMachado joined
23:39 JeanCarl1Machado joined
23:40 markus1209 joined
23:40 funrep joined
23:41 markus1219 joined
23:41 halogenandtoast joined
23:43 louispan joined
23:46 dual joined
23:46 rcat joined
23:47 ddere joined
23:47 augur joined
23:50 conal joined
23:50 JeanCarloMachado joined
23:50 JeanCarl1Machado joined
23:51 eacameron joined
23:56 e14 joined
23:57 Jesin joined
23:57 nakal joined
23:58 alveric joined
23:58 eacameron joined
23:59 infinity0_ joined
23:59 YongJoon joined
23:59 crobbins joined
23:59 infinity0_ joined
23:59 crobbins joined