<    April 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
00:08 takle joined
00:09 gibbers joined
00:13 t0by joined
00:15 takle joined
00:19 morphit joined
00:29 takle joined
00:29 takle joined
00:46 conal joined
00:49 eacameron joined
00:55 <kotangent> how do you deal with the record names when working with public API's that contain duplicate keys across function calls? for example, the "id" name is in each api call. In haskell do you split data types across several files?
00:55 <kotangent> also, "name" key is used often
01:05 peterbecich joined
01:07 Rodya_ joined
01:09 aarvar joined
01:14 Gurkenglas joined
01:22 aarvar joined
01:33 dni- joined
01:38 <kotangent> \quit
01:46 conal joined
01:57 takle joined
01:58 asivitz joined
02:12 Pupnik_ joined
02:12 takle joined
02:14 RoyalNightGuard joined
02:46 takle joined
02:51 blissdev joined
02:56 meandi_2 joined
02:59 exferenceBot joined
03:03 permagreen joined
03:04 takle joined
03:04 hexagoxel joined
03:06 sigmundv_ joined
03:11 govg joined
03:13 asdf__ joined
03:16 takle joined
03:18 harfangk joined
03:22 dni- joined
03:24 mac10688 joined
03:25 takle joined
03:30 Rodya_ joined
03:34 systemfault joined
04:00 aarvar joined
04:04 takle joined
04:07 sigmundv joined
04:11 conal joined
04:29 Pupnik joined
04:42 takle joined
05:07 mac10688 joined
05:08 Rodya_ joined
05:09 holygun joined
05:11 dni- joined
05:11 geekosaur joined
05:13 ali_bush joined
05:13 ali_bush joined
05:28 takle joined
05:32 systemfault joined
05:45 pixelfog joined
05:47 takle joined
06:10 davs joined
06:14 takle joined
06:18 kobigurk joined
06:30 xmonader2 joined
06:31 geekosaur joined
06:41 peterbecich joined
06:43 govg joined
06:48 peterbec` joined
07:00 dni- joined
07:05 Nikotiini joined
07:09 Denthir joined
07:10 Rodya_ joined
07:40 takle joined
07:50 delexi joined
07:55 mounty joined
07:55 takle joined
08:02 mounty joined
08:13 dni- joined
08:14 yellowj joined
08:15 systemfault joined
08:22 wei2912 joined
08:24 kobigurk joined
08:24 thc202 joined
08:31 t0by joined
08:33 chbatey joined
08:48 mounty joined
08:53 takle joined
09:01 mounty joined
09:04 MotherFlojo joined
09:11 TCZ joined
09:12 Rodya_ joined
09:15 rembo10 joined
09:33 azahi joined
09:45 takle joined
09:47 MotherFlojo joined
10:04 dni- joined
10:06 Gurkenglas joined
10:08 herr_jth joined
10:09 c0dehero joined
10:12 Rodya_ joined
10:14 netheranthem joined
10:18 kritzcreek_ joined
10:23 Denthir joined
10:30 contiver joined
10:47 chbatey joined
10:50 asdf__ joined
10:50 azahi joined
11:04 asdfyoyo joined
11:05 <asdfyoyo> hello!
11:05 <asdfyoyo> do you guys use stack or haskell platform?
11:06 wildlander joined
11:07 xmonader3 joined
11:08 <Gurkenglas> stack
11:09 xmonader3 left
11:10 xmonader joined
11:11 asdfjklyoyo joined
11:12 morphit joined
11:13 <asdfyoyo> is it necessary to learn category theory to understand monads / functors?
11:13 xmonader2 joined
11:13 <asdfyoyo> monads seem so weird
11:13 Rodya_ joined
11:14 <xmonader2> asdfyoyo, how about you take a look at this? http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html
11:15 <asdfyoyo> thank you!
11:21 <xmonader2> yw
11:30 karce joined
11:42 <xmonader2> I found this article amazing http://fsharpforfunandprofit.com/posts/elevated-world-6/#readermonad ocaml syntax is bit approachable to me
11:43 albertus1 joined
11:44 albertus1 joined
11:50 wei2912 joined
11:54 dni- joined
11:54 nirvinm joined
11:56 binaryplease joined
12:08 Deide joined
12:14 Rodya_ joined
12:19 nullcone joined
12:20 mengu joined
12:38 Prutheus joined
12:52 govg joined
12:53 NoCreativity joined
12:56 Denthir joined
13:04 Rodya_ joined
13:15 <xmonader2> why i can't do this? ` let z = \e -> (id e) (abs e)` ?
13:18 pbrant joined
13:24 <asdfjklyoyo> Wouldn't you write it like this? "let z = \e -> (abs (id e))" or is that different behavior from the one you wanted?
13:26 <Akii> that would reduce to z = abs
13:26 <Akii> no idea what this infinite type is but you cannot take abs from a function
13:27 <Akii> `let z = \e -> e (abs e)`
13:27 <__rgn> is it normal that f <$> g <*> h starts to look like a pattern of "pass something to g and h of which results are passed as arguments to f respectively" instead of parsing <$> and <*> independently
13:31 <xmonader2> asdfjklyoyo, i was trying to make it abs and id to wait on a specific e
13:31 <xmonader2> Akii, fmap id abs worked for me
13:31 <Akii> fmap id abs == abs?
13:33 <xmonader2> fmap id abs is equivalent to id.abs
13:33 sigmundv_ joined
13:33 <Akii> which is equivalent to abs
13:35 chbatey joined
13:43 dni- joined
13:44 <Akii> :t otherwise
13:44 <lambdabot> Bool
13:44 <Akii> so good
13:46 nirvinm left
13:57 chbatey joined
13:58 sigmundv_ joined
14:06 Denthir joined
14:09 chbatey joined
14:10 vmeson joined
14:10 Uniaika joined
14:17 <xmonader2> can someone check this http://lpaste.net/1923040498335875072 ? and tell me why i can't bind the reader myr1 to the function myf?
14:18 <Akii> xmonader2: try (>=>)
14:18 <xmonader2> :t (>=>)
14:18 <lambdabot> Monad m => (a -> m b) -> (b -> m c) -> a -> m c
14:18 <Akii> can only help you with the why if you also give me your reader def :D
14:19 <xmonader2> Akii, thank you this is the definition http://lpaste.net/354640
14:21 <Akii> what's myInc2
14:22 delexi1 joined
14:23 <xmonader2> Akii, let myInc2 = (+2)
14:27 <Akii> hm
14:27 <Akii> no idea about the why in particular.. other than type mismatch
14:27 <Akii> runR (myr1 >>= return . runR myf) 0
14:27 <Akii> that works though ^.^
14:29 <xmonader2> Akii, merci ^_^
14:32 Blacink joined
14:34 <Akii> http://lpaste.net/354640
14:34 <Akii> interesting question still
14:34 stef204 joined
14:42 kori joined
14:43 aminb joined
14:43 aminb joined
14:43 <Akii> xmonader2: but you can write it like this! MyReader (+2)
14:49 <xmonader2> Akii, i needed more coffee
14:54 <xmonader2> Akki, i guess it maybe related to monad transformers? afaik it's about stacking multiple monads and executing it as one .. didn't reach that part yet
14:55 <Akii> nope
14:55 <Akii> you're within the same monad
14:55 <Akii> but composition of this is kinda unique to the Reader Monad
14:55 <Akii> I'm unable to express this with return and bind
14:55 <Akii> but I'm also a noob; just thinking this is interesting
14:56 <xmonader2> i guess haskell got like 100 elites and the rest of us are trying to survive xD
14:59 <Akii> nah
14:59 <Akii> https://docs.google.com/presentation/d/1bSANLVcGnfVIFjicj81Uo_MYQhsF0FZi_EF-NEKFecE/edit#slide=id.g21ecc886bf_0_64
15:01 <Akii> I'd add that the productive Haskell bar depends on what you want to do
15:01 xmonader3 joined
15:02 <xmonader3> Akii, i follow julie xD i saw that pyramid xD
15:03 <Akii> well it's true
15:04 <xmonader3> it's like my 5th attempt to learn haskell
15:04 <adarqui_> i'm on my 100th attempt. one thing i know, is i'm a bad programmer. however, my badly written programs are BETTER in Haskell than in other languages like Go, C, node etc
15:05 <adarqui_> so purescript/haskell make my horribly written programs, more stable & maintainable
15:05 <adarqui_> funny how that works
15:07 <xmonader3> adarqui_, very inspiring :D
15:07 <adarqui_> hehe. cool. it's the truth though.. I have some haskell projects which are an insane amount of code (for me), say 100k lines total. an equivalent codebase in go, node, C etc.. would be a nightmare.
15:07 <qu1j0t3> @karma+ adarqui_
15:07 <lambdabot> adarqui_'s karma raised to 1.
15:08 <Akii> wow
15:08 <adarqui_> making changes is not so worrying.. refactoring is absolutely amazing - best experience you will ever have
15:08 <Akii> I recently measured the code ratio between PHP and what I wrote in Haskell
15:08 <qu1j0t3> Akii: I expect ratios between 4:1 and 10:1 even against Scala
15:08 <Akii> "surprisingly" I'm a very bad Haskell programmer and the ratio was like 1:10
15:08 <qu1j0t3> Akii: yeah, 10:1 should be typical with Haskell
15:09 <Akii> ah wait let me recall.. more like 1:3
15:09 <Akii> I expected it to be 1:10
15:09 <xmonader3> Hoping one day to use in production at work
15:09 <Akii> but again, I'm new
15:09 <qu1j0t3> it varies, but i've definitely measured 10:1
15:09 <adarqui_> in large code bases: i'm petrified to make changes in C, javascript .. less afraid but still worried in Go.. not worried one bit in haskell - the only thing you worry about, IMHO, is just knowing it might takes some time to work around figuring out how to get it to compile, lmao
15:09 <qu1j0t3> just switching to a functional language should get you a ratio of around 4:1
15:09 <adarqui_> but then when it does.. boom.
15:09 <Akii> but that's just LOC
15:09 <qu1j0t3> adarqui_: exactly. This is huge.
15:09 <Akii> not counting the amount of tests I didn't have to write
15:10 <Akii> which are not existing in the PHP codebase
15:10 <qu1j0t3> adarqui_: I can never be confident about any refactor in PHP, Python, Ruby .. and naturally regressions can't be avoided
15:10 RonnieHolm joined
15:10 <xmonader3> also anyone knows if don stewart going to update RWH ?
15:10 <Gurkenglas> adarqui_, can I review something?
15:11 <adarqui_> qu1j0t3: ya.. enormous.. ESPECIALLY for bad programmers like myself. I think that's often overlooked. Bad programmers may shy away from haskell because it seems difficult etc.. may seem too advanced.. but you can write any kind of app in haskell, in a "novice style", and still get enormous benefits.. One issue though is potentially writing badly performing code, but in that case, rely on well developed libraries at least.. I haven't run into many problem
15:11 <adarqui_> ya qu1j0t3 .. it's a nightmare
15:12 <adarqui_> Gurkenglas: ?
15:12 <Akii> that's actually funny
15:12 <Akii> because I'm a bad programmer as well
15:12 <Akii> and you do end up with better code in Haskell
15:13 <Gurkenglas> adarqui_, I wanted to take a look at some of this horrible 100k code and thought I'd ask you which you'd want looked at
15:13 <Akii> but takes some effort to switch
15:13 <adarqui_> ya.. it's funny, haskell could literally be the best language for bad programmers.. funny.
15:13 <qu1j0t3> I think it transcends good/bad programmers tbh. All programmers are going to make mistakes haskell will find.
15:14 <adarqui_> Gurkenglas: oh ok cool. I mean I have a ton of bad code on my github.. lots of stuff with ln-* is part of this project I was working on, but i've simplified it recently to "lnotes".. so here's an example: https://github.com/adarqui/lnotes-yesod https://github.com/adarqui/lnotes-ui-purescript
15:15 RonnieHolm left
15:18 <Akii> btw, anyone in here using Haskell for modelling complex business processes?
15:18 <adarqui_> qu1j0t3: one of the biggest issues with bad programmers like myself, is probably architecture itself.. haskell helps in that sense because, you get so much code reuse .. because of the shift to pure functions, haskell's class system, ADT's and such. I mean learning haskell helps you in other languages for sure, i take what i've learned and apply it in something like golang for example. Also re-architecting is easier in haskell, so that helps too.
15:19 <* qu1j0t3> nods
15:20 <* Sornaensis> writes 10,000 lines of code with 0 test suites and ships
15:20 <Akii> I do that with PHP
15:20 <Akii> get on my level
15:22 <qu1j0t3> now i know who writes the stuff i have to maintain...
15:23 <adarqui_> hah ya. what's funny though, i actually write more tests in haskell than i do with other languages (except maybe go). mostly for 'example usage' for when i come back to a module/library after a long time
15:24 <adarqui_> hspec-discover or whatever, makes it simple
15:25 <adarqui_> this is my favorite test code i've ever written: https://github.com/adarqui/haskell-bbcode-parser/blob/master/test/Data/BBCode/ParserSpec.hs
15:26 <adarqui_> that code actually has perhaps the worst function i've ever written in haskell though.. i just kept adding to it, because it was driving me insane.. no regard to writing it properly.. and it ended up being absolutely crazy: https://github.com/adarqui/haskell-bbcode-parser/blob/master/src/Data/BBCode/Parser.hs#L488
15:27 <adarqui_> if i end up using that library one day (hopefully, to finish my forum), i'll definitely have to fix that.. lmao
15:27 pyo_io joined
15:28 nullcone joined
15:31 <xmonader3> why stack always download the templates and everything for every new project?
15:31 dni- joined
15:33 morphit joined
15:37 Denthir joined
15:46 yellowj joined
15:54 Rodya_ joined
15:57 nicknovitski joined
15:57 initiumdoeslinux joined
15:59 stef204 joined
16:00 haskelleksah joined
16:00 morphit joined
16:06 mac10688 joined
16:09 madjestic joined
16:15 Thanzex joined
16:22 yellowj joined
16:22 <Thanzex> (sorry for the long message) Hi there!, i'm completely new to haskell and its principles and i'd really like to learn it. I'm reading the book and now i'd like to start doing the exercizes and experiment of my own. I'm trying to set up the environment for windows, but i'm having some difficulties, as i really still didn't understand how it works. A
16:22 <Thanzex> nyway, i'm trying to use Atom as my text editor, and i found this guide https://github.com/simonmichael/haskell-atom-setup I'm on win 10 Creators Update and i found out that the 8.02 version of ghc in stack is broken in this release but fixed in 8.2 and official 8.02. Do you have any experience on this or any idea on how to fix it? Thanks!
16:23 albertus1 joined
16:24 albertus1 joined
16:25 albertus1 joined
16:36 <geekosaur> Thanzex, until the stack folks fix it, you'll need to install the 8.02 bindist for win10 yourself and then tell stack to use system-ghc
16:37 <geekosaur> and make sure the ghc you installed is before any other ghc installations in %PATH% (probably by removing any others, since they won't work)
16:42 dni- joined
16:51 boxscape joined
17:05 Uniaika joined
17:09 conal joined
17:10 OscarZ joined
17:16 LiaoTao joined
17:19 haskelleksah joined
17:35 chbatey joined
17:40 Rodya_ joined
17:45 Denthir joined
17:54 Boarders joined
17:56 <Boarders> could someone explain how error works in haskell, it has type signature error :: [String] -> a but show returns the string you input
17:56 <Boarders> or at least ghci shows it
17:58 holygun joined
17:59 <peterbecich> Hello, would someone tell me the significance of the name "Loop" for this monad transformer?
17:59 <peterbecich> https://github.com/peterbecich/fp-course/blob/master/projects/NetworkServer/haskell/src/Network/Server/Chat/Loop.hs#L23-L28
17:59 <peterbecich> I've read this (https://github.com/peterbecich/fp-course/blob/master/projects/NetworkServer/NetworkServer.markdown#loop) but can't figure out the significance of "Loop". I've thought of it as ReaderT, but this is probably missing something. Thanks
18:05 azahi joined
18:07 yellowj joined
18:12 <geekosaur> Boarders, error throws an exception with the String (not [String]) as payload
18:13 <Boarders> (sorry I was going to write [Char] or String and it ended up like that :/ )
18:17 <geekosaur> peterbecich, I think the idea is that Loop encapsulates a handler that gets run on everything received. so it's not so much a loop itself, as a thing to be run in a loop
18:19 <geekosaur> more specifically it has (a) a source of inputs to be looped over (b) a persistent environment (c) the handler to be run on the received inputs
18:23 <geekosaur> Boarders, so anyway ghci has an exception handler that traps (among others) the ErrorCall exception, prints the exception body, and prompts again. The thrown exception aborts whatever computation it was embedded in
18:24 <geekosaur> there's some documentation of the exception system at https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/base-4.9.1.0/Control-Exception.html
18:24 <Boarders> oh ok thanks, so the type of error is just a way to get the code to type check
18:25 chbatey joined
18:29 azahi joined
18:43 <geekosaur> sort of
18:44 <geekosaur> "botto"/nontermination is the only "value" that inhabits all types, so an unconstrained 'a' is actually the correct type for its 'result'
18:45 Thanzex joined
18:49 asdfjklyoyo joined
18:53 aarvar joined
18:53 sigmundv_ joined
18:59 Rodya_ joined
19:03 <peterbecich> geekosaur: thank you!
19:06 <qmm> Sornaensis: what do you mean by the typical formulation of fmap?
19:08 <qmm> benzrf, Akii: would you mind linking to the la carete paper?
19:10 systemfault joined
19:14 <geekosaur> @google data types a la carte
19:14 <lambdabot> http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf
19:14 <lambdabot> Title: FUNCTIONAL PEARL Data types `a la carte
19:15 jud joined
19:15 jud joined
19:16 thebigapple joined
19:18 <qmm> thanks geekosaur
19:20 GreySunshine joined
19:21 <qmm> i am trying to get better at writing typeclasses. i seem to struggle with this. is there a way to tell the minimum number of methods that you need to write to have a fully functioning instance of a typeclass? e.g. the typeclass Ord has several methods. i don't know the minimum amount of methods needed to implement an Ord instance
19:21 <geekosaur> usually it's documented somewhere
19:22 <geekosaur> "Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types." https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/base-4.9.1.0/Data-Ord.html
19:24 <geekosaur> note that the minimum is sometimes 0, when the typeclass has defaults that work via generics (see for example aeson's FromJSON and ToJSON)
19:24 <qmm> thanks again!
19:26 <qmm> what is the $ in I# and x#? (I# x#) `compareInt` (I# y#) = compareInt# x# y#
19:26 <geekosaur> you mean the #? trailing # is a convention for an unboxed value
19:27 <geekosaur> (you need -X MagicHash to use it in code)
19:27 <monochrom> You mean #? It's a naming convention to remind you it's primitive types and operations. (Only a naming convention.)
19:31 <qmm> primitive being boxed and unboxed?
19:31 <qmm> thank you both for answering :)
19:33 <geekosaur> they're related but not identical
19:34 <geekosaur> for example there are primitive types in ghc that can't meaningfully be passed to C, but naything passed to/from C must ultimately be unboxed
19:35 <monochrom> primtive means provided by the compiler, built-in.
19:50 <lpaste> qmm pasted “instance Ord Int” at http://lpaste.net/354653
19:51 <qmm> what is (<#) ?
19:54 <benzrf> qmm: a primitive operation (in ghc at least)
19:54 <benzrf> it's magically special-cased by the compiler to compile down to an actual comparison instruction
19:54 <qmm> i'm trying to figure out how comparison happens between integers
19:56 holygun joined
20:01 Rodya_ joined
20:02 MotherFlojo joined
20:02 Ferdirand joined
20:03 <monochrom> From Haskell source down to STG, it is a built-in (axiomatized, if you are math-inclined) <# without any further elaboration.
20:03 <monochrom> After STG, code generator sees <# and generates the appriopriate machine code.
20:04 <qmm> and that machine code somehow knows how to compare integers...
20:04 <monochrom> I wouldn't say that. The code generator emits the correct bytes.
20:04 m3tti joined
20:04 <monochrom> Pretty much hardcoded into the code generator, if I may say so.
20:05 <monochrom> I used to know which bytes, too.
20:06 chbatey joined
20:08 <qmm> i guess this is good enough for me. i'm trying to get better at writing typeclasses, so this is probably a detour
20:11 <monochrom> It is "the bytes ask the CPU to compare, and the CPU has the circuit for that" rather than "the bytes teach the CPU how to compare".
20:11 <monochrom> So ironically it's a built-in again.
20:11 acarrico joined
20:15 chrissl joined
20:22 mounty joined
20:22 <lpaste> qmm pasted “No title” at http://lpaste.net/354654
20:23 acarrico joined
20:23 <qmm> this seems almost too trivial since you are relying on a built-in
20:24 <geekosaur> it still has to be compiled to machine code at some oint :)
20:24 <qmm> i really want to know how that works
20:24 <qmm> maybe i'll find out by reading the ghc wiki article on stg
20:26 systemfault joined
20:31 <monochrom> Integer is different from Int.
20:32 <monochrom> And the code generator generates calls to GMP.
20:36 xmonader3 joined
20:40 dni- joined
20:43 delexi joined
20:43 Uniaika joined
20:45 dejanr joined
20:47 aarvar joined
21:02 mengu joined
21:02 smichel17 joined
21:08 Rodya_ joined
21:21 Denthir joined
21:33 aarvar left
21:41 xmonader3 joined
21:50 xmonader2 joined
21:51 binaryplease joined
21:52 hiratara joined
21:56 xmonader3 joined
22:04 sigmundv joined
22:12 <qmm> how can i set overlapping patterns with :set in ghci?
22:12 xmonader3 joined
22:12 <qmm> <interactive>:122:3: warning: [-Woverlapping-patterns]
22:13 <qmm> :set -X???
22:13 <qmm> :set -fwarn-overlapping-patterns
22:14 <qmm> instance Monoid a => Monoid (Optional a) where mempty = Nada ; mappend (Only a) _ = Only a ; mappend _ (Only a) = Only a ; mappend _ _ = Nada
22:15 <boxscape> have you tried :set -Woverlapping-patterns ?
22:15 <qmm> that works too
22:15 <qmm> thanks boxscape
22:18 binaryplease joined
22:21 MotherFlojo joined
22:25 peterbec` joined
22:29 dni- joined
22:31 hiratara joined
22:38 nacon joined
22:38 nacon joined
22:42 ali_bush joined
22:42 ali_bush joined
22:46 MotherFlojo joined
22:53 conal joined
22:57 <qmm> i didn't quite understand what th exercise in 15.12 was asking of me
22:57 <qmm> the exercise starts on page 585 and ends on page 586
22:59 joneshf-laptop joined
23:01 <glguy> qmm: Lots of us who can help don't have the book, so page numbers don't mean anything
23:03 asdfjklyoyo joined
23:05 TerNit joined
23:08 <TerNit> Hi ppl! How to malk?
23:10 <TerNit> How to make instance of composition ? https://paste.pound-python.org/show/49U027PZ6277J1K272bv/
23:11 takle_ joined
23:15 MotherFlojo joined
23:23 aarvar joined
23:26 peterbec` joined
23:27 asdfjklzozo joined
23:39 <glguy> :t foldMap fold
23:39 <lambdabot> (Foldable t, Foldable t1, Monoid m) => t1 (t m) -> m
23:40 <TerNit> thank you! I found...
23:51 TerNit left
23:55 asdfjklzozo joined
23:58 Pupnik joined
23:59 <monochrom> @type fold
23:59 <lambdabot> (Monoid m, Foldable t) => t m -> m