Search Haskell Channel Logs

Saturday, February 25, 2017

#haskell channel featuring tfc[m], hexagoxel, lambdabot, glguy, kadoban, maerwald,

tfc[m] 2017-02-25 09:47:33
hm i am not really getting it
tfc[m] 2017-02-25 09:48:03
can you help me with a working example that transforms Just (Just "foo", Just "bar") to Just ("foo", "bar") ?
tfc[m] 2017-02-25 09:48:41
i am not getting the proposals to run in ghci with my example value
tfc[m] 2017-02-25 09:50:41
oh wait sry
hexagoxel 2017-02-25 09:50:49
Tuplanolla: result should be Maybe (Int, Int)
kadoban 2017-02-25 09:51:00
\x -> case x of (Just (Just a, Just b)) -> Just (a,b) _ -> Nothing
tfc[m] 2017-02-25 09:51:03
so i need liftA3 (,,)because i have Just (Just 1, Just 2, Just 3)
Tuplanolla 2017-02-25 09:51:07
Oh, right, hexagoxel.
tfc[m] 2017-02-25 09:51:09
but that doesnt work with uncurry...
kadoban 2017-02-25 09:51:38
You'd probably have to write an uncurry3
tfc[m] 2017-02-25 09:51:53
oh then the case is by far easier.
Tuplanolla 2017-02-25 09:53:25
How do you even define a tuple analogue for `toListOf`?
hexagoxel 2017-02-25 09:57:15
> join . fmap (each id) $ Just (Just 'a', Just 'b')
lambdabot 2017-02-25 09:57:34
Just ('a','b')
hexagoxel 2017-02-25 09:57:58
and that is (>>=) of course
hexagoxel 2017-02-25 09:58:05
> (>>= each id) $ Just (Just 'a', Just 'b')
lambdabot 2017-02-25 09:58:08
Just ('a','b')
hexagoxel 2017-02-25 09:58:24
well, lens golfing successful
Tuplanolla 2017-02-25 09:58:43
Very nice.
glguy 2017-02-25 10:35:30
> (=<<) bisequence $ Just (Just "foo", Just "bar") -- if you want to sick to "base"
lambdabot 2017-02-25 10:35:33
Just ("foo","bar")
maerwald 2017-02-25 10:40:49
> bisequence =<< Just (Just "foo", Just "bar")
lambdabot 2017-02-25 10:40:52
Just ("foo","bar")
T0pH4t 2017-02-25 10:44:40
hello all, quick question. What does ghc prof output mean when you have a type followed by (...). For example foo.(...)