Search Haskell Channel Logs

Tuesday, January 31, 2017

#haskell channel featuring jle`, mrkgnao, _sras_,

mrkgnao 2017-01-31 18:45:16
and the typechecker wants me to expand this out into the (a -> f a) -> b -> f b form and add an Applicative constraint
mrkgnao 2017-01-31 18:45:40
should I change this to a Traversal'? I don't know anything about those though
jle` 2017-01-31 18:46:27
mrkgnao: have you turned on RankNTypes?
jle` 2017-01-31 18:47:06
oh, but yeah, if your function only works on Applicative f, it'd be Traversal'
mrkgnao 2017-01-31 18:47:15
I have, at intero's suggestion
jle` 2017-01-31 18:47:23
Traversal' is basically Lens' constrained to all Applicatives instead of just all Functor's
jle` 2017-01-31 18:48:28
Lens' a b = forall f. Functor f => (b -> f b) -> (a -> f a)
jle` 2017-01-31 18:48:39
Traversal' a b = forall f. Applicative f => (b -> f b) -> (a -> f a)
mrkgnao 2017-01-31 18:49:15
uh, why does my a-type need to be a Monoid?
mrkgnao 2017-01-31 18:49:28
pretty sure I'm making a dumb mistake somewhere
jle` 2017-01-31 18:51:21
hm, what do you mean?
mrkgnao 2017-01-31 18:51:41
jle`: I'm trying to get an AsmInst from a VMState
mrkgnao 2017-01-31 18:52:09
so I tried doing vm ^. instAt i, and it says AsmInst doesn't have a Monoid instance
mrkgnao 2017-01-31 18:57:49
I'm very confused now
mrkgnao 2017-01-31 19:04:36
oh, I should've done vm ^?! instAt i instead. huh.
_sras_ 2017-01-31 19:43:17
Using TH, how can I generate a toplevel call to a template haskell function. I mean, I want to generate a bunch of code, one of which is a call to an external TH function....