<     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 bydo joined
00:03 juanpaucar joined
00:06 eacameron joined
00:10 eacamero_ joined
00:12 louispan joined
00:19 Xlaech joined
00:29 eacameron joined
00:29 louispan joined
00:29 justinfokes joined
00:31 juanpaucar joined
00:32 i-amd3 joined
00:46 systemfault joined
00:47 justinfokes joined
00:47 aarvar joined
00:59 carlomagno joined
01:06 harfangk joined
01:07 nullcone joined
01:11 justinfokes joined
01:11 Xlaech joined
01:19 cschneid_ joined
01:25 louispan joined
01:25 Youmu joined
01:26 cschneid_ joined
01:34 prophile joined
01:35 juanpaucar joined
01:40 vaibhavsagar joined
01:44 eacameron joined
01:52 Xlaech joined
01:58 dni- joined
01:59 justinfokes joined
01:59 justinfokes joined
02:03 juanpaucar joined
02:07 pie_ joined
02:07 <pie_> hi guys, noob here
02:07 <pie_> im trying to write a parser for the SWF specification
02:07 <pie_> using attoparsec
02:08 <pie_> (terrible idea for a beginner probably but hey)
02:08 <pie_> so i see there are unsigned integral types in Data.Word
02:09 <pie_> but those have nothing to do with endianness....so, xy problem, what i really want to do is, how do i tell the parser i want an x byte big endian integer?
02:09 <pie_> for something like data SWFIntU64 = Word64 deriving Show
02:13 <LiaoTao> pie_: System.Endian?
02:14 <pie_> LiaoTao, ok but can i express this in the type or is thie a ...how do you say it? code thing?
02:14 <pie_> *or is this
02:15 <monochrom> pie_: attoparsec has anyWord8 so you can read 8 bytes and merge them.
02:16 <pie_> this is what i have so far xD https://pastebin.com/pPfzxVmY
02:16 <pie_> also you guys know anything more recent than https://www.schoolofhaskell.com/school/starting-with-haskell/libraries-and-frameworks/text-manipulation/attoparsec, most of the stuff it uses is marked depracated
02:17 <pie_> monochrom, hmmmmm ok
02:17 <pie_> monochrom, and data.word appears to have endianness conversion
02:17 <pie_> but uh...well i guess ill just have to think about it
02:18 <pie_> this is what i have so far xD https://pastebin.com/pPfzxVmY
02:18 <pie_> "The SWF file format uses 8-bit, 16-bit, 32-bit, 64-bit, signed, and unsigned integer types. All integer values are
02:18 <pie_> stored in the SWF file by using little-endian byte order: the least significant byte is stored first, and the most
02:18 <pie_> significant byte is stored last, in the same way as the Intel x86 architecture. The bit order within bytes in the
02:18 <pie_> SWF file format is big-endian: the most significant bit is stored first, and the least significant bit is stored last."
02:18 <pie_> ugh, pdf copy pasting
02:22 <pie_> if anyone cares, swf format spec is at https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf-file-format-spec.pdf
02:22 <pie_> im at the beginning on page 14 :P
02:23 jud^ joined
02:25 Xlaech joined
02:26 exferenceBot joined
02:28 <pie_> do i just stick deriving show on the end of everything
02:30 <pie_> yeah i totally messed up the type signatures
02:31 hexagoxel joined
02:33 Xlaech left
02:34 wedens joined
02:40 <pie_> uh not supposed to be any {} in ther
02:43 <pie_> oh wait there are im just bad at recognizing patterns :P
02:46 aarvar joined
02:47 <glguy> pie_: it seems like you might be confusing these data type declarations
02:48 <pie_> glguy, basically i have nothing to do with types at the moment :C
02:48 <pie_> any they are lik 70% of the whole point
02:48 <glguy> what is the SWFIntS08 type supposed to be for, for example?
02:49 <pie_> well really its just supposed to be a 8bit integer
02:50 <pie_> SWFIntS16 is a 16bit big little endian integer
02:50 <glguy> ok, it's not
02:50 <pie_> *bit
02:50 <glguy> right now or only has one value
02:50 <glguy> i think you meant to provide a different constructor
02:51 <pie_> thats easily possible
02:51 <glguy> and for the constructor to have a Word8 field
02:51 <pie_> yeah probably
02:51 <pie_> this didnt really make sense to me either as is, then again a lot of things dont yet
02:52 <pie_> glguy, well theres this https://hackage.haskell.org/package/attoparsec-binary-0.2/docs/Data-Attoparsec-Binary.html
02:53 <pie_> but i cant tell how that helps with my types
02:53 <pie_> glguy, should i be using Parser Word8 and such?
02:54 <glguy> yeah, you'll need to use those
02:55 <pie_> ok
02:55 <pie_> one sec
02:56 <pie_> ok now it doesnt error on deriving xD
02:57 <pie_> on the keyword
02:57 <pie_> which makes sense i think
02:57 <pie_> having looked up what that kinda means
02:57 <pie_> glguy, heres what i have now https://pastebin.com/Ee5NS5c6
02:57 takle joined
03:02 <pie_> "All EncodedU32's
03:02 <pie_> are encoded as 1-5 bytes depending on the value (larger values need more space). The encoding method is if the
03:02 <pie_> hi bit in the current byte is set, then the next byte is also part of the value. Each bit in a byte contributes 7 bits to
03:02 <pie_> the value, with the hi bit telling us whether to use the next byte, or if this is the last byte for the value."
03:02 <* pie_> mumbles about dependent types
03:03 justinfokes joined
03:04 juanpaucar joined
03:06 <pie_> glguy, wait, the parser isnt supposed to take an integer, its supposed to parse one out of the bytestream...does Parse Word8 do that?
03:06 <pie_> i mean youre more likely to be right than i am... :P
03:07 argent0 joined
03:10 prophile joined
03:10 <glguy> yes the Parser is parameterized by the type of thing it parses out of in source
03:10 <glguy> the source*
03:13 <pie_> ok thanks
03:13 <pie_> so im already getting in over my head with some ideas
03:14 <pie_> glguy, would it be possible to do something like Parser Aligned Word8? so that it wont work unless the parser is byte aligned?
03:14 <pie_> swf does a lot of bit-level stuff
03:14 <pie_> the aligned belongs to the word8, idk if i need to parenthesize?
03:15 <pie_> or do i need to make a completely new type for this
03:18 eacameron joined
03:21 prophile joined
03:24 prophile joined
03:27 cschneid_ joined
03:31 eacameron joined
03:36 takle joined
03:39 prophile joined
03:46 shayan_ joined
03:47 dni- joined
04:06 justinfokes joined
04:18 juanpaucar joined
04:19 aarvar joined
04:20 takle joined
04:22 seangrove joined
04:28 takle joined
04:34 <LiaoTao> Sigh
04:34 <LiaoTao> After all that learning I still can't write a symbol parser
04:35 takle joined
04:43 takle joined
04:50 smwangi joined
05:00 takle joined
05:09 justinfokes joined
05:13 shayan_ joined
05:16 takle joined
05:24 nomotif joined
05:27 meandi_2 joined
05:27 cobragoat joined
05:27 justinfokes joined
05:35 dni- joined
05:39 cobragoat joined
05:42 takle joined
05:45 justinfokes joined
05:50 juanpaucar joined
05:51 takle joined
06:03 ThomasLocke joined
06:03 ThomasLocke joined
06:13 takle joined
06:13 juanpaucar joined
06:18 arpanetus joined
06:18 <arpanetus> hi!
06:19 <arpanetus> @ChanServ
06:19 <lambdabot> Unknown command, try @list
06:19 <arpanetus> @list
06:19 <lambdabot> What module? Try @listmodules for some ideas.
06:20 takle joined
06:20 <arpanetus> @takle
06:20 <lambdabot> Unknown command, try @list
06:20 <arpanetus> takle
06:21 justinfokes joined
06:24 Computist joined
06:29 condy joined
06:31 juanpaucar joined
06:39 takle joined
06:40 justinfokes joined
06:41 prophile joined
06:43 dni- joined
06:46 eminhi joined
06:57 galderz joined
06:57 takle joined
06:58 justinfokes joined
06:58 bvad joined
07:11 slomo joined
07:16 justinfokes joined
07:17 conal joined
07:20 conal joined
07:22 Pupnik joined
07:23 pbrant joined
07:24 takle joined
07:26 mattyw joined
07:27 conal joined
07:29 im0nde joined
07:29 thc202 joined
07:31 juanpaucar joined
07:31 takle joined
07:36 Levex joined
07:43 fbergmann joined
07:45 Computist joined
07:45 conal joined
07:47 zero_byte joined
07:47 Computist joined
07:49 Computist joined
07:51 Computist joined
07:51 merijn joined
07:52 colt44 joined
07:52 justinfokes joined
07:53 Computist joined
07:55 Computist joined
07:59 justanumber joined
07:59 takle joined
08:10 justinfokes joined
08:13 conal joined
08:21 pranitbauva1997 joined
08:21 grdryn joined
08:24 nickolay joined
08:28 Levex joined
08:29 justinfokes joined
08:35 juanpaucar joined
08:36 takle joined
08:40 kritzcreek joined
08:48 cur8or joined
08:52 yaewa joined
08:53 nacon joined
08:53 nacon joined
08:57 moei joined
08:58 juanpaucar joined
09:04 qu1j0t3 joined
09:05 justinfokes joined
09:15 yellowj joined
09:16 eacameron joined
09:18 im0nde joined
09:23 justinfokes joined
09:37 qu1j0t3 joined
09:39 netheranthem joined
09:40 mengu joined
09:41 justinfokes joined
09:50 mengu joined
10:00 louispan joined
10:02 juanpaucar joined
10:03 albertus1 joined
10:08 mattyw joined
10:08 TCZ joined
10:18 justinfokes joined
10:19 conal joined
10:25 romank joined
10:30 madjestic joined
10:32 fred-fri joined
10:36 justinfokes joined
10:39 slomo joined
10:41 eacameron joined
10:44 takle joined
10:49 eminhi joined
10:50 takle joined
10:52 TCZ joined
10:52 eacameron joined
10:54 justinfokes joined
10:57 eacameron joined
11:04 bluepixel joined
11:07 juanpaucar joined
11:12 justinfokes joined
11:16 albertus1 joined
11:18 mengu joined
11:20 albertus1 joined
11:22 mengu joined
11:22 albertus1 joined
11:23 im0nde joined
11:29 juanpaucar joined
11:34 pie_ joined
11:41 justinfokes joined
11:41 <pie_> hi guys, i installed binary-bits but for import qualified Data.Binary.Bits.Get as Bits ( getBool, getWord8, runBitGet, getWord16be ) im getting
11:41 <pie_> Failed to load interface for ‘Data.Binary.Bits.Get’
11:45 Levex joined
11:54 mengu_ joined
11:54 NeverDie joined
11:59 justinfokes joined
12:00 mengu joined
12:11 juanpaucar joined
12:13 dmi3y joined
12:17 justinfokes joined
12:20 fotonzade joined
12:35 justinfokes joined
12:37 shayan_ joined
12:45 wei2912 joined
12:52 fotonzade joined
12:54 justinfokes joined
12:56 tusj joined
13:10 mengu_ joined
13:11 iAmerikan joined
13:12 justinfokes joined
13:18 juanpaucar joined
13:20 eacameron joined
13:20 justinfokes joined
13:20 juanpaucar joined
13:28 eacameron joined
13:32 mengu joined
13:32 <jle`> pie_: are you in a project?
13:32 condy joined
13:33 <pie_> maybe? :/
13:33 <pie_> im in a dir with a stack.yaml
13:37 <jle`> do you have a cabal file?
13:37 <jle`> you'd need to add binary-bits to build-depends
13:39 Big_G joined
13:45 vmeson joined
13:47 erisco joined
13:48 madjestic joined
13:49 madjestic joined
13:49 fotonzade joined
13:51 Gurkenglas joined
13:56 jathan joined
14:00 <juanpaucar> Hi, since aeson 1.2 now doesn't use C FFIs by default would this mean that it would impact on the performance?
14:00 <juanpaucar> i was trying to look at benchmarks
14:02 galderz joined
14:06 jathan joined
14:06 takle joined
14:08 nacon joined
14:08 nacon joined
14:11 mitchty joined
14:14 takle joined
14:21 uglyfigurine joined
14:27 toppler joined
15:07 cschneid_ joined
15:15 im0nde joined
15:19 Gurkenglas joined
15:19 takle joined
15:19 fotonzade joined
15:23 alqatari joined
15:27 zero_byte joined
15:32 Levex joined
15:37 jathan joined
15:38 bram_ joined
15:40 <bram_> I think the PCRE package is broken, where can I file a bug?
15:40 <bram_> Should I just e-mail the maintainer?
15:42 cobragoat joined
15:43 fbergmann joined
15:48 wedens joined
15:48 kykim joined
15:51 skeet70 joined
15:52 fotonzade joined
15:54 TCZ joined
16:03 cobragoat joined
16:04 cobragoat joined
16:12 mattyw joined
16:14 cobragoat joined
16:22 mattyw joined
16:26 <bram_> I'm lost, what is a good default regex library to use? I have UTF-8 input and would like to do subgroup matches
16:30 pilne joined
16:32 <bram_> I'll just keep bashing at PCRE and see if UTF-8 support can get in there somehow
16:33 <bram_> bye
16:33 jathan joined
16:38 jespada joined
16:41 pie_ joined
16:48 argent0 joined
17:00 Nik05 joined
17:02 peterbecich joined
17:03 jathan joined
17:10 uglyfigurine joined
17:16 takle joined
17:18 takle_ joined
17:20 malaclyps joined
17:32 mattyw joined
17:37 malaclyps joined
17:37 numberten joined
17:43 Uniaika joined
17:44 cobragoat joined
17:46 carlomagno joined
17:47 takle joined
17:48 Levex joined
17:48 <geekosaur> meh, bram_'s gone. they should know that whether a haskell pcre binding handles utf8 or not depends on whether the system pcre lib does... not all systems ship a pcre with utf8 support, and some that do require you to configure/select it (notably, debian)
17:56 ebw joined
18:00 mengu joined
18:00 takle joined
18:00 <ebw> /windows
18:01 romank joined
18:03 iAmerikan joined
18:07 smichel17 joined
18:17 ebw joined
18:24 ebw joined
18:25 ebw joined
18:26 malaclyps joined
18:29 jathan joined
18:31 mac10688 joined
18:34 jathan joined
18:50 takle joined
18:56 iAmerikan joined
19:00 mstruebing joined
19:03 malaclyps joined
19:06 nacon joined
19:09 smwangi joined
19:15 mengu joined
19:23 iAmerikan joined
19:24 juanpaucar joined
19:25 mstruebing joined
19:26 mstruebing joined
19:27 uglyfigurine joined
19:27 shayan_ joined
19:34 zero_byte joined
19:36 mstruebi1 joined
19:39 takle joined
19:40 mstruebi1 joined
19:41 mengu joined
19:46 fotonzade joined
19:47 Gurkenglas joined
19:49 cobragoa_ joined
19:56 juanpaucar joined
19:57 mojjo joined
19:59 <Squarism> is there some simple single level "lenslike" mutation in base?
19:59 <Squarism> ..or in haskell
20:00 <Squarism> like elm has { rec | field = ... }
20:03 takle joined
20:08 <srhb> Squarism: As in change the value of some field?
20:08 juanpaucar joined
20:08 <Squarism> srhb, yep
20:09 <srhb> Squarism: value { fieldname = newvalue }
20:09 <Squarism> ah
20:09 <Squarism> thats it
20:09 <srhb> I believe it's called record update syntax, and that explanation was unclear, but I guess you got it anyway ;-)
20:10 zero_byte joined
20:20 juanpaucar joined
20:21 colt44 joined
20:21 takle joined
20:24 ebw joined
20:24 <ebw> #join #haskell-irc
20:24 m3tti joined
20:32 justinfokes joined
20:33 shainer joined
20:39 justinfokes joined
20:41 nullcone joined
20:47 justinfokes joined
20:48 takle joined
20:49 justinfokes joined
20:51 malaclyps joined
21:01 justinfokes joined
21:10 <thang1> what's the difference between #haskell_irc and #haskell?
21:10 shainer left
21:10 <jle`> thang1: haskell_irc is about haskell and the IRC protocol
21:10 <jle`> most discussion is about a haskell IRC client
21:10 <jle`> but i guess making irc bots in haskell is still within on-topic discussion
21:10 <jle`> #haskell is for general discussion about the haskell language
21:11 <thang1> ooh interesting, got it.
21:11 <jle`> thang1: in the future you can also look at the topics of the channels
21:11 <jle`> they're usually at the top of the screen on most clients when you enter a channel
21:11 <glguy> Yeah, using Haskell to do IRC related things
21:11 <thang1> Any way to do that without actually joining it?
21:12 <jle`> some clients might offer it
21:12 <MarcelineVQ> any stand-alone client I've used have a channel list you can search through which typically also has the topic
21:12 <MarcelineVQ> it might even be /list for you if you're lucky
21:13 <glguy> On Freenode it's: /msg alis list #haskell-irc
21:14 <thang1> /list doesn't work for me
21:14 <jle`> it might show up on a different window
21:14 <thang1> oh whoops
21:15 <mengu> thang1: you are using weechat with bnc
21:15 <thang1> yeah /list works, it gives me literally every single channel on Freenode
21:15 <thang1> Weechat with znc, yeah.
21:15 <glguy> thang1: did you see my message?
21:15 <jle`> so /list #haskell-irc
21:16 <thang1> neat, thanks. I'll keep that in mind
21:16 <thang1> glguy: which one? the /msg alis list #haskell-irc one?
21:16 <glguy> yeah
21:17 <thang1> Yeah that one works too. I was expecting it to pop up in a new window instead of in the Freenode server window (which doesn't notify me of any new output) so I didn't see anything happen at first
21:19 mengu joined
21:28 juanpaucar joined
21:38 kritzcreek joined
21:39 nickager joined
21:42 carlomagno joined
21:43 <lpaste> nickager pasted “counting usage of `rem` in various FizzBuzz solutions using State monad” at http://lpaste.net/3293703882638622720
21:44 <nickager> My state solutions appear to work, but I’m sure there is a less verbose way to code them.
21:45 takle joined
21:45 <nickager> I’d be greatful for any pointers for improvement …
21:45 justinfokes joined
21:46 justinfokes joined
21:47 justinfo_ joined
21:53 hiratara joined
21:54 malaclyps joined
21:55 irco joined
21:55 <hexagoxel> nickager: but "rem" is used even if the guard returns false. you just count divisible numbers.
21:56 <hexagoxel> also you can replace `state` with `modify` and ($>) (or (>>)/(>>=))
21:56 <nickager> oh yes
21:56 <hexagoxel> :t \x -> modify (+1) $> x
21:56 <lambdabot> (Num s, MonadState s f) => a -> f a
21:57 <hexagoxel> :t modify (+1) $> "foo"
21:57 <lambdabot> (Num s, MonadState s f) => f [Char]
21:57 takle_ joined
21:58 <nickager> :t ($>)
21:58 <lambdabot> Functor f => f b -> a -> f a
21:59 <hexagoxel> :t modify (+1) $> "foo" :: State Integer String
21:59 <lambdabot> State Integer String
21:59 <hexagoxel> well or State Int
22:00 <hexagoxel> you cannot execute an action in the guard, so if you want to count, the easiest way might be to do +1, +2, +3 in the different cases.
22:00 <nickager> yes I see that
22:01 <nickager> whoops, not only too verbose, but wrong!
22:01 <hexagoxel> if you really want to count evaluation, you could add some Debug.Trace stuff around `rem`. But that would lead to stderr output only
22:01 <nickager> it was an experiment to see if I understood the State monad
22:02 <nickager> it felt like the kind of thing State is used for … at least that’s my understanding
22:03 <nickager> Ok thanks for your help
22:03 <hexagoxel> yeah, just for State learning, the exact semantics don't matter too much i guess :)
22:04 <nickager> :t (*>)
22:04 <lambdabot> Applicative f => f a -> f b -> f b
22:04 ryantm joined
22:07 takle joined
22:08 <argent0> nickager: maybe a Writer monad is more specific to your case (counting uses of rem)
22:09 daxorid joined
22:09 <nickager> I thought Writer was problematic
22:10 <argent0> how so?
22:12 <nickager> I thought I read that it was easy to create space-leaks with Writer so use State instead, but now I search I can’t find a reference, so I’ve probably muddled it up with something else
22:13 <hexagoxel> nah, you remember correctly.
22:13 <nickager> How would the Writer work in this context?
22:13 <monochrom> FSVO "easy".
22:13 <monochrom> More precisely, naïve use does. But naïve use of a lazy language already does.
22:14 <monochrom> In particular, space leak with State is just as easy.
22:14 <nickager> hmm looking my Haskell code feels fairly naive at the moment :-(
22:14 <argent0> nickager: I don't know yet, but i was thinking about using the Sum monoid
22:15 <monochrom> Even more precisely, my "naïve" means you pretend that the language is still eager.
22:20 <hexagoxel> monochrom: does that extend to WriterT?
22:20 <monochrom> I think yes.
22:21 <hexagoxel> because the first things i find on the mailing list are "Stricter WriterT" with examples where only StateT has the desired performance, and WriterT does not.
22:23 <monochrom> It is easier to increase eagerness of State. You can just issue a "get" and seq the answer. You don't have a similar handle on the log Writer keeps.
22:24 dedgrant joined
22:26 <nickager> and doesn’t “Control.Monad.Writer.Strict” help as well?
22:26 <hexagoxel> .. sounds like a good argument to avoid Writer.
22:26 <monochrom> How do you know that it helps, apart from presuming you know what that "Strict" means?
22:27 <hexagoxel> how does using Writer help?
22:27 <monochrom> Having said that, I think you are supposed to stick to execWriter(T) and consume the log lazily. That will be an impedence match with how Writer(T) produces the log.
22:28 <nickager> monochrom: I don’t, I was asking
22:29 <monochrom> No, it doesn't.
22:30 iAmerikan joined
22:30 <hexagoxel> you could argue that until you can distinguish the cases where State is appropriate and where Writer is, just using State might be the easier approach, just from a learning perspective.
22:31 hiratara joined
22:31 <monochrom> Well, you will also find an argument to not use a lazy language altogether. let x=[1..100000000000000] in sum x `div` length x.
22:32 <hexagoxel> my argument aligns with learning haskell, yours does not.
22:32 <lpaste> argent0 annotated “counting usage of `rem` in various FizzBuzz solutions using State monad” with “counting usage of `rem` in various FizzBuzz solutions using State monad (annotation)” at http://lpaste.net/3293703882638622720#a511198213139595264
22:32 <nickager> http://dev.stephendiehl.com/hask/#writer-monad - “This implementation is lazy, so some care must be taken that one actually wants to only generate a stream of thunks. Most often the lazy writer is not suitable for use, instead implement the equivalent structure by embedding some monomial object inside a StateT monad, or using the strict version.
22:32 <nickager> import Control.Monad.Writer.Strict”
22:32 <glguy> "Strict" (WriterT e) isn't strict in the values of type 'e'
22:33 <nickager> is this bad information
22:33 <nickager> ?
22:33 <monochrom> Eh? People will encounter my example during learning. In fact my example 2 months earlier than any Writer example.
22:34 <glguy> I think think of good uses of the lazy writerT, I can't think of any particularly good uses of the strict one
22:38 <glguy> I suppose if you're going to use WriterT on top of another Monad instance witha strict >>= you might as well use the strict writer
22:38 malaclyps joined
22:46 <lpaste> glguy annotated “counting usage of `rem` in various FizzBuzz solutions using State monad” with “Instead of half-monoid with Writer, how about full monoid?” at http://lpaste.net/3293703882638622720#a355560
22:48 <glguy> nickager: also if you're counting rems, then lines 11 and 12 should count 2 and 3 uses (depending on what you had in mind)
22:49 <glguy> oh, and 3 for otherwise, too
22:50 uglyfigurine joined
22:50 Levex joined
22:50 <nickager> indeed, poor code in many ways :-)
22:52 sigmundv__ joined
23:02 danny_ joined
23:03 <lpaste> argent0 annotated “counting usage of `rem` in various FizzBuzz solutions using State monad” with “Imperative style” at http://lpaste.net/3293703882638622720#a355561
23:18 <nickager> argent0: neat
23:23 cschneid_ joined
23:32 shayan_ joined
23:34 nickager left
23:39 louispan joined
23:57 alqatari joined
23:59 louispan joined
23:59 jathan joined