<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:06 eacameron joined
00:10 louispan joined
00:11 sigmundv joined
00:11 takle joined
00:16 buoto joined
00:17 saussure joined
00:20 <DataComputist> Can someone please elaborate what's the significance of 'Functions are not partial, you can partially apply a function.'?
00:20 <DataComputist> Is it you can or you must or you always have to?
00:26 saussure joined
00:29 eacameron joined
00:29 cschneid_ joined
00:29 <ski> to "partially apply" a function means to provide some of the arguments, but not all, leaving (or constructing) a function that's still "waiting" for the remaining arguments before being able to compute the results
00:30 <ski> "partially apply" is something you do to a function that's expecting multiple inputs
00:31 <ski> strictly speaking, all functions in Haskell take exactly one argument
00:31 <ski> but you can *encode* functions taking multiple arguments
00:32 <ski> there's two basic ways to do this. "tupled" style, and curried style
00:33 <ski> "tupled" means that you bundle your "multiple" arguments together into a single arguments. usually a tuple (hence the name). sometimes it may be nicer to use a record, or even perhaps a list
00:33 <ski> e.g. you can define
00:33 <ski> tupledMean :: (Float,Float) -> Float
00:34 <ski> tupledMean (x,y) = (x + y) / 2
00:35 <ski> there is a single argument, which is a pair of two (single-precision) floating point numbers. this argument is unpacked into the two parts, `x' and `y', in the definition (on the left of `='), by pattern-matching
00:35 eacameron joined
00:36 <ski> otoh, curried style means that you make a function which expects the first argument, and will return a function that expects the next argument, and so on, until all arguments have been got, and the result can be computed
00:36 <ski> in this case, it would look like
00:36 takle joined
00:36 <ski> curriedMean :: Float -> Float -> Float
00:36 <ski> curriedMean x y = (x + y) / 2
00:37 <ski> note that `curriedMean x y' really means `(curriedMean x) y', iow `curriedMean x' is the intermediate function that still expects to be passed the second argument
00:38 <ski> similarly, the type `Float -> Float -> Float' really means `Float -> (Float -> Float)', so we have a function that takes a `Float' and returns a new function (the next `->') that takes a `Float' and returns a `Float'
00:38 <ski> here, `curriedMean x' is the partial application of `curriedMean' to the (first) argument, `x'
00:39 <ski> partial application is nice to use with higher-order functions
00:40 <ski> `map' is a function that takes a function argument, and (returns a function that takes) a list, and returns a new list, consisting of the function argument applied to every element of the input list
00:40 <ski> > map f [x,y,z]
00:40 <lambdabot> error:
00:40 <lambdabot> Ambiguous occurrence ‘x’
00:40 <lambdabot> It could refer to either ‘Debug.SimpleReflect.x’,
00:41 <ski> hrm
00:41 <ski> > map f [x,y,z] :: [Expr]
00:41 <lambdabot> [f x,f y,f z]
00:41 <ski> that is supposed to show the general idea of how `map' works
00:41 twopoint718 joined
00:41 kaychaks joined
00:42 <ski> now, we can use it with `curriedMean' as follows
00:42 <ski> > map (curriedMean 5) [0,1,2,3,4,5]
00:42 <lambdabot> [2.5,3.0,3.5,4.0,4.5,5.0]
00:42 eacameron joined
00:43 <ski> so, we're passing `5' as "early" argument to `curriedMean', and then we're applying the function we get as a result to every element of the list. so, we're in effect applying `curriedMean' many times, each time with the same (`5') "early" argument, but with different values for the "late" argument
00:44 <ski> another use of partial application is as follows
00:44 <ski> let's suppose we wanted to define
00:44 <ski> mean5 :: Float -> Float
00:44 saussure joined
00:44 <ski> mean5 y = curriedMean 5 y
00:44 <ski> the defining equation here can be abbreviated as
00:45 <ski> mean5 = curriedMean 5
00:45 <ski> ("cancelling" the `y's)
00:45 <ski> so we're simply giving a name to the function that `curriedMean 5' returns, rather than defining `mean5' to, when applied on an input, call it `y', compute the result of applying `curriedMean' to `5' and `y'
00:46 <ski> (a moments reflection might tell you that the function you get with one definition will behave in the same way as the one you get with the other definition)
00:47 <ski> DataComputist : ok ?
00:47 <DataComputist> Got it; Thanks!
00:50 eacameron joined
00:51 systemfault joined
00:53 uglyfigurine joined
01:02 saussure joined
01:12 saussure joined
01:14 vaibhavsagar joined
01:24 cschneid_ joined
01:26 alasi joined
01:30 saussure joined
01:34 ebsen joined
01:39 eacameron joined
01:48 saussure joined
01:57 louispan joined
01:57 saussure joined
01:59 saussure joined
02:02 Youmu joined
02:03 mengu joined
02:12 twopoint718 joined
02:12 carlomagno joined
02:16 saussure joined
02:18 exferenceBot joined
02:22 hexagoxel joined
02:27 Cale joined
02:29 sync__ joined
02:34 saussure joined
02:40 acertain joined
02:41 cschneid_ joined
02:43 saussure joined
02:55 aarvar joined
03:01 conal joined
03:01 saussure joined
03:19 saussure joined
03:24 louispan joined
03:25 diegs_ joined
03:26 alexelcu joined
03:29 saussure joined
03:35 sync__ joined
03:42 twopoint718 joined
03:47 saussure joined
03:52 uglyfigurine joined
03:57 louispan joined
04:05 saussure joined
04:12 louispan joined
04:12 blissdev joined
04:23 saussure joined
04:25 unsymbol joined
04:28 mimi_vx joined
04:30 Guest37310 joined
04:32 eacameron joined
04:32 diegs_ joined
04:33 saussure joined
04:38 tnks joined
04:47 eacameron joined
04:50 louispan joined
04:50 saussure joined
05:09 saussure joined
05:09 peterbecich joined
05:18 saussure joined
05:18 meandi_2 joined
05:29 ebw joined
05:29 cschneid_ joined
05:30 Kuros` joined
05:36 saussure joined
05:46 saussure joined
05:48 ThomasLocke joined
05:56 louispan joined
06:02 Gurkenglas joined
06:02 peterjg joined
06:04 saussure joined
06:04 <peterjg> how do I know if I have latest version of book. It is marked Early Release..
06:08 <peterjg> P 353, getting an error on one of the foldr evals that is supposed to show spine is unevaluated except for first element.
06:08 <peterjg> *Folding> Prelude> foldr (\_ _ -> 9001) 0 ([1, 2, 3] ++ undefined)
06:08 <peterjg> <interactive>:11:1: error: Data constructor not in scope: Prelude :: Integer
06:12 eacameron joined
06:19 <glguy> peterjg: You aren't supposed to type the "Prelude>" part
06:20 <glguy> > foldr (\_ _ -> 9001) 0 ([1, 2, 3] ++ undefined)
06:20 <lambdabot> 9001
06:20 <glguy> You aren't supposed to type the > part either, that's a lambdabot convention
06:21 <glguy> > foldr (\_ _ -> 9001) undefined (undefined : undefined)
06:21 <lambdabot> 9001
06:22 saussure joined
06:27 nullcone joined
06:37 <thang1> peterjg: if you paid for it, you'll have the latest version of the book and you should be able to request the latest version at any time
06:41 exferenceBot joined
06:41 <MarcelineVQ> if I lost my email I probably wouldn't know how to figure that one out, the latest I'm aware of is 0.12.0
06:42 eacameron joined
06:42 <MarcelineVQ> There are a lot of examples with the line "Prelude>" before that one though, seems like an odd error to stumble into later on
06:43 <thang1> Yeah that's what I was thinking...
06:43 Majiir joined
06:44 <MarcelineVQ> literally hundreds actually :>
06:44 <MarcelineVQ> oh well hopefully it's solved
06:45 <peterjg> duh. I didn't with all the others. apologies. :)
06:47 <thang1> Nah all good, it happens. Everyone has brain farts every now and then :p
06:48 <peterjg> I did pay for the book, I was expecting notifications. thang1: There is no metatadata in the pdf to tell me what version or date... Polling them for changes seems a bit inefficient. Anyway thanks..
06:49 peterjg left
07:07 mattyw joined
07:09 thc202 joined
07:10 ianandrich joined
07:17 saussure joined
07:19 pbrant joined
07:19 bvad joined
07:24 merijn joined
07:28 uglyfigurine joined
07:29 grdryn joined
07:31 Pupnik joined
07:33 l3dx joined
07:34 alexelcu joined
07:35 saussure joined
07:36 runway77 joined
07:39 louispan joined
07:40 <thang1> No problem. I can't see a version number on my version of the book either. I'm guessing it's in an email or something...
07:40 <thang1> (whoops, he left, nvm)
07:53 grayjoc joined
07:53 saussure joined
07:57 nickolay joined
07:59 Bhootrk_ joined
08:02 saussure joined
08:04 colt44 joined
08:08 rembo10 joined
08:08 grdryn joined
08:10 zero_byte joined
08:20 saussure joined
08:21 romank joined
08:25 romank_ joined
08:30 Iceland_jack joined
08:30 saussure joined
08:32 twopoint718 joined
08:33 rembo10 joined
08:36 romank joined
08:39 mlehmk joined
08:41 galderz joined
08:48 saussure joined
08:49 corintho[m] joined
08:51 machuga joined
08:51 romank joined
08:53 alibabzo joined
08:53 runway77 joined
08:55 agates joined
08:55 sirius[m] joined
08:55 unclechu joined
08:55 razvanc-r[m] joined
08:55 dyce[m] joined
08:55 sudoreboot[m] joined
08:55 M-wamaral joined
08:55 curry[m] joined
08:55 johnson[m] joined
08:55 korayal[m] joined
08:55 im0nde joined
08:56 <Iceland_jack> Good morning
08:56 <Iceland_jack> Beautiful overcast day in London
08:56 Denthir joined
08:57 saussure joined
08:57 Gloomy joined
09:05 yellowj joined
09:07 grdryn joined
09:09 MotherFlojo joined
09:09 romank joined
09:15 saussure joined
09:25 takle joined
09:25 <Xion_> Iceland_jack: Yes, the weather got back to normal after yesterday
09:26 grdryn joined
09:26 <Geekingfrog> oÔ somehow I would've expected iceland_jack to be in iceland -_-'
09:27 <Iceland_jack> Have you never heard of London, Iceland ;-)
09:28 <Iceland_jack> yeah yesterday was a too hot..
09:30 MotherFlojo joined
09:31 takle joined
09:33 saussure joined
09:37 romank joined
09:41 nullcone joined
09:41 runway77 joined
09:43 saussure joined
09:44 Levex joined
09:48 grdryn joined
09:50 fotonzade joined
09:56 mengu joined
09:59 <Iceland_jack> I am Icelandic for the record Geekingfrog
09:59 <Geekingfrog> makes sense
09:59 <Geekingfrog> Also, I'm a frog for the record
10:00 <Iceland_jack> I didn't doubt it for a second
10:00 <Geekingfrog> :D
10:01 saussure joined
10:03 govg joined
10:03 Bhootrk_ joined
10:04 uglyfigurine joined
10:04 mengu joined
10:05 Bhootrk_ joined
10:10 cschneid_ joined
10:17 kadoban joined
10:19 saussure joined
10:20 Nikotiini joined
10:25 takle joined
10:32 twopoint718 joined
10:34 takle joined
10:34 romank joined
10:37 saussure joined
10:41 netheranthem joined
10:49 yellowj joined
10:55 saussure joined
11:05 saussure joined
11:09 romank joined
11:15 mr_sm1th joined
11:20 Denthir joined
11:23 saussure joined
11:23 govg joined
11:26 Sose_ joined
11:28 TCZ joined
11:35 dni- joined
11:36 Xion_ joined
11:41 saussure joined
11:44 Gloomy joined
11:45 dni- joined
11:50 dni- joined
11:50 saussure joined
11:52 mengu joined
12:05 Denthir joined
12:08 Iceland_jack joined
12:08 saussure joined
12:10 im0nde joined
12:11 cschneid_ joined
12:12 dni- joined
12:13 corintho[m] joined
12:14 sns joined
12:14 saussure joined
12:19 razvanc-r[m] joined
12:19 sirius[m] joined
12:19 sudoreboot[m] joined
12:19 johnson[m] joined
12:19 unclechu joined
12:19 agates joined
12:19 dyce[m] joined
12:19 korayal[m] joined
12:19 curry[m] joined
12:19 M-wamaral joined
12:22 eacameron joined
12:23 cschneid_ joined
12:24 dni- joined
12:30 dni- joined
12:31 lukky513 joined
12:32 saussure joined
12:40 acarrico joined
12:41 dni- joined
12:50 saussure joined
12:58 dni- joined
13:00 pbrant joined
13:06 govg joined
13:07 dni- joined
13:08 saussure joined
13:13 saussure joined
13:15 jathan joined
13:15 iAmerikan joined
13:19 mattyw joined
13:19 <Xion_> https://medium.com/@zw3rk/template-haskell-75c7b67f9718 -- Very nice accessible intro to Template Haskell
13:23 dni- joined
13:23 eacameron joined
13:31 saussure joined
13:34 dni- joined
13:35 wei2912 joined
13:41 saussure joined
13:41 takle joined
13:47 galderz joined
13:54 nohTo joined
13:55 blissdev joined
13:56 chlong joined
13:58 saussure joined
14:00 mr_sm1th joined
14:06 saussure joined
14:08 govg joined
14:09 prophile joined
14:09 nohTo joined
14:10 twopoint718 joined
14:10 spike` joined
14:12 thc202 joined
14:13 takle joined
14:17 Big_G joined
14:20 juanpaucar joined
14:35 juanpauc_ joined
14:39 nohTo joined
14:39 cschneid_ joined
14:42 nohTo joined
14:47 fotonzade joined
14:47 kritzcreek joined
14:47 Gloomy joined
14:58 juanpaucar joined
15:08 romank joined
15:09 takle joined
15:12 sshine left
15:21 romank joined
15:21 cschneid_ joined
15:22 juanpaucar joined
15:22 bvad joined
15:26 uglyfigurine joined
15:28 saussure joined
15:34 famusmockingbird joined
15:34 Gurkenglas joined
15:35 <famusmockingbird> hiiii! i have some q's on non-js front-end alternatives (e.g. elm, clojurescript, purescript, ghc-js, etc.) -- is this an ok place for such questions?
15:38 <Cale> famusmockingbird: Sure, but you might get more answers from #haskell
15:39 aarvar joined
15:40 <Cale> famusmockingbird: Where I work, we've been using GHCJS (and Reflex-DOM) to produce web and mobile applications. It's pretty great.
15:40 GreySunshine_ joined
15:42 ianandrich joined
15:43 <famusmockingbird> Cale: What is the interface like btw ghcjs and javascript libraries? or is that a ~nogo~
15:43 chlong joined
15:46 <famusmockingbird> The use case that i have is i'm working on a web based simulation of microgrids (interconnected communities of p2p solar power networks), and would like represent my data-model, and the simulation itself by making heavy use of types. But i understand that most of the actual visualizations that I want to do may require some big javascript libraries (d3, potentially some webGL libraries
15:46 <famusmockingbird> like babylon.js, etc.)
15:57 <zaquest> famusmockingbird, there's ffi. i was able to use diagrams to produce graphics in browser with ghcjs, it's not intended for interactive graphics though. and i had better luck with purescript tbh: smaller js code, runs faster, but it has less ready-to-use libraries.
15:58 nickolay joined
15:59 juanpaucar joined
16:06 spike` joined
16:07 spike` joined
16:16 govg joined
16:17 conal joined
16:24 <Cale> famusmockingbird: It's mostly pretty straightforward. If you're using GHCJS directly, you can foreign import arbitrary bits of Javascript.
16:26 <Cale> famusmockingbird: If you're using JSaddle, that gives you a Javascript eval function.
16:29 conal joined
16:29 thc202 joined
16:40 juanpaucar joined
16:45 zero_byte joined
16:54 saussure joined
16:56 saussure joined
17:04 juanpaucar joined
17:07 uglyfigurine joined
17:09 uglyfigurine joined
17:10 Deide joined
17:11 alhariel joined
17:19 exferenceBot joined
17:21 yellowj joined
17:31 erisco joined
17:33 mstruebing joined
17:33 joedevivo joined
17:33 marmalodak joined
17:34 meandi joined
17:35 pilne joined
17:41 Gloomy joined
17:48 mjora7 joined
17:49 uglyfigurine joined
17:50 juanpaucar joined
18:00 mr_sm1th joined
18:01 surfer2007 joined
18:05 <uglyfigurine> So what is the deal with let. Books say that REPL will need it but I can do just fine without it
18:05 <kadoban> GHC 8 made it optional in ghci
18:16 geekosaur joined
18:20 conal joined
18:22 jud^ joined
18:24 peterbecich joined
18:35 juanpaucar joined
18:42 saussure joined
18:43 saussure joined
18:46 acertain joined
18:48 juanpaucar joined
18:49 juanpaucar joined
18:52 Gloomy joined
18:55 eacameron joined
19:01 Bare joined
19:06 malaclyps joined
19:14 <DataComputist> Why can't one do 'Prelude> myInt :: Int' in GHCi?
19:16 <geekosaur> because at heart it's about evaluating expressions, not defining things. defining (some_) things was added, but if they comprise a group (e.g. type signature + 1 or more patterns) then they have to be one logical line
19:16 <geekosaur> either via semicolons or one of the multi-line input modes
19:17 surfer2007 joined
19:19 <DataComputist> Tks
19:20 merijn joined
19:20 <monochrom> Although, you can do that in a file.
19:21 <monochrom> Line 5 is myInt :: Int. 300 lines later, you can finally reveal myInt = 0.
19:23 mjora7 joined
19:25 famusmockingbird joined
19:29 saussure joined
19:40 saussure joined
19:46 jud joined
19:53 saussure joined
19:55 Levex joined
19:58 jathan joined
20:03 jathan_ joined
20:10 iAmerikan joined
20:21 teqwve joined
20:24 juanpaucar joined
20:25 juanpauc_ joined
20:34 takle_ joined
20:38 conal joined
20:39 Gurkenglas joined
20:40 Levex joined
20:44 mengu joined
20:44 Levex joined
20:49 stux|RC-only joined
20:51 Levex joined
20:55 sync___ joined
20:56 <rotsix> hi guys, i'm having an issue with this code : https://ptpb.pw/MCo7.hs there is a problem with maximumBy, but dunno where :( any idea ?
20:57 <monochrom> @type maximumBy
20:57 <lambdabot> Foldable t => (a -> a -> Ordering) -> t a -> a
20:57 <monochrom> length's type doesn't fit a->a->Ordering
20:58 <rotsix> got [Integer] -> Int
20:59 <rotsix> how can i solve this ?
21:00 <geekosaur> think about what the parameter to maximumBy means, and what you are trying to do
21:01 <monochrom> Design a parameter that has the right type.
21:01 <rotsix> thx
21:02 <monochrom> "maximumBy length" would get an A+ in an essay. It sounds so "makes sense".
21:02 <monochrom> Also why people love COBOL. It is English.
21:02 nickolay joined
21:03 <geekosaur> hint:
21:03 <geekosaur> :t on
21:03 <lambdabot> (b -> b -> c) -> (a -> b) -> a -> a -> c
21:04 tusj joined
21:05 juanpaucar joined
21:07 iAmerikan joined
21:08 juanpauc_ joined
21:12 juanpaucar joined
21:15 famusmockingbird joined
21:17 zacts joined
21:19 systemfault joined
21:26 <rotsix> monochrom: found, made a `maximumBy (compare `on` length) list`
21:29 <monochrom> IIRC there is also "comparing" which combines compare with on.
21:29 <monochrom> @type comparing
21:29 <lambdabot> Ord a => (b -> a) -> b -> b -> Ordering
21:32 <geekosaur> the fun part here is how long it took the haskell community to go from maximumBy/sortBy/etc. to `comparing` (although the subsequent jump to `on` was pretty quick)
21:32 <geekosaur> so you shouldn't feel too bad about it :)
21:33 juanpaucar joined
21:33 <monochrom> Yes, we had 10 years of maximumBy without "comparing" or "on".
21:36 iAmerikan joined
21:36 juanpaucar joined
21:37 <kadoban> That seems like a surprisingly long time.
21:37 <kadoban> What'd people do, lambdas?
21:40 juanpauc_ joined
21:40 im0nde joined
21:40 <monochrom> Yes.
21:42 <kadoban> Ew
21:43 juanpaucar joined
21:43 a3f joined
21:43 a3f joined
21:46 juanpauc_ joined
21:47 juanpaucar joined
21:51 juanpaucar joined
21:52 <monochrom> Perhaps because Haskell was not used in anger back then.
21:52 hiratara joined
21:53 <kadoban> I've always liked that phrase used in that sense.
21:53 <monochrom> You know, very little incentive to add small utilities to the library if you are just a prof handing out assginments.
21:53 im0nde_ joined
21:54 <kadoban> Was haskell really that academic-only 10 years ago?
21:55 <monochrom> No. The absence of "comparing" and "on" were the 10 years before 10 years ago.
21:55 <kadoban> Oh, yes right. Math fail.
21:56 takle joined
22:18 takle joined
22:22 MarcelineVQ joined
22:25 greeny joined
22:26 cstrahan joined
22:28 diegs_ joined
22:31 hiratara joined
22:38 takle joined
22:42 dmj` joined
22:44 netheranthem joined
22:44 nacon joined
22:55 <geekosaur> I would say not so much academic only. My impression is more that there was less mathematical thinking about Haskell code. (am tempted to cite the Num hierarchy as proof...)
22:59 takle joined
23:05 uglyfigurine joined
23:07 mengu joined
23:09 malaclyps joined
23:09 im0nde joined
23:15 Levex joined
23:20 takle joined
23:26 louispan joined
23:30 zero_byte joined
23:33 Levex joined
23:33 NoCreativity joined
23:41 takle joined
23:42 louispan joined
23:46 exferenceBot joined
23:46 hexagoxel joined
23:48 uglyfigurine joined
23:53 bydo joined
23:53 cschneid_ joined
23:56 vaibhavsagar joined