Search Haskell Channel Logs

Friday, January 27, 2017

#haskell channel featuring ertes, laz, Ferdirand, ph88, liste, kvazau, and 9 others.

Profpatsch 2017-01-27 00:54:52
meh
ph88 2017-01-27 01:05:51
kuribas, i heard they are working towards it
kuribas 2017-01-27 01:06:35
ph88: I've been learning idris. It'd be nice if they bring it to haskell :)
ongy 2017-01-27 01:06:41
can I give ghc a flag to print all files read during compilation?
kuribas 2017-01-27 01:06:49
ph88: like safe vector acces without bounds checking.
ph88 2017-01-27 01:06:49
kuribas, there is also liquid haskell
kuribas 2017-01-27 01:07:19
ph88: does it work with ghc extensions?
ph88 2017-01-27 01:08:15
don't think so
ph88 2017-01-27 01:08:50
i think you should view it more as a separate compiler which shares like 99% of code with ghc
ph88 2017-01-27 01:10:45
ah no the stuff they added seem to be implemented as comments so i think it's backwards compatible with haskell ^^
ph88 2017-01-27 01:11:07
i type annotated nearly this entire function to get some help from the typechecker, but i'm still getting errors i can't make sense of https://paste.fedoraproject.org/537597/51880114/
maerwald 2017-01-27 01:20:20
kuribas: it's pretty early in development state, although there's a lot of stuff that works already
maerwald 2017-01-27 01:20:40
you can also performance-kill it pretty easily with a few unexpected constructs
kuribas 2017-01-27 01:21:26
maerwald: well, for me the most interesting is using unsafe vector acces, and prove it correct.
kuribas 2017-01-27 01:21:53
And unsafeThaw etc...
tfc 2017-01-27 01:27:13
hi there. i would like to send ICMP ping packets to machines in my network from haskell. i found the Net.ICMP package to construct such packets, but it seems like this needs to be combined with other libraries. i did not find any nice tutorial for that. can someone give me a pointer/
kvazau 2017-01-27 01:29:21
me too
Bish 2017-01-27 01:32:10
ongy maybe try strace :o
Bish 2017-01-27 01:32:34
strace -e open ghc ...
Bish 2017-01-27 01:32:50
will give you all files opened by the process, but not only sourcefiles
laz 2017-01-27 01:34:57
tfc: you'll need Network.Socket
ertes 2017-01-27 01:35:17
tfc: and you'll need root
tfc 2017-01-27 01:35:42
root? you mean root privileges on the system in order to send icmp packets?
ertes 2017-01-27 01:36:00
tfc: yes (or the capability that lets you send raw packets)
laz 2017-01-27 01:36:02
tfc: or CAP_NET_RAW
ertes 2017-01-27 01:36:12
yeah, that one
ertes 2017-01-27 01:36:49
in portable terms you need to be root
tfc 2017-01-27 01:37:21
i really hoped that i could get around root privileges. so it seems to be more feasible to write code which uses the system's ping application, in order to not need to be root.
ertes 2017-01-27 01:37:37
tfc: yep
tfc 2017-01-27 01:37:57
ok, at least that's not a hard thing to do.
merijn 2017-01-27 01:38:13
Well, you still need root for ping, it's just that the ping command is setuid root :)
tfc 2017-01-27 01:38:14
thank you both for the help!
ertes 2017-01-27 01:38:23
tfc: or split your application into a client and server, such that the server can initialise itself as root
tfc 2017-01-27 01:38:29
yeah, it has setuid and it's reasonably stable.
tfc 2017-01-27 01:38:41
but none of my haskell application code shall run as root or get the S bit
merijn 2017-01-27 01:38:46
:)
ertes 2017-01-27 01:38:54
unlike the ping command the server will only need to be root for a very short amount of time
tfc 2017-01-27 01:39:30
that sounds reasonable, but try to convince my coworkers that my haskell app needs root rights for pinging machines, lol
merijn 2017-01-27 01:39:46
If you just need to ping machines, then no, don't do that :p
ertes 2017-01-27 01:39:49
tfc: that shouldn't be difficult
tfc 2017-01-27 01:40:13
they are not even convinced of haskell, lol
ertes 2017-01-27 01:40:16
tfc: alternatively: does it have to be ICMP ping?
tfc 2017-01-27 01:40:37
ertes: not really. i need to ping a machine and check its mac address
Ferdirand 2017-01-27 01:40:57
writing hnagios ?
tfc 2017-01-27 01:41:18
my use case is basically: a config file says "machine FOO; IP 123.123.123.123; MAC ab:cd:..." and i need to check if it exists like this.
Ferdirand 2017-01-27 01:41:53
sounds like a job for arping
ertes 2017-01-27 01:42:25
tfc: then any communication will do: send some arbitrary UDP packet, check the ARP table every second
LazyUncleBob 2017-01-27 01:42:39
Hello, I'm new to Haskell and learning about recursion.
tfc 2017-01-27 01:42:44
ok, sounds like a nice workaround
liste 2017-01-27 01:42:45
hello LazyUncleBob
LazyUncleBob 2017-01-27 01:42:58
This code example runs forever and never stops, while I specify an edge-condition. Could someone explain me what's going on here?
LazyUncleBob 2017-01-27 01:42:59
https://hasteb.in/zudutohamo.coffee
ertes 2017-01-27 01:43:12
tfc: or even use something like arping
asthasr_ 2017-01-27 01:43:22
LazyUncleBob: you're already lazy, so...
LazyUncleBob 2017-01-27 01:43:27
I am! haha
LazyUncleBob 2017-01-27 01:43:34
Exactly why I chose to learn Haskell :)
asthasr_ 2017-01-27 01:43:52
are you "the" Uncle Bob?
liste 2017-01-27 01:43:57
LazyUncleBob: that piece of code has no recursion
LazyUncleBob 2017-01-27 01:44:01
Depends if you're talking about me.
tfc 2017-01-27 01:44:07
ertes is this there is a library for or do i need to assemble stuff for that myself?
LazyUncleBob 2017-01-27 01:44:07
Oh wait, dangit, I left out a bit.
LazyUncleBob 2017-01-27 01:44:11
Excuse me, I'll fix it.
LazyUncleBob 2017-01-27 01:44:19
What a way to make a first impression.
ertes 2017-01-27 01:44:27
tfc: you use the command line program 'arping'
LazyUncleBob 2017-01-27 01:44:45
Hereby my corrected version: https://hasteb.in/janayopoye.coffee
maerwald 2017-01-27 01:44:45
ertes: did you see my question from yesterday or something?
tfc 2017-01-27 01:44:52
ertes: ok, but then i would prefer ping because it's preinstalled for sure, while arping is not.
ertes 2017-01-27 01:45:07
maerwald: yeah, i've answered it