<    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:05 Rodya_ joined
00:21 ederign joined
00:24 eacameron joined
00:28 binaryplease joined
00:30 eacameron joined
00:36 eacameron joined
00:36 hexagoxel joined
00:42 eacameron joined
00:45 louispan joined
00:50 eacameron joined
01:01 eacameron joined
01:11 texasmynsted joined
01:14 eacameron joined
01:17 Ferdirand joined
01:21 <mk1> I'm learning about writing pointfree functions for the Chapter 10 exercises, and my strategy has been to take working functions, and re-arrange them so that they look like "f x = <some stuff> x" and then use eta reduction to say f = <some stuff>. However, I found a case where that doesn't work.
01:21 louispan joined
01:21 <mk1> let f x = (||) . (==) x
01:21 Youmu joined
01:22 eacameron joined
01:22 <glguy> mk1: Why doesn't it work?
01:22 <mk1> ghci gives me a type error for "f = (||) . (==)".
01:23 <glguy> let f x = (||) . (==) x isn't in the form you showed above
01:23 <glguy> It's (||) . ((==) x)
01:23 DataComputist joined
01:23 <mk1> I've worked that that is because precedence means that I'm really saying ...what you just typed.
01:24 <mk1> But I don't understand why. Where does that extra set of parentheses come from?
01:25 <glguy> normal function application: f x
01:25 <glguy> binds more tightly than operator application: x . y
01:26 <glguy> so ' x . y z ' means ' x . (y z) '
01:26 takle joined
01:26 eacameron joined
01:26 EricPoe joined
01:26 <geekosaur> mk1, precedence is just rules for where to insert parentheses
01:28 <mk1> glguy: So if I want to know whether I can do eta reduction, I could put in the implicit parentheses, and then see if I really have a variable hanging off the end?
01:29 <glguy> yes. you have to consider only the outermost function application
01:29 vaibhavsagar joined
01:32 dni- joined
01:34 <mk1> Thank you! That helps.
01:39 takle joined
01:49 Ferdirand joined
01:49 exferenceBot joined
01:53 Rodya_ joined
01:54 takle joined
01:55 \Mike joined
02:03 Rodya_ joined
02:05 texasmynsted joined
02:09 takle joined
02:12 exferenceBot joined
02:17 hexagoxel joined
02:18 louispan joined
02:20 Ferdirand joined
02:21 DataComputist joined
02:24 takle joined
02:30 Rodya_ joined
02:35 louispan joined
02:46 gfixler joined
02:53 louispan joined
02:53 Ferdirand joined
03:00 takle joined
03:09 louispan joined
03:14 takle joined
03:20 malaclyps joined
03:21 dni- joined
03:25 Ferdirand joined
03:49 takle joined
03:56 eacameron joined
04:02 eacameron joined
04:10 eacameron joined
04:14 peterbec` joined
04:16 eacameron joined
04:16 blissdev joined
04:16 takle joined
04:20 Rodya_ joined
04:22 aarvar joined
04:22 jrm joined
04:27 yaewa joined
04:34 takle joined
04:46 cschneid_ joined
04:51 Jackoe joined
04:52 moei joined
04:56 sherub1 joined
05:02 alexelcu joined
05:04 lithie joined
05:10 dni- joined
05:10 takle joined
05:14 howdoi joined
05:18 pixelfog_ joined
05:21 Rodya_ joined
05:28 takle joined
05:30 harfangk joined
05:38 takle joined
05:42 kritzcreek_ joined
05:52 ThomasLocke joined
05:52 ThomasLocke joined
05:53 meandi_2 joined
05:56 takle joined
06:00 Rodya_ joined
06:10 cur8or joined
06:14 takle joined
06:22 harfangk joined
06:23 Jackoe joined
06:25 eacameron joined
06:32 takle joined
06:37 AndreasK joined
06:42 takle joined
06:43 sherub1 joined
06:52 takle joined
06:52 Jackoe joined
06:54 Pupnik joined
06:54 nick_h joined
06:55 prophile joined
06:59 dni- joined
07:02 takle joined
07:06 for{} joined
07:06 <for{}> hi
07:07 <for{}> guys, i have `f x`. how can i find out more about the ' ' operator at my ghci prompt?
07:10 thc202 joined
07:10 Youmu joined
07:10 Youmu joined
07:10 <for{}> im not talking about $ but 'about '
07:10 <for{}> *about ' '
07:10 <tuturto> backtick?
07:10 <for{}> the space
07:11 <for{}> between f and x
07:11 <for{}> i tried :i (' ') but error
07:11 <MarcelineVQ> the so-called whitespace operator is just a cute name people give to function application, there's not much to find out, it's effectively the highest precidence
07:12 <for{}> :i whitespace outputs error
07:12 <for{}> is there any way i could get more info about it inside my ghci?
07:13 <for{}> like 'infixl 7 *' ?
07:13 <MarcelineVQ> no. it's not a defined thing to ask about with :i it's part of the syntax of the language that something in the form of "foo bar" means foo applied to bar
07:14 <for{}> what is its precedence, is it left or right associative?
07:14 <MarcelineVQ> it's left associative
07:16 <for{}> is there any instruction that can output that information every time i enter it at ghci prompt?
07:17 <MarcelineVQ> no
07:17 <ski> precedence `10'
07:18 <ski> it's not a defined operator. one might call it a "syntactic operator" (just like `@' in patterns, e.g. .. which incidentally has even higher precedence)
07:19 takle joined
07:20 <for{}> thank you both
07:21 Rodya_ joined
07:24 <ski> if you have `data Foo = MkFoo Bar', and are writing the `Show' instance manually, it'd be `instance Show Foo where showsPrec p (MkFoo bar) = showParen (p > 10) $ showString "MkFoo " . showsPrec (10+1) bar' -- the `10' here is the precedence
07:24 <ski> (if it was right associative, then the `+1' would be dropped. but it isn't, so it isn't)
07:25 <ski> (and ditto for `Read' instances, with `readsPrec' and `readParen')
07:26 mattyw joined
07:28 prophile joined
07:29 <for{}> what about `!!` ?
07:31 <MarcelineVQ> the fixity? if you don't see a precedence listed then it's infixl 9 by default
07:32 <MarcelineVQ> for operators like !! or functions used infix like `div`
07:32 <MarcelineVQ> er allthough `div` does have a declared fixity, infixl 7 `div`
07:33 takle joined
07:38 <for{}> MarcelineVQ, how do you find out all you need to know about specific operators, monads or about the laws of a specific typeclass?
07:38 galderz joined
07:40 <MarcelineVQ> haddock documentation for the most part, if I know the operator I want to learn about I can search for its documentation with something like http://hoogle.haskell.org/ typeclasses that have laws normally list them in their documentaton as well, e.g. https://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Functor
07:42 permagreen joined
07:48 dni- joined
07:51 takle joined
07:56 galderz joined
07:57 Durz0 joined
08:01 Prutheus joined
08:03 nacon joined
08:03 nacon joined
08:09 takle joined
08:12 thebored joined
08:13 grdryn joined
08:14 yellowj joined
08:26 lithie joined
08:26 gregman_ joined
08:35 Gurkenglas joined
08:43 alexelcu joined
08:43 takle joined
08:43 aarvar joined
08:44 eacameron joined
08:49 Gurkenglas_ joined
08:52 patbecich joined
08:54 govg joined
08:56 slomo joined
09:02 patbecich joined
09:03 vaibhavsagar joined
09:08 Pupnik_ joined
09:20 t0by joined
09:20 t0by joined
09:21 LiaoTao joined
09:22 louispan joined
09:25 takle joined
09:27 nil_ joined
09:31 <nil_> I keep reading the verb "witness" from Edward Kmett and others. What does it mean precisely?
09:32 <nil_> If x :: a, does x "witness" the type a?
09:32 <ski> yes
09:33 eacameron joined
09:35 mlehmk joined
09:35 <ski> it's also sometimes used with existentials
09:36 <Iceland_jack> it is also possible to witness constraints, (Dict :: Dict (Show a)) witnesses that the type a is "Show"able
09:36 <Iceland_jack> If you are familiar with constraint kinds
09:38 <nil_> So is "x is a witness of p" equivalent to "x is a proof of p"?
09:40 <ski> the witness in (known) `exists x. P x' would be the value `v' such that `P v'
09:41 <nil_> Okay, that's clear.
09:41 <nil_> Thanks
09:41 <ski> (that's for the constructive existential. for the classical existential, it forgets tha value of `v' when you wrap it up in the existential)
09:41 <nil_> What?
09:42 <Iceland_jack> To make it concrete, the number "2" is the witness of "exists n. 8 + n = 10"
09:42 <nil_> Iceland_jack: got that.
09:42 eacameron joined
09:43 <ski> if you know `2' is `even', then you know `exists n. even n'. if that's a classical existential, and you "unpack it", you could just as well get `4' back
09:43 <ski> for a constructive existential, you get back the same thing you put in
09:44 <nil_> So a "classical existential" is just a promise that yes, there is such a value?
09:44 <ski> yes
09:48 Ferdirand joined
09:48 <ski> so if you have a classical proof of `forall x. exists y. R (x,y)', then you can't say "using *the* assignment (function) from `x' to `y' there" (if you wanted to rely on the particular "construction" in that proof, rather than only what `R' tells you)
09:48 <nil_> Uh-huh, I think I see the difference.
09:49 <ski> if you want to rely on such details, then you have to make them part of `R', so that you can access them "externally"
09:52 eacameron joined
09:53 azahi joined
10:01 mengu joined
10:06 uglyfigurine joined
10:07 eacameron joined
10:09 ubsan joined
10:14 madjestic joined
10:22 merijn joined
10:28 eacameron joined
10:28 mattyw joined
10:34 pbrant joined
10:46 contiver joined
11:03 louispan joined
11:04 zero_byte joined
11:04 louispan joined
11:21 VKIND joined
11:23 VKIND left
11:30 sujeet joined
11:31 sherub2 joined
11:35 azahi joined
11:40 louispan joined
11:44 dgonzo joined
11:50 <sshine> I wonder if there's a neater way to write 'coordinate = brackets ((,) <$> expr *> symbol "," <*> expr)' - in particular if there's a library function that will join two parsers by some thing much like 'between' encloses a parser by two things.
12:01 <srhb> sshine: Almost like sepBy?
12:03 <srhb> sshine: Though I suppose `between` is even closer :P
12:12 ederign joined
12:16 lithie joined
12:22 <sshine> srhb, yes, except between discards the 'betweeners' and I wanna discard the separator. :)
12:23 <srhb> sshine: Yeah, I know. :-P
12:23 <sshine> srhb, I'll just make that. it sounds nice.
12:23 <sshine> also, hi :)
12:23 <srhb> hi
12:30 ederign_ joined
12:43 Iceland_jack joined
12:48 eacameron joined
12:53 eacameron joined
12:58 pixelfog_ joined
13:03 eacameron joined
13:11 eacameron joined
13:22 mengu_ joined
13:23 Pupnik joined
13:33 mengu joined
13:33 chlong joined
13:33 mattyw joined
13:35 jathan joined
13:39 iAmerikan joined
13:39 galderz joined
13:51 takle joined
13:55 amir_ joined
13:56 <Guest96810> Anyone knows a successor of the #haskellbook? something that covers a little bit more advanced materials?
13:57 mitchty joined
13:57 <mniip> papers, lots of papers
13:57 <Guest96810> no book?
13:58 <Guest96810> Things like GHC extensions, Lens library, etc.
14:02 <Guest96810> :D
14:03 <Guest96810> has anyone done CS240H?
14:04 <mniip> that's a lot of sulphur
14:04 <merijn> Guest96810: Have you read the GHC manual? It covers a lot of extensions (although not always in depth)
14:04 <merijn> Guest96810: Usually has links to relevant papers, though
14:04 <mniip> lens is ehh
14:04 <mniip> hard to explain in a gradual way
14:04 <Guest96810> Thanks Merijn
14:04 <Guest96810> I will take a look
14:04 <Guest96810> was hoping for something similar to haskellbook
14:05 <mniip> you want to see the entire picture at once
14:06 <Iceland_jack> Guest96810: You are going to have to do some snooping yourself I'm afraid
14:08 <Guest96810> pity. but ik know cs240h, and schoolofhaskell stuff
14:08 <Guest96810> any main reference i am missing?
14:12 vmeson joined
14:14 acarrico joined
14:17 eacameron joined
14:19 <glguy> Guest96810: I'd recommend reading "the essence of the iterator pattern" to start with lens
14:20 <glguy> it's not about the lens package, but it will help make the lens package make sense
14:22 <Guest96810> thanks
14:22 MotherFlojo joined
14:22 carlomagno joined
14:23 <Iceland_jack> Guest96810: Pay attention to the Applicative instance for Const
14:26 <__rgn> https://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf
14:26 <__rgn> any mirror?
14:27 <Iceland_jack> http://ropas.snu.ac.kr/~bruno/papers/Iterator.pdf ?
14:27 <Iceland_jack> may be an older version
14:28 <Iceland_jack> In that paper it's called: instance Monoid b => Idiom (K b)
14:28 <Iceland_jack> In modern Haskell it's: instance Monoid b => Applicative (Const b)
14:28 <* ski> likes idioms
14:29 <* Iceland_jack> likes them too
14:29 <Iceland_jack> type Idiom = Applicative
14:29 <Guest96810> oh I see
14:29 <Guest96810> i thought you meant in Lens
14:30 takle joined
14:31 <Guest96810> I do haskell for like a couple of months now, looks like a never ending process learning it. Also not a very good ide around.
14:32 <Iceland_jack> Yes
14:32 <__rgn> just started using vim-hdevtools, it's very useful
14:33 <Guest96810> yes, I use a bunch of vim plugins
14:33 <Guest96810> still not perfect
14:33 <Guest96810> like ghcmod one, tells me the types of a selected expression
14:33 <Guest96810> but not always working
14:34 <Guest96810> i have tags installed, not always jumps to the proper definition
14:34 <Gurkenglas> Would be nice if there was a VM image available that has all of the ide stuff and so on set up already
14:34 <Guest96810> I don't know emacs but I guess it comes with more support
14:35 <Iceland_jack> I use Haskell professionally and I have a very minimal Emacs setup
14:35 <__rgn> Guest96810: yes the thing i find useful about vim-hdevtools is showing type of the expression under cursor
14:35 <Guest96810> if you want to quickly check some definition, you use hackage?
14:35 <Guest96810> or you can do it in your emacs?
14:36 azahi joined
14:36 <Iceland_jack> I do it from Emacs on my personal machine, but here I just use a search engine / bookmark with a hot key
14:37 <Guest96810> convenient
14:45 rizary joined
14:47 <vaibhavsagar> Gurkenglas: this might be useful as a Nix shell expression as well
14:58 uglyfigurine joined
15:06 <Gurkenglas> "Nix shell expression"?
15:06 cschneid_ joined
15:14 acarrico joined
15:14 blissdev joined
15:29 skeet70 joined
15:31 eacameron joined
15:44 yellowj joined
15:47 eacameron joined
15:53 wildlander joined
16:00 <Geekingfrog> Silly question, I have a Int but I need to convert it to a ByteString. Is there something simple to do that ? Something unsafe would do as well since the value will always be something like 1 or 2
16:00 <Geekingfrog> (and it's for a small script)
16:03 pixelfog_ joined
16:06 <Geekingfrog> Uhm, I ended up with Data.Text.Encoding.encodeUtf8 $ Text.pack $ show i
16:09 <Cale> Geekingfrog: looks like what I'd do
16:09 <Cale> Geekingfrog: It's worth noting that you can import all the Text-related modules qualified as T
16:09 <Geekingfrog> I always feel pack . show isn't very nice
16:11 DataComputist joined
16:23 AM_ joined
16:25 <AM_> Just following a simple project and when tried to issue "stack build" I am getting the following errors ----- Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for helloworld-0.1.0.0: DogsRule must match -any, but the stack configuration has no specified version Hello must match -any, but the stack configuration has no specified version Plan construction failed
16:29 shayan_ joined
16:38 malaclyps joined
16:44 Ferdirand joined
16:48 takle_ joined
16:49 eacameron joined
16:55 iAmerikan joined
16:56 eacameron joined
16:58 nepiktaz joined
17:08 eacameron joined
17:09 irons_ joined
17:09 aarvar joined
17:10 merijn joined
17:12 takle joined
17:17 malaclyps joined
17:27 AM_ joined
17:29 eacameron joined
17:30 govg joined
17:32 <AM_> I posted this earlier, anyone have seen similar error during "stack build" ..... Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for hello-world-0.1.0.0: DogsRule must match -any, but the stack configuration has no specified version Hello must match -any, but the stack configuration has no specified version Plan construction failed.
17:34 nek0 joined
17:35 <MarcelineVQ> at a blind guess you may have put module names in the build depends section but that section is for packages, what's your project's cabal file look like?
17:35 uglyfigurine joined
17:35 guampa joined
17:36 <glguy> The problem is in the stack.yaml
17:37 eacameron joined
17:39 <AM_> Cabal content .... name: hello-world version: 0.1.0.0 -- synopsis: -- description: license: BSD3 license-file: LICENSE -- author: -- maintainer: -- copyright: -- category: build-type: Simple extra-source-files: ChangeLog.md, README.md cabal-version: >=1.10 executable hello-world hs-source-dirs: exe main-is: Main.hs build-depends: base >
17:39 <AM_> so what particular problem in stack.yaml?
17:39 <glguy> AM_: No, don't paste to the IRC channel. You need a pastebin like http://lpaste.net
17:40 malaclyps joined
17:41 <glguy> stack solves the problem of resolving which package versions to use by having you decide for it. You specify versions manually via a resolver, specific versions listed in extra-deps, and specific directories with source files in packages
17:42 <glguy> so whatever Hello and DogsRule are, you need to sure that stack knows either exactly which directory has them, or which versions they have if they're from hackage
17:43 eacameron joined
17:43 <glguy> If you paste your stack.yaml to a pastebin we can see what's missing
17:43 <AM_> ok sure
17:44 <MarcelineVQ> paste both the cabal and the yaml when you do, just to be comprehensive
17:44 <lpaste> AM pasted “hello-world.cabal” at http://lpaste.net/8007672180693270528
17:45 <glguy> OK, so if Hello and DogsRule are modules in your package, then they don't go into your build-depends
17:45 <glguy> (which is for packages)
17:46 chlong_ joined
17:46 <MarcelineVQ> the name of your library is the name at the top of the cabal file hello-world so that's what you may need to put in your exectable's build-depends instead of module names as you've tried
17:49 <lpaste> AM pasted “stack.yaml” at http://lpaste.net/938821057098285056
17:51 eacameron joined
17:51 <AM_> Thank you MarcelineVQ. Updating executable's build-depends fixes it.
17:51 <MarcelineVQ> awesome
17:52 hoffmeyer joined
17:53 dni- joined
17:59 malaclyps joined
18:04 eacameron joined
18:09 eacameron joined
18:14 eacamero_ joined
18:17 sigmundv joined
18:18 eacameron joined
18:18 hoffmeyer joined
18:19 MotherFlojo joined
18:19 Ferdirand joined
18:24 takataka joined
18:29 MotherFlojo joined
18:34 iAmerikan joined
18:37 nepiktaz joined
18:37 aarvar joined
18:43 ralu joined
18:45 normie_whisperer joined
18:49 albertus1 joined
18:49 albertus1 joined
18:50 albertus1 joined
18:51 Ferdirand joined
18:53 takle joined
18:55 iAmerikan joined
19:09 eacameron joined
19:12 vmeson joined
19:13 freechips joined
19:16 iAmerikan joined
19:20 merijn joined
19:22 Ferdirand joined
19:24 takle joined
19:25 iAmerikan joined
19:36 freechips joined
19:41 dni- joined
19:42 chlong joined
19:43 perlnecrohacker joined
19:45 Deide joined
19:46 pixelfog joined
19:48 amuck joined
19:52 nepiktaz joined
19:53 Gurkenglas joined
20:08 yellowj joined
20:11 nick_h joined
20:16 stef204 joined
20:20 Kuros joined
20:20 azahi joined
20:30 contiver joined
20:32 MotherFlojo joined
20:48 meck joined
20:58 guampa joined
20:58 Ferdirand joined
20:59 freechips joined
21:21 eacameron joined
21:24 iAmerikan joined
21:28 eacameron joined
21:30 dni- joined
21:32 eacamero_ joined
21:34 mengu joined
21:37 eacameron joined
21:44 iAmerikan joined
21:50 MotherFlojo joined
21:52 hiratara joined
22:05 iAmerikan joined
22:10 dpren joined
22:14 pietilson joined
22:15 ederign joined
22:27 madjestic joined
22:31 hiratara joined
22:48 louispan joined
22:51 MotherFlojo joined
23:01 uglyfigurine joined
23:19 dni- joined
23:21 eacameron joined
23:24 uglyfigurine joined
23:28 shayan_ joined
23:34 cschneid_ joined
23:38 seagreen joined
23:57 jle` joined
23:57 jle` joined