<     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 25 26 27  
28 29 30 31
00:00 eacameron joined
00:10 kritzcreek joined
00:18 nille joined
00:21 saussure joined
00:26 prophile joined
00:29 eacameron joined
00:31 zacts joined
00:32 <zacts> is there a haskell equivalent to Ruby's Ruby on Rails, or Elixir-lang's Pheonix framework?
00:32 <zacts> I'm wondering if I should consider Haskell for web development, and why or why not?
00:32 <jle`> zacts: try asking on #haskell for more feedback
00:33 <zacts> jle`: ok thanks :-)
00:33 <zacts> I do actually have to go as my wifi hotspot is broken, but I'll ask in a few hours
00:39 saussure joined
00:48 takle joined
00:51 saussure joined
00:55 trolling joined
00:55 patbecich joined
01:03 patbecich joined
01:13 carlomagno joined
01:14 takle joined
01:18 juanpaucar joined
01:21 Pupnik joined
01:21 louispan joined
01:25 tmciver joined
01:26 Bhootrk_ joined
01:38 prophile joined
01:40 takle joined
01:43 mjora7 joined
01:49 vmeson joined
02:08 nomotif joined
02:10 louispan joined
02:16 takle joined
02:20 exferenceBot joined
02:23 louispan joined
02:24 peterbecich joined
02:25 hexagoxel joined
02:30 MarcelineVQ joined
02:36 saussure joined
02:38 Lokathor joined
02:38 dni- joined
02:40 wei2912 joined
02:43 saussure joined
02:45 juanpaucar joined
02:51 louispan joined
02:51 Lokathor joined
03:06 <Lokathor> Section "29.4 Sharing", in the IO chapter of the book
03:07 <Lokathor> this section has some strange ideas, let me tell you
03:08 takle joined
03:10 <MarcelineVQ> how strange, would you say?
03:10 <Lokathor> rather
03:10 <Lokathor> there's a use of the word "not" exactly where it should not be
03:11 <Lokathor> There's some strange assumptions too, about when you're guranteed to get a result back or not
03:13 <Lokathor> the sentence, it [GHC] couldn’t [disable all forms of sharing], because all Haskell programs have a main action with an obligatory IO type.
03:13 <Lokathor> is also suspect
03:15 <MarcelineVQ> Ah a concrete example :> Well if IO disabled all sharing and everything you do is in main :: IO _ (which in the end it is) then ghc haskell wouldn't have sharing.
03:17 <MarcelineVQ> where is the 'not' you referred to by the way, "A function of type IO String is not a computation that, if evaluated, will result in a String" ?
03:17 <Lokathor> no, next paragraph or so
03:17 <Lokathor> A function of type IO String is not a computation that, if evaluated,
03:17 <Lokathor> will result in a String; it’s a description of how you might get that
03:17 <Lokathor> String from the “real world,” possibly performing effects along the
03:17 <Lokathor> way.
03:18 saussure joined
03:19 <MarcelineVQ> So yes? :>
03:19 <Lokathor> I would contend that the word "not" shouldn't be in that sentence
03:20 <Lokathor> oh, sorry
03:20 <Lokathor> yes, you were right the first time
03:20 <MarcelineVQ> consider evaluation and executation as seperate things, I can evaluate liftA2 (++) getLine getLine and get a new computation
03:20 <MarcelineVQ> but if I don't execute it I don't have the value that computation described how to make
03:21 <Lokathor> well i suppose it breaks down to how you label evaluate vs execute
03:24 <MarcelineVQ> "Describing IO actions does not perform them" is the meat of the section
03:25 <MarcelineVQ> I can evaluate (piece together) different recipe combinations but that doesn't bake the pie.
03:29 takle joined
03:42 geekosaur joined
03:44 takle joined
03:46 <Lokathor> MarcelineVQ, That part I agree with
03:47 <Lokathor> it's all the sentences leading up to that which don't sit right :P
03:48 takle joined
03:59 takle joined
04:07 takle joined
04:15 takle joined
04:18 saussure joined
04:19 louispan joined
04:23 begriffs joined
04:23 takle joined
04:26 nomotif joined
04:27 <gnusosa> Any Parsec experts in the room? :)
04:28 dni- joined
04:35 wedens joined
04:36 saussure joined
04:46 juanpaucar joined
04:51 systemfault joined
04:53 begriffs joined
05:11 louispan_ joined
05:16 <glguy> gnusosa: Unless you're taking a survey on the number of experts you should ask your actual question
05:20 meandi_2 joined
05:21 aijony joined
05:37 nomotif joined
05:39 begriffs joined
05:43 begriffs joined
05:45 eacameron joined
05:45 begriffs joined
05:49 eacamero_ joined
05:51 ebw joined
05:55 juanpaucar joined
06:04 ebw joined
06:05 <ebw> Those stack lts version numbers get a new minor every (subjectively) hour or so ... I thought it would mean Long Term Support. How is that supposed to work?
06:11 <ebw> 3 Months ... that is not pretty long ..
06:17 dni- joined
06:17 <MarcelineVQ> lts numbers don't change that fast, even the nightly releases are once a day. regardless, long term support doens't mean things change slowly, it means that things that work should continue to work for a long time.
06:19 <MarcelineVQ> more info here https://github.com/fpco/lts-haskell#readme
06:21 <ebw> Fair enough, but there is nothing written, how long a snapshot will be available? (In contrast to being maintained.)
06:22 <MarcelineVQ> well there isn't exactly a maintaining to do since version of packages lock in
06:23 <MarcelineVQ> so far, afaik, stack isn't old enough to have snapshots too old to be worth keeping around
06:24 Kuros` joined
06:24 aijony joined
06:25 <MarcelineVQ> even the oldest nightlies are still around https://www.stackage.org/snapshots?page=17
06:26 patbecich joined
06:27 nomotif joined
06:29 <ebw> nice so far
06:36 juanpaucar joined
06:45 takle joined
06:48 <ebw> Is it good practice for a library author to provide Arbitrary instances for the types the library provides?
06:52 <glguy> no
06:52 <glguy> or at least certainly not common
06:53 <glguy> it would probably depends on the kind of library you were making
07:02 <ebw> I was simply thinking about that, as I got orphan instances in my toy projects (for learning), when I placed types in lib/whatever.hs and arbitrary instances in tests/tests.hs. Maybe I should look at some libs that come with a testsuite, how they do it.
07:06 conal joined
07:10 grizwako joined
07:12 saussure joined
07:21 takle joined
07:25 nomotif joined
07:32 patbecich joined
07:39 nickolay_ joined
07:39 takle joined
07:41 saussure joined
07:46 takle joined
07:57 louispan joined
07:58 juanpaucar joined
07:59 saussure joined
08:05 Gurkenglas joined
08:06 dni- joined
08:09 ebw joined
08:18 saussure joined
08:20 raduom joined
08:22 Xion_ joined
08:28 saussure joined
08:32 colt44 joined
08:33 patbecich joined
08:42 ralu joined
08:46 Uniaika joined
08:46 saussure joined
08:48 chbatey joined
09:04 saussure joined
09:05 eacameron joined
09:07 juanpaucar joined
09:10 thc202 joined
09:16 saussure joined
09:28 ljc joined
09:41 Gloomy joined
09:42 nickolay_ joined
09:48 grizwako_ joined
09:50 Gloomy joined
09:50 patbecich joined
09:52 saussure joined
09:54 dni- joined
09:55 takle joined
09:57 Uniaika joined
10:04 netheranthem joined
10:07 ridho joined
10:11 juanpaucar joined
10:11 saussure joined
10:18 louispan joined
10:29 saussure joined
10:31 nickolay_ joined
10:34 delexi joined
11:05 saussure joined
11:14 raduom joined
11:14 ebw joined
11:15 patbecich joined
11:16 juanpaucar joined
11:16 madjestic joined
11:18 bvad joined
11:24 saussure joined
11:24 ebw joined
11:36 haskelleksah joined
11:42 saussure joined
11:43 dni- joined
11:52 spion joined
11:53 colt44 joined
11:54 <colt44> What is the best way to handle sql exceptions when trying to execute a query with persistent and esqueleto?
11:54 <colt44> I tried to use insertUnique to avoid exceptions caused by violation of unique constraints.
11:54 <colt44> But I keep getting the exception back. Using insert or insertUnique made no difference.
11:54 <colt44> Also, according to persistent's documentation - there is some fragility to trying to catch the correct exception and determing the column of failure;.
11:54 <colt44> So, I wonder, how does one handle such cases in a more robust way?Y
11:54 <colt44> bitemyapp: any suggestions?
11:59 yellowj joined
12:01 saussure joined
12:19 saussure joined
12:20 juanpaucar joined
12:22 spion joined
12:24 sigmundv joined
12:28 romank joined
12:29 saussure joined
12:43 romank joined
12:46 shainer joined
12:46 shainer left
12:48 pbrant joined
12:49 wei2912 joined
12:52 ebw joined
12:53 contiver joined
12:55 ebw joined
12:56 prophile joined
12:56 saussure joined
13:05 simendsjo joined
13:09 Uniaika joined
13:10 Uniaika joined
13:18 Xion_ joined
13:18 romank joined
13:22 saussure joined
13:24 juanpaucar joined
13:25 ebw joined
13:29 saussure joined
13:32 dni- joined
13:35 pie_ joined
13:38 aarvar joined
13:43 madjestic joined
13:47 kritzcreek joined
13:50 nschoe joined
13:55 ebw joined
13:59 patbecich joined
14:01 pie_ joined
14:05 pilne joined
14:07 madjestic joined
14:07 fotonzade joined
14:13 Bhootrk_ joined
14:16 ebw joined
14:18 madjestic joined
14:19 juanpaucar joined
14:21 sigmundv joined
14:31 saussure joined
14:35 henrytill joined
14:49 romank joined
14:52 romank joined
14:53 c4r50nz joined
14:59 exferenceBot joined
15:06 madjestic joined
15:11 begriffs joined
15:20 begriffs_ joined
15:21 dni- joined
15:22 patbecich joined
15:24 juanpaucar joined
15:35 saussure joined
15:40 begriffs joined
15:46 juanpaucar joined
15:49 aarvar joined
16:06 sigmundv joined
16:06 m3tti joined
16:21 grayjoc joined
16:21 wedens joined
16:22 romank joined
16:27 Kuros` joined
16:29 saussure joined
16:32 patbecich joined
16:35 romank joined
16:38 romank joined
16:40 malaclyps joined
16:40 malaclyps joined
16:48 yellowj joined
16:56 saussure joined
17:04 juanpaucar joined
17:10 machaerus joined
17:10 dni- joined
17:13 Gurkenglas joined
17:14 saussure joined
17:15 kadoban joined
17:17 netheranthem joined
17:25 saussure joined
17:28 albertus1 joined
17:29 <gnusosa> Hi, I'm trying to match only uppercase words in parsec but I can't seem to find a way to combine `many1 letter` with `upper`, I was wishing for something like `many1 letter . many1 upper` or similar. I just want to parse uppercase words. Is there a correct way to do this?
17:31 eHammarstrom joined
17:35 patbecich joined
17:39 erisco joined
17:40 systemfault joined
17:44 saussure joined
17:44 romank joined
17:50 <kadoban> gnusosa: Probably: many1 (satisfy isUpper) or something like that
17:50 <kadoban> Not sure if there's a more concise way, didn't see one on a quick scan of parsec docs.
17:53 saussure joined
17:53 <gnusosa> kadoban: that's correct, you can simplify that to `many1 upper`. But that satisfies one or more cases of an uppercase letter.
18:01 romank joined
18:03 takle joined
18:03 RouxTheDay joined
18:08 sigmundv joined
18:08 juanpaucar joined
18:11 saussure joined
18:23 <kadoban> gnusosa: Oh, what do you want instead?
18:23 <kadoban> You want to match 'Blah' and not 'BLAH' and not 'blah' ?
18:26 yellowj joined
18:26 ebw joined
18:26 Kuros` joined
18:29 nomotif joined
18:31 saussure joined
18:38 <gnusosa> I want to match "BLAH BAH", but it seems "Teem Toady" is also match, I only want uppercase words.
18:38 <gnusosa> I assume `many1` is matching against the two uppercase Ts in `Teem Toady`.
18:38 <gnusosa> kadoban: ^^^
18:38 <kadoban> What's your current try exactly?
18:39 <gnusosa> (Text.Parsec.try $ many1 upper <* eof)
18:40 <kadoban> That should match exactly one UPPERCASEWORD and then nothing else after it. But it'll backtrack if it doesn't match
18:41 <kadoban> If you want to match "BLAH BAH", that would be something like: (many1 upper) `sepBy` space
18:42 takle joined
18:43 <gnusosa> oh I see.
18:44 <kadoban> Depending on context it might need a bit more around it. If there is any context.
18:45 <gnusosa> that's what it needed the spaces
18:45 <gnusosa> Thanks so much kadoban
18:46 <kadoban> Anytime
18:53 kritzcreek joined
18:58 saussure joined
18:59 dni- joined
19:11 Gloomy joined
19:12 juanpaucar joined
19:16 saussure joined
19:19 Xion_ joined
19:24 systemfault joined
19:30 Gloomy joined
19:31 madjestic joined
19:32 romank joined
19:34 saussure joined
19:36 ebw joined
19:37 <ebw> Why can't I write a Semigroup instance for something that is already a Monoid? Like 'instance Monoid a => S.Semigroup a where ...' if I imported Data.Semigroup qualified as S?
19:37 fotonzade joined
19:38 <kadoban> ebw: What's the error? But in general you can't do that because then what happens with anything that already has both a Monoid instance and a Semigroup instance? Which instance is used, yours or the already existing one? Haskell generally doesn't allow this inconsistency.
19:40 <ebw> It says something about needing a type like (T a1 .. an) with distinct type variables a1 to an.
19:43 <MarcelineVQ> ah, it'll also propose a solution to that in the error, give it a try and see if it helps
19:43 <MarcelineVQ> in the not too distant future Semigroup will be a superclass of Monoid so when possible it's better to write Monoid in terms of Semigroup instead of Semigroup in terms of Monoid
19:44 vmeson joined
19:44 takle joined
19:45 takle joined
19:48 <MarcelineVQ> I think that's FlexibleInstances, which is :seti -XFlexibleInstances in ghci or {-# LANGUAGE FlexibleInstances #-} at the top of your source file, if it suggests something else in the error try that
19:50 <ebw> yes it suggests FlexibleInstances but at the moment I try to google what that is and if there are caveats I need to take care of, if I use that.
19:50 <MarcelineVQ> good plan
19:50 <MarcelineVQ> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/search.html?q=-XFlexibleInstances&check_keywords=yes&area=default
19:51 <kadoban> It's certainly not in my "known okay to turn on always" set of extensions.
19:52 nullcone joined
19:52 saussure joined
19:57 <geekosaur> it's in my list of "safe but often inappropriately suggested" list
19:57 <geekosaur> er s:2nd/list/extensions/
19:59 <Akii> it's in my "had that once and fixed it by adding a type signature" list
20:00 <kadoban> Oh is it? I thought it was in the not-all-that-safe-or-sane list. I'll have to take another peek at it sometime.
20:01 <MarcelineVQ> Undecidable is closer to that description, depending on what you're making
20:01 <geekosaur> yeh, it's no UndecidableInstances pragma, its main "problem" is ghc often suggests it when something else is wrong
20:02 <geekosaur> and turning it on mya or may not unconfuse ghc
20:02 <kadoban> Ah
20:02 RouxTheDay joined
20:02 <geekosaur> but having it on always won't mean all your programs are unsafe
20:02 <geekosaur> (or potentially unsafe)
20:04 bluepixel joined
20:11 saussure joined
20:11 mengu joined
20:14 hecliunyx joined
20:14 merijn joined
20:15 <colt44> anyone willing to enlighten me on how to catch an error thrown by persistent/esqueleto?
20:22 shainer joined
20:24 truelean joined
20:30 saussure joined
20:32 patbecich joined
20:39 <dmj`> colt44: what have you tried so far
20:42 <colt44> dmj`: I tried to use insertUnique to get a maybe in case of unique constraint violation but I kept getting the exception back when executing the query. then I used `try` to get an Either in case of exceptions. but whenever I try to work with the Either I get this error message Could not deduce (Exception t0) arising from a use of ‘catch’ from the context: (MonadHandler m, MonadCatch m)
20:42 <colt44> I ran out of ideas.
20:42 shainer left
20:42 truelean left
20:44 <colt44> dmj`: being able to work with the either is enough for me. but I don't understand what I need to do to make the compiler happy in this case
20:45 <dmj`> colt44: can you paste code (lpaste.net)
20:45 <colt44> sure
20:48 zero_byte joined
20:48 saussure joined
20:48 dni- joined
20:51 <lpaste> colt44 pasted “Handle Persistent Exception” at http://lpaste.net/355740
20:51 systemfault joined
20:52 <colt44> dmj`: here it goes
20:53 <dmj`> :t putStrLn “test"
20:53 <lambdabot> error: lexical error at character '\8220'
20:53 <colt44> dmj` line 11 is the one that throws the exception
20:56 <dmj`> colt44: have you tried to use `catch` (the method of MonadCatch)
20:56 <dmj`> also, slight nit, line 12
20:56 <dmj`> :t ($) forM xs
20:56 <lambdabot> error:
20:56 <lambdabot> • Variable not in scope: xs :: t a
20:56 <lambdabot> • Perhaps you meant one of these:
20:56 <dmj`> :t \xs -> ($) forM xs
20:56 <lambdabot> (Monad m, Traversable t) => t a -> (a -> m b) -> m (t b)
20:56 <dmj`> :t \xs -> forM xs
20:56 <lambdabot> (Monad m, Traversable t) => t a -> (a -> m b) -> m (t b)
20:56 <dmj`> you can drop the ($)
20:57 <dmj`> https://hackage.haskell.org/package/exceptions-0.8.3/docs/Control-Monad-Catch.html#v:catch
21:02 <colt44> dmj`: just wrap the whole query ? -> catch (query)(something else)
21:03 <dmj`> colt44: sure
21:03 <dmj`> the monad you’re in is type SqlPersistT = ReaderT SqlBackend
21:04 jship joined
21:04 <dmj`> ReaderT is an instance of MonadError, so catchError might works as well
21:05 <dmj`> colt44: you could do this in Handler though.
21:05 <dmj`> newIdE <- runDB $ saveEntry authId audioFileInfo category now entry
21:05 <dmj`> what if you put a try here instead
21:05 <dmj`> result <- try $ runDB (saveEntry authId audioFileInfo category now entry)
21:08 saussure joined
21:08 mjora7 joined
21:13 colt44 joined
21:16 jmiven joined
21:17 <colt44> dmj`: not sure how to use the catch in this context.
21:17 <dmj`> :t catchError
21:17 <lambdabot> MonadError e m => m a -> (e -> m a) -> m a
21:18 romank joined
21:19 <dmj`> x <- (runDB $ saveEntry authId audioFileInfo category now entry) `catchError` (\(e :: SomeException) -> liftIO (print e))
21:21 aarvar joined
21:21 <dmj`> colt44: you’ll have to comment out returning entryId in saveEntry
21:21 <dmj`> SqlPersistT m () ~ ReaderT r IO ()
21:22 <dmj`> where m ~ IO, I’m unsure what r is in SqlPersistT
21:23 nomotif joined
21:27 saussure joined
21:32 <colt44> dmj`: but I need to know what the inserted key is. omiting it would be of no use to me
21:32 juanpaucar joined
21:37 dni- joined
21:38 <dmj`> colt44: right, what is the type of Handler? I’ve never used Yesod
21:39 <colt44> `postEntriesR :: EntryCategory -> Handler ()` where EntryCategory is a value extracted from the URL.
21:43 <dmj`> colt44: try something like this, http://lpaste.net/3982074629224136704
21:44 <dmj`> colt44: where Int is your Key Entry
21:45 saussure joined
21:49 cschneid_ joined
21:50 <colt44> dmj`: I got a Illegal type signature: ‘Either SomeException EntryId’ Type signatures are only allowed in patterns with ScopedTypeVariables, do I need to enable anything to be able?
21:51 <dmj`> put {-# LANGUAGE ScopedTypeVariables #-} at the top
21:51 <dmj`> of the file
21:52 hiratara joined
21:56 <colt44> dmj`: thank you so much. it worked. I was on the rigth path with the entry thing. What I was missing was the language extension to give the proper type for the compiler.
21:56 <dmj`> colt44: sweet!
21:57 <dmj`> colt44: happy hacking
21:57 <colt44> dmj`: I pretty much appreciate your help
21:57 <colt44> thanks
21:57 <dmj`> colt44: np
22:00 ego joined
22:02 RouxTheDay joined
22:02 nomotif joined
22:03 saussure joined
22:04 Rodya_ joined
22:04 im0nde joined
22:04 im0nde joined
22:23 saussure joined
22:24 romank joined
22:27 romank joined
22:30 pie_ joined
22:31 hiratara joined
22:32 juanpaucar joined
22:37 moly joined
22:38 <moly> Is this the place to ask for help about using stack to install a package?
22:39 mr_sm1th joined
22:40 <kadoban> moly: It's an acceptable place
22:41 saussure joined
22:41 <moly> I'm trying to install HaskellR using stack and nix, as the documentation says to do, using the command "stack --nix build".
22:42 <kadoban> Never heard of it. I don't really know nix either. What trouble are you running into though?
22:42 <moly> some of the packages fail to install because stack cannot find a C compiler, but I have gcc installed and in my $PATH
22:46 <moly> Configuring network-
22:46 <moly> configure: WARNING: unrecognized options: --with-compiler, --with-gcc
22:46 <moly> checking build system type... x86_64-unknown-linux-gnu
22:46 <moly> checking host system type... x86_64-unknown-linux-gnu
22:46 <moly> checking for gcc... no
22:46 <moly> checking for cc... no
22:46 <moly> checking for cl.exe... no
22:46 <moly> configure: error: in `/run/user/1000/stack11595/network-':
22:46 <moly> configure: error: no acceptable C compiler found in $PATH
22:46 <moly> See `config.log' for more details
22:48 <moly> but "which gcc" returns "/usr/bin/gcc", and "echo $PATH" returns a string that includes /usr/bin
22:54 systemfault joined
22:59 saussure joined
23:02 romank joined
23:04 bluepixel joined
23:07 Gurkenglas joined
23:07 romank joined
23:10 romank joined
23:17 saussure joined
23:17 <moly> Is there a better forum to ask the above question?
23:19 conal joined
23:19 <glguy> moly: #haskell is more active than this channel. It's probably worth bundling up all the output from the terminal and from config.log and putting it on http://lpaste.net and asking there
23:20 <glguy> You shouldn't be pasting so many lines to IRC
23:21 <glguy> moly: Using nix to build will limit the set of people who can help you, but perhaps someone will notice something from the log
23:27 romank joined
23:28 saussure joined
23:28 <moly> OK, thanks
23:32 romank joined
23:46 saussure joined
23:53 romank joined
23:56 louispan joined