Search Haskell Channel Logs

Thursday, February 23, 2017

#haskell channel featuring byorgey, sshine, dmwit, Welkin, sssilver, Rotaerk, and 5 others.

lordcirth 2017-02-23 14:52:14
lol
Zemyla 2017-02-23 14:55:04
So what the hell do I do to fix this?
lordcirth 2017-02-23 14:55:24
Zemyla, well for now you could edit the configure script?
Zemyla 2017-02-23 14:57:48
lordcirth: No, because it's being launched from Distribution.Simple, which is an already-compiled package.
dmwit 2017-02-23 14:58:51
Fix whichever tool is calling it wrong.
lordcirth 2017-02-23 14:58:59
Zemyla, is it a bash configure script, in the sense of ./configure; make; make install?
dmwit 2017-02-23 15:00:05
But I, too, am a bit confused about the juxtaposition of "the configure script is running ghc-pkg dump -global" and "it's being launched from Distribution.Simple", which appear contradictory.
Zemyla 2017-02-23 15:00:39
lordcirth: No, it's a Setup.hs.
Zemyla 2017-02-23 15:01:16
Its script is basically "import Distribution.Simple; main = defaultMain"
lordcirth 2017-02-23 15:01:23
Zemyla, and this Setup.hs does not contain the actual string, "ghc-pkg dump -global"? Where is this string being set?
lordcirth 2017-02-23 15:02:07
Use my fav debugging tool, grep -r :)
Zemyla 2017-02-23 15:03:31
lordcirth: https://www.haskell.org/cabal/release/latest/doc/API/Cabal/Distribution-Simple.html
lordcirth 2017-02-23 15:04:31
Zemyla, I don't see any reference to ghc-pkg
Zemyla 2017-02-23 15:05:53
It's somewhere in the source code.
Zemyla 2017-02-23 15:08:25
And then it turns out that was a red herring and all I had to do was add --user to it.
sssilver 2017-02-23 15:10:45
People still use the so-called Haskell in a world that already has Javascript. SAD!
Welkin 2017-02-23 15:13:03
?
hpc 2017-02-23 15:14:24
heh
halogenandtoast 2017-02-23 15:18:48
I keep realizing that I probably misunderstand the Reader, Writer, and State monads. Are there any good practice problems I could try that would benefit from the usage of any of these so I can see it in the wild and in context?
Welkin 2017-02-23 15:19:00
Writer can be used for logging
Welkin 2017-02-23 15:19:06
Reader is used for "global state"
Welkin 2017-02-23 15:19:08
er
Welkin 2017-02-23 15:19:11
global constants
Welkin 2017-02-23 15:19:21
and state is for, well, state
Welkin 2017-02-23 15:19:35
I have never actually use writer for anything
Welkin 2017-02-23 15:19:52
I only used state as part of an exercise in making a toy example of a game
Welkin 2017-02-23 15:19:56
Reader is used a TON
Welkin 2017-02-23 15:20:00
in everything
Welkin 2017-02-23 15:20:04
every web app uses Reader
Welkin 2017-02-23 15:20:09
to store configuration
Rotaerk 2017-02-23 15:20:16
Reader can be used to accomplish something akin to what dependency injection frameworks do, but better
Welkin 2017-02-23 15:20:29
Rotaerk: no idea what dependency injection is
Welkin 2017-02-23 15:20:45
but I know it an Big Enterprise Bullshit term for Java
Rotaerk 2017-02-23 15:20:54
oh, some shitty bandwagon OO language users are riding
sshine 2017-02-23 15:21:50
Welkin, dependency injection is a neat concept, I think. not OO-specific.
byorgey 2017-02-23 15:24:32
Reader is not just for global configuration. Given the 'local' function, it can be used for tracking a statically-scoped environment. E.g. a value that changes or is extended when you recurse, but then is automatically restored to its previous value when the recursive call returns
byorgey 2017-02-23 15:24:46
so it shows up a lot when implementing things like e.g. typecheckers
halogenandtoast 2017-02-23 15:26:41
Hmm I'm trying to write a bunch of board games in Haskell, they of course have state, could benefit from logging, etc.
sshine 2017-02-23 15:27:01
halogenandtoast, ermagerd monerds!
halogenandtoast 2017-02-23 15:27:05
I keep wondering if I should try to force these monads in somehow, but I can't ever figure out how so I assume I misunderstand them
halogenandtoast 2017-02-23 15:27:14
dem monadz
sshine 2017-02-23 15:27:47
halogenandtoast, do without them first. write a bunch of functions with excessive parameters. then identify those parameters as certain monadic patterns.
halogenandtoast 2017-02-23 15:29:34
Right, I just don't know what those patterns are yet... I guess I want a tiny bit of hand-holding to say (You are doing x, try doing it with this Monad) to that end I'll paste some code and if someone wants to point me towards a reasonable monad I would be grateful
Welkin 2017-02-23 15:30:50
what is haogen and toast?
Welkin 2017-02-23 15:31:35
halogen
halogenandtoast 2017-02-23 15:31:36
https://gist.github.com/halogenandtoast/b92a1a12e981fa1e5e624d40f8c321e7
halogenandtoast 2017-02-23 15:31:36
A juxtaposition between something seemingly complex and something seemingly simple
Welkin 2017-02-23 15:31:36
halogenandtoast: oh, you live in tokyo?
halogenandtoast 2017-02-23 15:31:36
Welkin: yes
Welkin 2017-02-23 15:31:36
are you a contractor, do you run your own business, or are you a salaryman?
halogenandtoast 2017-02-23 15:31:59
I work for Cookpad
halogenandtoast 2017-02-23 15:31:59
So no, no, and not really.
halogenandtoast 2017-02-23 15:32:17
I work for the international team, so I don't have to follow any of the Japanese rules.
halogenandtoast 2017-02-23 15:32:40
I come to work in a t-shirt and jeans and go home well before 10pm.
Welkin 2017-02-23 15:33:38
no izakaya for you?
halogenandtoast 2017-02-23 15:34:00
Nope, haven't been to one yet.
halogenandtoast 2017-02-23 15:34:07
I mean not for work at least.
Welkin 2017-02-23 15:34:31
cool, I'd like to visit soon; I've wanted to go for years
sshine 2017-02-23 15:34:40
halogenandtoast, you might have a datatype GameState { hand :: [Card], deck :: [Card] } and a function housePlays :: GameState -> (GameState, Bool), and you might think such functions will become so common you'll make an alias for them: State GameState Bool.
halogenandtoast 2017-02-23 15:35:50
sshine: I don't understand housePlays (is this implying an AI, currently there isn't and won't be an AI)
halogenandtoast 2017-02-23 15:36:20
Welkin: I'd suggest visiting, especially if you like rice, noodles, and fish.
Welkin 2017-02-23 15:36:50
halogenandtoast: my number one place to visit is kyoto
halogenandtoast 2017-02-23 15:36:56
sshine: I also don't understand the Bool.
ezyang 2017-02-23 15:37:17
y'all missed ICFP last year! ;)
sshine 2017-02-23 15:37:27
halogenandtoast, I was thinking of black-jack. the Bool is whether the house wins or loses. in black-jack the house plays quite deterministically. you could make some similar actions for a human player.
Welkin 2017-02-23 15:37:32
ezyang: it was in japan?
ezyang 2017-02-23 15:37:44
yeah, Nara
Welkin 2017-02-23 15:37:57
oh cool http://conf.researchr.org/home/icfp-2016
halogenandtoast 2017-02-23 15:38:16
I missed ICFP as well :(
halogenandtoast 2017-02-23 15:39:14
Welkin: Kyoto is nice. I get bored with it quickly though, but I definitely suggest checking it out.
halogenandtoast 2017-02-23 15:39:34
It's also a day trip to Nara and the Inari Shrine
Welkin 2017-02-23 15:40:20
I just love all the architecture, historical clothing, bridges, gardens
halogenandtoast 2017-02-23 15:40:26
sshine: Ah yeah I see, would you use [Card] instead of type Deck = [Card]
sshine 2017-02-23 15:40:48
halogenandtoast, sure, I like type aliases.
sshine 2017-02-23 15:41:39
halogenandtoast, I mean, I'd go with Deck if I had to use it often and/or had to export it. :) makes replacing its implementation slightly easier.
halogenandtoast 2017-02-23 15:41:59
True, afk for lunch