<     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:08 <saylu> Oof -- is there a standard `round` function in Haskell that rounds up from 0.5?
00:08 <saylu> Turns out the usual one rounds up for even numbers and down for odd ones, which isn't quite what I'm looking for
00:08 <saylu> > round 0.5
00:09 <lambdabot> 0
00:09 <saylu> > round 1.5
00:09 <lambdabot> 2
00:16 vlnts joined
00:19 malaclyps joined
00:20 ysgard joined
00:23 <saylu> https://www.irccloud.com/pastebin/LvFnnGaZ/
00:24 <saylu> I'm using this janky fix which seems to be working fine in my tests
00:25 takle joined
00:26 hphuoc25 joined
00:28 nicknovi1 joined
00:30 ysgard_ joined
00:32 takle joined
00:35 MotherFlojo joined
00:35 <_cyril_> saylu: I don't know, but I'm curious: why round even numbers up and odd ones down? Why does it work like that?
00:36 <_cyril_> (it's actually even rounded down and odd rounded up)
00:36 <saylu> Whoops, my slip there.
00:36 <thang1> It shouldn't round up for even and down for odd
00:36 <saylu> https://mail.haskell.org/pipermail/haskell-cafe/2008-October/049915.html
00:36 <thang1> Integers are the only things that are even or odd. Fractions and decimals aren't even or odd
00:38 <_cyril_> thang1: we mean the "part left of the ." is odd/even
00:38 <thang1> ah, got it
00:38 <thang1> Still, I honestly don't know why anyone bothers inventing behavior for standard functions like this anymore
00:38 <thang1> IEEE is the golden standard for "how do I do this", so just use it
00:39 <_cyril_> Well, the link saylu posted might offer a clue, I'll try to go through it later tonight
00:39 <thang1> I feel like I should just make a rounding library that correctly handles rounding to the IEEE standard...
00:40 <thang1> (replace "I" with anyone sufficiently knowledgable and actually knows enough of haskell to do that)
00:42 <thang1> https://en.wikipedia.org/wiki/IEEE_floating_point#Rounding_rules hmm
00:42 <thang1> Doesn't seem too hard?
00:44 <_cyril_> thang1: there seem to be libraries that have that already, such as https://github.com/ekmett/rounded
00:45 <thang1> of course there's an ekmett library for that...
00:46 <_cyril_> :)
00:46 <_cyril_> And it doesn't appear to mention "co" anything, which is surprising :)
00:46 <thang1> aha! It's like 3 years old
00:46 <thang1> and isn't in hackage anymore
00:52 vaibhavsagar joined
00:52 <thang1> lol how does every single library I see from ekmett always have like 27 pragmas
00:53 jship joined
00:56 <thang1> Anywya, saylu, I prefer to wrap hacky fixes up in a prime function
00:57 eacameron joined
00:57 <thang1> So I wouldn't say `round .fix $ x`, I'd just make a new function round' = round . fix
00:58 patbecich joined
00:59 <thang1> and I'd name fix as roundUpFromHalf and then it's self documenting :p
01:08 bigos joined
01:18 shayan_ joined
01:26 eacameron joined
01:27 Youmu joined
01:32 louispan joined
01:32 eacameron joined
01:33 vaibhavsagar_ joined
01:36 eacameron joined
01:39 hphuoc25 joined
01:41 acarrico joined
01:43 eacameron joined
01:46 eacamero_ joined
01:50 louispan joined
01:54 eacameron joined
02:04 louispan joined
02:21 MotherFlojo joined
02:23 eacameron joined
02:26 michbad joined
02:26 LiaoTao joined
02:30 eacameron joined
02:30 takle joined
02:33 eacamero_ joined
02:36 eacameron joined
02:41 exferenceBot joined
02:41 eacameron joined
02:45 hexagoxel joined
02:47 dni- joined
02:47 newhoggy_ joined
02:48 eacameron joined
02:51 shawn_lu joined
02:51 peterbecich joined
02:53 takle joined
02:54 <shawn_lu> Hi Friends, really don’t know how to solve this: http://lpaste.net/355122
02:59 tom7942 joined
03:02 <Lokathor> shawn_lu, well
03:03 <shawn_lu> @Lokathor, yeah
03:03 <lambdabot> Unknown command, try @list
03:03 <shawn_lu> Lokathor, yeah sup
03:03 <Lokathor> shawn_lu, so what's the trouble you're having
03:03 eacameron joined
03:04 <Lokathor> let me put it another way: if the ??? wasn't there, what type would the expression you have be, and what type do you need it to become
03:04 <shawn_lu> so embedded can be “return 1”
03:04 <shawn_lu> but in the form of “??? (const (Right (Just 1)))”
03:05 <shawn_lu> I can’t figure out how to use a constructor to get the IO working
03:05 carlomagno joined
03:05 <Lokathor> :t ReaderT
03:05 <lambdabot> forall k (a :: k) (m :: k -> *) r. (r -> m a) -> ReaderT r m a
03:05 <Lokathor> hmm, so r = (), m = IO, and a = Int
03:07 <Lokathor> shawn_lu, what does the type signature of ReaderT suggest to you?
03:07 <Lokathor> let's clear out the constraint nonsense, just look at "(r -> m a) -> ReaderT r m a"
03:08 pixelfog_ joined
03:08 <shawn_lu> let me think...
03:09 <Lokathor> shawn_lu, also, where did you get this practice problem from?
03:10 ridho joined
03:10 <shawn_lu> Oh it’s “HaskellBook” mentioned in the link in this channel
03:10 <Lokathor> ah, right. Mind refreshing me on a page number? There's a lot of pages in there
03:10 <shawn_lu> With ereader verison, it’s P1524
03:11 <shawn_lu> let me check the screen version in a sec
03:11 <MarcelineVQ> 26.8
03:11 <Lokathor> section number will do fine, i should have remembered that there's two variants
03:11 <shawn_lu> Correct, 26.8, Page 991
03:13 mac10688 joined
03:15 <Lokathor> oh right
03:15 <shawn_lu> Hi MarcelineVQ are you the co-author?
03:16 <Lokathor> naw just a help vampire :3
03:16 <MarcelineVQ> nah just good search-fu
03:16 <Lokathor> page 991 on the page, but the PDF "page numbers" don't match the numbers on the sheets, so much nonsense
03:16 louispan joined
03:17 <shawn_lu> Oh, sorry pdf page is 1023
03:17 <Lokathor> got it now
03:17 <shawn_lu> 1024
03:18 <Lokathor> hmm, so you're trying to fill in the question marks to make a valid expression of that type
03:18 <shawn_lu> right
03:18 <MarcelineVQ> If I was actually helpful I'd have said "Exercise: Wrap It Up" :>
03:18 <shawn_lu> yeah, I should’ve done that
03:18 <MarcelineVQ> muahaha
03:18 <shawn_lu> will do it next time
03:25 louispan joined
03:27 ysgard joined
03:30 <Lokathor> hmm
03:30 <Lokathor> I'm lost
03:31 <Lokathor> Guess I'll need to review before trying to stack up any dangerous transformers by hand
03:31 <shawn_lu> :)
03:31 hphuoc25 joined
03:32 <Lokathor> i used the typeclass stuff last time i did monad stacking
03:33 <Lokathor> you forget how it actaully works when you do it that way
03:34 <shawn_lu> Monad transformation is a blur to me as for now : )
03:36 malaclyps joined
03:40 <MarcelineVQ> hmm
03:40 <Lokathor> my current project doesn't need a single monad transformation, and yet i've already managed to write an impressive 0 lines all evening
03:40 <MarcelineVQ> :t (const (Right (Just 1)))
03:40 <lambdabot> Num a => b -> Either a1 (Maybe a)
03:44 <MarcelineVQ> can you solve for: ??? (pure . const (Right (Just 1)))
03:52 hphuoc25 joined
03:55 ysgard joined
03:59 takle joined
04:00 rstefanic joined
04:14 newhoggy joined
04:15 newhoggy joined
04:24 louispan joined
04:24 takle joined
04:28 conal joined
04:29 newhoggy joined
04:31 takle joined
04:36 dni- joined
04:36 newhoggy joined
04:40 <rstefanic> I'm going through chapter 10 in Haskell Book, and I'm a bit lost by one of the exercises. In the exercises for foldl, it wants me to correct one of the problems: foldr const 'a' [1..5]
04:40 newhoggy joined
04:40 <rstefanic> But the only solution to this I can think of is "foldr const 1 [1..5]"
04:40 <rstefanic> Am I on the right track? or is this a red herring?
04:40 takle joined
04:41 <glguy> rstefanic: What's the exercise exactly?
04:41 <rstefanic> The directions are to correct the errors
04:41 <rstefanic> And the problem is "foldr const 'a' [1..5]"
04:41 <rstefanic> and the only way I can think of fixing it is if I change the Char to an Int
04:42 <rstefanic> but I'm not sure if that's what needs to be fixed.
04:42 <glguy> What is it supposed to do after you correct the errors?
04:42 conal joined
04:43 <rstefanic> I'm not sure. It doesn't say what the correction should be
04:43 <rstefanic> These are the only directions: The following are simple folds very similar to what you've already seen, but each has t least one error. Please fix them and test in your REPL:
04:44 <rstefanic> That's partly why I'm confused. I'm not sure if the correct that's being looked for is changing the Char to an Int
04:44 <rstefanic> I mean, it type checks, and it doesn't give me an error
04:49 <MarcelineVQ> it is really quite vague, consider it either way, you might change foldr const 0 "goober" to foldr const 0 [1,2,3,4,5] or foldr const 'd' "goober"
04:50 <MarcelineVQ> whatever makes the most sense and typechecks
04:59 takle joined
05:01 nicknovi1 joined
05:03 Gurkenglas joined
05:14 takle joined
05:14 <rstefanic> Yeah I see. It can go any of those ways. Thanks for the advice
05:24 newhoggy joined
05:27 pungi-man joined
05:29 takle joined
05:35 carlomagno joined
05:37 hphuoc25 joined
05:38 mstruebing joined
05:39 permagreen joined
05:50 takle joined
05:52 jle` joined
05:52 jle` joined
05:55 aarvar left
06:01 pbrant joined
06:03 <LiaoTao> I've implemented a simple prime sieve using Data.Map, but it's running slowly
06:03 <LiaoTao> I'd like to use Data.Array instead just to compare their execution times
06:04 <LiaoTao> But I can't for the life of me figure out what the list comprehension in the Array constructor is supposed to do
06:04 <LiaoTao> Could someone enlighten me, please?
06:04 <jle`> LiaoTao: can you show an example of what you mean?
06:05 <jle`> what list comprehension?
06:05 <LiaoTao> https://hackage.haskell.org/package/array-0.5.1.1/docs/Data-Array-IArray.html
06:05 <LiaoTao> The [(i,e)] in the Array construction section
06:06 <LiaoTao> And the following example
06:06 takle joined
06:06 <LiaoTao> I don't understand what it's doing
06:06 <LiaoTao> jle`: I have no example because I don't understand how to begin using it!
06:07 <jle`> ah that's not a list comprehension
06:07 <jle`> that's just the type of a list
06:07 <jle`> :t [(False, 'a'),(True, 'e')]
06:07 <lambdabot> [(Bool, Char)]
06:08 <jle`> for what it's worth, Array's interface is usually considered more clunky than Vector's
06:08 <jle`> so if you just wanted to use an array/sequential memory data structure, vector might be a better first choice
06:08 <LiaoTao> jle`: Sorry for hte inaccurate language
06:08 <LiaoTao> jle`: Is that so? I'll take a look then! Thanks
06:08 <jle`> LiaoTao: yeah, the [(i, e)] is the list of the items in the array you want it to have
06:09 <LiaoTao> jle`: So it can be an empty list?
06:09 <jle`> where 'i' is the type of the "indices" of the Array, and 'e' is the type of the elements
06:09 <jle`> yes, for an empty array
06:09 <LiaoTao> jle`: Right, so it's an analogue to the "initializer list" of other languages
06:09 <jle`> an array with 'a', 'b', and 'c' would be array (0,0) [(0, 'a'), (2, 'b'), (3, 'c')]
06:10 <jle`> er, that should be (1, 'b'), (2, 'c')
06:10 <jle`> and (0,2)
06:10 <jle`> or listArray (0,2) ['a','b','c']
06:10 <LiaoTao> jle`: I thought it had something to do with the relations between different elements
06:10 <thang1> yeah that seems a bit obtuse compared to Vector?
06:10 <thang1> *disclaimer that I've never used Vector*
06:10 <jle`> yeah, you can see from the number of times i messed up that array is a little annoying to use
06:10 <jle`> Vector would just be `fromList ['a','b','c']`
06:11 <LiaoTao> Right
06:11 <LiaoTao> jle`: Thanks!
06:11 <jle`> Array's weird interface is from because Array is supposed support arbitrary "index types"
06:11 <jle`> so you can have elements indexed by (Int,Int)
06:11 <jle`> but i don't think anyone actually uses this feature
06:12 <LiaoTao> Not sure what's wrong with that
06:12 <LiaoTao> Like for addressing matrix elements?
06:12 <thang1> I see it as "making general for the sake of general"
06:13 <thang1> not everything neesd to be the most general thing on the face of the planet. Sometimes it's okay to assume everyone uses the "normal" indexing methods
06:13 <jle`> nothing particularly wrong, but compare how usable the API is
06:13 <jle`> and note that i messed up three times using the array constructor API heh
06:13 <thang1> (and jle` is most definitely not a haskell beginner)
06:14 <thang1> I'd fuck up about 15 times using the Array API, probably
06:17 takle joined
06:17 baweaver left
06:25 dni- joined
06:32 nomotif joined
06:39 aarvar joined
06:58 louispan joined
06:58 Durz0 joined
07:02 louispan joined
07:04 nomotif joined
07:08 dni- joined
07:12 hphuoc25 joined
07:15 Pupnik joined
07:16 louispan joined
07:18 madjestic joined
07:23 louispan joined
07:24 mattyw joined
07:31 galderz joined
07:47 m1dnight_ joined
07:51 thc202 joined
07:55 m1dnight_ joined
07:59 navilan joined
08:00 louispan joined
08:04 zero_byte joined
08:07 nacon joined
08:07 nacon joined
08:09 takle joined
08:12 louispan joined
08:14 takle joined
08:18 takle_ joined
08:19 louispan joined
08:23 alqatari joined
08:23 takle joined
08:24 grdryn joined
08:25 eacameron joined
08:27 <LiaoTao> So it seems my prime sieve actually got slower when using Data.Vector since its update time is O(n)
08:28 <LiaoTao> is there no way to get O(1) lookup and update without using monads?
08:28 <LiaoTao> Still haven't taken that plunge yet!
08:31 yushyin joined
08:31 hrnz joined
08:33 newhoggy joined
08:39 colt44 joined
08:50 ebw joined
08:51 mengu joined
08:52 Iceland_jack joined
09:02 binaryplease joined
09:41 Pupnik_ joined
09:42 newhoggy joined
09:42 romank joined
09:44 rstone_ joined
09:45 etrepum joined
09:48 nkpart joined
09:49 netheranthem joined
09:50 ajmccluskey joined
09:51 newhoggy joined
09:56 jimcroft joined
09:56 codedmart joined
09:57 enolan joined
10:00 newhoggy joined
10:00 BOOKBOOK joined
10:13 houli joined
10:13 yellowj joined
10:16 Youmu joined
10:18 Cir0X joined
10:24 nickolay joined
10:35 newhoggy joined
10:41 newhoggy joined
10:43 hphuoc25 joined
10:48 noumenon joined
10:52 yellowj joined
10:53 BOOKBOOK joined
10:59 alqatari joined
11:11 newhoggy joined
11:23 newhoggy joined
11:25 zaphyr joined
11:25 shayan_ joined
11:33 kritzcreek joined
11:48 binaryplease joined
11:52 acarrico joined
12:10 nicknovi1 joined
12:21 mpiuser__ joined
12:21 <mpiuser__> hey all
12:22 superlinux joined
12:22 <superlinux> hey all :)
12:22 <superlinux> any arabs here?
12:22 <superlinux> just curious
12:24 <superlinux> anyways.. I have a Facebook group for Arab people who write Haskel. now it has around 450 members.
12:28 acarrico joined
12:31 LiaoTao_ joined
12:36 slomo joined
12:36 slomo left
12:42 Gurkenglas joined
12:58 conal joined
13:00 yellowj joined
13:00 BOOKBOOK joined
13:08 mizu_no_oto_work joined
13:10 iAmerikan joined
13:13 jathan joined
13:13 conal joined
13:14 chlong joined
13:16 dni-_ joined
13:16 <mimi_vx> hwau, good
13:18 vlnts joined
13:21 newhoggy joined
13:24 superlinux left
13:31 bvad joined
13:32 mniip joined
13:36 dni- joined
13:46 dni- joined
13:47 mstruebing joined
13:50 nobodyzxc joined
13:53 iAmerikan joined
13:56 greeny__ joined
14:10 newhoggy joined
14:10 Pupnik joined
14:11 Denthir joined
14:17 gpampara joined
14:18 nicknovi1 joined
14:25 jship joined
14:26 newhoggy joined
14:30 takle joined
14:32 ysgard joined
14:39 madjestic joined
14:41 newhoggy joined
14:42 davenpcm_ joined
14:43 hphuoc25_ joined
14:43 drewr joined
14:44 nicknovitski joined
14:45 enolan joined
14:46 CuriousErnestBro joined
14:46 jimcroft joined
14:46 brennie joined
14:46 vodkaInferno joined
14:46 anoe joined
14:46 Cthalupa joined
14:47 hazyPurple joined
14:47 amuck joined
14:47 houli joined
14:47 nkpart joined
14:47 lambdabot joined
14:48 ajmccluskey joined
14:48 etrepum joined
14:49 edmoore joined
14:49 ridho joined
14:49 cmdv joined
14:50 abh joined
14:50 DDR joined
14:51 Jello_Raptor joined
14:52 rizary joined
14:52 eacameron joined
14:53 leothrix joined
14:53 NemesisD joined
14:54 zerokarmaleft joined
14:54 sclv joined
14:57 wamaral joined
14:57 jle` joined
14:57 codedmart joined
14:57 jathan joined
14:58 zero_byte joined
14:58 joel135 joined
14:59 acarrico joined
14:59 baroncharlus joined
15:00 jasobrown joined
15:02 metalrain joined
15:04 AlainODea joined
15:04 gluegadget joined
15:07 ocharles joined
15:08 newhoggy joined
15:11 reptar_ joined
15:15 carlomagno joined
15:16 jackhill joined
15:21 pixelfog_ joined
15:23 uglyfigurine joined
15:24 carlomagno joined
15:27 nomotif joined
15:27 newhoggy joined
15:27 reptar_ joined
15:30 chlong joined
15:37 ebw joined
15:39 yellowj joined
15:39 newhoggy joined
15:40 alqatari joined
15:42 reptar_ joined
15:46 newhoggy joined
15:49 hazyPurple joined
15:52 ridho joined
16:00 newhoggy joined
16:08 baweaver joined
16:12 newhoggy joined
16:13 meandi_2 joined
16:22 newhoggy joined
16:29 chatter29 joined
16:29 <chatter29> hey guys
16:29 <chatter29> allah is doing
16:29 <mengu> what
16:29 <chatter29> sun is not doing allah is doing
16:30 <chatter29> to accept Islam say that i bear witness that there is no deity worthy of worship except Allah and Muhammad peace be upon him is his slave and messenger
16:30 <mengu> and?
16:30 <mengu> lol
16:31 newhoggy joined
16:31 <Geekingfrog> dat cliffhanger
16:31 jathan joined
16:32 tom7942 joined
16:32 Levex joined
16:32 baweaver left
16:35 tom7942 joined
16:41 newhoggy joined
16:42 thoradam joined
16:44 kritzcreek joined
16:53 ridho joined
16:54 newhoggy joined
16:59 jathan joined
17:02 micro_ joined
17:03 newhoggy joined
17:08 iAmerikan joined
17:17 newhoggy joined
17:26 <Akii> lol
17:26 <Akii> question is: does islam have types tho
17:27 <Akii> oh, this was an hour ago
17:27 <Akii> nvm ^^
17:27 <mniip> this spam has been repeated so many times it's not even worth joking about
17:27 <Akii> first time I see it
17:28 pilne joined
17:28 <nitrix> "If programming languages were religions..."
17:28 <* nitrix> ducks
17:28 <Akii> hrhr
17:28 <Akii> out!
17:28 <mniip> the old version was ~40 lines, by the time they finished flooding it we usually had already gotten a report, reacted, joined, and banned them
17:29 newhoggy joined
17:29 <Akii> but hey, I'm always up for praising the sun a bit
17:29 <Akii> with onion bro
17:34 abrar joined
17:37 newhoggy joined
17:40 Levex joined
17:45 newhoggy joined
17:50 Denthir joined
17:51 malaclyps joined
17:53 newhoggy joined
17:54 romank joined
17:55 zaquest joined
18:02 newhoggy joined
18:04 chlong joined
18:04 delexi joined
18:05 uglyfigurine joined
18:11 newhoggy joined
18:20 newhoggy joined
18:22 Brokenprogrammer joined
18:24 <Brokenprogrammer> Hello
18:28 newhoggy joined
18:31 pungi-man joined
18:32 malaclyps joined
18:33 delexi joined
18:34 alqatari joined
18:36 newhoggy joined
18:40 ebw joined
18:42 <lpaste> ebw pasted “Indentation?” at http://lpaste.net/355136
18:43 <ebw> A question regarding indentation: Why does http://lpaste.net/355136 work? I thought the colum of 'F' in First would become the pivotal column and the '|' in the next line would be regarded to not belong to the same block any more?
18:44 newhoggy joined
18:44 <hexagoxel> ebw: layouting rule does not affect data declarations at all.
18:44 <geekosaur> only some things induce layout. data is not one of them
18:45 <geekosaur> let, do, case, while
18:46 <ebw> Thanks
18:46 <geekosaur> (the while in a module definition does induce layout, but at column 0 so it's rarely relevant)
18:50 jathan joined
18:50 shayan_ joined
18:55 ridho joined
18:56 jathan joined
18:56 newhoggy joined
18:58 taksuyu joined
19:02 jathan joined
19:03 malaclyps joined
19:05 newhoggy joined
19:06 patbecich joined
19:09 cschneid_ joined
19:10 abhiroop joined
19:11 takle joined
19:16 newhoggy joined
19:23 colt44 joined
19:28 iAmerikan joined
19:29 jathan joined
19:41 newhoggy joined
19:49 newhoggy joined
19:52 Denthir joined
19:57 <ebw> Why is it possible to create an incomplete record value?
19:57 newhoggy joined
19:59 <benzrf> ebw: history, probably
20:04 malaclyps joined
20:06 Bare joined
20:07 sigmundv_ joined
20:09 newhoggy joined
20:14 malaclyps joined
20:15 malaclyps joined
20:18 newhoggy joined
20:23 nicknovitski joined
20:25 newhoggy joined
20:29 iAmerikan joined
20:31 malaclyps joined
20:33 newhoggy joined
20:38 lukesp joined
20:41 peterbecich joined
20:51 newhoggy joined
20:56 iAmerikan joined
20:56 ridho joined
21:00 yellowj joined
21:02 ick joined
21:05 shayan_ joined
21:11 carlomagno joined
21:16 chlong joined
21:34 nomotif joined
21:38 Levex joined
21:42 Myrl-saki left
21:52 romank joined
21:53 hiratara joined
21:58 ysgard_ joined
22:05 levex_ joined
22:12 bno1 joined
22:16 zero_byte joined
22:16 Levex joined
22:20 moei joined
22:21 uglyfigurine joined
22:22 zaquest joined
22:23 mac10688 joined
22:31 hiratara joined
22:35 uglyfigurine joined
22:37 peterbecich joined
22:38 HallaSurvivor joined
22:44 iAmerikan joined
22:46 ysgard joined
22:46 ysgard joined
22:46 bno1 joined
22:51 newhoggy joined
22:55 carlomagno1 joined
22:58 ridho joined
22:59 ysgard_ joined
23:00 carlomagno joined
23:01 mengu joined
23:05 carlomagno joined
23:09 shayan_ joined
23:09 carlomagno joined
23:11 cschneid_ joined
23:14 carlomagno joined
23:14 prophile joined
23:19 patbecich joined
23:21 guampa joined
23:24 romank joined
23:25 shayan_ joined
23:27 moei joined
23:42 cschneid_ joined
23:44 louispan joined
23:49 uglyfigurine joined
23:57 romank joined