Search Haskell Channel Logs

Thursday, February 23, 2017

#haskell channel featuring ezyang, Sornaensis, Koterpillar, dijonmustard, lambdabot, Welkin, and 7 others.

michbad 2017-02-23 17:47:09
Thanks glguy.
Welkin 2017-02-23 17:49:36
what's the point of interns?
Welkin 2017-02-23 17:49:45
seems like cheap (and low quality) labor to me
Welkin 2017-02-23 17:49:54
exploitation
glguy 2017-02-23 17:50:04
Nope, not that
glguy 2017-02-23 17:50:46
It's common that someone is in school and wants a short-term bit of of experience working in a field they're interested in. For example over a summer break from school
Welkin 2017-02-23 17:51:05
I never was able to find an internship like that
Welkin 2017-02-23 17:51:17
I didn't know wtf they were looking for
Welkin 2017-02-23 17:51:20
it wasn't obvious
glguy 2017-02-23 17:51:20
internships offer a way for people in that situation to make some money and get some experience relevant to the field they want to work in
Welkin 2017-02-23 17:51:27
seemed like they wanted cheap labor
Welkin 2017-02-23 17:52:05
I worked in a high tech research lab for a little more than minimum wage one summer
nshepperd 2017-02-23 18:02:43
huh, the prisms in lens are all made using 'prism' combinator
glguy 2017-02-23 18:03:18
nshepperd: What did you have in mind?
nshepperd 2017-02-23 18:03:54
I was wondering if there was some 'direct' way like with Lenses '_1 f (a,b) = (,b) <$> f a'
jle` 2017-02-23 18:04:01
there is a way
jle` 2017-02-23 18:04:10
you can just inline prism's definition, heh
jle` 2017-02-23 18:04:31
(that's what i do fwiw)
glguy 2017-02-23 18:04:31
nshepperd: I see. Also note that that's not the definition for _1 but rather for _1' !
jle` 2017-02-23 18:04:50
it's actually not too tricky if you follow the types
glguy 2017-02-23 18:04:52
GHC is pretty good at inlining prism's definition
nshepperd 2017-02-23 18:06:54
hmm, lemme try expanding out prism's definition and see if the result is at all nice
nshepperd 2017-02-23 18:11:34
I guess that's not much different, I still end up writing a getter and a setter
buttons840 2017-02-23 18:14:41
I'm having trouble finding documentation for the Spock function `text`, it is exported from Web.Spock, yet it is not listed in that modules hadock documentation anywhere -- when I got some information from GHCI, it says "Defined in 'Spock-core-0.12.0.0:Web.Spock.Internal.CoreAction'", but CoreAction is not listed on hackage or stackage -- any suggestions?
buttons840 2017-02-23 18:17:07
or maybe I need to step back and ask what web frameworks people recommend using?
MarcelineVQ 2017-02-23 18:17:09
the Spock-core part is referencing another pacakge
MarcelineVQ 2017-02-23 18:17:23
it's a dependency of Spock http://hackage.haskell.org/package/Spock-core
buttons840 2017-02-23 18:17:48
MarcelineVQ: https://hackage.haskell.org/package/Spock-core-0.12.0.0 -- yeah, I couldn't find the CoreAction module though
buttons840 2017-02-23 18:18:38
like, the word "CoreAction" does not appear on that page you linked
MarcelineVQ 2017-02-23 18:19:13
it's not exposed but it exists, http://hackage.haskell.org/package/Spock-core-0.12.0.0/src/
nshepperd 2017-02-23 18:20:04
buttons840: https://github.com/agrafix/Spock/blob/master/Spock-core/src/Web/Spock/Internal/CoreAction.hs#L275
nshepperd 2017-02-23 18:20:25
it's exported by Web.Spock.Action
dijonmustard 2017-02-23 18:21:06
Is every Foldable a Monoid?
nshepperd 2017-02-23 18:21:07
ehm, here http://hackage.haskell.org/package/Spock-core-0.12.0.0/docs/Web-Spock-Action.html#v:text
dolio 2017-02-23 18:21:26
No.
Sornaensis 2017-02-23 18:21:41
:info Foldable
Sornaensis 2017-02-23 18:21:47
@src Foldable
lambdabot 2017-02-23 18:21:48
Source not found. :(
Sornaensis 2017-02-23 18:22:05
@hoogle Foldable
lambdabot 2017-02-23 18:22:08
Prelude class Foldable t
lambdabot 2017-02-23 18:22:08
module Data.Foldable
lambdabot 2017-02-23 18:22:08
Data.Foldable class Foldable t
dijonmustard 2017-02-23 18:22:31
Ok. I was reading the hackage page and they have foldMap f Empty = mempty for a Tree
buttons840 2017-02-23 18:23:29
MarcelineVQ: what do you mean by not exposed? as a Spock user I can use the text function, and it seems like an important part of the library?
MarcelineVQ 2017-02-23 18:24:03
I just meant that module isn't directly exposedfor import
buttons840 2017-02-23 18:25:51
ok
dijonmustard 2017-02-23 18:26:08
Oh, so you can either define foldMap or foldr, and foldMap requires the type to be a Monoid but foldr doesn't
nshepperd 2017-02-23 18:26:21
dijonmustard: foldMap :: (Foldable f, Monoid m) => (a -> m) -> f a -> m'
buttons840 2017-02-23 18:26:28
if I do "import X" in a haskell library, are all the functions defined in X automatically re-exported from my module?
ezyang 2017-02-23 18:26:33
no
Koterpillar 2017-02-23 18:26:45
buttons840: you have to list X in your 'module' statement
nshepperd 2017-02-23 18:28:07
dijonmustard: foldMap produces some output for you, from the "contents" of the foldable value. the output can be anything you like, as long as it's a monoid
nshepperd 2017-02-23 18:28:27
because the monoid tells foldmap how to combine the contents together
dijonmustard 2017-02-23 18:29:12
Ok I get it now. Thanks!
nshepperd 2017-02-23 18:29:37
the alternative is to use something like foldr which uses a combining function and a 'zero value' instead
nshepperd 2017-02-23 18:30:12
which serves basically the same purpose as the monoid