Search Haskell Channel Logs

Sunday, February 26, 2017

#haskell channel featuring dmwit_, dolio, mauke, buttons840, JoshTriplett, S11001001, and 12 others.

Starfflame 2017-02-26 09:45:30
English is a clusterfuck
mounty 2017-02-26 09:45:44
... if by pure you mean unchanged over time.
hpc 2017-02-26 09:45:50
90% of english if germanic and the other 90% is everything else
Starfflame 2017-02-26 09:45:53
It's so damn hard to learn that not even its native speakers can use it properly
mounty 2017-02-26 09:45:59
Wie heisst 'clusterfuck' auf Deutsche?
mounty 2017-02-26 09:47:10
Starfflame: the problem with its native speakers is that English, unlike German, is not taught formally in schools.
Starfflame 2017-02-26 09:47:29
It's not?
Starfflame 2017-02-26 09:47:43
The fuck did I do for 6 years in elementary school english classes then?
hpc 2017-02-26 09:48:59
you learned spelling
ongy 2017-02-26 09:49:29
mounty: I'd probably say that it's "zusammengewürfelt" but that's an adjective, not noun (also are natural language on topic for #haskell?)
Koterpillar 2017-02-26 09:49:33
in English-speaking countries schools, presumably?
monochrom 2017-02-26 09:49:48
Wait, why are you arguing this in #haskell?
Starfflame 2017-02-26 09:50:18
cuz someone compared german to haskell
JoshTriplett 2017-02-26 09:50:24
A normal Monad has (>>=) :: m a -> (a -> m b) -> m b . What's the name of the thing with the combining operation of type SomeTypeFunction t1 t2 t3 => m t1 a -> (a -> m t2 b) -> m t3 b where SomeTypeFunction can combine the types arbitrarily?
JoshTriplett 2017-02-26 09:50:36
Effectively, a Monad where the type can change after each operation.
Koterpillar 2017-02-26 09:51:11
Types already change, m a is different from m b
JoshTriplett 2017-02-26 09:51:36
Koterpillar: True, but a and b are the types of the value contained by the monad.
JoshTriplett 2017-02-26 09:51:53
Koterpillar: I'm looking for something where the type can change in another way from step to step.
monochrom 2017-02-26 09:52:06
Does such a thing exist?
Koterpillar 2017-02-26 09:52:07
I get what you mean, but I'm not sure what instances would you write for this. Perhaps you have one in mind?
JoshTriplett 2017-02-26 09:52:25
monochrom: I remember seeing it a long time ago, I just can't remember what it's called.
JoshTriplett 2017-02-26 09:54:48
Koterpillar: Something tracking type-level metadata about what functions have been called. For instance, say you have functions f1 through f9, and you want f1 :: a -> Functions [1] b , f2 :: a -> Functions [2] b , and so on. The type of an operation that calls both f2 and f7 would be Functions [2,7] x .
JoshTriplett 2017-02-26 09:56:01
(Using a type-level list.)
Koterpillar 2017-02-26 09:56:04
Ah, I see. I can only recall constrained monads, but that's a different thing.
monochrom 2017-02-26 09:58:18
maybe "indexed monad" is or is not relevant
Koterpillar 2017-02-26 09:59:15
ibind :: (a -> m j k b) -> m i j a -> m i k b
JoshTriplett 2017-02-26 10:12:29
monochrom, Koterpillar: indexed monads do indeed look like what I was thinking of, thanks!
Starfflame 2017-02-26 10:24:03
http://puu.sh/ulaLT/1e4947696e.PNG
Starfflame 2017-02-26 10:24:25
compiler felt like giving me an extra big middle finger today
mauke 2017-02-26 10:39:18
processEval (foo, bar) x
Koterpillar 2017-02-26 10:39:18
actually, can you define a type [synonym] inside a function?
monochrom 2017-02-26 10:39:24
To me the hardest part of defining my own types is coming up with good names.
dolio 2017-02-26 10:39:29
Koterpillar: No.
Starfflame 2017-02-26 10:39:37
i don't really know how to define types yet
monochrom 2017-02-26 10:39:50
I think pattern matching is a good idea.
monochrom 2017-02-26 10:40:10
And even when you define your own types, you will still want to stick to pattern matching when you use them.
Starfflame 2017-02-26 10:40:38
damn that pattern match actually is a good idea mauke
Starfflame 2017-02-26 10:40:47
i wouldn't have thought to use that here
monochrom 2017-02-26 10:40:49
mauke++
dolio 2017-02-26 10:41:47
Do note that pattern matching will be slightly different than the fst/snd stuff you were using.
dolio 2017-02-26 10:41:51
But it probably won't matter.
dolio 2017-02-26 10:42:51
In this case, that is.
Starfflame 2017-02-26 10:44:03
http://pastebin.com/RJkjS2cP
Starfflame 2017-02-26 10:46:35
can anyone translate this for me?
Starfflame 2017-02-26 10:46:35
i tried interpreting what it's telling me and i have no idea what it's complaining about
monochrom 2017-02-26 10:46:35
It is an Int and it is a Char.
Starfflame 2017-02-26 10:46:35
yeah, i see that, but what is it pointing to?
Starfflame 2017-02-26 10:46:35
i see a big function
monochrom 2017-02-26 10:46:35
In the expression: fst (foldl processEval (0, ' ') xs)
monochrom 2017-02-26 10:46:35
That whole expression needs to be both Int and Char.
mauke 2017-02-26 10:46:35
Starfflame: total + x
mauke 2017-02-26 10:46:35
that's the source of the problems
Starfflame 2017-02-26 10:46:35
oh shit
Starfflame 2017-02-26 10:46:35
thanks
Starfflame 2017-02-26 10:46:36
the function assumes that in the list if there's not a + or a - it's a number
buttons840 2017-02-26 11:08:42
I have a function that takes a "proxy entity"; what is this?
Koterpillar 2017-02-26 11:09:55
buttons840: it's a value that doesn't carry any information at runtime, but helps the type checker pick the correct type.
buttons840 2017-02-26 11:09:55
Koterpillar: satisfy that argument?
buttons840 2017-02-26 11:09:55
Koterpillar: how do I satisfy that argument?
Koterpillar 2017-02-26 11:09:55
buttons840: (Proxy :: Proxy YourType)
Koterpillar 2017-02-26 11:10:23
https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Proxy.html
glguy 2017-02-26 11:11:46
buttons840: if it takes a "proxy entity" you can use a [Entity], Maybe Entity, Proxy Entity, etc
buttons840 2017-02-26 11:14:29
the function is `mkName` from the github [api] package, the type is `mkName :: proxy entity -> Text -> Name entity`
Koterpillar 2017-02-26 11:14:29
lowercase proxy?
c_wraith 2017-02-26 11:14:29
Koterpillar: yes, that's the standard
Koterpillar 2017-02-26 11:14:29
where can I read about this (presumably) special syntax?
c_wraith 2017-02-26 11:15:15
It's not special syntax
c_wraith 2017-02-26 11:19:21
buttons840: Name isn't a complete type by itself. what does contentsFor do with the entity variable?
S11001001 2017-02-26 11:19:28
buttons840: contentsFor requires a Name ... what?
dmwit_ 2017-02-26 11:19:44
buttons840: :t contentsFor -- ?
tempeh 2017-02-26 11:19:45
anyone know how to change the stack path for intero? can't get it to work on nixos
buttons840 2017-02-26 11:20:44
https://hackage.haskell.org/package/github-0.15.0/docs/GitHub-Endpoints-Repos.html#v:contentsFor -- ah, I see now, Name is a `* -> *` like you said, so I need to use my proxy to specify whether I want a Name Owner or a Name Repo, etc
bennofs 2017-02-26 11:20:52
tempeh: doesn't it just use whatever is in PATH
c_wraith 2017-02-26 11:21:00
buttons840: there you go. That's the full chain of reasoning. :)
schell 2017-02-26 11:40:57
tempeh: i'm interested - care to write up a quick blog or something explaining how you have everything set up?
wayne 2017-02-26 11:58:49
hi
wayne 2017-02-26 11:59:30
working through exercise 6 here: http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
wayne 2017-02-26 11:59:59
i'm a little stuck, at: concat (map unit f) = concat (map f unit) = f
wayne 2017-02-26 12:00:03
any hints?
dolio 2017-02-26 12:02:07
I think one of those has to be ill typed.
wayne 2017-02-26 12:07:15
dolio: yeah that's what it seems to me too :/
Koterpillar 2017-02-26 12:09:37
you have to add x on them
Koterpillar 2017-02-26 12:09:37
so the right side is "f x"
wayne 2017-02-26 12:09:37
ah thanks
wayne 2017-02-26 12:09:47
hmm, not sure that's the case
wayne 2017-02-26 12:09:59
are you saying what's written in the post is wrong?
Koterpillar 2017-02-26 12:10:09
no
Koterpillar 2017-02-26 12:10:17
how do you prove function equality?
Koterpillar 2017-02-26 12:10:42
f = g iff f x = g x for all x
wayne 2017-02-26 12:11:11
ah you're saying we need the same domain for the proof
Koterpillar 2017-02-26 12:11:44
yes, you can't apply the equation for bind without the value