<    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 _2_4 25  
26 27 28 29 30 31
00:00 mengu joined
00:04 peterbecich joined
00:06 Rizy joined
00:21 dni- joined
00:27 peterbec` joined
00:29 peterbec` joined
00:32 hiratara joined
00:34 Rizy joined
00:34 begriffs joined
00:43 Pupnik joined
00:44 Rizy joined
00:44 vaibhavsagar joined
00:47 peterbec` joined
00:51 Rizy joined
00:59 yellowj joined
01:07 MotherFlojo joined
01:11 michaelt joined
01:18 mengu joined
01:19 cschneid_ joined
01:25 malaclyps joined
01:31 moei joined
01:56 begriffs joined
02:00 conal joined
02:07 Ayey_ joined
02:10 dni- joined
02:20 danny_ joined
02:24 Rodya_ joined
02:30 takle joined
02:32 louispan joined
02:43 Ayey_ joined
02:47 begriffs_ joined
02:52 systemfault joined
02:56 louispan joined
03:01 takle joined
03:08 MotherFlojo joined
03:14 peterbec` joined
03:14 peterbecich joined
03:14 DataComputist joined
03:15 Rizy joined
03:20 mengu joined
03:24 DataComputist joined
03:27 begriffs joined
03:29 gpolitis joined
03:32 Rizy joined
03:32 DataComputist joined
03:38 takle joined
03:38 mengu joined
03:40 MotherFlojo joined
03:44 exferenceBot joined
03:48 hexagoxel joined
03:53 Blacink joined
03:58 Pupnik_ joined
03:59 dni- joined
03:59 Ayey_ joined
04:11 AgentChicken joined
04:14 michaelt joined
04:17 takle joined
04:18 <mounty> Can I ask about evaluation in the context of >> and >>= ? Take the example of requireAuthId at https://hackage.haskell.org/package/yesod-auth-1.4.17/docs/Yesod-Auth.html
04:18 <mounty> Now without requiring specific knowledge of the Yesod framework of which this is a part ...
04:18 <mounty> That obviously returns a Monad transformer result and is generally used thus:
04:18 <mounty> requireAuthId >>= someFunc
04:19 <mounty> where someFunc takes an (AuthId master
04:19 <mounty> ) argument.
04:20 <mounty> As the documentation says though, it has the effect of 'redirects to a login page if user is not authenticated'.
04:20 <mounty> So if the user be not authenticated, someFunc is not called. If the user be authenticated, someFunc is called and the authentication token is passed in.
04:20 <mounty> Simple!
04:20 <glguy> Yes, that's right
04:20 <mounty> But what if you want to ensure authentication but don't need the token?
04:21 <mounty> requireAuthId >>= (const someOtherFunc)
04:21 <glguy> Then you can use >> like you seemed to be eluding to
04:21 cschneid_ joined
04:21 <mounty> right but can one be sure that it still has the side-effect if the user be not authenticated?
04:21 <glguy> yes
04:22 <mounty> Since it doesn't need to supply the authentication token, will it still do the test ? AIUI yes, glguy has already answered.
04:22 <mounty> I just wanted to be sure.
04:22 <glguy> m >> n is short-hand for m >>= \_ -> n
04:22 <mounty> As I'm writing quite a few requireAuthId >>= const
04:23 <mounty> OK; thanks. I thought so but just wanted to confirm.
04:25 <mounty> That's a very nice simple security mechanism to keep the baddies out of your application.
04:29 cschneid_ joined
04:35 hexagoxel joined
04:39 harfangk joined
04:41 takle joined
04:43 louispan joined
04:43 <monochrom> The IO exception mechanism is another instance when "x >>= y" is not obliged to let y happen.
04:50 takle joined
04:51 Pupnik__ joined
04:57 takle joined
04:57 <mounty> So to understand what is going on here, thinking in terms of the AST, if x evaluate to a monad, then (apply (>>=) (x) (y)) happens.
04:58 <mounty> If x evaluates to 'error', (>>=) itself throws an error because it doesn't know what to do with an argument of that type. Richtig?
05:03 <monochrom> It highly depends on the actual x and which monad (>>=) comes from. I am just saying that examples exist.
05:05 takle joined
05:18 cschneid_ joined
05:20 cschneid_ joined
05:30 <qmm> epta: sorry for the delay. i was afk for the rest of the day. i will take a look tomorrow and get back with you if someone hasn't
05:31 takle joined
05:39 mengu joined
05:39 patbecich joined
05:42 <Cale> mounty: As a point about terminology: monads don't live at the level of values in Haskell -- A monad is always a type-level function, like IO or Maybe. People use various words for the values of type M t when M happens to be a monad, "M-actions" is a popular one.
05:46 <Cale> mounty: Also, toward your questions about evaluation: evaluation in Haskell typically has no user-visible effects (apart from making the CPU warm) -- it just computes values for the purposes of being able to match patterns, and doesn't generally cause I/O to occur (lazy I/O messes with that worldview a bit, but only a little bit for input effects, and unsafePerformIO breaks it)
05:46 <Cale> mounty: Execution of IO actions, that is, carrying out the effects that they describe, is a separate process from evaluation (which only does some work to figure out which action to take, without really doing anything)
05:48 dni- joined
05:48 <Cale> So, when you fail to evaluate the result of an IO action, *usually* the effects of the action still happen -- I can only say usually because getContents is magic and breaks that.
05:50 patbecich joined
05:54 peterbecich joined
05:54 peterbec` joined
05:56 takle joined
05:56 MotherFlojo joined
05:57 mengu joined
05:59 eacameron joined
06:15 systemfault joined
06:17 takle joined
06:22 louispan joined
06:27 hexagoxel joined
06:30 uglyfigurine joined
06:30 <yellowj> a noob questio => is there any difference between (traverse) and (mapM)?
06:34 cschneid_ joined
06:34 <geekosaur> mapM is much older and has a Monad constraint as a result. That's pretty much it.
06:47 takle joined
06:50 hexagoxel joined
06:50 meandi_2 joined
06:51 patbecich joined
06:56 Pupnik joined
07:21 wei2912 joined
07:21 owiecc joined
07:22 simendsjo joined
07:23 xmonader2 joined
07:23 xmonader2 left
07:26 eacameron joined
07:34 Gurkenglas joined
07:37 louispan joined
07:37 dni- joined
07:38 takle joined
07:46 takle joined
07:50 michaelt joined
07:51 nomotif joined
07:55 nomotif joined
07:57 MotherFlojo joined
07:59 mengu joined
08:04 <jle`> yellowj: i practice it means that you can use traverse on more things than you can use mapM on, and it's often more performant
08:04 <jle`> s/often/sometimes
08:05 <jle`> these days there isn't really any purpose for mapM, besides maybe its homey familiarity among certain crowds
08:07 <Cale> Well, and the fact that it has a better name :P
08:07 takle joined
08:08 <jle`> proving my point :p
08:09 <Cale> mapA might've been more popular
08:11 <Cale> "for" is pretty good, but feels out of place without the "A" at the end somehow
08:11 <jle`> yes for does feel very weird to type/read
08:12 Durz0 joined
08:13 <Cale> The thing is, there are very few commonly relevant examples of things which are Applicative but not Monads, and even the performance benefit is pretty rare, and well, you lose either do-notation, or the ability to understand what do-notation means.
08:14 <Cale> So, while I use Applicative notation in various places, I don't often struggle over the distinction between Applicative vs. Monad when defining stuff.
08:15 <jle`> having things that are monad but not applicative happens often enough for me that i have to make a distinctino
08:15 <Cale> You mean the other way
08:15 <Cale> ?
08:15 <jle`> ah, yes.
08:15 <Cale> There's like, Validation.
08:16 <Cale> (and ZipList, but nobody uses ZipList)
08:16 <Cale> and what else? :)
08:16 <Cale> Maybe some less-popular parsing libraries
08:16 <jle`> Const
08:16 mengu joined
08:16 <jle`> but mostly because i don't like using Writer w (), heh
08:18 <jle`> also i'm in the admittedly rare position of writing applicative-polymorphic code a lot
08:19 <jle`> so in that case i have to mind my traverse/mapM's
08:19 <jle`> but not many people are forced to write applicative-polymorphic code very often
08:19 <Cale> yeah
08:19 <jle`> maybe if they work a lot with lenses/traversals
08:21 t0by joined
08:21 <rockfruit> I've been trying to get Reflex.Dom setup with stack. I've inserted dependencies as complaints surfaced, but now I seem to have hit a stalemate. In truth, I don't quite know how to interpret the output of `stack build`, can anyone help me? http://lpaste.net/353705
08:22 <Cale> rockfruit: Also note that #reflex-frp exists :)
08:22 <Cale> I know there are some stack users there who managed to get things going
08:23 <Cale> (though I don't know whether they're awake right now)
08:23 peterbec` joined
08:23 <kadoban> rockfruit: It looks like you're not using the right version of GHC at least (that's the "base" stuff). What's in your stack.yaml?
08:23 peterbecich joined
08:23 <Cale> ah, yeah
08:25 <Cale> rockfruit: If you're just looking to get going writing a reflex-dom application and don't care much about whether you use stack, I would highly recommend reflex-platform
08:25 <rockfruit> Cale thanks. kadoban the only mods to my yaml are pasted below the message on that pastie
08:25 <rockfruit> Cale stack's all I know (totally new to fp and haskell, and hit all kinds of weird behaviour before stack 'saved' me)
08:25 <rockfruit> so I'll try it!
08:26 <kadoban> rockfruit: Oh. You have to at least tell stack to use GHCJS, which is some mess you copy/paste from the docs.
08:26 <Cale> rockfruit: If nothing else, it will save you hours of compiling ghcjs
08:26 <rockfruit> right on, thanks folks.
08:26 <Cale> https://github.com/reflex-frp/reflex-platform
08:26 <kadoban> Ya, I'd probably recommend you go with Cale's suggestion unless you're really set on stack (I say as a user of stack)
08:27 <rockfruit> ah yes. I remember this - I tried it last week, and failed-over to stack on a hair-trigger. I'll give it a go now. thanks truly.
08:28 <Cale> With respect to being saved from version hell, reflex-platform uses nix, which is like stack, but for anything.
08:28 <kadoban> It is possible to use stack for this, I've done it before. But I don't have an up-to-date setup for it, and I'm not sure where to find one and etc.
08:28 <Cale> and so it'll make sure you have all the same system libraries and so on installed -- which consumes a good chunk of disk space, but otherwise is very nice for reliability
08:29 <rockfruit> I've been skirting nix for ages, this is as good a reason as any to get it down.
08:33 michaelt joined
08:33 takle joined
08:44 NeverDie joined
08:44 hexagoxel joined
08:54 mengu joined
08:55 Pupnik_ joined
08:58 kritzcreek_ joined
09:02 takle joined
09:16 <mounty> Cale: thanks for the explanation. The more I hang around here and other Haskell channels, the less I think I understand ... which is an essential step to true understanding, of course.
09:17 <Cale> mounty: No problem :)
09:18 <mounty> Cale: I understand IO being a side-effect or almost parallel behaviour in IO. The actual appearance of data in the output is somehow magicked-in to the >>= AIUI.
09:18 nepiktaz joined
09:18 <mounty> So you just evaluate stuff and as an almost incidental side-effect, output appears.
09:22 <mounty> Last night I was trying to write a function (Applicative f) => [f a] -> f [a].
09:22 <mounty> I was sure it was possible and was trying at first to use 'sequence', not appreciating that was specific to IO.
09:23 <mounty> It was a bit like a stoner trying to draw a square circle ... I was sure it must be possible but I just couldn't see how.
09:23 <mounty> Eventually I found applicativeA and its TWO possible definitions. :-(
09:23 <mounty> It was a timely reminder that I'm still a beginner.
09:25 <kadoban> :t sequence
09:25 <lambdabot> (Monad m, Traversable t) => t (m a) -> m (t a)
09:25 <kadoban> That's not specific to IO? Or did I misunderstand?
09:25 <mounty> Oh wait, not specific to IO but to Monads. Applicative /= Monad.
09:26 <kadoban> Ah, yes. There is an Applicative one though, uhm
09:26 <kadoban> :t sequenceA
09:26 <lambdabot> (Applicative f, Traversable t) => t (f a) -> f (t a)
09:26 dni- joined
09:26 <kadoban> There we go. sequence has the type it does mostly for historical reasons I believe. Applicative didn't exist
09:26 <mounty> Yep. I found it, and its definition. http://learnyouahaskell.com/functors-applicative-functors-and-monoids
09:31 MarcelineVQ joined
09:35 michaelt joined
09:36 Pupnik__ joined
09:40 thc202 joined
09:41 <Cale> mounty: Ah, but if you only *evaluate* IO actions, then nothing actually occurs
09:41 <Cale> You have to *execute* them, which is a different thing.
09:42 <Cale> Now, if you look at GHC's implementation of things, internally, it uses impure functions, and internally, evaluation and execution get unified along the way for simplicity
09:43 <Cale> But in principle there are other ways that IO could be implemented, and GHC's somewhat hacky way where it passes around 0-bit-wide tokens to keep the dependency analysis in the right order isn't such a great mental model.
09:43 louispan joined
09:43 <Cale> But yeah, as far as what ordinary usage lets you see, evaluation doesn't cause much to occur
09:43 <Cale> You might try:
09:43 <Cale> getLine `seq` 5
09:44 <Cale> which will evaluate getLine before producing 5 as the result
09:44 <Cale> (and you'll notice you're not asked for any keyboard input)
09:44 <Cale> Conceptually, getLine is merely a description of a thing that could be done (get some input from stdin, constructing a String)
09:45 <Cale> and evaluating it just puts that description into some form where it's ready to be pattern matched on
09:46 <Cale> You can imagine if you want that the runtime system might contain an interpreter taking apart the IO action recursively, and actually carrying out the actions described
09:46 <Cale> In reality, GHC produces better native code than that, but in principle, it would be the same except slower to do everything that way
09:46 <mounty> Cale: yes; I do understand that bit.
09:47 <mounty> Also I did read somewhere that GHC's code-generation has improved greatly since the compiler was first released.
09:48 dni- joined
09:49 <Cale> mounty: Oh, that's certainly true
09:51 <Cale> mounty: It's been around since 1991 -- there have been some advances since then for sure ;)
09:54 <mounty> One of the main points of attraction to me of Haskell is that it just keeps giving and giving (in a good way, unlike say WordPress which keeps giving and giving in a bad way).
09:55 <mounty> I mean that it just seems you can never get to the end of understanding the language, unlike most where it's just a matter of quickly skimming though whatever syntax they've devised for the same old concepts.
09:56 <mounty> "Yep, it's got classes/types, it does, er, single inheritance and this is the syntax. Functions as first class values? no, not this language. etc. You just run down a checklist and have the whole thing pigeon-holed in a couple of days.
09:57 <mounty> That doesn't apply to Javascript where the questions are more like, did he SERIOUSLY do THAT??? Has the guy got a CLUE at all? etc.
09:57 <kadoban> I rather like JS. It's quirky. And at least it didn't just copy the same old languages exactly.
09:59 <mounty> It sure didn't kadoban. It sure didn't.
09:59 <mounty> It took all the worst bits from others and put them all together in one place.
09:59 owiecc joined
10:00 <kadoban> Not really. The number parts are AFAIK new, and the prototype inheritence and such I've never seen elsewhere. Not that I'm saying it's a language I'd use, but at least it's interesting.
10:01 <mounty> The prototype inheritance is one part of what's wrong with it. That single feature makes the language almost impossible to analyse statically, which is why it's such a security disaster.
10:02 <mounty> Just because you CAN do something, doesn't mean you SHOULD.
10:03 albertus1 joined
10:04 <Cale> It does keep giving and giving for quite a long time. I'm not sure what more I can extract from the language *itself* at this point, but certainly the body of Haskell libraries as a whole also has a lot to offer which I haven't yet understood.
10:04 zero_byte joined
10:05 <Cale> (and I've been programming in Haskell since 2001 or so)
10:06 <mounty> Cale: you're so lucky. There are so few jobs in Haskell here in my home city of Brisbane, and most of those that are, are with a government body that recruits at the speed of a glacier on a slow weekend.
10:06 <mounty> (I am of course assuming that your day job is Haskell)
10:06 <Cale> Yeah
10:07 <Cale> Well, I've been professionally using Haskell for not as much of that time :)
10:08 uglyfigurine joined
10:08 <mounty> Anyway, I'm AFOK now. Got an hour to work on my project while my good lady wife is watching her favourite TV programme.
10:08 <Cale> :)
10:18 louispan joined
10:18 eacameron joined
10:22 louispan joined
10:22 jarshwah_ joined
10:24 peterbecich joined
10:24 peterbec` joined
10:24 obh15 joined
10:25 Glooomy joined
10:35 netheranthem joined
10:37 louispan joined
10:39 Pupnik joined
11:01 cschneid_ joined
11:02 grayjoc joined
11:09 justicefries joined
11:12 wildlander joined
11:18 pie_ joined
11:20 louispan joined
11:21 MotherFlojo joined
11:26 louispan joined
11:36 uglyfigurine joined
11:43 jarshwah joined
11:44 eacameron joined
11:52 Zialus joined
11:59 mengu joined
12:03 nschoe joined
12:04 peterbec` joined
12:04 peterbecich joined
12:11 michaelt joined
12:24 curious_corn joined
12:30 initiumdoeslinux joined
12:45 NoCreativity joined
12:56 wildlander joined
12:57 wildlander joined
13:05 uglyfigurine joined
13:05 peterbec` joined
13:05 peterbecich joined
13:06 Blacink joined
13:07 hexagoxel joined
13:09 grayjoc joined
13:12 pilne joined
13:14 <epta> what is a proper way to get 'A' header of response? https://hackage.haskell.org/package/http-types-0.9.1/docs/Network-HTTP-Types-Header.html#t:ResponseHeaders
13:15 Vzox01 joined
13:15 <epta> should I filter this list of headers with (\pair -> fst pair == "A") or smth like that?
13:16 <epta> originally I came from https://hackage.haskell.org/package/http-client-0.5.4/docs/Network-HTTP-Client.html#v:responseHeaders
13:17 cschneid_ joined
13:19 <Vzox01> > filter (("A" ==) . fst) [("A", 1), ("B", 2)]
13:19 <lambdabot> [("A",1)]
13:20 <Vzox01> epta: You don't seem to need a lambda there to filter, you can just compose a new function
13:20 <epta> I mean shouldn't it be a Map of headers?
13:20 <epta> list seems to be not the best container for it
13:21 <Vzox01> epta: Yes, but you can create a map from a list of tuples, while there are different map implementations
13:22 MotherFlojo joined
13:22 <Vzox01> epta: The way I understand it not all maps are good for everything, so it depends on what a user of the library prefers. Then the user can just do M.fromList where M is his prefered Map module
13:29 <Vzox01> epta: There are at least four available right away: Data.Map.Stric/Lazy, Data.HashMap.Strict/Lazy, you can see benchmarks here: https://github.com/haskell-perf/dictionaries
13:32 uglyfigurine joined
13:33 owiecc joined
13:45 AndreasK joined
13:47 jomg joined
13:49 systemfault joined
13:51 systemfault joined
13:52 systemfault joined
13:53 systemfault joined
14:02 obh15 joined
14:06 peterbec` joined
14:06 peterbecich joined
14:07 uglyfigurine joined
14:10 Ayey_ joined
14:16 blissdev joined
14:29 Rizy joined
14:41 grayjoc joined
14:50 <Phillemann> I defined a type class "MonadHttp" with one function "httpRequest :: Request -> m Response". I also made "IO" an instance of this type class. I'm using "MonadIO" everywhere in my code, so I'd like to write something like "instance MonadIO m => MonadHttp m", but I'm not sure how.\
14:51 <Phillemann> Also, I'm not sure if this even makes sense :D
15:01 bungoman_ joined
15:02 enitiz joined
15:05 Apocalisp joined
15:11 uglyfigurine joined
15:22 cur8or joined
15:23 MotherFlojo joined
15:33 michaelt joined
15:37 t0by joined
15:37 t0by joined
15:39 owiecc joined
15:40 grayjoc joined
15:42 grayjoc joined
15:43 grayjoc joined
15:44 grayjoc joined
15:44 Cthalupa joined
15:44 grayjoc joined
15:45 uglyfigurine joined
15:49 enitiz joined
16:00 Cthalupa joined
16:01 jsoo joined
16:05 pie_ joined
16:07 peterbecich joined
16:07 peterbec` joined
16:09 MotherFlojo joined
16:14 t0by joined
16:19 \Mike joined
16:20 uglyfigurine joined
16:28 decaf joined
16:34 albertus1 joined
16:34 conal joined
16:44 michaelt joined
16:54 uglyfigurine joined
16:58 mac10688 joined
17:07 expo873 joined
17:07 MotherFlojo joined
17:08 peterbec` joined
17:08 peterbecich joined
17:18 cschneid_ joined
17:24 conal joined
17:26 Lazersmoke joined
17:28 ralu joined
17:29 begriffs joined
17:29 uglyfigurine joined
17:31 gpolitis joined
17:34 eacameron joined
17:37 bungoman joined
17:39 Glooomy joined
17:41 harfangk joined
17:44 Uniaika joined
17:49 yellowj joined
18:03 conal joined
18:04 uglyfigurine joined
18:07 Ayey_ joined
18:07 mac10688 joined
18:17 uglyfigurine joined
18:19 michaelt joined
18:29 shayan_ joined
18:33 pie_ joined
18:34 dibblego joined
18:34 nomotif joined
18:42 eacameron joined
18:46 cschneid_ joined
18:46 mac10688 joined
18:48 systemfault joined
18:52 aarvar joined
18:56 vaibhavsagar joined
18:56 Gurkenglas joined
18:57 cschneid_ joined
18:58 yellowj joined
19:09 peterbec` joined
19:09 peterbecich joined
19:17 dennisvennink joined
19:19 Glooomy joined
19:20 MotherFlojo joined
19:21 eacameron joined
19:37 cschneid_ joined
19:40 mengu joined
19:46 EvilVodkaMan joined
19:48 nil_ joined
19:57 <saylu> Hey everyone! I have a quick question about parsing. How do I parse an optional field? For example, I'm trying to parse semver numbers (ie. 1.0.0, 1.0.0-prerelease, 1.0.0+meta.192, 1.0.0-prerelease+meta)
19:57 <saylu> They'll always have the three main numbers (1.0.0)
19:57 <saylu> and optionally a hyphen, plus, both, or neither
19:57 <saylu> I've got some examples written here:
19:57 <saylu> http://lpaste.net/353700
19:57 <saylu> Right now I've got a parser with these two lines:
19:58 <saylu> ` rel <- try (string "-" *> many parseNoS) <|> return [] `
19:58 <saylu> ` meta <- try (string "+" *> many parseNoS) <|> return [] `
19:58 <saylu> Essentially, if there's a hyphen, then parse the following numbers or strings, and if not, just give the empty result
19:58 <saylu> Same thing for the plus representing metadata
19:58 <saylu> This works if there is one or the other, but not when there are both.
20:01 <nil_> saylu: does the "many" combinator help you?
20:01 <AndreasK> you need a form of manyTill I guess
20:01 <AndreasK> right now your parseNoS also consumes the +
20:03 <saylu> manyTill seems promising
20:03 <saylu> I mistakenly thought 'letter' meant alphabetical letters but it seems to just mean 'char'
20:03 <saylu> but tokenized
20:04 <saylu> nil_ I'm using 'many' just to repeatedly parse numbers / strings
20:05 <saylu> Hmm -- with manyTill, can I provide 'either "+" or end of input"?
20:05 <nil_> saylu: oh, I didn't look at the paste, I just took a stab in the dark when I read your question
20:05 <saylu> there may or may not be both these types
20:05 <AndreasK> what parser are you using?
20:05 <saylu> Trifecta
20:06 <AndreasK> don't know that one. Might also be that your rel parser fails upon hitting the +
20:06 <AndreasK> leaving the - at the start
20:06 <saylu> I very well may be going about this the wrong way
20:06 <AndreasK> But manyTill sounds like it might solve it
20:06 <saylu> Yes, it does.
20:07 louispan joined
20:10 contiver joined
20:11 Pupnik joined
20:11 adamCS joined
20:14 <saylu> Huh, tried to switch to `v <- (NOSI <$> integer) <|> (NOSS <$> some (oneOf ['a'..'z']))` and it's still catching the "+" in there
20:30 takle joined
20:33 takle joined
20:34 eacameron joined
20:34 danny_ joined
20:38 curious_corn joined
20:38 <AndreasK> huh thats weired
20:39 <AndreasK> saylu: Does oneOf ['a'..'z'] capture a single +?
20:40 <saylu> This version happens to work
20:40 <saylu> http://lpaste.net/353721
20:41 <saylu> λ: parseString (some (oneOf ['a'..'z'])) mempty "abc+def"
20:41 <saylu> Success "abc"
20:42 <saylu> ^^ No, it doesn't. My intuition was wrong.
20:44 jomg joined
20:44 <AndreasK> saylu: Happens to the best^^ happy you found a solution
20:45 <saylu> I'm still so unsteady with parsing. Hopefully continuing through little ones like this will help build that intuition!
20:46 peterbec` joined
20:46 peterbecich joined
20:57 <parsnip> how did aeson pick the .: notation for lookup? is that like, look for k . in table :
20:57 <parsnip> *key . in table :
20:58 <saylu> oof
20:58 <saylu> turns out it's even easier than I thought :(
20:58 <saylu> here's a simple working version of it now
20:58 <saylu> http://lpaste.net/353721
20:58 <saylu> Gotta run, thanks andreasK and nil_ for pitching in!
21:04 <monochrom> parsnip: I think it's inspired by OOP's "obj.field_name" but we have to change . to something else.
21:19 eacameron joined
21:20 michaelt joined
21:41 vaibhavsagar joined
21:42 <parsnip> ha, now i see aeson has no problem with filling a record type with json with missing fields, so this should be pretty simple after all.
21:43 <parsnip> er, well, i'll get back to you on that, i'll have to read up on where that Nothing will go
21:44 <parsnip> the things coming before and after the aeson i have some reading to do yet.
21:50 eacameron joined
21:52 hiratara joined
21:55 zero_byte joined
21:58 marmalod1 joined
22:09 louispan joined
22:16 vaibhavsagar joined
22:18 carlomagno joined
22:25 Rizy joined
22:31 hiratara joined
22:37 louispan joined
22:52 eacameron joined
23:01 liangzan joined
23:06 michaelt joined
23:06 shubhaml joined
23:09 Rizy joined
23:12 louispan joined
23:13 danny_ joined
23:21 a3f_ joined
23:24 cschneid_ joined
23:36 louispan joined
23:40 <parsnip> hmm, how do i parse something like tiny :: B.ByteString; tiny = "[hello:\"world\" add:\"1\"]"
23:40 NoCreativity joined
23:41 <parsnip> seems easier if i have "{\"hello\":\"world\" \"add\":\"1\"}"
23:41 <parsnip> is this pre-aeson modification necessary?
23:44 <geekosaur> I would expect it to be needed for parsing as a generic hash object instead of as a record, or if the keys contain characters that must be escaped. If you tell it to parse to a record and the field names match the record fields (as specified by the fromJSON instance) then I would not expect to need quoting.
23:44 <geekosaur> hash objects might well also work without it if the key characters are all legal. try it in ghci?
23:50 MotherFlojo joined
23:56 peterbecich joined
23:56 delexi joined