Search Haskell Channel Logs

Wednesday, March 1, 2017

#haskell channel featuring marvin2, AndreasK, glguy, lyxia, mauke, ezyang, and 6 others.

mtjmullen 2017-03-01 11:45:07
glguy: I should be more specific: I would like to lift a semigroup instance to Free
glguy 2017-03-01 11:45:24
mtjmullen: I don't know what that means
Cale 2017-03-01 11:45:35
(but the way type classes work, you have to do this for each monad)
mtjmullen 2017-03-01 11:45:44
So if I have a (Free f a), and a forms a semigroup, can I have (Free f a) be a semigroup by deferring to the semigroup on a
glguy 2017-03-01 11:46:17
mtjmullen: That's the hypothetical Data.Monoid.App case I mentioned above
Cale 2017-03-01 11:46:17
instance Semigroup a => Semigroup (Free f a) where (<>) = liftM2 (<>)
glguy 2017-03-01 11:46:23
You don't need a Monad for that, an Applicative will do
Cale 2017-03-01 11:46:29
Sure
mtjmullen 2017-03-01 11:46:42
That's what I thought, I was surprised the free package didn't have it
mtjmullen 2017-03-01 11:47:43
I guess they want you to use the Alt instance
mtjmullen 2017-03-01 11:48:07
sorry, Data.Monoid.App instance
markholmes 2017-03-01 12:07:29
is there a way to stop an infinite list from printing
markholmes 2017-03-01 12:07:36
in ghci
markholmes 2017-03-01 12:07:40
... :)
dmwit 2017-03-01 12:07:43
fresheyeball: Make a `Set` and use `Data.Set.member` or `Data.Set.elem` or whatever it's called.
markholmes 2017-03-01 12:07:50
ctrl + c and ctrl + z do not work
dmwit 2017-03-01 12:08:13
markholmes: Hm. They work here.
dmwit 2017-03-01 12:08:22
markholmes: Perhaps you will like to become acquainted with `kill`. =)
markholmes 2017-03-01 12:08:51
i'm assuming it's an issue with git bash on windows
markholmes 2017-03-01 12:08:55
:/
markholmes 2017-03-01 12:09:17
thanks
dmwit 2017-03-01 12:10:26
fresheyeball: What have you tried so far?
dmwit 2017-03-01 12:13:07
markholmes: You could also try ctrl+q
dmwit 2017-03-01 12:13:25
Whoops, ctrl+q is resume. I meant ctrl+s
mauke 2017-03-01 12:13:44
on windows?
glguy 2017-03-01 12:13:49
When I have a run-away GHCi, I use Ctrl+Z and then kill -9 %1
dmwit 2017-03-01 12:13:53
Well, if he's in bash...
dmwit 2017-03-01 12:14:06
Presumably he has some kind of terminal emulation.
mauke 2017-03-01 12:14:08
^S/^Q is a terminal thing, not shell
dmwit 2017-03-01 12:14:15
I am aware.
mauke 2017-03-01 12:14:20
ah
markholmes 2017-03-01 12:14:20
yeah, it's git bash
markholmes 2017-03-01 12:15:11
ctrl + s pauses it
dmwit 2017-03-01 12:15:31
Right. That should give you enough time to use some other tool to do something to ghci.
markholmes 2017-03-01 12:15:41
and then ctrl + z exits ghci
markholmes 2017-03-01 12:15:47
cool, thanks
markholmes 2017-03-01 12:17:31
oops, they were still running in the background. each one (i did it twice) was taking up 30% of my cpu
markholmes 2017-03-01 12:17:39
according to task manager
dmwit 2017-03-01 12:17:44
Yes, you can't forget the second half of glguy's workflow. =)
geekosaur 2017-03-01 12:24:21
on windows I'd expect c-z to exit, on unix it means suspend and will still be running
Koterpillar 2017-03-01 12:24:59
On Windows, Ctrl-Z is EOF
marvin2 2017-03-01 12:26:51
my windows ghci must be special.. it exists on C-d
marvin2 2017-03-01 12:26:59
exits
AndreasK 2017-03-01 12:27:33
In what shell
marvin2 2017-03-01 12:27:44
just tried in both cmd.exe and powershell
AndreasK 2017-03-01 12:28:12
actually it does for me as well
geekosaur 2017-03-01 12:29:29
that doesn't surprise me, haskeline likely supports both on windows
geekosaur 2017-03-01 12:29:43
what I would *not* expect is c-z on windows somehow suspending the ghci
geekosaur 2017-03-01 12:30:27
the way glguy described for unix
ezyang 2017-03-01 12:33:12
Haskell, I am braining right now. If A <: B, and A <: C, and it's the "best" choice, is that a greatest upper bound or a lowest upper bound
ezyang 2017-03-01 12:33:27
erm, greatest lower bound, I mean
lyxia 2017-03-01 12:33:51
looks like a glb
lyxia 2017-03-01 12:34:00
A is "lower" than B and C
ezyang 2017-03-01 12:34:06
ok thanks