Search Haskell Channel Logs

Tuesday, March 7, 2017

#haskell channel featuring Squarism, suica, dolio, sena_kun, glguy, codedmart,

Squarism 2017-03-07 06:52:20
if class "Cls z" defines type "MemType z" if i somewhere have a function "f" that takes a type argument "y" that requires a Cls instance. Ie "f :: (Cls b) => b -> Int" . Can i use (MemType b) in the arguments list of f?
Squarism 2017-03-07 06:52:46
ops.. "." after "MemType z"
Squarism 2017-03-07 06:54:23
Something along the lines of : "f :: (Cls b) => b -> *MemType b* -> Int"
Squarism 2017-03-07 06:54:49
*...* to show idk how to write it
glguy 2017-03-07 06:56:32
What happened when you tried?
Squarism 2017-03-07 06:59:38
"Cls b" defines a method "gimmeMemType :: ... -> MemType b". Compiler complains theres 2 variants of MemType b ( MemType b and MemType b1) around - so cant do operations between them
Squarism 2017-03-07 07:03:43
Yes i know, my code is horrible - but im learning. http://lpaste.net/353292
glguy 2017-03-07 07:05:29
Squarism: incidentally, Ord (PlayerPos a) implies Eq (PlayerPos a)
Squarism 2017-03-07 07:05:30
Line 140 (in file) == 36 in paste
Squarism 2017-03-07 07:06:03
oh ok
glguy 2017-03-07 07:10:15
Squarism: It's going to be hard to guess since you didn't include many definitions or types. There are two issues to understand with a line like this, however:
glguy 2017-03-07 07:10:22
let faction = ((toPos _gc_gp gc) (_p_faction p)) :: (PlayerPos a)
glguy 2017-03-07 07:10:22
you're saying that faction has the type 'forall a. PlayerPos a'
suica 2017-03-07 07:10:22
has anyone read this post? https://lukepalmer.wordpress.com/2008/05/02/enumerating-a-context-free-language/ the core of it seems to be this function (http://lpaste.net/353293) but I'm seriously struggling to figure out what it's doing
glguy 2017-03-07 07:10:22
1, that's probably not what you meant and also 2, it won't work if you did meant that because PlayerPos being a type family
glguy 2017-03-07 07:10:22
you won't be able to determine what type 'a' ever is
Squarism 2017-03-07 07:11:47
glguy, Yes i thats what i hoped. Thanks for the advice. Ill work on that
Squarism 2017-03-07 07:14:05
glguy, thanks for your advice. Now it works
codedmart 2017-03-07 07:35:44
I am seeing this error every so often in development. Doesn't seem to cause problems in production as far as I can tell. `Left thread blocked indefinitely in an MVar operation`. This is a servant api I have been working on. I know this is vague but any initial ideas where to look?
napping 2017-03-07 07:38:11
is "Left" the name of a thread?
dolio 2017-03-07 07:38:17
I don't know servant, but that is GHC detecting some sort of deadlock.
napping 2017-03-07 07:38:24
or an Either constructor?
dolio 2017-03-07 07:38:40
Either threads blocking on each other, or a thread blocking on an empty mvar that's been garbage collected, or something along those lines.
napping 2017-03-07 07:39:52
It sounds like you're catching the exception somehow - it's Control.Exception.BlockedIndefinitelyOnMVar
dolio 2017-03-07 07:39:59
Maybe the way you're setting up your dev environment leads to this.
sena_kun 2017-03-07 07:43:53
hi, guys. I want to quickly start an openshift(redhat's paas) cartridge with haskell(scotty, to be precise), but https://wiki.haskell.org/Web/Cloud#OpenShift - links from here are dead and hence I cannot. What is the current practice of openshift+haskell usage, do I need to set up everything from scratch?