<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 bydo joined
00:05 newhoggy_ joined
00:10 ab9rf joined
00:11 abhiroop joined
00:12 eacameron joined
00:15 malaclyps joined
00:15 contiver joined
00:16 newhoggy joined
00:16 eacameron joined
00:21 prophile joined
00:22 eacameron joined
00:23 conal joined
00:27 eacameron joined
00:34 eacameron joined
00:36 newhoggy joined
00:43 eacameron joined
00:43 conal joined
00:47 eacamero_ joined
00:51 eacameron joined
00:55 newhoggy joined
00:55 eacamero_ joined
00:56 newhoggy joined
01:00 vaibhavsagar joined
01:01 eacameron joined
01:06 des joined
01:07 eacameron joined
01:08 mac10688 joined
01:12 peterson joined
01:15 eacameron joined
01:21 vaibhavsagar_ joined
01:29 bkboggy joined
01:34 abhiroop joined
01:43 Youmu joined
01:45 des joined
01:47 MotherFlojo joined
01:55 vaibhavsagar joined
02:03 MotherFlojo joined
02:14 abhiroop joined
02:26 eacameron joined
02:30 MotherFlojo joined
02:34 eacameron joined
02:34 vaibhavsagar_ joined
02:40 eacameron joined
02:41 geekosaur joined
02:43 eacamero_ joined
02:48 systemfault joined
02:50 des joined
02:50 exferenceBot joined
02:51 eacameron joined
02:54 hexagoxel joined
02:58 eacameron joined
03:05 abhiroop joined
03:05 eacameron joined
03:12 <mac10688> pattern matching on Seq is a lot more difficult than lists
03:13 hphuoc25 joined
03:14 <MarcelineVQ> I've not used Seq but looking at the docs it looks like you don't pattern match on Seq, you pattern match on ViewL or ViewR if you pattern match
03:15 <MarcelineVQ> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#view-patterns might help with that a bit, not sure
03:15 MotherFlojo joined
03:15 <mac10688> yeah but with lists I could do (x:y:xs) and pattern match, this is a bit more difficult
03:15 <mac10688> yeah i saw that too
03:16 <mac10688> not sure if codeingame will let me turn on those language features
03:16 <mac10688> guess I should give that a shot
03:16 <mac10688> i'll let you know in a jiffy
03:17 ebsen joined
03:17 <mac10688> oh wow! I guess I can use language extensions for codingame
03:21 aarvar joined
03:39 <pixelfog> I'm working on the exercises at the end of Chapter 10 in HaskellBook, and really struggling with creating pointfree versions. I don't have a good strategy, and I've realized, I don't know how to evaluate (in both senses) the pointfree functions I've created. If I want to manually check a function I've created, should I try to use its real definition, or just its types? Any recommendations on
03:39 <pixelfog> strategies or resources?
03:43 hphuoc25 joined
03:45 abhiroop joined
03:57 eacameron joined
04:01 nepiktaz joined
04:03 nepiktaz joined
04:46 abhiroop joined
04:58 <mac10688> dang it
04:58 <mac10688> Seq is still too slow
04:59 <lpaste> mac10688 pasted “Still too slow even with Seq :(” at http://lpaste.net/354874
05:03 govg joined
05:05 Gurkenglas joined
05:06 abhiroop joined
05:16 vaibhavsagar_ joined
05:42 Levex joined
05:46 MarcelineVQ joined
05:53 ThomasLocke joined
05:54 myrkraverk joined
05:58 pbrant joined
06:05 <mac10688> I got the problem working. I was building a uni-directional graph but it was supposed to be bi-directional
06:05 <mac10688> thanks for the help jle` and MarcelineVQ
06:07 <MarcelineVQ> what are you makin?
06:08 <mac10688> codingame problem
06:08 <mac10688> It's been a fun way for me to work on my haskell and get to know the most common libraries
06:09 <mac10688> I learned a lot about Map and Sequence and how to make a tree structure in haskell today and traverse it
06:10 <MarcelineVQ> oh right hehe
06:12 <glguy> speaking of manipulating graphs for a game, my project lately has been a solver for KAMI 2 (iOS based game)
06:12 <mac10688> that sounds cool
06:12 <mac10688> is it open source?
06:14 <mac10688> nvm, I just found it
06:15 <MarcelineVQ> oh interesting
06:15 <mac10688> what's the c code for?
06:15 <MarcelineVQ> hoping to revolutionlize floodfill?
06:16 abhiroop joined
06:17 <MarcelineVQ> this and 2048 look like fun games to create solutions for
06:17 <glguy> the C code speeds up the heuristic function I use to guide my A* search
06:17 <mac10688> oh bummer you had to use C to speed it up :(
06:18 <mac10688> how do you read in the .puz files?
06:18 <glguy> it computes graph diameter
06:18 <glguy> there's a module called Parser
06:18 <mac10688> i clicked on .puz and it looks encoded
06:18 <mac10688> oh ok
06:21 <MarcelineVQ> The part most mysterious to me about making solvers for games is actually interfacing with them, I wanted to make something for starcraft the other day and spent awhile fruitlessly determining I didn't know where to start :>
06:29 abinr joined
06:30 dmi3y joined
06:33 kritzcreek joined
06:39 dmi3y joined
06:45 abinr joined
07:11 mounty joined
07:11 mattyw joined
07:15 nicknovi1 joined
07:17 mstruebing joined
07:17 abinr joined
07:23 eacameron joined
07:24 Pupnik joined
07:24 abhiroop joined
07:31 mounty joined
07:31 abhiroop joined
07:34 thc202 joined
07:38 mounty joined
07:43 madjestic joined
07:44 yellowj joined
07:46 newhoggy_ joined
07:48 merijn joined
07:50 dmi3y joined
07:50 bvad joined
07:50 newhoggy joined
07:55 dmi3y_ joined
07:56 mounty joined
07:57 nickolay joined
08:04 slomo joined
08:04 slomo joined
08:06 yellowj joined
08:12 dmi3y joined
08:13 crave joined
08:14 aosman joined
08:14 nacon joined
08:14 nacon joined
08:14 newhoggy joined
08:25 abhiroop joined
08:29 colt44 joined
08:33 aarvar joined
08:37 colt44 joined
08:38 <Akii> how can I get the elems of a map with a lens?
08:39 binaryplease joined
08:39 abhiroop joined
08:40 <Akii> ah, traverse
08:41 xificurC joined
08:51 abhiroop joined
08:56 abhiroop joined
08:59 Iceland_jack joined
09:00 eatman joined
09:02 <eatman> Hi!
09:04 <Akii> ohai :D
09:08 <Iceland_jack> Hey #haskell-beginners!
09:09 <mstruebing> hey Iceland_jack!
09:15 <vaibhavsagar_> hi Iceland_jack!
09:16 ali_bush joined
09:16 ali_bush joined
09:24 eacameron joined
09:27 <Iceland_jack> Nice morning :)
09:29 vaibhavsagar__ joined
09:33 vaibhavsagar joined
09:36 grdryn joined
09:42 newhoggy joined
09:50 govg joined
10:19 vaibhavsagar joined
10:22 govg joined
10:25 tamasgal joined
10:32 zero_byte joined
10:43 netheranthem joined
10:49 abhiroop joined
10:54 abhiroop joined
11:04 tractatus joined
11:04 galderz joined
11:06 newhoggy joined
11:11 abhiroop joined
11:12 <ThomasLocke> I plan on throwing myself at scotty - anybody got some good resources/advice they like to offer? :o)
11:13 <ThomasLocke> I realize now, that if you don't know what scotty is, then my previous message either makes little sense, or appears to belong on some other IRC channel.. :D
11:15 eacameron joined
11:17 <MarcelineVQ> there should be a few tutorials for it around so you're likely in good hands
11:21 abinr joined
11:22 abhiroop joined
11:30 kieran_ joined
11:37 prophile joined
11:40 exferenceBot joined
11:42 abhiroop joined
11:45 kieran_ joined
11:47 abhiroop joined
11:56 kieran_ joined
12:05 <mstruebing> what is scotty
12:05 <Iceland_jack> It's a web framework (https://hackage.haskell.org/package/scotty)
12:06 abhiroop joined
12:06 <mstruebing> ah thx
12:10 abhiroop joined
12:12 binaryplease joined
12:13 abhiroop joined
12:15 eacameron joined
12:23 abhiroop joined
12:26 mixandgo joined
12:28 <Iceland_jack> pure a = [a]
12:31 mizu_no_oto_work joined
12:51 vaibhavsagar joined
12:58 abhiroop joined
13:10 kadoban joined
13:18 eacameron joined
13:23 harfangk joined
13:28 jathan joined
13:30 abhiroop joined
13:33 govg joined
13:35 slomo joined
13:35 mizu_no_oto_work joined
13:58 taksuyu joined
13:58 crave joined
13:59 lampda joined
13:59 prophile joined
14:00 nicknovi1 joined
14:02 newhoggy joined
14:02 mengu joined
14:09 newhoggy joined
14:10 <lampda> How come the type of "(>>=) id" is (a -> a -> b) -> a -> b? It seems rather weird with my limited understanding. :P Can anyone show me how to get from the type signatures of bind and id to this?
14:10 mthek joined
14:10 <merijn> :t (>>=)
14:10 <lambdabot> Monad m => m a -> (a -> m b) -> m b
14:11 <merijn> lampda: ok, let's use 'id :: c -> c" to use unique variable names
14:11 <merijn> So, we have: 'm a = c -> c' in some way
14:12 <merijn> Let's start by rewriting "c -> c" to prefix application of ->, which gives us "id :: (->) c c"
14:12 <Iceland_jack> Prelude> :t (>>=) @((->) _)
14:12 <Iceland_jack> (>>=) @((->) _) :: (t -> a) -> (a -> t -> b) -> t -> b
14:12 <merijn> lampda: So now we have 'm a = (->) c c', so 'm = (->) c' and 'a = c'
14:13 <merijn> This means that 'a -> m b' turns into 'a -> ((->) c) b' or 'a -> (c -> b)', but since 'a = c' that's just 'c -> c -> b'
14:14 <merijn> the result 'm b' becomes 'c -> b' following the same logic
14:15 <merijn> so '(>>=) id' as a whole becomes '(c -> c -> b) -> (c -> b)' or, if we simply keep using 'a' instead of 'c': '(a -> a -> b) -> a -> b'
14:16 guampa joined
14:18 acarrico joined
14:19 <Iceland_jack> lampda: Analogously you study "pure :: Applicative f => a -> f a" which also has the type "pure :: a -> r -> a"
14:20 <Iceland_jack> Prelude> :t pure @((->) _)
14:20 <Iceland_jack> pure @((->) _) :: a -> t -> a
14:20 <Iceland_jack> Simpler example of the same phenomenon
14:20 <lampda> merijn: Wow, that was very helpful! Thank you, kind sir! This is awesome.
14:21 <merijn> lampda: I would strongly recommend doing these kinda exercises on paper any time you get confused :)
14:21 <Iceland_jack> paper++
14:24 <lampda> Iceland_jack: Interesting, thanks. I'll have a look at pure.
14:25 <Iceland_jack> lampda: It may also help to use a non-type operator for (->)
14:25 <Iceland_jack> defining: type Arr = (->)
14:25 <Iceland_jack> Then you replace "f" with "Arr r"
14:25 <Iceland_jack> pure :: a -> Arr r a
14:26 <Iceland_jack> Same with: (>>=) :: Arr r a -> (a -> Arr r b) -> Arr r b
14:28 des joined
14:28 carlomagno joined
14:29 <lampda> Cool. I'm gonna have to think this through slowly, step by step. :-)
14:30 <Iceland_jack> Also try "fmap"
14:30 <Iceland_jack> @type fmap
14:30 <lambdabot> Functor f => (a -> b) -> f a -> f b
14:30 <Iceland_jack> This can be difficult to wrap your head around :) I have some tricks that helped me grasp it
14:30 <Iceland_jack> if you're interested
14:31 <lampda> I think fmap id make more intuitive sense.
14:32 <Iceland_jack> more intuitive sense than ((>>=) id)?
14:32 <lampda> Yes.
14:33 <lampda> I guess I'll have to walk it through though...
14:33 <Iceland_jack> there are some differences, ((>>=) id) forces the Monad instance
14:33 <Iceland_jack> (fmap id) does not force the Functor instance
14:33 <lampda> That is very kind of you, Iceland_jack. Even more tricks? :-)
14:34 Levex joined
14:34 <Iceland_jack> 1. Write your own type classes (class Functor2 f where fmap2 :: (a -> b) -> (f a -> f b))
14:34 <Iceland_jack> 2. Use InstanceSigs when you write instances
14:35 <Iceland_jack> instance Functor2 Maybe where fmap2 :: (a -> b) -> (Maybe a -> Maybe b); fmap2 _ Nothing = Nothing; fmap2 f (Just x) = Just (f x)
14:35 ubsan joined
14:36 <Iceland_jack> Includes writing (instance Functor2 (Arr r))
14:36 <lampda> What do you mean with "forces the Monad instance"? There seems to be no class constraint for "(>>=) id :: (a -> a -> b) -> a -> b".
14:36 <Iceland_jack> that's what I mean, "(>>=) id" forces the Monad instance for ((->) r)
14:37 <Iceland_jack> (>>= id) on the other hand does not restrict it
14:37 <Iceland_jack> :t (>>= id)
14:37 <lambdabot> Monad m => m (m b) -> m b
14:37 <geekosaur> maybe the right phrasing here is "fulfills the Monad constraint with ((->) r)
14:38 <Iceland_jack> Depends on perspective really, if it's from the user's or the solver's
14:39 <Iceland_jack> lampda: 3. Enable TypeApplications and use that to explore (check the type of: fmap @((->) _), (>>=) @((->) _), pure @((->) _), (<*>) @((->) _))
14:40 <Iceland_jack> lampda: Oh. And (join :: Monad m => m (m a) -> m a) is excellent to learn about this
14:40 prophile joined
14:40 <Iceland_jack> join @(Arr _) :: Arr r (Arr r a) -> Arr r a
14:40 <Iceland_jack> join @((->) _) :: (r -> r -> a) -> (r -> a)
14:41 <Iceland_jack> reading the type should give you a dash of enlightenment
14:41 <Iceland_jack> To enable TypeApplications in GHCi: >>> :set -XTypeApplications
14:54 <lampda> Wow, I have many nice things to learn about. :-) Thanks for your insights, Iceland_jack! It's also nice to have some exercises to play with. I'll get back to you all when I've spent some quality time with a pen, a paper and a bit of ghci. :-) Thanks again.
14:59 mthek joined
15:00 vmeson joined
15:05 uglyfigurine joined
15:13 netheranthem joined
15:18 Gurkenglas joined
15:32 newhoggy joined
15:34 ysgard joined
15:35 conal joined
15:36 baweaver left
15:37 ralu joined
15:40 newhoggy joined
15:46 ultalbot joined
15:51 skeet70 joined
15:52 Levex joined
15:56 newhoggy joined
16:04 abhiroop joined
16:05 newhoggy joined
16:09 conal joined
16:12 meandi_2 joined
16:12 simendsjo joined
16:13 newhoggy joined
16:21 newhoggy joined
16:28 eatman joined
16:30 <eatman> Hi! Really quick question : https://hackage.haskell.org/package/set-monad Is it know to be inefficient? Or is it simply a Data.Set implementation with Ord contraints shifted to the functions signatures?
16:33 newhoggy joined
16:35 abhiroop joined
16:36 <eatman> Well, I'll come back to it on tomorrow.
16:41 abhiroop joined
16:41 newhoggy joined
16:49 abhiroop joined
16:50 malaclyps joined
16:50 newhoggy joined
16:52 m3tti joined
16:52 conal joined
16:53 abhiroop joined
16:57 delexi joined
16:57 abhiroop joined
16:58 pilne joined
17:02 newhoggy joined
17:04 yellowj joined
17:08 abhiroop joined
17:11 Gurkenglas joined
17:15 abhiroop joined
17:18 Levex joined
17:19 des_ joined
17:20 mizu_no_oto_work joined
17:21 zacts joined
17:21 abinr joined
17:21 newhoggy joined
17:31 prophile joined
17:35 delexi joined
17:37 newhoggy joined
17:39 binaryplease joined
17:42 sigmundv__ joined
17:45 nschoe joined
17:51 pixelfog joined
17:52 abinr joined
17:54 newhoggy joined
17:54 exferenceBot joined
17:57 m3tti joined
17:59 chlong joined
18:03 geekosaur joined
18:11 newhoggy joined
18:20 newhoggy joined
18:21 Durz0 joined
18:24 sigmundv joined
18:25 nitrix joined
18:29 mac10688 joined
18:33 govg joined
18:35 vague-cl joined
18:38 benzrf joined
18:44 Levex joined
18:45 newhoggy joined
18:54 newhoggy joined
19:00 Levex joined
19:03 newhoggy joined
19:06 malaclyps joined
19:19 newhoggy joined
19:21 <m3tti> hey there i'm looking for something like express in haskell are there any recomendations
19:22 <m3tti> i've seen servant, yesod, spock and happstack what is suited best for small or medium sized rest services
19:25 albertus1 joined
19:26 Levex joined
19:27 Durbley joined
19:27 newhoggy joined
19:30 <nitrix> m3tti: Depending on your level of expertise, I'd normally recommend Snap (more advanced), otherwise Scotty (easier).
19:32 <nitrix> m3tti: Oh I forgot, Servant is primarily designed for REST APIs.
19:32 <nitrix> I heard a lot of good things about it but never used that one.
19:35 m3tti joined
19:38 abinr joined
19:40 m` joined
19:44 newhoggy joined
19:50 nickager joined
19:51 newhoggy joined
19:51 <lpaste> nickager pasted “groupBy confusion” at http://lpaste.net/354885
19:53 <nickager> test results in: [[Card {value = Three, suit = Diamond}],[Card {value = Four, suit = Spade}],[Card {value = Three, suit = Heart}]]
19:53 <nitrix> nickager: You might be confused how groupBy works
19:54 <nickager> but I would have expected: [[Card {value = Three, suit = Diamond}, Card {value = Three, suit = Heart}],[Card {value = Four, suit = Spade}]]
19:54 <geekosaur> group does not imply sort
19:54 <nickager> OK
19:54 <nitrix> > groupBy (==) [1,2,1,2,1,1,1,1,2] -- nickager
19:54 <lambdabot> [[1],[2],[1],[2],[1,1,1,1],[2]]
19:54 <nitrix> nickager: The elements aren't re-ordered, simply grouped together if the predicate is respected.
19:54 <kadoban> You can usually combine groupBy and sortBy for what you apparently want
19:55 <nickager> perfect, if I sort first I get what I expect
19:55 <nickager> brilliant thanks all
20:01 newhoggy joined
20:01 Levex joined
20:09 newhoggy joined
20:18 newhoggy joined
20:26 newhoggy joined
20:32 Rodya_ joined
20:35 newhoggy joined
20:41 crave joined
20:44 newhoggy joined
20:45 malaclyps joined
20:51 nschoe joined
20:54 abinr joined
20:59 mengu joined
21:00 newhoggy joined
21:05 grayjoc joined
21:05 mattyw joined
21:11 newhoggy joined
21:17 <mattyw> is someone around to offer some help with happstack? Specifically I'm I've got a route that (for want of a better idea) makes use of an IORef to get some state about the server
21:18 <mattyw> and I can't work out how to register with it correctly. The code (which I know to be horrifically wrong) is here: https://github.com/mattyw/haspi/blob/master/src/Main.hs#L36
21:18 __rgn joined
21:19 newhoggy joined
21:20 Levex joined
21:27 cschneid_ joined
21:37 nschoe joined
21:38 _cyril_ joined
21:38 nicknovi1 joined
21:40 newhoggy joined
21:48 uglyfigurine joined
21:48 uglyfigurine joined
21:53 hiratara joined
21:54 <nitrix> @tell mattyw I see what you're trying to do with that IORef, but unsure what your issue is. If you still have your problem when you're back could you please elaborate? I'll gladly help.
21:54 <lambdabot> Consider it noted.
21:58 Rodya_ joined
21:58 nschoe joined
21:59 __rgn joined
22:00 newhoggy joined
22:08 NeverDie joined
22:08 newhoggy joined
22:10 Kuros` joined
22:11 freechips joined
22:15 GreySunshine joined
22:18 newhoggy joined
22:22 argent0 joined
22:27 newhoggy joined
22:28 aarvar joined
22:31 hiratara joined
22:31 malaclyps joined
22:36 newhoggy joined
22:41 nicknovi1 joined
22:45 newhoggy joined
22:47 hvr joined
22:47 hvr joined
22:49 binaryplease joined
23:03 sigmundv joined
23:08 newhoggy joined
23:15 emmanuel_erc joined
23:15 newhoggy joined
23:16 <emmanuel_erc> hello there everyone
23:16 <emmanuel_erc> Has anyone experienced this before: It is weird switching back to using imperative languages after using Haskell (exclusively) for some period of time?
23:17 <geekosaur> lots of people do
23:19 <emmanuel_erc> ok, I thought something weird was happening to me. It just seems that Haskell makes it easier to write out simple things
23:19 seangrove joined
23:19 <jle`> it's commonly cited as the curse of haskell
23:20 <jle`> see https://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/
23:23 <emmanuel_erc> I did not know pythoners had the same problem.
23:23 c_my_nick joined
23:24 sigmundv joined
23:27 newhoggy joined
23:29 sigmundv joined
23:30 <thang1> emmanuel_erc: any language which has a higher level of expressiveness will cause someone to suffer a withdrawl when switching to a lower language
23:32 miguel_fontes__ joined
23:33 Rodya_ joined
23:33 <c_my_nick> i am using pipes + StateT + attoparsec, and i am having a bit of trouble getting my code to typecheck properly. runParser has the behavior i want, but i need the type signature that runParser' has (i think) http://lpaste.net/354894
23:37 newhoggy joined
23:38 heath joined
23:44 newhoggy joined
23:44 sigmundv joined
23:51 newhoggy joined
23:56 heath joined
23:59 newhoggy joined