Search Haskell Channel Logs

Monday, February 20, 2017

#haskell channel featuring dmwit, cheshircat, lambdabot, jpthing, nate_, hpc, and 6 others.

dmwit 2017-02-20 10:45:22
Benzi-Junior: The newest haddock will link instances to their sources, but some packages haven't had an upload since Hackage's haddock got that upgrade.
dmwit 2017-02-20 10:45:46
In that case, you're out of luck. You'll have to use the old way (grep!).
Benzi-Junior 2017-02-20 10:46:03
dmwit, its not in there
dmwit 2017-02-20 10:46:07
Actually, come to think of it, you can probably ask GHC.
Benzi-Junior 2017-02-20 10:46:28
dmwit, I've literally spent days looking for this
dmwit 2017-02-20 10:46:42
:i shows information about instances of a class (or classes a type instantiates) which I think mentions where the instance lives.
Tuplanolla 2017-02-20 10:47:16
Then it's in some `Internal` module that you have to dig up separately.
dmwit 2017-02-20 10:47:32
Benzi-Junior: What is the specific instance you're looking for source for?
dmwit 2017-02-20 10:47:48
"implementations for vector tuples" doesn't make much sense to me.
Benzi-Junior 2017-02-20 10:48:39
dmwit, (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Vector Vector (a, b, c, d, e)
fizbin 2017-02-20 10:50:28
If I have a library I'm importing qualified, and that library defines a function that's meant to be used inline (e.g. if that lib. defines a function called "&"), what's the syntax for invoking that function inline? a `(G.&)` b isn't working.
dmwit 2017-02-20 10:50:55
Benzi-Junior: In ghci, load `Data.Vector.Generic` and `Data.Vector.Unboxed`, then ask `:i Vector`.
Tuplanolla 2017-02-20 10:51:11
> f Data.Function.$ x -- Like this, fizbin.
lambdabot 2017-02-20 10:51:14
error:
lambdabot 2017-02-20 10:51:14
• Ambiguous type variable 'a0' arising from a use of 'show_M785854188758...
lambdabot 2017-02-20 10:51:14
prevents the constraint '(Show a0)' from being solved.
Benzi-Junior 2017-02-20 10:51:19
if I clikc the #source link on hackage it points me to line 671 in Data.Vector.Generic.Base ... which is only 140 lines long
dmwit 2017-02-20 10:51:20
Benzi-Junior: It will tell you about that instance, followed by a comment that says `-- Defined in 'Data.Vector.Unboxed.Base'`
fizbin 2017-02-20 10:51:42
Tuplanolla: Huh. Ok...
dmwit 2017-02-20 10:55:53
Benzi-Junior: In the source, look in `internal/unbox-tuple-instances`.
dmwit 2017-02-20 10:57:00
Benzi-Junior: lines 537-730
Benzi-Junior 2017-02-20 10:58:16
dmwit, oh god
dmwit 2017-02-20 10:58:32
?
Benzi-Junior 2017-02-20 10:58:39
dmwit, I was to focused looking under the Data directory
dmwit 2017-02-20 10:59:18
Just read the source. It's what I did. At the end of the file that GHC pointed me at is a comment `-- Tuples` followed by `#include "unbox-tuple-instances"`.
dmwit 2017-02-20 11:00:49
Probably explains the whole "line 671 of 140" thing in the haddocks, too, come to think of it.
hpc 2017-02-20 11:01:22
haha
hpc 2017-02-20 11:02:06
does template haskell have the same issue?
Benzi-Junior 2017-02-20 11:07:27
dmwit, ye that would explain it
cheshircat 2017-02-20 11:17:41
Hello, what is the simplest way to get haskell and rust IPC? I have JSON serialization and deserialization for the structures I want to send set up, but I don't know whether to use named pipes or unix domain sockets, and I don't know what libraries to use on either side. I care more about the Haskell interface because the bulk of my code is on that side, so whatever works best on Haskell's side I will make
cheshircat 2017-02-20 11:17:43
work on Rust's side
jpthing 2017-02-20 11:18:49
There are plenty of JSON libs. Like the one in Real world Haskell. Why do you need rust.
dmwit 2017-02-20 11:18:52
Both solutions should be relatively easy to use. There's also dbus bindings if you find yourself needing asynchronous communication.
dmwit 2017-02-20 11:19:18
jpthing: He's already done the JSON part. And why does it matter why he needs rust?
dmwit 2017-02-20 11:20:09
cheshircat: I should clarify that when I said "relatively easy to use" I meant "...in Haskell". No idea about the rust side of things but I'd be shocked if they don't have support for pipes and sockets.
cheshircat 2017-02-20 11:21:47
yeah, the have support for either
cheshircat 2017-02-20 11:22:20
is there not any particular reason why I should favor one over the other, and are there particular haskell libraries you would recommend?
dmwit 2017-02-20 11:23:01
Boring old file IO functions work for named pipes, too (kind of the point of named pipes).
dmwit 2017-02-20 11:23:24
?hackage bytestring is probably preferable for file IO
lambdabot 2017-02-20 11:23:24
http://hackage.haskell.org/package/bytestring is probably preferable for file IO
dmwit 2017-02-20 11:23:33
?hackage network has socket operations
lambdabot 2017-02-20 11:23:34
http://hackage.haskell.org/package/network has socket operations
dmwit 2017-02-20 11:24:02
I expect there are higher-level wrappers around these, too; depends what you want, I guess.
dmwit 2017-02-20 11:25:09
e.g. I think conduit probably has something for both kinds of interaction
cheshircat 2017-02-20 11:25:27
Oh, I've heard good things about conduit
cheshircat 2017-02-20 11:26:01
OK, thank you, I guess the answer is a little self-evident in retrospect but I didn't really know where to start
nate_ 2017-02-20 11:30:55
I'm trying to understand pretty-printed Core, and it's not clear what the meaning of the various sigils is ($, #, @) is there a legend somewhere?
megaTherion 2017-02-20 11:34:12
strange question maybe, but is it possible to colorize the output of ghci - to let it be more friendly to the eyes? ^^
merijn 2017-02-20 11:36:47
Is it possible? Yes!
merijn 2017-02-20 11:36:52
Do I remember how? No! :p
mzabani 2017-02-20 11:39:19
Hi everyone, I'm trying to instantiate http-client's ManagerSettings with custom connectionRead and connectionWrite functions. The problem is that these functions need to call a function that runs in a MonadState. Is this possible?