<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:01 marvin2 joined
00:10 uglyfigurine joined
00:13 Axman6 joined
00:22 eacameron joined
00:23 jgertm joined
00:29 binaryplease joined
00:33 <Durbley> `<$>' is not a (visible) method of class `Functor'
00:33 <Durbley> writing a Functor and applicative for reader
00:33 <Durbley> ???
00:35 <geekosaur> yes. it's an infix alias for the class method which is fmap
00:36 <Durbley> so I have to use "fmap"?
00:36 Kuros` joined
00:37 <monochrom> Yes.
00:37 <Durbley> o
00:37 <Durbley> k
00:46 eacameron joined
00:51 eacameron joined
00:55 eacamero_ joined
00:55 mac10688 joined
01:00 eacameron joined
01:04 DataComputist joined
01:09 roboguy` joined
01:09 conal joined
01:10 eacameron joined
01:11 asdf_ joined
01:18 eacameron joined
01:26 circ-user-oryB7 joined
01:35 mthek joined
01:39 Rodya_ joined
01:51 karls joined
01:53 eacameron joined
01:54 malaclyps joined
01:58 oscarvarto joined
01:59 uglyfigurine joined
02:03 mac10688 joined
02:05 roboguy` joined
02:06 roboguy` joined
02:09 louispan joined
02:13 andyhoang joined
02:13 takle joined
02:15 exferenceBot joined
02:18 geekosaur joined
02:19 circ-user-oryB7 joined
02:19 hexagoxel joined
02:27 DataComputist1 joined
02:39 HallaSurvivor joined
02:40 Rodya_ joined
02:44 gpolitis joined
02:55 argent0 joined
03:08 takle joined
03:29 malaclyps joined
03:33 ebsen joined
03:35 takle joined
03:48 uglyfigurine joined
04:04 uglyfigurine joined
04:07 Sose joined
04:18 takle joined
04:32 Rodya_ joined
04:34 takle joined
04:38 malaclyps joined
04:38 roboguy` joined
04:41 louispan joined
04:42 Ferdirand joined
04:47 takle joined
04:59 takle joined
05:05 ultalbot joined
05:06 houli_ joined
05:06 AlainODea_ joined
05:06 metalrain_ joined
05:06 feepo_ joined
05:07 joel135_ joined
05:07 rizary_ joined
05:07 makufiru_ joined
05:08 kadoban joined
05:09 chindy_ joined
05:09 drtop joined
05:09 damncabb1ge joined
05:09 zerokarm1left joined
05:09 meck_ joined
05:09 tjt__ joined
05:11 machuga_ joined
05:12 x1n4u- joined
05:12 azahi joined
05:12 sbrg_ joined
05:12 snsapiens joined
05:13 condy_ joined
05:14 takle joined
05:16 Geekingfrog joined
05:16 Deaddy joined
05:18 codedmart joined
05:19 wedens joined
05:20 gspia joined
05:21 majoh joined
05:22 diamat joined
05:22 unclechu joined
05:22 SaidinWoT joined
05:30 Sose joined
05:32 pdgwien joined
05:33 peterbecich joined
05:33 Kuros joined
05:34 louispan joined
05:35 takle joined
05:36 yellowj joined
05:37 madgoat joined
05:37 madgoat left
05:39 uglyfigurine joined
05:40 Kuros joined
05:43 andyhoang joined
05:48 takle joined
05:48 ThomasLocke joined
05:56 Levex joined
05:57 meandi_2 joined
06:03 Durbley_ joined
06:04 <peterbecich> Hi there, I'd appreciate a hint with this question for the NICTA/Data61 course. https://github.com/peterbecich/fp-course/blob/master/src/Course/Extend.hs#L76-L77
06:05 <peterbecich> cojoin (1 :. 2 :. 3 :. 4 :. Nil) returns [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]] . Correct answer is [[1,2,3,4],[2,3,4],[3,4],[4]]. The other tests for cojoin are correct. I suspect the problem is in the implementation of Extend for Lists: https://github.com/peterbecich/fp-course/blob/master/src/Course/Extend.hs#L42-L48 Thank you
06:05 takle joined
06:06 <dibblego> here is a hint, remove the left side of <<= and then figure out what type goes there, and put something of that type there
06:06 <peterbecich> dibblego: thanks, will do
06:12 eacameron joined
06:13 <peterbecich> dibblego: Perfect hint, I fixed it. Thank you!
06:15 nick_h joined
06:16 kritzcreek_ joined
06:17 Ferdirand joined
06:19 thoradam joined
06:21 louispan joined
06:23 Levex joined
06:24 galderz joined
06:29 Pupnik joined
06:42 eacameron joined
06:49 louispan joined
06:51 levex_ joined
06:53 thc202 joined
06:58 Gurkenglas_ joined
06:58 Rodya_ joined
07:05 eacameron joined
07:06 <dibblego> :)
07:06 Levex joined
07:10 takle joined
07:10 Gloomy joined
07:12 sherub1 joined
07:14 Nycatelos joined
07:14 sdx23 joined
07:15 zph joined
07:29 takle joined
07:29 mattyw joined
07:31 Durz0 joined
07:34 nacon joined
07:34 nacon joined
07:41 louispan joined
07:42 DataComputist joined
07:43 DataComputist joined
07:43 DataComputist joined
07:44 DataComputist joined
07:44 DataComputist joined
07:45 DataComputist joined
07:52 Ferdirand joined
07:57 eacameron joined
07:57 takle joined
08:00 sypwex joined
08:02 takle joined
08:05 harfangk joined
08:15 grdryn joined
08:19 eacameron joined
08:21 alexelcu joined
08:25 malaclyps joined
08:25 eacameron joined
08:27 malaclyps joined
08:27 malaclyps joined
08:29 eacamero_ joined
08:37 malaclyps joined
08:37 vaibhavsagar joined
08:38 eacameron joined
08:40 gregman_ joined
08:42 eacamero_ joined
08:48 eacameron joined
08:48 <Akii> not my proudest function implementation `removeNel k = NE.nonEmpty . M.toList . M.delete k . M.fromList . NE.toList`
08:50 stef204 joined
08:50 dni- joined
08:55 Gurkenglas_ joined
08:59 permagreen joined
09:35 irclogger_com joined
09:35 Topic for
09:43 Baikonur joined
09:47 mengu joined
10:15 TCZ joined
10:26 contiver joined
10:27 louispan joined
10:36 merijn joined
10:44 sphere joined
10:48 <timdiels> Is there a function like $ which is infixl 0?
10:52 madjestic joined
10:54 adjesticm joined
10:57 <madjestic> hey guys. Is there a way to get something like this working for haskell in emacs: https://goo.gl/dXokJK ?
10:58 <madjestic> that is a function documentation window next to the autocomplete popup?
10:59 <madjestic> I've got haskell deps compiled with doc flag, I see docs locally at /usr/share/doc
10:59 buoto joined
11:00 <madjestic> I nomrally use hoogle/hayoo, but wonder if there's a better way...
11:15 eacameron joined
11:21 eacameron joined
11:28 exferenceBot joined
11:28 abhiroop joined
11:29 govg joined
11:36 Levex joined
11:36 jathan joined
11:37 <__rgn> do you guys use an alias to compile and run .hs programs in one go
11:37 <__rgn> is there a better way
11:38 <sshine> __rgn, I use 'stack build'.
11:39 <sshine> __rgn, or rather, 'make' calls 'stack build' :)
11:39 <mniip> runghc
11:39 <mniip> :)
11:39 takle joined
11:40 <__rgn> mniip: nice. i was looking for that option in ghc binary
11:41 <__rgn> i have stack installed but i haven't used it for anything yet
11:41 <__rgn> except for installing hdevtools
11:44 circ-user-oryB7 joined
11:45 ederign joined
11:47 contiver joined
11:49 stef204 joined
11:50 <madjestic> __rgn: I used to have a makefile with a 'make run' target that would compile and run it for me.
11:50 <merijn> I usually just have a cabal file and run "cabal build && dist/foo/foo" to compile and run
11:51 <__rgn> i can see make being useful when your program consists of multiple files
11:51 <merijn> __rgn: People usually use cabal instead of make for building multi file programs
11:52 <__rgn> or the stack thing?
11:52 <merijn> __rgn: Honestly, I haven't used stack, because I'm a grumpy curmudgeon who refuses to learn new things ;)
11:59 binaryplease1 joined
12:09 abhiroop joined
12:11 chlong joined
12:12 marvin2 joined
12:22 circ-user-oryB7 joined
12:27 aarvar joined
12:30 malaclyps joined
12:34 louispan joined
12:35 eacameron joined
12:35 takle joined
12:45 eacameron joined
12:59 andyhoang joined
13:02 eacameron joined
13:09 abhiroop joined
13:13 Ferdirand joined
13:20 contiver joined
13:25 mizu_no_oto_work joined
13:27 nil_ joined
13:31 zero_byte joined
13:34 circ-user-oryB7 joined
13:46 binaryplease joined
13:56 earldouglas joined
13:57 eacameron joined
14:15 yellowj joined
14:17 Rodya_ joined
14:18 carlomagno joined
14:21 WarmCookie joined
14:29 lithie joined
14:33 anononull joined
14:33 anononull left
14:48 uglyfigurine joined
14:50 guampa joined
14:55 Levex joined
15:00 govg joined
15:06 geppettodivacin joined
15:22 Iceland_jack joined
15:26 mizu_no_oto_work joined
15:28 vaibhavsagar joined
15:34 Gloomy joined
15:36 greeny joined
15:45 NeverDie joined
15:48 uglyfigurine joined
16:00 mattyw joined
16:15 owiecc joined
16:20 guampa joined
16:28 conal joined
16:42 mandeep joined
16:44 circ-user-oryB7 joined
16:52 <srhb> Huh, I'd never even considered using make for building a Haskell project.
16:53 <srhb> My first instinct was "sounds painful" but I guess it really is no worse than gcc and make on a c project.
16:53 <* srhb> is spoiled, apparently.
16:53 mengu joined
16:55 <timdiels> Trying to understand deriving(Monad) for newtypes of monad stacks. So, NewType (t0 (t1 a)) has return = return . return ? I.e. return lifts value way up to the top of the stack?
16:58 <glguy> If you have a newtype T a = MkT (ThisT That a) deriving Monad
16:58 <glguy> then the derived return would be: return x = MkT (return x)
16:59 Deide joined
16:59 <glguy> using the instance Monad (ThisT m)
16:59 <geekosaur> srhb, that's how it used to work before --make was added to ghc (and then later made the default)
17:00 <geekosaur> ghc acted like a C compiler instead of like e.g. javac
17:01 abh joined
17:01 anononull joined
17:01 <srhb> geekosaur: So that's why it's ghc --make
17:02 <srhb> I didn't know, thanks. :)
17:04 argent0 joined
17:10 binaryplease joined
17:10 madjestic joined
17:21 <timdiels> glguy: so That is a monad and x is of type That a ?
17:22 anononull joined
17:22 kaen_ joined
17:27 Levex joined
17:28 <timdiels> glguy: The thing is that it appears the type of x should be a. For example, this compiles http://lpaste.net/2468186644084162560
17:30 peterbecich joined
17:34 <jle`> timdiels: newtype Foo a = MkFoo (t a) has return x = MkFoo (return x)
17:36 <jle`> timdiels: but also what you wrote cnanot be generalized-newtype-derived for Monad
17:36 initiumdoeslinux joined
17:36 <jle`> timdiels: if you try it, it won't work, no matter what t0 and t1 are
17:37 <jle`> timdiels: maybe you meant Foo a = MkFoo (t1 t2 a) ...?
17:39 wildlander joined
17:41 <timdiels> jle`: I probably meant the latter, I'm looking in particular at http://xmonad.org/xmonad-docs/xmonad/XMonad-Core.html#t:Query
17:42 <jle`> timdiels: ah yes, that's the same form as what i wrote
17:42 <jle`> newtype Foo a = Foo (SomeMonad a)
17:42 <jle`> for that, instance Monad Foo where return x = Foo (return x)
17:42 <jle`> it doesn't do "multiple returns", exactly
17:43 <jle`> it just uses the return for the Monad instance of SomeMonad
17:43 <glguy> Query is a newtype for ReaderT type applied to some stuff, the important thing is that ReaderT is the outermost type there
17:43 <jle`> timdiels: 'SomeMonad' here is 'ReaderT Window X'
17:43 <glguy> so the derived Monad instance is using ReaderTs instance
17:43 <jle`> so it's newtype Query a = ((ReaderT Window X) a)
17:43 <jle`> so the derived instance uses the monad instanace for 'ReaderT Window X'
17:44 <jle`> it doesn't care if it's a monad transformer or not
17:44 hoffmeyer joined
17:51 <timdiels> jle`: Oh I see, I was mistaking transformers for monads of monads instead of... transformed monads. My haskell has gotten real rusty, it being 2 years since I last read real world haskell and friends
17:51 <jle`> timdiels: to be fair, that's something that slip by a lot of tutorials
17:51 uglyfigurine joined
17:51 <jle`> but yeah, a monad transofmer is literally a Monad -> Monad function :)
17:52 <jle`> (ReaderT Window) :: (* -> *) -> (* -> *)
17:52 <jle`> monad comes in, monad comes out
17:57 <timdiels> jle`, glguy: thanks!
17:58 <jle`> np!
18:04 madjestic joined
18:09 contiver joined
18:09 Cale joined
18:10 carlomagno joined
18:13 dni- joined
18:16 t0by joined
18:20 carlomagno joined
18:20 Emir_28 joined
18:23 kadoban joined
18:25 carlomagno joined
18:26 andyhoang joined
18:27 carlomagno joined
18:28 chindy joined
18:30 NeverDie joined
18:30 carlomagno joined
18:32 Levex joined
18:32 carlomagno joined
18:34 peterbecich joined
18:39 dni- joined
18:41 govg joined
18:51 jrajav joined
18:57 argent0_ joined
19:11 NeverDie_ joined
19:11 MotherFlojo joined
19:14 jomg joined
19:18 anononull joined
19:18 <Akii> oh my, pipes are awesome
19:20 anononull left
19:28 for{} joined
19:28 <for{}> hi
19:28 andyhoang joined
19:28 anononull joined
19:31 <Akii> hi!
19:32 <Akii> Cale: you said something about re-writing websockets using pipes
19:45 Deide joined
19:50 mmaths joined
19:53 <mmaths> I'm confused as to what the analogies are for haskell and category theory. What are types suppose to be? I'm guessing that types should be categories, but pure functions do not fit into the picture nicely. But, it seems like monads are endofunctors on types.
19:53 <mmaths> Is there anywhere that clearly and concisely explains the analogies?
19:54 <qu1j0t3> mmaths: here's one such mapping https://wiki.haskell.org/Hask
19:58 Nezteb joined
19:58 _Nezteb joined
19:59 cur8or joined
20:03 <Cale> Akii: yes
20:04 <Akii> Cale: got a concrete vision of how that might look like? I'm not really deep into it but that sounds interesting
20:05 <Cale> Akii: Well, did you see my sort of awful hack of websockets?
20:05 <Akii> this is the point where I should've looked at your solution first
20:05 <Cale> It would be like that, but less hastily thrown together under time pressure
20:05 <Akii> let me come back to you
20:05 <Akii> once I did that
20:06 <Akii> but, to my defence, I've connected the first few pipes
20:07 <Cale> Honestly, looking at my code probably won't help all that much
20:08 <Akii> still, I need to look into the code of the websocket lib first
20:08 <Cale> (Because it just sort of adapts the stuff which was already there a bit awkwardly.)
20:08 <Akii> and get at least a bit more familiar with it
20:08 permagreen joined
20:08 <Akii> then look at how websockets actually work
20:09 <Akii> I've just been using the lib
20:09 sphere joined
20:09 <Akii> but then I feel like I could maybe do something :D
20:16 mojjo joined
20:17 yellowj joined
20:17 <Akii> I'll come back to you on that one
20:22 binaryplease joined
20:26 louispan joined
20:32 merijn joined
20:33 carlomagno1 joined
20:48 hoffmeyer joined
20:50 srnty joined
20:51 argent0 joined
20:52 erdos joined
20:54 cyrus__ joined
20:55 takle joined
20:56 contiver joined
20:56 <cyrus__> I have what I think is a stupid question. I have several types, e.g. data A = A1 Integer | A2 A, data B = B1 Bool | B2 B | B3 C B B, data C = C1 | C2 | C3. I want to make a type that is the sum type of A and B. I can do this by making data D = A A | B B, but this is ugly (and in my real code, quite cumbersome). What better options are there for doing this?
20:56 <cyrus__> A typeclass isn't quite what I want (I think), and I'm not sure that GADTs are the right fit either
20:56 <cyrus__> But I could easily be wrong
20:57 <geekosaur> they're not, and Haskell pretty much forces you to have the constructor (is an A1 type A or type D?)
20:58 <cyrus__> Good point. I'd be fine with an A1 being type D, but I essentially need to be able to specify *which* variant of D I want in some other constructors
21:00 <cyrus__> Really, what I'm trying to do is something like a tree of variants - data D = A (A1 Integer | A2 A) | B (B1 Bool | B2 B | B3 C B B), etc., but obviously this is not valid in Haskell. Perhaps I just need to rearrange my type abstractions to make this fit under D.
21:02 yellowj joined
21:02 takle joined
21:14 cur8or joined
21:25 abhiroop joined
21:33 mojjo joined
21:38 mandeep joined
21:40 albertus1 joined
21:46 louispan joined
21:47 conal joined
21:49 hoffmeyer joined
21:52 hiratara joined
22:01 louispan joined
22:06 binaryplease joined
22:09 ali_bush joined
22:09 ali_bush joined
22:10 <mounty> I'm just running hlint on my source. What a fantastic program!
22:13 markh joined
22:15 Rodya_ joined
22:24 abhiroop joined
22:26 louispan joined
22:27 permagreen joined
22:28 dni- joined
22:31 hiratara joined
22:32 <mounty> It's an excellent tutor for me as a Haskell learner. Write some code then let hlint tell you how to do it better.
22:44 markh left
22:47 <MarcelineVQ> It's pretty nice when it shows you better ways to think about what you've written, at times it's a little nitpicky though
22:49 jayjam124 joined
22:49 <jayjam124> https://pastebin.com/50uwN5hH
22:49 <jayjam124> what's a good way to generate new digits in this thread?
22:49 <jayjam124> constantly
22:49 hoffmeyer joined
22:50 zero_byte joined
22:50 <MarcelineVQ> :t forever
22:50 <lambdabot> Applicative f => f a -> f b
22:51 <MarcelineVQ> hmm, less isntructive than I was hoping for, https://hackage.haskell.org/package/base-4.9.1.0/docs/Control-Monad.html#v:forever
22:51 chin-tastic left
22:51 <jayjam124> you talking to me now or?
22:51 <MarcelineVQ> yes
22:52 <jayjam124> ok so basically in that thread I need to generate a string of random Integers and put them into a variable of some kind
22:52 <jayjam124> my Haskell is rusty so that's why I'm here
22:52 <jayjam124> so how can I do that? can you walk me through it if possible?
22:55 <jayjam124> I guess not
22:55 <MarcelineVQ> What are you going to do with the variable?
22:55 <jayjam124> oh, nice
22:55 <jayjam124> well
22:55 <jayjam124> lemme give you a big picture of what I have to do then
22:55 <jayjam124> so basically I have to do a game where you have three threads
22:56 <jayjam124> in the first thread you have to have a random number generator that puts the numbers into a string
22:56 <jayjam124> the second thread is when you test for user input
22:56 <jayjam124> and the third handles the game logic
22:57 <jayjam124> so the objective of the game is for the user to guess the digits in the string
22:57 <jayjam124> and after 10 guesses the game ends and returns the number of guesses, the removed numbers (in the fully generated random string of Integers)
22:57 <jayjam124> and that's it
22:57 sherub1 joined
22:57 <jayjam124> that's the big picture
22:59 <jayjam124> so first step is to create a thread that generates random numbers and put them into a variable, I've tried to do a bit of that but how can I keep it to generate on and on and how do I put it into a variable?
22:59 suls joined
23:01 <jayjam124> did that make any sense at all? hah
23:01 <MarcelineVQ> yep, I'm just thinking about the ways I might approach the problem
23:02 <jayjam124> ok awesome!
23:05 myrkraverk joined
23:11 <jayjam124> any luck MarcelineVQ?
23:13 abhiroop joined
23:15 <MarcelineVQ> I've not done much things is seperate threads so I'm playing in ghci to try to figure out what's simple hehe. there's multiple ways to approach it, mostly simply is not generating the random number in another thread since it's a pretty fast operation, an option is a queue of some kind that the random numbet thread continuous writes to and your main thread pulls numbers as needed
23:15 m1dnight_ joined
23:17 <jayjam124> sadly I have to generate the random number in a different thread
23:17 <jayjam124> "One thread is responsible for triggering the events that cause the main
23:17 <jayjam124> thread to generate new digits."
23:17 <jayjam124> I read that as you have to put the random generation in a separate thread
23:19 <jayjam124> do you think that is the case?
23:19 <MarcelineVQ> Oh interesting, I read that differently, do you have a writeup of the problem verabtim?
23:19 <jayjam124> yes I would prefer to message you it
23:19 <jayjam124> if that's ok?
23:19 <MarcelineVQ> sure
23:23 eacameron joined
23:32 sigmundv joined
23:33 DataComputist joined
23:43 louispan joined
23:50 hoffmeyer joined