Search Haskell Channel Logs

Monday, February 6, 2017

#haskell channel featuring lambdabot, kadoban, byorgey, dcoutts, tfc, MarcelineVQ, and 10 others.

quchen 2017-02-06 04:48:15
f .: g = \x y -> f (g x y)
quchen 2017-02-06 04:48:19
Mostly used to confuse people.
tsahyt 2017-02-06 04:48:29
where is .: defined?
tfc 2017-02-06 04:48:35
opqdonut: are you still there?
maksim_ 2017-02-06 04:48:49
what is the current story for dev ops? is it haskell stack? hsenv? cabal sandboxes?
kadoban 2017-02-06 04:48:57
I don't think it's in base anywhere. It's probably in some libraries here and there. It should really be better known ... it's quite a useful little family of things.
kadoban 2017-02-06 04:49:08
maksim_: The first or the last
kadoban 2017-02-06 04:49:15
Never heard of hsenv
athan 2017-02-06 04:49:27
tsahyt: Composition.Extra :)
byorgey 2017-02-06 04:49:35
I don't think hsenv is maintained anymore
athan 2017-02-06 04:49:46
nor is mine >.>
maksim_ 2017-02-06 04:49:55
can i have distinct ghcs per project using haskell stack?
byorgey 2017-02-06 04:50:01
maksim_: yes.
athan 2017-02-06 04:50:03
@hackage composition-extra
lambdabot 2017-02-06 04:50:03
http://hackage.haskell.org/package/composition-extra
byorgey 2017-02-06 04:50:33
maksim_: if you want that then you definitely want to use stack, not cabal sandboxes
athan 2017-02-06 04:50:40
(there should be way more combinators... combinatorically :|)\
maksim_ 2017-02-06 04:51:04
byorgey, thank you
jophish 2017-02-06 04:51:15
doubleleft_: I probably wouldn't use (.:)
AMDmi3 2017-02-06 05:06:59
hey; is there a complete hackage index available somewhere?
AMDmi3 2017-02-06 05:07:13
like http://hackage.haskell.org/packages/names but with versions and preferrably in machine-readable format
tdammers 2017-02-06 05:11:39
AMDmi3: https://github.com/commercialhaskell/all-cabal-hashes
quchen 2017-02-06 05:11:40
AMDmi3: https://hackage.haskell.org/api#core says the result is available as JSON somehow
quchen 2017-02-06 05:11:53
At the /packages/ resource
AMDmi3 2017-02-06 05:12:58
:q
AMDmi3 2017-02-06 05:15:27
umm, looks as something close; how do I request json from /packages/?
AndriusBartulis 2017-02-06 05:16:38
Hiding the join/leave messages on irc client was one of the best decisions today.
AMDmi3 2017-02-06 05:19:24
oh, Accept header works
quchen 2017-02-06 05:22:19
AMDmi3: Had to read some hackage-server source, but found it! curl -G 'https://hackage.haskell.org/packages/.json'
AMDmi3 2017-02-06 05:24:17
unfortunately this only returns package names; I need basically all the date available on package page: https://hackage.haskell.org/package/zlib
AMDmi3 2017-02-06 05:27:32
I think I can heg index.tar.gz, as .cabal files contain this info. just not sure if I can parse them easily
dcoutts 2017-02-06 05:27:58
AMDmi3: the Cabal lib has the stuff you need to parse them
AMDmi3 2017-02-06 05:28:24
I'd prefer not to use any depends, so I need to parse them by hand
MarcelineVQ 2017-02-06 05:31:34
between the Cabal lib and http://hackage.haskell.org/package/hackage-db you're quite set for working with full package info
AMDmi3 2017-02-06 05:32:05
I don't use haskell at all
thatguy 2017-02-06 05:33:26
do I see it right that *> just chooses the right one of two functors?
quchen 2017-02-06 05:33:44
There is only one functor involved when using *>
quchen 2017-02-06 05:34:08
It discards the value computed by its left arugment, yes
quchen 2017-02-06 05:34:15
FWIW *> is the same as the monadic >>
thatguy 2017-02-06 05:34:25
I didnt do monads yet
quchen 2017-02-06 05:34:32
Nevermind then
thatguy 2017-02-06 05:34:33
so is *> fa fb = fb ?
quchen 2017-02-06 05:34:50
No, it's not
quchen 2017-02-06 05:34:54
That would be (flip const)
quchen 2017-02-06 05:35:07
> Nothing *> Just 3
lambdabot 2017-02-06 05:35:11
Nothing
quchen 2017-02-06 05:35:47
thatguy: Do you understand <*> yet?
thatguy 2017-02-06 05:35:53
hmm I want to implement the function for a tutorial but I don't get which kind of behavior is expected
thatguy 2017-02-06 05:35:57
yes I understood that
quchen 2017-02-06 05:36:10
*> can easily be defined in terms of *> :-)
quchen 2017-02-06 05:36:17
<*>, I mean
quchen 2017-02-06 05:36:47
:t (<*>)
lambdabot 2017-02-06 05:36:49
Applicative f => f (a -> b) -> f a -> f b
quchen 2017-02-06 05:36:50
:t (*>)
lambdabot 2017-02-06 05:36:52
Applicative f => f a -> f b -> f b
thatguy 2017-02-06 05:37:16
But I don't really understand which kind of behavior is expected. f g <*> f a applies the function g to a inside of f, I used that alrady a lot
thatguy 2017-02-06 05:37:36
I am somehow missing a definition of what *> should do
quchen 2017-02-06 05:37:39
thatguy: Yup! Now leave away the part that applies f to something :-)
quchen 2017-02-06 05:38:28
This is a standard way of using <*>: (\x y -> f x y) <*> X <*> Y
quchen 2017-02-06 05:38:36
It's equivalent to f <*> X <*> Y.
thatguy 2017-02-06 05:38:46
hmm sorry I have a hard time grasping this. is there some simple definition of what *> should do?
thatguy 2017-02-06 05:38:51
sorry for the inconvinience
tdammers 2017-02-06 05:39:10
the definition follows from the type
thatguy 2017-02-06 05:39:12
quchen: yes I used <*> that way a lot on the last exercise sheet
thatguy 2017-02-06 05:39:18
I thing I understood <*>
thatguy 2017-02-06 05:39:20
think*
quchen 2017-02-06 05:39:22
thatguy: It's just a shorthand for a use case that arises a lot, namely when f ignores the »x« and returns simply the »y«
tdammers 2017-02-06 05:39:39
the intuition is that the angle bracket points to the thing you're interested in, while the other end is the part that you only have there for its effects
quchen 2017-02-06 05:39:52
thatguy: What's the function that discards its first argument and returns the second? :-)
quchen 2017-02-06 05:40:10
Well, it's f x y = x.
quchen 2017-02-06 05:40:27
And if you use that as the first argument to <*>, you get *>
thatguy 2017-02-06 05:40:34
yes, but as you said fa *> fb = fb is not what is expected here
c_wraith 2017-02-06 05:40:40
quchen: uh, check that definition. :)
quchen 2017-02-06 05:40:58
c_wraith: Woops. »up to isormorphism« lalalalaala
thatguy 2017-02-06 05:41:17
c_wraith: you can explain with mathematical terms if you need to, I do maths
quchen 2017-02-06 05:41:24
(\x y -> y) <*> A <*> B
quchen 2017-02-06 05:41:29
That one
quchen 2017-02-06 05:41:40
It still evaluates A and B, but discards the »x« result
quchen 2017-02-06 05:41:51
That's what *> does
c_wraith 2017-02-06 05:41:52
that first <*> should be a <$>
quchen 2017-02-06 05:41:57
Eh right.
c_wraith 2017-02-06 05:41:57
you're having an off day. :)
quchen 2017-02-06 05:42:11
c_wraith: You go ahead, I'm talking nonsense ;-(
tdammers 2017-02-06 05:42:19
also worth noting, maybe:
tdammers 2017-02-06 05:42:23
:t (*>)
tdammers 2017-02-06 05:42:25
:t (>>)
lambdabot 2017-02-06 05:42:25
Applicative f => f a -> f b -> f b
lambdabot 2017-02-06 05:42:29
Monad m => m a -> m b -> m b
thatguy 2017-02-06 05:42:45
so this is about side effects?
c_wraith 2017-02-06 05:42:59
thatguy: it's about effects.
thatguy 2017-02-06 05:43:19
ok I think I have to play around a bit with this
c_wraith 2017-02-06 05:43:46
> [1,2,3] *> "hello"
lambdabot 2017-02-06 05:43:48
"hellohellohello"
thatguy 2017-02-06 05:44:14
there is obviously something I dont understand since I am not getting the difference between flip const and (\x y -> y) <$> A <*> B
quchen 2017-02-06 05:44:31
\x y -> y *is* flip const
thatguy 2017-02-06 05:44:43
ah yes
quchen 2017-02-06 05:44:48
flip const *is not* something <$> A <*> b