<    March 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 31
00:00 <dougger> Hi, is anyone familiar with using servant-client to delete resources? I'm having trouble finding the correct type for the content-type of the return value (http://lpaste.net/353792)
00:00 tsmish joined
00:01 pixelfog joined
00:01 <dougger> In short, the rest service doesn't return any content when deleting but the servant "Delete" verb seems to expect a content type. How can I reconsile this?
00:13 tom7942 joined
00:15 <tom7942> i enjoyed the (Compose f) <*> (Compose a) exercise, solving that was a cool ah-hah moment
00:22 peterbecich joined
00:38 skeet70 joined
00:43 \Mike joined
00:52 eacameron joined
00:56 amirji joined
00:59 eacameron joined
00:59 dni- joined
01:01 tom7942 joined
01:03 baweaver left
01:06 eacameron joined
01:09 tapirus_ joined
01:22 tom7942 joined
01:25 acarrico joined
01:33 eacameron joined
01:34 conal joined
01:40 harfangk joined
01:43 Youmu joined
01:44 conal joined
01:46 tom7942 joined
01:49 peterbecich joined
01:54 eacameron joined
01:56 conal joined
01:58 eacameron joined
02:18 chin-tastic joined
02:48 dni- joined
02:50 eacameron joined
02:51 <jle`> there's something uniquely satisfying about solving polymorphic puzzles in haskell
02:54 <benzrf> :>
02:56 eacameron joined
02:59 <mniip> jle`, but
02:59 <mniip> there's a P algorithm for those
02:59 eacamero_ joined
03:06 eacameron joined
03:07 <jle`> i'm someone that enjoys rubik's cubes
03:11 bko97 joined
03:19 <parsnip> P.parse (`P.sepBy` (P.char ':')) "(src)" "hello:world"
03:19 <parsnip> but... this is not right
03:27 uglyfigurine joined
03:29 <MarcelineVQ> you're missing an argument to sepBy
03:30 <MarcelineVQ> did you want something like P.parse (many1 letter `P.sepBy` (P.char ':')) "(src)" "hello:world"
03:31 <MarcelineVQ> assuming P is some thing like Parsec
03:34 takle joined
03:36 howdoi joined
03:41 exferenceBot joined
03:42 takle joined
03:45 hexagoxel joined
03:50 takle joined
04:05 jud joined
04:06 Rizy joined
04:12 takle joined
04:21 takle joined
04:28 takle joined
04:37 dni- joined
04:39 eacameron joined
04:42 takle joined
04:50 takle joined
04:53 uglyfigurine joined
04:56 eacameron joined
05:01 takle joined
05:04 splanch joined
05:06 eacameron joined
05:12 ali_bush joined
05:14 eacameron joined
05:15 moei joined
05:17 takle joined
05:18 malaclyps joined
05:21 splanch joined
05:27 takle joined
05:34 tom7942 joined
05:37 takle joined
05:37 splanch joined
05:37 hphuoc25 joined
05:40 ali_bush joined
05:40 ali_bush joined
05:45 takle joined
05:47 justicefries left
05:51 ali_bush joined
05:52 takle joined
05:54 hphuoc25 joined
05:56 conal joined
06:02 takle joined
06:03 ali_bush joined
06:08 nomotif joined
06:10 takle joined
06:22 uglyfigurine joined
06:23 takle joined
06:26 Sose_ joined
06:26 dni- joined
06:32 takle joined
06:35 meandi_2 joined
06:36 tom7942 joined
06:47 hphuoc25 joined
06:49 takle joined
06:54 ThomasLocke joined
06:55 hphuoc25 joined
07:00 takle joined
07:10 cur8or joined
07:10 takle joined
07:17 gmg85 joined
07:17 takle joined
07:20 galderz joined
07:21 Pupnik joined
07:21 eacameron joined
07:26 takle joined
07:27 t0by joined
07:27 t0by joined
07:27 eacameron joined
07:30 eacameron joined
07:42 tom7942 joined
07:44 yellowj joined
07:45 raduom joined
07:49 zero_byte joined
07:49 earldouglas joined
07:50 arpl joined
07:51 ljc joined
07:56 mattyw joined
07:58 thc202 joined
08:04 splanch joined
08:06 splanch_ joined
08:07 vito_swiss joined
08:14 dni- joined
08:24 <Akii> is it possible to form a new datatype out of data constructors from other datatypes?
08:25 <Akii> (just a random thought xD)
08:26 splanch joined
08:27 Miroboru joined
08:31 takle joined
08:44 <Cale> Not in Haskell, at least.
08:51 takle joined
08:57 takle joined
08:58 Durz0 joined
09:08 <Akii> :(
09:11 takle joined
09:14 <Akii> that's kinda weird to me though
09:15 <Akii> why can't I compose that like I can compose the rest
09:15 <Akii> I'm well over a year into Haskell and this still bothers me
09:16 <Akii> oh well, some day I'll figure out a way that works for me
09:18 takle joined
09:26 takle joined
09:28 <Akii> I could, of course, just write the JSON parser myself and re-use that
09:28 <Akii> no wait, that also doesn't work
09:28 <Akii> sum types it is :D
09:31 grdryn joined
09:35 kritzcreek_ joined
09:37 lithie joined
09:38 ljc joined
09:41 gregman_ joined
09:43 tom7942 joined
09:43 <Cale> Akii: Well, one reason would be that it would make type inference kind of suck
09:44 <Cale> If you saw a data constructor, there would be no way of telling what type of thing it was producing -- it could be any of the types which included that constructor.
09:44 <Cale> So it would require an explicit type annotation every time.
09:45 <Akii> okay, that makes sense
09:52 madjestic joined
09:53 takle joined
09:57 skapazzo joined
10:00 uglyfigurine joined
10:08 contiver joined
10:09 dni- joined
10:15 trolling joined
10:20 Gloomy joined
10:32 nacon joined
10:32 louispan joined
10:34 adjesticm joined
10:34 mattyw_ joined
10:35 madjestic joined
10:36 jarshwah joined
10:44 tom7942 joined
10:47 splanch joined
10:47 hphuoc25 joined
10:53 prophile joined
10:54 skapazzo joined
10:54 myrkraverk joined
11:03 Nik05 joined
11:13 netheranthem joined
11:23 Gurkenglas_ joined
11:28 ederign joined
11:31 acarrico joined
11:32 Gloomy joined
11:35 stryx joined
11:36 carlomagno1 joined
11:38 stryx joined
11:44 snowcrshd joined
11:44 tom7942 joined
11:45 eacameron joined
11:56 eacameron joined
11:58 dni- joined
11:58 eacameron joined
12:04 zaquest joined
12:08 eacameron joined
12:14 eacameron joined
12:24 acarrico joined
12:32 vmeson joined
12:34 ZZZzz joined
12:41 jomg joined
12:45 tom7942 joined
12:46 zero_byte joined
12:46 shayan_ joined
12:55 mattyw joined
13:01 conal joined
13:06 Gloomy joined
13:17 smichel17 joined
13:33 zaquest joined
13:38 xmonader2 joined
13:39 xmonader2 joined
13:41 mattyw joined
13:41 pbrant joined
13:44 mizu_no_oto_work joined
13:46 dni- joined
13:52 eacameron joined
13:53 <ski> Akii : perhaps look into "refinement types"
13:54 freechips joined
13:59 mattyw joined
14:01 hanspeter joined
14:04 <hanspeter> Hey guys, can someone please help me to understand this little piece of haskell code? It's only 3 lines http://lpaste.net/8434397878998269952
14:05 chlong joined
14:05 <Akii> ski: that looks very difficult
14:06 <Geekingfrog> Any idea how to avoid the nested case there: http://lpaste.net/353815 ?
14:09 Rizy joined
14:12 <ski> Akii : with refinement types, one can "refine" an existing type by excluding values from it. e.g. getting a type of non-empty lists. or a type of lists with an even number of elements
14:13 <ski> Akii : this is a kind of subtyping, but it's not the same as the more usual kind, which for variant types involves *adding* more data constructors (and for record types, adding more fields)
14:13 chlong joined
14:20 jdelreal joined
14:20 <Akii> ski: ah ok
14:27 <Cale> hanspeter: That collects all possible selections of n elements from the given list, in the order they occured in that original list.
14:27 <Cale> > tails "hello"
14:27 <lambdabot> ["hello","ello","llo","lo","o",""]
14:28 <hanspeter> Cale: yes i know that, but there are two things i don't understand
14:28 <Cale> > [(x,xs) | (x:xs) <- tails [1,2,3,4]]
14:28 <lambdabot> [(1,[2,3,4]),(2,[3,4]),(3,[4]),(4,[])]
14:28 <Cale> > [(x,xs,y) | (x:xs) <- tails [1,2,3,4], y <- xs]
14:28 <lambdabot> [(1,[2,3,4],2),(1,[2,3,4],3),(1,[2,3,4],4),(2,[3,4],3),(2,[3,4],4),(3,[4],4)]
14:28 <Cale> > [(x,y) | (x:xs) <- tails [1,2,3,4], y <- xs]
14:28 <lambdabot> [(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)]
14:29 <Cale> So you could do that if you just wanted pairs
14:29 <Cale> But instead, what it does is to apply the same function recursively to the remainder of the elements in the tail that it chose
14:30 <Cale> But what are your questions? :)
14:30 <hanspeter> but how does the recursive call "gen_turn db' (n-1)" work? when db' should be a list of list. [[a]]
14:30 <hanspeter> but gen_turn is only declared for normal lists [a]
14:30 <Cale> db' is just a list
14:30 <Cale> It's the remainder of the tail that was selected
14:31 <Cale> > [(x,db) | (x:db') <- tails [1,2,3,4]]
14:31 <lambdabot> error:
14:31 <lambdabot> • Variable not in scope: db
14:31 <lambdabot> • Perhaps you meant one of these:
14:31 <Cale> > [(x,db') | (x:db') <- tails [1,2,3,4]]
14:31 <lambdabot> [(1,[2,3,4]),(2,[3,4]),(3,[4]),(4,[])]
14:31 <Cale> So, here, when x = 1, db' = [2,3,4], and so on
14:32 <hanspeter> ahh.. i think that was my mistake.. inside the list comprehension the result of tails is "rolled out"
14:32 <hanspeter> maybe that helps to answer the second question
14:32 <Cale> Yeah, in a list comprehension p <- xs means that p is bound to each of the elements of xs, and these selections get made in all possible ways
14:32 <hanspeter> when you pass an integer bigger than the list, like in the example 3, the result is empty
14:33 <Cale> That's right, if ever there's nothing to select, the list will become empty
14:34 <hanspeter> but it doesn't reach the case db 0 = [[]] when you call it with 3, right?
14:34 <Cale> > tails []
14:34 <lambdabot> [[]]
14:34 <hanspeter> i thought that tails [] has something to do with it
14:34 <Cale> There is one tail of the empty list, and it's the empty list
14:34 <hanspeter> but i couldn't figure out why the list will become empty, i thought the the previously added numbers should be in the list
14:34 <Cale> however, that list doesn't match the pattern x:db'
14:34 <Cale> (since it's empty)
14:35 <Cale> and so if db is empty, the result is an empty list
14:35 <Cale> > [(x,xs) | x:xs <- [[]]]
14:35 <lambdabot> []
14:36 <hanspeter> but isn't the list built up recursively?
14:36 <Cale> Sure, but if you can't pick x and db', there's nothing further to do
14:36 <hanspeter> the x:xs's .. shouldn't there be the x's in the list, even if xs becomes empty
14:37 <Cale> in which list?
14:37 <zaquest> Geekingfrog, something like `Foo <$> (findOneThing x <> fallbackThing x)` with Data.Semigroup (<>)
14:37 <Cale> In the case where you give db as a list of two elements, but ask for a sublist of 3,
14:37 <hanspeter> in [x:xs | x:db' <- tails db...
14:37 <Cale> gen_turn [1,2] 3
14:37 <Cale> = [x:xs | x:db' <- tails [1,2], xs <- gen_turn db' 2]
14:38 <Geekingfrog> zaquest: thanks. I was too focused on <|> that I forgot <> :/
14:38 <Cale> > tails [1,2]
14:38 <lambdabot> [[1,2],[2],[]]
14:38 <Cale> There are two nonempty tails here
14:38 <Cale> So first we'll try x = 1, db' = [2]
14:38 Gloomy joined
14:38 <Cale> and then x = 2, db' = []
14:39 e14 joined
14:39 <Cale> right?
14:39 <hanspeter> yes i think i can follow to this point
14:39 <Cale> in the first case, we'll want to pick xs from gen_turn [2] 2
14:40 <Cale> gen_turn [2] 2 = [x:xs | x:db' <- tails [2], xs <- gen_turn db' 1]
14:41 <Cale> Now there will be only one nonempty tail of [2] to try, with x = 2 and xs = []
14:41 <Cale> er, sorry
14:41 <Cale> Now there will be only one nonempty tail of [2] to try, with x = 2 and db' = []
14:41 <hanspeter> yes, i can follow
14:41 <Cale> and so we'll try to pick xs from gen_turn [] 1
14:41 splanch joined
14:42 <hanspeter> but at this point, shouldn't we have 1:2:[] in the list?
14:42 <Cale> However, gen_turn [] 1 = [x:xs | x:db' <- tails [], xs <- gen_turn db' 0]
14:42 <Cale> in which list?
14:42 <Cale> We haven't finished constructing even a single element of our initial right hand side
14:42 <hanspeter> i mean the expression [x:xs |... ] shouldn't this become 1:2:xs at this point?
14:42 yellowj joined
14:43 <Cale> why?
14:43 <Cale> Note that it hasn't always been the same x
14:43 <Cale> and we've yet to actually pick xs
14:43 <Cale> anywhere
14:43 <hanspeter> ahh, i missed the point that we have to construct the right hand side first
14:43 <hanspeter> i think
14:44 <Cale> So at this point, we obtain gen_turn [] 1 = []
14:44 <hanspeter> yes
14:44 <Cale> because no tail of [] will match the pattern x:db'
14:44 <Cale> and so there's no choice for xs, one level up
14:45 <Cale> so gen_turn [2] 2 = []
14:45 <Cale> and then there's no choice for xs up at the top level, where we had chosen x = 1, db' = [2]
14:45 <Cale> So we abandon that choice of x:db'
14:45 <Cale> and try x = 2, db' = []
14:46 <Cale> and, by now you should expect that fails as well
14:46 <Cale> So, we're just never able to pick an xs, since the lists we try to pick from turn out to be empty
14:46 <Cale> and so we never construct an element of the resulting list
14:47 jorris joined
14:49 <Cale> hanspeter: You can do this much faster if you just assume that the function does what it ought to rather than trying to figure out what happens in each recursive step
14:50 <hanspeter> okay, i understand that xs will become empty, i just can't figure out why the list is empty, when xs is empty.. e.g. replace x <- gen_turn db' (n-1) with xs <- []
14:51 <Cale> xs won't become empty
14:51 <Cale> the list of lists that xs is meant to be selected from is empty
14:51 <hanspeter> how could it be done faster? i still would like to understand the recursion though
14:51 <Cale> The easiest way to understand and write recursive functions is to assume that the recursive applications of them will work as expected.
14:52 <hanspeter> yes, that's the same as doing xs <- [], right?
14:52 <Cale> right
14:52 <hanspeter> i thought that xs will then be [].. that's not right?
14:52 <Cale> that's not right, indeed
14:52 <Cale> xs won't get bound to anything
14:52 <hanspeter> ahaaa
14:52 <Cale> It'll get bound to each of the elements of [] in turn, and [] has no elements
14:53 <Cale> So we're just done, without ever having produced an element
14:53 <hanspeter> so it will not even create any list at this point
14:53 <hanspeter> yes.. not inserting any element i mean
14:53 joneshf-laptop joined
14:54 <hanspeter> i think that was the problem why i didn't understand it
14:54 <hanspeter> thank you very much Cale
14:55 <hanspeter> Cale++
14:56 <hanspeter> isn't that how karma is increased?
14:57 runforestrun joined
14:58 <Akii> @karma+ Cale
14:58 <lambdabot> Cale's karma raised to 80.
14:58 <hanspeter> @karma+ Cale
14:58 <lambdabot> Cale's karma raised to 81.
14:58 <hanspeter> thank you
14:58 splanch joined
15:05 baweaver joined
15:07 ysgard joined
15:07 ysgard joined
15:07 tom7942 joined
15:08 jorris joined
15:11 uglyfigurine joined
15:17 aarvar joined
15:20 skeet70 joined
15:25 netheranthem joined
15:34 chlong joined
15:35 dni- joined
15:39 tom7942 joined
15:39 guampa joined
15:43 mizu_no_oto_work joined
15:43 e14 joined
15:48 mattyw_ joined
15:49 yellowj joined
16:02 jrajav joined
16:04 ubsan joined
16:06 expo873 joined
16:08 stef204 joined
16:10 pilne joined
16:10 Gloomy joined
16:14 jathan joined
16:18 lithie joined
16:30 smichel17 joined
16:38 <Akii> designing data types is so hard >.<
16:39 <Akii> anyone got a few articles on how to design data types such that invalid states become unrepresentable?
16:39 e14 joined
16:40 <sdx23> "invalid states"
16:40 <boxscape> that sounds like a job for dependent types to me (although I don't know too much about them)
16:41 <benzrf> boxscape: dependent typing is fun :)
16:41 <boxscape> I agree
16:41 <benzrf> Akii: what are you trying to do?
16:42 permegreen joined
16:44 <Akii> benzrf: I'd have to explain my business constraints to you now
16:46 <benzrf> Akii: you can do that if you want
16:46 <Akii> can I catch you tomorrow? work is almost over :D
16:52 chlong joined
16:53 e14 joined
17:00 conal joined
17:09 arpl left
17:10 jorris joined
17:11 jorris joined
17:12 vmeson joined
17:17 takle joined
17:24 <Vzox01> Hello, everyone! Speaking of depended types. I have a type "Level Int", where Int has to be between 1 and 72, currently I do that with a "smart" constructor (e.g. a function that returns a valid Level) and by defining a Functor instance for it to allow access to the Int with additional logic (e.g. not going over or under). Is that the best I can do with Haskell, there is no way to define bounds on a type level right?
17:24 dni- joined
17:25 <Vzox01> Also, what if I were to do "data Level = Level1 | Level2 | ... | Level72" how bad would that be? Doesn't feel good at all, but at least I have limits on the type level.
17:28 takle joined
17:29 <geekosaur> probably not that terrible although I'd probably shorten to L01 ... L72 or something
17:30 <MarcelineVQ> I think that last one would be more annoying for you than bad exactly. it's a good question, and should be approachable with the tools ghc has currently, I'm not quite sure how though, all I can find are puzzple pieces
17:30 <MarcelineVQ> oop :>
17:30 <geekosaur> and yes, more annoying than terrible
17:30 <geekosaur> type level can be done with Nat-s, but that's annoying in a different way
17:30 <MarcelineVQ> the second part was about type level nats
17:36 malaclyps joined
17:39 e14 joined
17:40 eatman joined
17:40 <eatman> Hi!
17:46 nil_ joined
17:51 <MarcelineVQ> Vzox01: the most relevant thing I came accross, I've not written that sort of thing myself so I don't have any particular advice about it http://conal.net/blog/posts/type-bounded-numbers
17:55 <MarcelineVQ> eatman: heya
17:56 takle joined
17:58 <nil_> Is anything special being planned for Haskell's 30th birthday?
17:58 <nil_> I would love a Haskell 30 t-shirt for starters.
18:01 <qu1j0t3> nil_: No, the community's too lazy.
18:02 <nil_> Use seq then.
18:02 <nil_> Or bang patterns, I guess?
18:05 <MarcelineVQ> pseq where p = party
18:12 takle joined
18:15 uglyfigurine joined
18:16 arpl joined
18:19 e14 joined
18:24 jorris joined
18:28 blissdev joined
18:29 <boxscape> Strict people aren't necessarily known for being party animals
18:30 swashdown joined
18:44 takle joined
18:47 conal joined
18:55 <parsnip> the :t result in ghci is messy for Parsec items. is there anyway to shorten the names in the type output?
18:56 <parsnip> so like:
18:56 <parsnip> λ> :t P.sepBy ==> P.sepBy :: P.Stream s m t => P.ParsecT s u m a -> P.ParsecT s u m sep -> P.ParsecT s u m [a]
18:57 <parsnip> hmm, maybe just have to really write them down on paper to help thought process
19:00 nomotif joined
19:02 t0by joined
19:03 dni- joined
19:08 guampa joined
19:11 efes joined
19:11 harfangk joined
19:13 <efes> Hi! I'm doing the Haskell from first principles book and have a question. Shouldn't "6 / fromIntegral (length [1,2])" and "6 / fromIntegral $ length [1,2]" do the same? I don't understand why the second expression is wrong
19:14 <boxscape> the first one is "6 / (fromIntegral (length [1,2]))", the second one is "(6 / fromIntegral) (length [1,2])"
19:14 <boxscape> "/" has a stronger precedence than "$"
19:15 <boxscape> ^ efes
19:16 <efes> Thanks boxscape! I remember that $ has a precendence of 0 and / something like 7. So there is no way of writing that expression with $?
19:16 <boxscape> well, you can use $, but only if you put paretheses around (fromIntegral $ length [1,2])
19:16 <geekosaur> parenthesize (fromIntegral ... )
19:17 <efes> I see :) Thank you very much guys!
19:20 delexi joined
19:21 jomg joined
19:28 takle joined
19:36 takle joined
19:46 MotherFlojo joined
19:48 <eatman> Hey, tell me, I'm used to have a Tab taking 2 spaces, not 4. Is it a big deal in the Haskel comunity or no-one realy care?
19:48 takle joined
19:50 <kadoban> eatman: Well, you shouldn't usually be using tabs, by convention. If you mean your usual indent is 2 spaces, that'll fit in fine.
19:51 <kadoban> (to be clear, what key you actually hit isn't important, it's what your editor puts in the file itself)
19:52 <eatman> Yeah, true, indent not tabs.
19:52 <eatman> (Vim changes them into spaces anyway)
19:52 <kadoban> Anywhere between 2 and 4 seems common it haskell
19:53 <eatman> Perfect, thanks.
19:57 mengu joined
19:57 raduom joined
19:58 <raduom> Hi. If I use guarded recursion the stack will still blow up if i try to evaluate too many elements. It's only thing is that the computation can be stopped at any point in the evaluation due to laziness. Am I understanding this correctly?
19:59 <geekosaur> stack blowup usually means too much laziness, so you have too many expressions waiting on the pattern match stack for some other expression to be evaluated
20:01 <raduom> in general foldr will blow the stack if fed enough elements from a list, but it can work with infinite lists, while foldl' can be constant in space, but cannot deal with infinite lists.
20:01 <raduom> i am trying to properly understand what 'guarded recursion' is.
20:03 <Cale> foldr won't always cause a stack overflow at all
20:03 <Cale> e.g. you can let foldr (:) [] [1..] run essentially forever, and it won't hurt
20:04 <raduom> foldr (+) 0 (repeat 1) -- this one does.
20:04 <Cale> Well, right, but it's not really foldr which is putting things on the stack
20:04 <Cale> It's (+)
20:05 <Cale> (+) needs to match on both of its arguments to be able to produce its result
20:05 <raduom> Isn't (+) supposed to be strict?
20:05 <Cale> It is
20:05 <Cale> That's the problem
20:05 <raduom> ouch. it makes foldr useless.
20:05 <Cale> foldr isn't useless, it's quite often the one you want
20:05 <Cale> Usually you either want foldr, or you want foldl'
20:06 <raduom> yeah. i mean you cannot 'stop' it anymore if (+) will try to evaluate it's second arguent.
20:06 <Cale> Ah, yeah, foldr and (+) don't work so well together, at least not the (+) for Integer or most of the other standard numeric types.
20:07 <Cale> But if you want to implement, say, filter, or map, then foldr is certainly what you want.
20:08 <raduom> and if you have a accumulator function that is lazy in it's accumulator argument then it gets tail call optimized.
20:08 curious_corn joined
20:08 <Cale> It's weird to say tail call optimised
20:09 <Cale> because there's no call stack
20:09 <Cale> There's a stack, but it's more like a stack of case expressions waiting for their scrutinee to be sufficiently evaluated to match a pattern
20:09 <raduom> i think it is called tail recursion modulo cons, or guarded recursion. no?
20:09 <Cale> Evaluation is outermost-first, so you don't ever let a function wait on the stack while you evaluate its argument
20:10 <Cale> You might let a function application wait on the stack while you evaluate the function
20:10 <Cale> (but that's almost never the cause of a stack overflow apart from contrived cases)
20:12 <Cale> and generally, when you're going to evaluate a function application, you don't need to alter the stack at all, ever.
20:13 <Cale> So I guess that might be "tail call optimisation", but it's weird, because that always applies to every function application.
20:15 <raduom> I meant that if you have that function the foldr gets optimized.
20:15 <raduom> so foldr (:) ... will not consume any space on the stack.
20:17 acarrico joined
20:19 takle joined
20:20 <Cale> Well, it'll briefly use the stack while it pattern matches the list, but it will immediately finish with something of the form (x:xs) that a surrounding case expression can match on
20:20 <Cale> and then only if xs is evaluated will the foldr continue
20:20 <raduom> yes. i think constant space would be the better way of stating that.
20:21 e14 joined
20:23 carlomagno joined
20:25 mizu_no_oto_work joined
20:27 curious_corn joined
20:28 <raduom> cool. i think i've got it. thanks a lot for the help, Cale and geekosaur!
20:50 curious_corn joined
20:56 ysgard_ joined
21:00 louispan joined
21:02 conal joined
21:05 takle joined
21:18 malaclyps joined
21:31 uglyfigurine joined
21:32 e14 joined
21:52 jarshwah_ joined
21:52 hiratara joined
22:01 peterbecich joined
22:07 zero_byte joined
22:08 ederign_ joined
22:09 uglyfigurine joined
22:14 lambda3 joined
22:21 briansteffens joined
22:26 ederign_ joined
22:28 benley joined
22:29 louispan joined
22:29 l_coal left
22:31 hiratara joined
22:37 takle joined
22:38 djfo joined
22:44 takle joined
22:51 smkz joined
22:54 ro6 joined
22:56 ScarieBlowfish joined
22:57 uglyfigurine joined
23:05 eacameron joined
23:08 <parsnip> when you read "ParsecT s u m a", do you read this as " oh, and a parser"?
23:10 <parsnip> yep, docs say this way too
23:11 <parsnip> "... is a parser with ..."
23:11 takle joined
23:15 takle joined
23:15 freeside joined
23:17 <freeside> say, what's the function that turns [Just 1, Just 2, Just 3] into Just [1,2,3] and vice versa?
23:18 lambda3 left
23:19 <benzrf> freeside: sequence!
23:24 <parsnip> :t sequence
23:24 <lambdabot> (Monad m, Traversable t) => t (m a) -> m (t a)
23:24 <parsnip> :t traverse
23:24 <lambdabot> (Applicative f, Traversable t) => (a -> f b) -> t a -> f (t b)
23:30 acarrico joined
23:31 mengu joined
23:32 grayjoc joined
23:34 louispan joined
23:37 suls joined
23:38 NoCreativity joined
23:42 systemfault joined
23:45 arpl left
23:47 <freeside> thanks, i was trying to find it by type signature on hoogle, but couldn't: http://hoogle.haskell.org/?hoogle=t%20(m%20a)%20-%3E%20m%20(t%20a)