fizbin 2017-02-21 03:46:57
Is there any way to get a heap profile to use longer names for cost centers? I'm naming my cost centers with -fprof-auto and have multiple different large pieces labeled "makeMyProp.splitExpan...", which isn't that helpful.
fizbin 2017-02-21 03:48:08
I mean, right now I'm re-running it with SCC annotations at every spot I could think of in that function, but I was wondering if there was a more generic solution that didn't require running a heap profile once to find out what code I should annotate the stuffing out of, and then running it again.
Cooler 2017-02-21 03:49:47
http://lpaste.net/352816
Cooler 2017-02-21 03:49:54
does that work?
stobix 2017-02-21 03:50:26
What's a good package to install if I want to do something like foo:: Natural -> Natural?
Cooler 2017-02-21 03:50:35
seems kinda weird that something like that is a monad
ph88 2017-02-21 03:51:15
Cooler, you know any imperative languages ?
Cooler 2017-02-21 03:51:30
yes
ph88 2017-02-21 03:51:45
if you have a function like foo(arg1, arg2) { return "hello"; } and then you say: kind of weird that something like that is a function
stobix 2017-02-21 03:51:51
Cooler: huh! Yeah, that's a weird monad alright.
ph88 2017-02-21 03:52:05
i think specifically it's weird to ignore the arguments, not that it's a monad perce
Cooler 2017-02-21 03:52:56
what does that have to do with monad?
ph88 2017-02-21 03:53:11
you ignore the arguments with _
Cooler 2017-02-21 03:53:24
so?
ph88 2017-02-21 03:53:31
that's weird lol
plantedseed 2017-02-21 03:53:35
Cale: you still here? what are you up to? you dont remember me and i dont even remember my username but i leanred haskell around 2008-09 and you helped a lot. what are you dong these days? programming in haskell? or is it still the same with haskell jobs another 10 years down the road?
Cooler 2017-02-21 03:54:27
no i am saying its weird that something that basic is a monad
ph88 2017-02-21 03:54:29
and you plantedseed ?
ph88 2017-02-21 03:54:56
Cooler, i know what you were saying, i guess the anology to a function isn't working for you ^^
Cooler 2017-02-21 03:55:18
ph88, well a function can be anything
Zemyla 2017-02-21 03:55:42
Cooler: Nope a is basically a function Void -> a.
Cooler 2017-02-21 03:55:51
you expect more structure with something like a monad
ph88 2017-02-21 03:56:20
Cooler, well you have more structure with the definition of >>= and so forth ..
Cooler 2017-02-21 03:56:45
not really, all they do is return NopeDotJpg
sm 2017-02-21 03:56:46
ertes: very cool (reflex comments)
Zemyla 2017-02-21 03:57:07
The reason it has only one value is that there is only one function of type Void -> a.
ph88 2017-02-21 03:57:09
Cooler, as far as i know it's normal for a monad to return a value
Zemyla 2017-02-21 03:57:12
:t absurd
lambdabot 2017-02-21 03:57:16
Void -> a
stobix 2017-02-21 04:00:51
There is a very similar type to what Cooler describes that can be an Applicative, but not a monad. Interesting that this compiles, whereas the other one doesn't. (Is it data Const a b = Const b? Can't remember.)
Zemyla 2017-02-21 04:01:03
@let newtype Nope a = Nope (Void -> a) -- Cooler
lambdabot 2017-02-21 04:01:09
Defined.
merijn 2017-02-21 04:01:14
stobix: "data Const a b = Const a" :)
stobix 2017-02-21 04:01:20
ah, right
Zemyla 2017-02-21 04:01:20
@let nopeDotJpg = Nope absurd
lambdabot 2017-02-21 04:01:25
Defined.
Zemyla 2017-02-21 04:01:52
@let instance Functor Nope where fmap _ _ = nopeDotJpg
lambdabot 2017-02-21 04:01:56
Defined.
kgadek_ 2017-02-21 04:02:42
There was a discussion about incorporating Shake into Stack. The topic seems to be dead though, as there was no top-priority reason to do so, right?
Zemyla 2017-02-21 04:02:46
You can write similar instances for Applicative and Monad.
kgadek_ 2017-02-21 04:03:16
re myself: the discussion was here: https://groups.google.com/d/msgid/haskell-stack/5c46f622-a261-487b-96fd-3c9a86edb4ce%40googlegroups.com?utm_medium=email&utm_source=footer
Cooler 2017-02-21 04:03:45
Zemyla, i did already
Cooler 2017-02-21 04:03:54
was just saying its weird
plantedseed 2017-02-21 04:05:46
ph88: what do you mean?
ph88 2017-02-21 04:06:01
are you working with haskell n stuff
mniip 2017-02-21 04:08:14
> case fmap id (Nope id) of Nope f -> f `seq` ()
lambdabot 2017-02-21 04:08:17
()
mniip 2017-02-21 04:08:25
curious
mniip 2017-02-21 04:09:14
ah, it is still covariant, nevermind
mniip 2017-02-21 04:10:52
Zemyla, isn't this functor the same as (Void ->) ?
Cooler 2017-02-21 04:22:23
how do you write join in terms of the other functions like fmap >>=
Cooler 2017-02-21 04:22:55
?src join
lambdabot 2017-02-21 04:22:55
join x = x >>= id
Cooler 2017-02-21 04:23:50
wait what?
Cooler 2017-02-21 04:23:56
oh
Cooler 2017-02-21 04:24:21
wait
Cooler 2017-02-21 04:24:47
isn't the type of id there m a -> m a ?
mauke 2017-02-21 04:24:55
yes
mauke 2017-02-21 04:24:57
\x -> do { y <- x; z <- y; return z }
Cooler 2017-02-21 04:25:15
so how does that type check?
merijn 2017-02-21 04:25:39
Cooler: Well, what's the type of 'x' there? :)
Cooler 2017-02-21 04:25:44
>>= needs a -> ma
Cooler 2017-02-21 04:25:47
>>= needs a -> m a
merijn 2017-02-21 04:26:04
Cooler: No, >>= needs 'a -> m b'
Cooler 2017-02-21 04:26:12
right
merijn 2017-02-21 04:26:20
Cooler: But it's perfectly fine if 'a == m b'
Cooler 2017-02-21 04:26:34
hmm
merijn 2017-02-21 04:27:50
So, can 'id :: c -> c' be equal to 'a -> m b'? Well 'c == a' and 'c == m b' in that case, so it's fine IFF 'a == m b'
merijn 2017-02-21 04:29:53
Now, 'join :: m (m a) -> m a' so in 'x >>= id' we have 'x :: m (m a)' (from join) and 'id :: m b -> m b' (from >>=)
merijn 2017-02-21 04:30:29
Plug those into the type of >>= and we see that, indeed, the signature of join falls out
max3 2017-02-21 04:38:05
i'm going to get raked over the coals for this but how do i use the global-variables package?
sm 2017-02-21 04:40:55
max3: there's an example in the haddock
max3 2017-02-21 04:41:04
in ghc it works
max3 2017-02-21 04:41:09
but not in a script
max3 2017-02-21 04:41:13
*in ghci it works
max3 2017-02-21 04:41:16
but not in a script
spatial 2017-02-21 04:42:56
list of lists and each element also has a label. Is there a way to associate a label ?