<     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:03 killtheliterate joined
00:03 bengt_ joined
00:04 fotonzade joined
00:05 <lpaste> fotonzade pasted “'where' problem” at http://lpaste.net/355342
00:05 <fotonzade> trie.hs:81:35: parse error on input ‘=’
00:05 <fotonzade> guys could you help me out with this?
00:05 <mniip> outdent the 'where'
00:05 <mniip> oh no
00:05 <mniip> outdent the 'd='
00:05 <mniip> it has to start at the same column as index
00:07 <fotonzade> these tabs are giving me hell
00:07 <fotonzade> thanks fellas
00:10 <monochrom> Actually my hex editor says it doesn't contain tabs.
00:10 <fotonzade> monochrom, I copied it out of vim
00:10 <fotonzade> it shows tabs as spaces on the terminal
00:13 DataComputist joined
00:17 <benzrf> hehe
00:17 <benzrf> wait what
00:19 <monochrom> I think it really means "I copied from the terminal emulator" rather than "I copied from vim".
00:20 <geekosaur> some terminal emulators expand tabs, some don't. likewise vim may or may not itself expand tabs, depending on whether "hardtab" is set or whether it thinks it knows the tabstops or not
00:21 <monochrom> There is a further complication of what vim tells the terminal, independent of hardtab.
00:22 <monochrom> Actually I don't know what hardtab does, you may be precisely saying that's what I said.
00:22 <geekosaur> it's a bit tricky. hardtab tells vim to tell curses that it can use hard tab stops. whether it does so afterward depends on whether it thinks the tab stops are set correctly or not (which in turn depends on the terminal init sequences)
00:22 <monochrom> Programmers are the people who need the most to drill into their brains that every abstraction layer adds one more lie.
00:23 <monochrom> And they are the people least aware of that.
00:24 <monochrom> So yeah there are 5 layers and 20 variables.
00:45 nacon joined
00:45 nacon joined
00:47 louispan joined
00:50 uglyfigurine joined
00:54 tom7942 joined
00:54 c4r50nz joined
01:32 shawn_lu joined
01:33 conal joined
01:37 tom7942 joined
01:41 cschneid_ joined
01:46 Durbley joined
01:47 louispan joined
01:50 malaclyps joined
01:50 jud joined
01:51 patbecich joined
01:52 takle joined
01:53 cschneid_ joined
01:59 blissdev joined
01:59 takle joined
02:08 takle joined
02:08 malaclyps joined
02:21 Youmu joined
02:23 takle joined
02:26 ridho joined
02:33 exferenceBot joined
02:35 andrew__n__ joined
02:37 hexagoxel joined
02:41 takle joined
02:41 ocharles joined
02:44 cstrahan joined
02:48 andreabedini joined
03:01 takle joined
03:08 davedub joined
03:12 takle joined
03:16 systemfault joined
03:17 systemfault joined
03:18 CARAM__ joined
03:19 takle joined
03:26 ridho joined
03:31 dni- joined
03:35 Durbley joined
03:35 hphuoc25 joined
03:39 takle joined
03:40 ridho joined
03:44 moei joined
03:49 <LiaoTao> powerset xs = filterM (\x -> [True, False]) xs
03:49 <LiaoTao> Having a bit of trouble understanding this
03:58 takle joined
04:07 binaryplease joined
04:07 rstefanic joined
04:09 <rstefanic> I'm working through Chapter 11 of Haskell book, and I'm stuck on an exercise. It's for the exercises on newtype. The last exercise wants you to create another instance of "TooMany", but the books says to create the instance for (Num a, TooMany a) => (a, a).
04:10 louispan joined
04:10 hphuoc25 joined
04:10 <rstefanic> How can I define the instance for TooMany if part of my instance includes TooMany?
04:11 <rstefanic> Like the instance that I'm trying to create includes the typeclass that I'm trying to define TooMany for.
04:15 <glguy> rstefanic: No, you get to use a TooMany instance on the type 'a' to make a TooMany instance on the tyoe '(a,a)'
04:15 <glguy> well, maybe not "no" , but you can use whatever TooMany type class methods at the 'a' type to build your new instance
04:16 <rstefanic> Maybe I didn't understand the section. I don't quite get how that would work.
04:16 hphuoc25 joined
04:17 <rstefanic> So you can create it with (Num a, TooMany a) => (a, a)
04:17 <rstefanic> ?
04:17 <glguy> Instead of worrying about this made up class, let's just talk about how we could implement: instance Eq a => Eq (a,a)
04:18 <glguy> given that: class Eq a where (==) :: a -> a -> Bool
04:18 <glguy> So that means our task is to write a definition with type: (a,a) -> (a,a) -> Bool
04:18 <glguy> and to do that we have at our disposal (==) :: a -> a -> Bool
04:19 <glguy> First we should check which parts of that you don't understand
04:19 <glguy> and which you do
04:19 <rstefanic> Okay!
04:19 <rstefanic> I get the first part. class Eq a where (==) :: a -> a -> Bool
04:20 <rstefanic> and then you could define an instance of it
04:20 <glguy> what's "it"
04:20 <rstefanic> But why in your (a, a) is it defined like this:
04:20 <glguy> (so that I don't have to guess)
04:20 <rstefanic> instance Eq a => Eq (a, a)
04:21 <rstefanic> instead of : instance Eq a => (a, a)
04:21 <glguy> Whenever you write an instance it will look like this: instance <CONTEXT> => ClassName (TypeConstructor a1 a2 a3 ... aN) where...
04:22 <glguy> there can be zero or more variables like a0, a1, etc
04:22 <glguy> The ClassName is always the class for which you are defining an instance
04:22 <rstefanic> So then in the TooMany example, I'd have to put
04:22 <rstefanic> instance TooMany (Num a, TooMany a) => TooMany (a, a) where...
04:22 <glguy> no
04:23 <glguy> The problem is your context is malformed
04:23 <rstefanic> Yeah, that's the error I'm getting
04:23 <glguy> The context you're given in the example is: (Num a, TooMany a)
04:23 <glguy> These are the extra things you get to assume while defining your instance
04:24 <glguy> You get to use all the Num type class methods, like (+), (-), fromInteger
04:24 <glguy> at the type 'a'
04:24 <glguy> and you get to use whatever methods TooMany provides at the type 'a'
04:24 <rstefanic> Oh, like the function tooMany?
04:24 <glguy> Yeah
04:24 <rstefanic> and all the functions from the Num Typeclass?
04:24 <glguy> yeah
04:25 <rstefanic> Okay. So that I understand.
04:25 <rstefanic> So I could use a previous instance of tooMany?
04:26 <glguy> You can assume that whatever type 'a' happens to eventually be, that that type will have a TooMany instance
04:26 <LiaoTao> instance Eq a => Eq (TooMany (a,a))?
04:27 <LiaoTao> Sorry for butting in, but it seems interesting :)
04:27 <glguy> No, TooMany is a typeclass
04:27 <LiaoTao> Oh
04:27 louispan joined
04:27 <LiaoTao> Nevermind then
04:27 <rstefanic> So what does it mean if my context is malinformed?
04:27 <rstefanic> *Malformed
04:27 <glguy> It means you can't write what you wrote, that it doesn't make sense
04:28 <glguy> TooMany (Num a, TooMany a) -- here you've applied a type class to another constraint, specifically the constraint (Num a, TooMany a)
04:28 <glguy> but (Num a, TooMany a) can't be an instance of this type class
04:29 <rstefanic> Okay. But reason it can't be an instance of this typeclass is *not* because it includes TooMany, correct?
04:29 <glguy> In standard Haskell terminology, only types can be instances of type classes, and constraints aren't types (this is generalized by the ConstraintKinds extension, but that's out of scope now)
04:30 cschneid_ joined
04:32 <glguy> Thinks like Int and Bool and (Int,Bool) and (Maybe Char), types with kind *, these can be instances of TooMany
04:32 <glguy> (Num a, TooMany a) isn't such a thing, so it doesn't make sense to assume that we have a TooMany instance for it
04:42 <rstefanic> I see
04:42 <rstefanic> TooMany has the kind of * -> Constraint
04:43 <rstefanic> So currently, TooMany isn't a concrete type
04:45 takle joined
04:52 hphuoc25 joined
04:52 hphuoc25 joined
04:54 <glguy> "concrete type" isn't really a thing, it's better to avoid that term
04:54 <rstefanic> Well I'm curious, but I assume that's a whole other can of worms.
04:55 <rstefanic> Okay. So I understand what you're saying about the instance being malformed.
04:55 shawn_lu joined
04:55 <rstefanic> But in your original example, how could [ instance Eq a => Eq (a,a) ] work?
04:55 <rstefanic> Wouldn't that also be malformed?
04:55 <rstefanic> OH
04:55 <rstefanic> I get it.
04:56 mudphone joined
04:56 <glguy> explain what you get so we can see what page we're all on
04:56 <rstefanic> each a has to be an instance of Eq in order for the instance of "Eq (a, a)" to be defined
04:56 <rstefanic> *each 'a' has to be...
04:56 <glguy> There's only one 'a'
04:56 shawn_lu left
04:56 <glguy> 'a' is a type, and we're assuming that there's a TooMany instance for that type
04:57 <rstefanic> Well, right now, I'm about your Eq a => Eq (a, a) example
04:58 shawn_lu joined
04:58 <glguy> instance TooMany a => TooMany (a,a) -- says "Here I'm defining an instance of TooMany for any type of the form '(a,a)', and I'm going to require that if you use this instance, then it must also be the case that there is a TooMany instance for whatever type 'a' is
04:58 <glguy> for the Eq version obviously you can replace TooMany with Eq
04:58 shawn_lu joined
04:59 <glguy> OK, so I think we said the same thing
04:59 <glguy> reading what you wrote again
04:59 <rstefanic> Yeah, you're write out is really helpful.
05:00 <rstefanic> In this case, we're defining the instance of "TooMany (a, a)" where each 'a' is constrained by "TooMany a".
05:00 <glguy> yeah
05:00 <rstefanic> it's not as difficult as I was making it out to be.
05:01 <rstefanic> You're write out of " instance <CONTEXT> => ClassName (TypeConstructor a1 a2 a3 ... aN) where... " really helped me
05:01 <rstefanic> Thanks a lot for your help.
05:01 <rstefanic> I really appreciate it.
05:03 louispan joined
05:03 takle joined
05:04 c4r50nz joined
05:04 <pixelfog_> rstefanic: I'm glad you asked about that exercise. I was stuck on it yesterday, and even though I eventually got a solution, I'm don't really understand what I did.
05:07 geekosaur joined
05:11 aarvar joined
05:11 <shawn_lu> Can anyone share some tips on how to connect to Oracle DB using Haskell? I found it quite difficult. What I've done so far:
05:11 <shawn_lu> (1) Checked out Persistent's documentation, on this page http://www.yesodweb.com/book/persistent it mentions all the mainstream one but Oracle.
05:11 <shawn_lu> (2) Got this book "Developing Web Apps with Haskell and Yesod", no mention of Oracle
05:11 <shawn_lu> (3) Checked out HDBC odbc, found this page https://hackage.haskell.org/package/HDBC-odbc the instruction in the bottom is hard to follow because some of the required binaries can't be found on homebrew on Mac.
05:11 <shawn_lu> Just curious, how other engineers are connecting to Oracle using Haskell?
05:11 <shawn_lu> Thanks!
05:12 <rstefanic> pixelfog_: Yeah, of course. I'm glad I wasn't the only one confused by it :)
05:12 Sose_ joined
05:15 Mutter joined
05:18 cur8or joined
05:19 aarvar left
05:20 dni- joined
05:23 hphuoc25 joined
05:25 hphuoc25 joined
05:28 takle joined
05:34 zgrepc joined
05:34 shawn_lu left
05:36 takle joined
05:42 Mutter joined
05:43 mstruebing joined
05:48 ThomasLocke joined
05:48 ThomasLocke joined
05:54 aarvar joined
05:54 takle joined
05:57 chrissl joined
06:06 galderz joined
06:08 eatman joined
06:10 Youmu joined
06:11 louispan joined
06:20 takle joined
06:24 BOOKBOOK joined
06:35 conal joined
06:40 louispan joined
06:41 takle joined
06:46 bkboggy joined
06:51 nullcone joined
06:54 BOOKBOOK joined
06:58 Pupnik joined
07:00 takle joined
07:00 dni- joined
07:02 uglyfigurine joined
07:04 prophile joined
07:08 nickolay joined
07:11 takle joined
07:11 binaryplease joined
07:13 Durz0 joined
07:18 bvad joined
07:24 haskelleksah joined
07:24 takle joined
07:26 <Guest44939> what is the use in the "do" notation?
07:27 madjestic joined
07:27 cur8or joined
07:28 mattyw joined
07:31 takle joined
07:32 <LiaoTao> Guest44939: It's a clear and concise way of chaining monads
07:32 <LiaoTao> AFAIK! Perhaps someone else will chime in
07:32 dni- joined
07:33 <Guest44939> I'll discuss this more when I get back, gtg, ty for the reply
07:35 thc202 joined
07:36 hphuoc25 joined
07:46 takle joined
07:58 takle joined
08:06 colt44 joined
08:08 takle joined
08:13 Glooomy joined
08:18 merijn joined
08:19 grdryn joined
08:21 dni- joined
08:22 slomo joined
08:25 metalrain joined
08:25 superlinux joined
08:26 gluegadget joined
08:27 <superlinux> hi. what is the expansion of the expression : (\x y z -> [x,y,z]) <$> (+3) ?? I know already it just makes a curried function. I just care for the expansion.
08:27 takle joined
08:30 <merijn> What do you mean by expansion?
08:31 <LiaoTao> merijn!
08:31 <LiaoTao> merijn: Thanks for the help yesterday
08:31 <merijn> LiaoTao: Did you manage to get everything working? :)
08:31 ploop joined
08:32 <LiaoTao> merijn: Yeah, finally
08:32 <LiaoTao> It helped to think of the f in (MyState f) as a function (s-> (a,s))
08:33 <LiaoTao> With some let magic it turned out quite neat
08:34 <merijn> LiaoTao: Right. The real StateT is, in fact, just a newtype for that function (newtypes don't exist at runtime). The reason for the newtype is to make the type variables "line up" with what Monad expects. It's really just an instance for a specific subset of functions :)
08:34 <merijn> LiaoTao: Which actually holds true for most transformers
08:35 <Guest44939> is a channel in Haskell like a buffer for things to be shared between threads?
08:36 <merijn> Guest44939: Channels are more general than that, but you can use them for that, yes
08:36 <Guest44939> so what is it defined as exactly?
08:36 <merijn> Guest44939: Effectively they're linked lists of MVars
08:37 <LiaoTao> merijn: Haven't yet looked at StateT
08:37 <Guest44939> an MVar is a mutuable variable yes?
08:37 <merijn> Guest44939: Simon Marlow's "Parallel and Concurrent Programming in Haskell" book covers everything you ever wanted to know (and more) about Haskell concurrency primitives, a very good read
08:37 <LiaoTao> So your explanation is lost for the moment
08:37 <merijn> LiaoTao: Oh, right, you just did MyState, not MyStateT yet :)
08:38 <LiaoTao> merijn: Could you link the homework template again? Browser history is wonky and I can't find it through browsing your repos
08:38 <merijn> LiaoTao: Well, after your epiphany about MyState, the solution to that is: Study the difference between the function in MyState and MyStateT and see if you can fix your current implementation to work with it :)
08:39 <merijn> https://gist.github.com/merijn/098106abd45c940dab09
08:39 <Guest44939> merijn yeah I might read that one day
08:39 <LiaoTao> ty
08:39 <Guest44939> just wish I had more time to read it properly
08:40 <Guest44939> is an MVar a buffer?
08:41 <merijn> Guest44939: An "MVar a" is a variable that can be either empty, or contain an 'a'. Said 'a' can be removed from it and others can be put in via IO. Putting an 'a' into a full MVar will block the thread, trying to take/read from an empty MVar will also block the thread
08:41 <LiaoTao> merijn: Right, so the new definition is there to allow monadic operations?
08:42 <merijn> LiaoTao: It's making MyState work across some other monad, yes
08:42 <LiaoTao> In keeping with >>= m a -> f -> m b -> m b
08:42 <LiaoTao> Or am I misunderstanding this?
08:43 <Guest44939> merijn
08:43 <merijn> LiaoTao: Well, think about "MyStateT s IO a" that gives you "s -> IO (a, s)"
08:43 <Guest44939> interesting, so what is the difference between an MVar and a monitor?
08:43 mengu joined
08:43 <Guest44939> is there much of a difference?
08:43 <merijn> Guest44939: In what way would you say MVars and monitors are similar?
08:44 <merijn> LiaoTao: So now your stateful computation can also perform IO
08:44 <LiaoTao> merijn: Right - a stateful IO interaction?
08:44 <Guest44939> merijn well I mean, a monitor is when you can have a mutex and the ability to block threads
08:44 <Guest44939> an MVar is a variable that can be empty or have something in it
08:44 <Guest44939> right?
08:45 <merijn> LiaoTao: But it could also be "MyStateT s [] a" which gives "s -> [(a, s)]", or how about "MyStateT s (Either Error) a" which gives "s -> Either Error (a, s)", etc :)
08:45 hphuoc25 joined
08:46 <LiaoTao> merijn: So basically allowing for a Monad state
08:46 <LiaoTao> Neat
08:46 <superlinux> merijn, I mean how it's interpreted
08:46 <merijn> Guest44939: You can use MVar's as a simple mutex, yes. But monitors are generally automatically run when performing specific operations (usually on some object)
08:47 <merijn> LiaoTao: That last one with Either, for example would result in "short-circuiting state", i.e. stateful computation that can exit early with an error
08:47 <superlinux> .. I mean how the expression should be written simplified
08:47 <LiaoTao> merijn: Does it still roll through all the chained operations?
08:48 <LiaoTao> Or is that optimized away?
08:48 <merijn> LiaoTao: What do you mean?
08:48 <merijn> superlinux: I'm not sure I understand the question?
08:48 <LiaoTao> merijn: The Error percolates through the monad chain and ends up as the result, right?
08:48 Levex joined
08:48 <LiaoTao> Is it explicitly passed through step by step or is the computation aborted?
08:48 <LiaoTao> Or is that irrelevant?
08:49 <merijn> LiaoTao: Well, try and implement it and see what makes sense :)
08:49 myrkraverk joined
08:49 <superlinux> merijn, the complete expression is this (\x y z -> [x,y,z]) <$> (+3) <*> (*2) <*> (/2) $ 5 . but I want to know how (\x y z -> [x,y,z]) <$> (+3) works.
08:50 <merijn> superlinux: So, step 1: Which Functor is <$> using there?
08:50 uglyfigurine joined
08:50 <Guest44939> merijn my lecturer has made a bunch of comparisons: https://pastebin.com/kgKPSvDb
08:51 <Guest44939> but I'm mixing the context info
08:51 <superlinux> it is a List functor... therefore it will be the simple map function
08:51 <Guest44939> MVars vs Monitors
08:51 takle joined
08:52 <merijn> superlinux: "It's a list functor" <- is it?
08:53 <superlinux> so does this mean the result will be : [\x -> x+3,\y -> y+3, \z -> z+3 ] . correct?
08:53 bvad joined
08:53 <merijn> superlinux: Looks to me like the functor is the "(->) r" functor :)
08:55 <superlinux> looks like the english language barrier is doing its work with me hehe
08:56 <superlinux> merijn, but what I said: [\x -> x+3,\y -> y+3, \z -> z+3 ] is correct? right?
08:57 <merijn> superlinux: Honestly, it's a tricky example so I'd have to think through what it's doing :)
08:58 <merijn> superlinux: Well, let's see! ;)
08:58 <merijn> :t (\x y z -> [x,y,z]) <$> (+3)
08:58 <lambdabot> Num t => t -> t -> t -> [t]
08:58 <superlinux> merijn, it's from the Learn You Haskell book. from the chapter 11 .
08:59 <merijn> Not quite the type you're expecting, I assume :)
08:59 <superlinux> the book is demonstrating the applicative.
09:03 <merijn> superlinux: Right, so we know it's the "(->) r" applicative, so what does fmap look like for that?
09:04 <merijn> :t fmap
09:04 <lambdabot> Functor f => (a -> b) -> f a -> f b
09:04 <merijn> fmap :: (a -> b) -> ((->) r) a -> ((->) r) b
09:04 <merijn> Or
09:04 <merijn> fmap :: (a -> b) -> (r -> a) -> r -> b
09:04 <* superlinux> all eyes
09:05 <merijn> Now, let's see what "\x y z -> [x,y,z]" is
09:05 <merijn> :t \x y z -> [x,y,z]
09:05 <lambdabot> t -> t -> t -> [t]
09:06 <merijn> So it takes three t's and makes a list of t's
09:06 <merijn> So: 'a = t', 'b = t -> t -> [t]'
09:06 <merijn> And our 'r -> a' corresponds with (+3)
09:06 <merijn> :t (+3)
09:06 <lambdabot> Num a => a -> a
09:07 <merijn> So we also know that 'a = r' and a is an instance of Num
09:07 <merijn> Put it back together into
09:07 <merijn> fmap :: (a -> b) -> (r -> a) -> r -> b
09:08 <merijn> fmap :: Num t => (t -> (t -> t -> [t])) -> (t -> t) -> (t -> (t -> t -> [t]))
09:08 <merijn> Now, all the t's are hiding something the original fmap shows us
09:08 <* superlinux> now has the head spinning
09:08 <merijn> If you look at the first type of fmap, what's it doing?
09:10 <merijn> hint
09:10 <merijn> :t (.)
09:10 <lambdabot> (b -> c) -> (a -> b) -> a -> c
09:11 <merijn> fmap :: (a -> b) -> (r -> a) -> r -> b
09:11 <superlinux> merijn, I am trying to understand the 1st lines. it's getting harder with me
09:16 Pupnik_ joined
09:17 zero_byte joined
09:21 tarcwynne_ joined
09:21 <Guest44939> what does the $ do?
09:21 <Guest44939> like forkIO $ do
09:21 <Guest44939> then stuff
09:21 <Akii> :t ($)
09:21 <lambdabot> (a -> b) -> a -> b
09:22 <Akii> basically makes it so that everything following the $ is evaluated into a single argument of the preceeding function
09:22 <Akii> (someone correct me if that's vague / wrong)
09:22 <Akii> :t forkIO
09:22 <lambdabot> error: Variable not in scope: forkIO
09:22 <Akii> :|
09:22 <Guest44939> forkIO $ do
09:22 <Guest44939> putMVar t "Hello "
09:22 <Guest44939> putMVar t "World!"
09:23 <merijn> Akii: forkIO is (obvious from the name) an IO action that spawns threads, but lambdabot doesn't allow IO
09:23 <superlinux> Guest44939, it's like the () . but you substitute the left parenthesis with $ and get rid of the right paran
09:23 <Akii> merijn: I didn't ask that :D
09:24 <Guest44939> so the stuff in the do block are the params I guess?
09:24 <Akii> yup
09:24 <superlinux> so all th things after $ are params to function befor it.
09:24 <Guest44939> ty
09:25 <superlinux> Guest44939, you will face the <$> later... be attent. do not let your eyes deceive you when your read
09:25 <Guest44939> hah ty
09:26 <superlinux> in haskell reading code is turtle slow hehe
09:27 <merijn> superlinux: Only at the start, once you get a bit adept at it you kinda just glance over the <$>'s and <*>'s :)
09:28 <superlinux> merijn, it's so generally.. specially when the one needs to understand the code written by strangers. :)
09:29 hphuoc25 joined
09:31 cschneid_ joined
09:32 <LiaoTao> merijn: Struggling a bit with <*>
09:32 <LiaoTao> Can you pattern match against Monad (a,b)?
09:33 <merijn> LiaoTao: No
09:33 <merijn> LiaoTao: But, remembe you can use >>= to get access to the (a,b) within some Monad, as long as you return within the same monad :)
09:33 fbergmann joined
09:39 yellowj joined
09:39 nacon joined
09:52 geekosaur joined
09:53 hphuoc25 joined
10:01 takle joined
10:23 cschneid_ joined
10:29 <Guest44939> in-terms of concurrent haskell, yes, someone suggested reading Simon Marlowe's book but sadly I don't have the time
10:29 <Guest44939> so what are the fundamental concepts of it? I can Google the rest if someone can give me some starters
10:30 <Akii> look at the libraries STM and Async
10:30 <yushyin> message passing
10:34 <Guest44939> anything else Akii?
10:34 <Akii> nothing comes to my mind, no
10:36 <Akii> but you can always just ask more concrete questions :D
10:38 govg joined
10:41 mattyw joined
10:47 jship joined
10:51 Nikotiini joined
11:00 <Guest44939> haha idk what to ask
11:00 <Guest44939> :P
11:06 fotonzade joined
11:09 <merijn> Guest44939: Honestly, I don't think any quick start is going to be as good as just reading the book
11:09 <zaquest> Guest44939, there's also parallel package
11:10 <zaquest> iirc correctly parallel is where Marlowe starts
11:10 <Akii> additionally it's a short book
11:10 <Akii> and an easy read (imo)
11:13 jarshwah_ joined
11:14 Glooomy joined
11:14 romank joined
11:19 <Guest44939> yeah the trouble is I got other stuff to revise
11:19 <Guest44939> so getting through the book might be difficult with the other stuff I got going on
11:19 navilan joined
11:22 <srhb> Guest44939: If you're busy it seems like quite a waste of time to try to dig up answers to questions you can't put into words yet :-)
11:23 <Guest44939> mm yes
11:23 <Guest44939> how long does the book take to get through?
11:23 <srhb> Guest44939: That depends on your skill level.
11:24 <Guest44939> can't give me a rough estimate per chance?
11:24 <Akii> it's about 280 pages
11:24 <srhb> Guest44939: If you can give me a rough estimate of your skill level :-)
11:24 <Akii> but srhb is right ^^
11:24 <Guest44939> my Haskell is bad
11:24 <Guest44939> sooo
11:24 <srhb> A month or so, then
11:24 <Guest44939> yeah
11:24 <Guest44939> I don't have that time
11:24 <Guest44939> XD
11:24 mengu joined
11:25 <Guest44939> my exam isn't just on Haskell concurrency
11:25 <srhb> I find it hard to gauge your intent here. What are you trying to do and why do you think you can solve that with Google instead of understanding the contents of the book?
11:25 <Guest44939> it's like 10% of the exam
11:25 <srhb> Ah.
11:25 <srhb> Which course is it? AP?
11:25 <Guest44939> no it's just Concurrency
11:25 <srhb> Hmm.
11:25 <Guest44939> teaches you concurrent concepts with Java and Haskell implementation
11:25 <Guest44939> I understand Java very well
11:25 <Guest44939> and the concepts
11:25 <srhb> WEll then I concur with the earlier advice of looking up the docs for MVars, CHans, etc.
11:25 <Guest44939> not the Haskell stuff
11:26 <srhb> Perhaps some simple hello world examples of using those as well.
11:27 <Guest44939> MVars, Channels, STM... anything else?
11:27 <srhb> That should be plenty to keep your occupied for a few days.
11:27 <superlinux> Guest44939, hi.
11:27 <Guest44939> yo
11:28 <superlinux> look! get whatever you can get of marks that can let you pass.. do not kill yourself.
11:28 <srhb> I support that sentiment as well :)
11:29 gpolitis joined
11:29 <Guest44939> I'll ask my lecturer today if he can tell me what parts specifically
11:29 <Guest44939> and I'll just study those
11:29 <superlinux> just pass the subject.. life out there will give you later all the time to read on Haskell.
11:29 <Guest44939> if he will give me an answer
11:29 <Guest44939> yes I quite agree
11:29 <Guest44939> my course doesn't give me enough time to learn everything
11:30 <superlinux> and you will be really pro and outstanding in front of others1
11:30 <superlinux> Guest44939, just memorize.
11:31 <Guest44939> but memorize what tho
11:31 <Guest44939> :P
11:32 <superlinux> it happened once with me with one of the uni instructors.. he gave us two books in the same course, like what you are having.
11:32 <Guest44939> yes
11:32 <superlinux> and all the classroom dropped
11:32 <superlinux> we quit
11:32 <Guest44939> dropped out of the course?
11:33 <superlinux> we did not see him later in uni
11:33 <Guest44939> huh
11:33 <Guest44939> so what are you trting to say?
11:33 netheranthem joined
11:33 <superlinux> what I am trying to tell you as long as you know java .. this is 50%
11:34 <superlinux> and get like 20% from haskel.
11:34 <superlinux> based on this strategy you will pass
11:35 <Guest44939> yeah
11:36 <Guest44939> I know I'm not gonna fail on this
11:36 <Guest44939> but it would be nice to know it if you get what I mean
11:36 <superlinux> Guest44939, in summer vacation - if you have one- you take your time improving your skills.
11:37 <Guest44939> yuh
11:38 <superlinux> also improve your network design skills and local network administration.
11:39 <superlinux> Guest44939, you have to have 3 jobs : programmer - admin - fixing computers.
11:40 <superlinux> I mean just in case when you graduate the economy gets more harder
11:40 <superlinux> and much tougher
11:43 <Guest44939> hopefully not :P
11:43 <Guest44939> ty for tips
11:48 fotonzade joined
11:49 zacts joined
11:52 nacon joined
11:56 romank joined
11:57 binaryplease joined
11:59 Glooomy joined
12:00 nobodyzxc joined
12:10 alibabzo joined
12:11 romank joined
12:12 mounty joined
12:31 ridho joined
12:32 navilan joined
12:34 Pupnik joined
12:36 fotonzade joined
12:36 zero_byte joined
12:38 hphuoc25 joined
12:42 mengu joined
12:45 mengu joined
12:50 Gurkenglas joined
12:52 navilan joined
12:56 binaryplease joined
12:58 binaryplease joined
13:13 superlinux joined
13:14 uglyfigurine joined
13:15 chlong joined
13:17 binaryplease joined
13:20 takle joined
13:24 boris_rh joined
13:25 im0nde joined
13:26 pbrant joined
13:27 jathan joined
13:34 im0nde joined
14:00 jship joined
14:06 mengu joined
14:10 gogely joined
14:22 vmeson joined
14:30 carlomagno joined
14:39 cschneid_ joined
15:02 nickolay joined
15:03 guampa joined
15:06 kritzcreek joined
15:08 ridho joined
15:11 ridho joined
15:16 cschneid_ joined
15:23 cschneid_ joined
15:24 eacameron joined
15:44 NeverDie joined
15:49 DataComputist joined
15:56 andyhoang joined
16:00 mengu joined
16:00 <Guest44939> superlinux yo
16:01 <Guest44939> I went to see my lecturer and he said to read chapter 2, 7 and 10 of Simon's book
16:01 <Guest44939> so that's what I'll do
16:08 slomo joined
16:13 meandi_3 joined
16:19 circ-user-qa1RI joined
16:20 guampa joined
16:24 taksuyu joined
16:47 dni- joined
16:51 pilne joined
16:51 bvad joined
16:55 im0nde joined
17:09 delexi joined
17:14 carlomagno joined
17:18 vmeson joined
17:24 Gurkenglas joined
17:29 DataComputist joined
17:32 fotonzade joined
17:44 guampa joined
17:47 haskelleksah joined
17:49 romank joined
17:55 szhwump joined
17:56 <szhwump> guys can you help me with my hoogle-fu: I'm working with gnuplot, and need to figure out how to take a type from T to IO(). What should I search for? (T is Graphics.Gnuplot.Private.Plot.T)
17:56 <benzrf> szhwump: this sounds like an XY problem - what are you doing precisely?
18:05 <szhwump> benzrf: just trying to plot a cloud of dots
18:05 taksuyu joined
18:05 <szhwump> cloud :: (Graphics.Gnuplot.Value.Tuple.C a, Graphics.Gnuplot.Value.Atom.C z, Graphics.Gnuplot.Value.Atom.C y, Graphics.Gnuplot.Value.Atom.C x) => gnuplot-0.5.4.1:Graphics.Gnuplot.Private.Graph3DType.T x y z a -> [a] -> T x y z
18:06 oscarvarto joined
18:07 <benzrf> szhwump: let me look @ the docs, one minute
18:09 <benzrf> jeez this seems like a poorly designed api
18:09 <szhwump> yeah, everyone seems to be saying so
18:09 <szhwump> should I just pick another plotting lib? Do you know of any good ones that can do 3d?
18:10 <benzrf> not off the top of my head sorry
18:10 <szhwump> thanks anyway
18:11 <benzrf> szhwump: see if "toScript" works
18:12 <benzrf> ok yeah jesus christ who made this
18:14 <szhwump> toScript in what package?
18:15 <benzrf> *module
18:15 <benzrf> "gnuplot" as a whole is a package
18:15 <benzrf> and never mind, forget i said that
18:15 <benzrf> just find a new package to use, this looks awful
18:16 <benzrf> szhwump: this looks nice enough https://hackage.haskell.org/package/easyplot-1.0/
18:22 shawn_lu joined
18:23 <shawn_lu> Can anyone share some tips on how to connect to Oracle DB using Haskell? I found it quite difficult. What I've done so far:
18:23 <shawn_lu> (1) Checked out Persistent's documentation, on this page http://www.yesodweb.com/book/persistent it mentions all the mainstream one but Oracle.
18:23 <shawn_lu> (2) Got this book "Developing Web Apps with Haskell and Yesod", no mention of Oracle
18:23 <shawn_lu> (3) Checked out HDBC odbc, found this page https://hackage.haskell.org/package/HDBC-odbc the instruction in the bottom is hard to follow because some of the required binaries can't be found on homebrew on Mac.
18:23 <shawn_lu> Just curious, how other engineers are connecting to Oracle using Haskell?
18:23 <shawn_lu> Thanks!
18:25 guampa joined
18:27 <DataComputist> I've just installed stack on a new computer. After running
18:27 <DataComputist> stack setup
18:27 <DataComputist> stack build --dependencies-only --test
18:27 <DataComputist> I got
18:27 <DataComputist> Error parsing targets: The specified targets matched no packages.
18:27 <DataComputist> Perhaps you need to run 'stack init'?
18:27 <DataComputist> But at https://docs.haskellstack.org/en/stable/README/, there seems to be no info about 'stack init'. Any suggestion?
18:30 <glguy> Did stack init work?
18:31 <glguy> What're you trying to do specifically?
18:34 govg joined
18:36 guampa joined
18:36 dni- joined
18:41 haskelleksah joined
18:49 deank joined
18:50 ralu joined
18:55 <DataComputist> It works, I was just a little concerned that the official doc doesn't mention 'stack init' as one of the first steps in setting up stack.
18:55 retbotto joined
18:57 romank joined
18:58 <DataComputist> Actually, 'stack init' didn't work, it seems,
18:58 <DataComputist> It output a long list of file paths with ': getSymbolicLinkStatus: invalid argument (File name too long)' at the end
18:58 <DataComputist> Those file paths do not look relevant for Haskell or stack.
18:59 <DataComputist> > What're you trying to do specifically?
18:59 <lambdabot> <hint>:1:23: error: parse error on input ‘do’
18:59 <DataComputist> I'm trying to verify my stack and Haskell are installed correctly.
19:00 Mutter joined
19:01 <kadoban> DataComputist: Are you running 'stack init' in a cabal project directory? It sounds like you're running 'stack build' where it doesn't makes sense either.
19:03 <DataComputist> I'm running it at $HOME, this is immediately after installing stack using Homebrew (https://docs.haskellstack.org/en/stable/install_and_upgrade/#macos). I do not have any Haskell projects created yet.
19:03 <kadoban> Then running 'stack build' and 'stack init' don't seem sensible.
19:03 <DataComputist> But I've already run 'stack setup'. Does that make sense?
19:04 <DataComputist> What does 'setup' do when there aren't any project.
19:04 <kadoban> Setup mostly just installs GHC when it's required
19:04 <kadoban> So it probably installed some fairly recent arbitrary GHC version
19:04 <DataComputist> To $HOME/.stack/<somewhere>, right?
19:05 <kadoban> Somewhere in there, yeah
19:05 simendsjo joined
19:05 <DataComputist> If I run 'stack new myproject' and then 'cd myproject && stack setup', does it install a new copy of GHC etc. again?
19:06 <kadoban> Only if the new project needs a different version of GHC. It only installs each version of GHC at most once.
19:14 takle joined
19:19 oscarvarto joined
19:21 <DataComputist> So what does the option ' --dependencies-only' exactly do?
19:22 <DataComputist> stack new myproject
19:22 <DataComputist> cd myproject
19:22 <DataComputist> stack setup
19:22 <DataComputist> stack build --dependencies-only --test
19:22 <DataComputist> This works.
19:22 carlomagno1 joined
19:22 <kadoban> Something not usually terribly useful. It only builds the things *needed* to build the thing you are talking about, not the thing itself.
19:24 <DataComputist> The 'thing' is 'myproject' which at the beginning is empty because there is no source file yet, right?
19:25 yellowj joined
19:27 <MarcelineVQ> the default template that "stack new myproject" would use should have basic source files
19:28 <MarcelineVQ> specifically in the lib and app directories
19:28 <MarcelineVQ> er, src and app
19:29 <MarcelineVQ> "<DataComputist> It works, I was just a little concerned that the official doc doesn't mention 'stack init' as one of the first steps in setting up stack." stack init isn't a first step in setting up stack, stack init is for creating a stack project from an existing cabal project
19:30 <DataComputist> Yes, 'stack new myproject' created a src/Lib.hs with
19:30 <DataComputist> module Lib
19:30 <DataComputist> ( someFunc
19:30 <DataComputist> ) where
19:30 <DataComputist> someFunc :: IO ()
19:30 <DataComputist> someFunc = putStrLn "someFunc"
19:31 <kadoban> Yes. There's not a lot of dependencies to that, so --dependencies-only is even more useless than usual.
19:31 <kadoban> It's a command line switch that you can fairly well forget anyway. I don't know any time you'd actually use it.
19:32 Durbley joined
19:33 Irishluck83 left
19:36 <MarcelineVQ> allrighty so what's next step you're after, building your new project? what does stack build do from the project's directory?
19:37 jbgi joined
19:40 merijn joined
19:43 <DataComputist> cd myproject
19:43 <DataComputist> stack build
19:44 <DataComputist> myproject-0.1.0.0: configure (lib + exe)
19:44 <DataComputist> Configuring myproject-0.1.0.0...
19:44 <DataComputist> myproject-0.1.0.0: build (lib + exe)
19:44 <DataComputist> Preprocessing library myproject-0.1.0.0...
19:44 <DataComputist> [1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Lib.o )
19:44 <DataComputist> Preprocessing executable 'myproject-exe' for
19:44 <DataComputist> myproject-0.1.0.0...
19:44 <DataComputist> [1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/myproject-exe/myproject-exe-tmp/Main.o )
19:44 <DataComputist> Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/myproject-exe/myproject-exe ...
19:44 <DataComputist> myproject-0.1.0.0: copy/register
19:44 <DataComputist> Installing library in
19:44 <DataComputist> /Users/xaf/myproject/.stack-work/install/x86_64-osx/lts-8.13/8.0.2/lib/x86_64-osx-ghc-8.0.2/myproject-0.1.0.0-2p1MpaiQCa9A6ZmPWjFgNy
19:44 <DataComputist> Installing executable(s) in
19:44 <DataComputist> /Users/xaf/myproject/.stack-work/install/x86_64-osx/lts-8.13/8.0.2/bin
19:44 guampa joined
19:45 <MarcelineVQ> looks like it worked, people prefer if you use a pastebin of some kind for more than a couple lines though :>
19:47 <DataComputist> Got it
19:50 shawn_lu joined
19:54 guampa joined
20:02 efm__ joined
20:03 romank joined
20:08 takle joined
20:25 dni- joined
20:28 Durbley joined
20:37 carlomagno joined
20:56 mengu joined
21:13 mojjo joined
21:16 carlomagno joined
21:23 zero_byte joined
21:25 carlomagno joined
21:34 <colt44> I recently noticed a warning when running 'stack ghci' regarding incompatibles ghc-options (-Werror, -threaded -O2) and I wonder what is the appropriate action in this case.
21:39 <glguy> -threaded and -O2 aren't for GHCi
21:39 <thang1_> It'd be nice if ghci just ignored those silently
21:43 <glguy> It's probably safer to keep the warning and not pass them in when you shouldn't so that mistakes aren't hidden
21:46 <thang1_> True. It's difficult to balance Haskell's desire to always do the most correct thing with a beginner's desire to have the least amount of friction
21:46 <glguy> Hiding things from beginners just makes it so beginners can't figure out what's going on
21:47 carlomagno joined
21:48 <thang1> You can reduce friction without hiding stuff.
21:49 <thang1> An error message of something like "the options X and Y cannot be used with interactive GHC. Please remove them" would go a long way to reduce friction without confusing beginners
21:50 <thang1> Anyway, I actually have something I'm stuck on. I'm probably way overthinking everything, but whatever
21:50 <thang1> https://www.docdroid.net/qYfWd2z/phone-haskell.pdf.html <-- So this exercise. I'm getting stuck on how to make the datatypes and all that
21:51 <thang1> My first thought was that this is a closed information environment. We know everything about everything before we even run the program, so pretty much everything can be done with types, in theory?
21:52 hiratara joined
21:52 <thang1> So if the keypads were rings where the elements of the ring corresponded to the letters, that would represent pretty much everything. Then the * keypad would be a toUpper transformation of the next character, 0 would be space
21:53 <thang1> But... no idea how to implement that elegantly (or even really at all). I'd like to avoid massive case/pattern matching on tons of stuff
21:53 carlomagno joined
21:55 <glguy> Maybe start with something simple and then make it complicated when you've finished the exercise the easy way?
21:56 <thang1> eh, fair enough. Coding a somewhat brute force and giant bunch of pattern matching just feels so wrong, though
21:56 <glguy> OK, then don't do a giant pattern match
21:59 jship joined
22:06 Levex joined
22:07 nille joined
22:14 takle joined
22:14 dni- joined
22:22 conal joined
22:28 <glguy> thang1: Let me know if you finish and want to compare solutions
22:31 <thang1> I have the reverseTaps done
22:32 <glguy> http://lpaste.net/3427214259589742592 Here's the link, you don't have to open it until you're ready
22:37 uglyfigurine joined
22:37 takle joined
22:40 uglyfigu_ joined
22:41 NoCreativity joined
22:44 <thang1> Ahh, much better than what I had
22:46 <thang1> http://i.imgur.com/tA2ZFVA.png glguy this is what I had
22:47 <thang1> Just out of curiosity, why do you import Data.Map and separtaely Date.Map as Map?
22:47 <glguy> So that I can use the type Map unqualified in type signatures
22:48 <thang1> got it. Didn't realize you couldn't just do that all in one line
22:58 Levex joined
23:00 <thang1> glguy: what's the Map.! part doing?
23:00 cschneid_ joined
23:00 <glguy> (!) is an indexing operation that raise an error on failure
23:01 <thang1> okay, makes sense. Couldn't find it by doing :t Data.Map.! so I was just curious
23:01 <thang1> is it part of Map?
23:01 <glguy> Try: (Data.Map.!)
23:01 <thang1> there we go, that's better
23:09 Dance_ joined
23:14 uglyfigurine joined
23:29 cschneid_ joined
23:33 prophile joined
23:34 aarvar joined
23:42 giraffe joined
23:47 aminb joined
23:49 ploop joined