News aggregator

common imports

del.icio.us/haskell - Tue, 10/14/2014 - 10:32pm
Categories: Offsite Blogs

common imports

del.icio.us/haskell - Tue, 10/14/2014 - 10:32pm
Categories: Offsite Blogs

status of rebindable syntax for arrows

glasgow-user - Tue, 10/14/2014 - 9:26pm
The GHC manual already for quite a number of version states: • Arrow notation (see Section 7.17, “Arrow notation ”) uses whatever arr, (>>>), first, app, (|||) and loop functions are in scope. But unlike the other constructs, the types of these functions must match the Prelude types very closely. Details are in flux; if you want to use this, ask! When using this feature we get the error: "Var/Type length mismatch: [s{tv aVL} [tv]] [] ghc: panic! (the 'impossible' happened) (GHC version 7.8.3 for x86_64-apple-darwin): tcTyVarDetails s{tv aVL} [tv] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug" So our question is whether we should really report this as a bug, and/or what we can do about this. Thanks for your help, Doaitse
Categories: Offsite Discussion

ANN: yi-0.10.0 , the text editor written in Haskell

General haskell list - Tue, 10/14/2014 - 7:05pm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 We're glad to announce Yi 0.10.0. Yi is 10 years old today! Our main repository is at [1]. Yi compiles with GHC 7.6.3 all the way up to GHC 7.8.3. There have been many changes since the latest Hackage release (0.8.2). I inline the relevant part of the changelog at the bottom. We are slowly trying to populate the documentation pages: we have recently started using GitHub pages[2] for this purpose. Please have a look! On top of the issues listed in the changelog, a lot of issues were closed separately. If you had a pending issue, please check the issue tracker. As always we're looking for contributors: we have tasks in just about any area. Note that you don't even need to know Haskell to help us. Visit us on #yi on Freenode: be prepared to stay for more than 5 minutes. Installation instructions are available at [2]. If you're using nix, Yi 0.10.0 will be packaged shortly. 0.10.0 - ------ * Unicode syntax highlighting fixed (issue #82) * Hook to GTK Wind
Categories: Incoming News

optimizing StgPtr allocate (Capability *cap, W_ n)

glasgow-user - Tue, 10/14/2014 - 6:08pm
Hello Glasgow-haskell-users, i'm looking a the https://github.com/ghc/ghc/blob/23bb90460d7c963ee617d250fa0a33c6ac7bbc53/rts/sm/Storage.c#L680 if i correctly understand, it's speed-critical routine? i think that it may be improved in this way: StgPtr allocate (Capability *cap, W_ n) { bdescr *bd; StgPtr p; TICK_ALLOC_HEAP_NOCTR(WDS(n)); CCS_ALLOC(cap->r.rCCCS,n); /// here starts new improved code: bd = cap->r.rCurrentAlloc; if (bd == NULL || bd->free + n > bd->end) { if (n >= LARGE_OBJECT_THRESHOLD/sizeof(W_)) { .... } if (bd->free + n <= bd->start + BLOCK_SIZE_W) bd->end = min (bd->start + BLOCK_SIZE_W, bd->free + LARGE_OBJECT_THRESHOLD) goto usual_alloc; } .... } /// and here it stops usual_alloc: p = bd->free; bd->free += n; IF_DEBUG(sanity, ASSERT(*((StgWord8*)p) == 0xaa)); return p; } i think it's obvious - we consolidate two if's on the crirical path into the single one
Categories: Offsite Discussion

Check for non-Member of an OpenUnion

Haskell on Reddit - Tue, 10/14/2014 - 4:25pm

extensible-effects includes a class, Member, for checking whether a type is present in a sum-type built up with :>

http://hackage.haskell.org/package/extensible-effects-1.7.1/docs/Data-OpenUnion1.html#Member

Is there a way to check whether a type is not present in the sum-type?

submitted by markandrus
[link] [3 comments]
Categories: Incoming News

research.microsoft.com

del.icio.us/haskell - Tue, 10/14/2014 - 3:20pm
Categories: Offsite Blogs

Joachim Breitner: Switching to sytemd-networkd

Planet Haskell - Tue, 10/14/2014 - 2:26pm

Ever since I read about sytemd-networkd being in the making I was looking forward to try it out. I kept watching for the package to appear in Debian, or at least ITP bugs. A few days ago, by accident, I noticed that I already have systemd-networkd on my machine: It is simply shipped with the systemd package!

My previous setup was a combination of ifplugd to detect when I plug or unplug the ethernet cable with a plain DHCP entry in /etc/network/interface. A while ago I was using guessnet to do a static setup depending on where I am, but I don’t need this flexibility any more, so the very simple approach with systemd-networkd is just fine with me. So after stopping ifplugd and

$ cat > /etc/systemd/network/eth.network <<__END__ [Match] Name=eth0 [Network] DHCP=yes __END__ $ systemctl enable systemd-networkd $ systemctl start systemd-networkd

I was ready to go. Indeed, systemd-networkd, probably due to the integrated dhcp client, felt quite a bit faster than the old setup. And what’s more important (and my main motivation for the switch): It did the right thing when I put it to sleep in my office, unplug it there, go home, plug it in and wake it up. ifplugd failed to detect this change and I often had to manually run ifdown eth0 && ifup eth0; this now works.

But then I was bitten by what I guess some people call the viral nature of systemd: sytemd-networkd would not update /etc/resolve.conf, but rather relies on systemd-resolved. And that requires me to change /etc/resolve.conf to be a symlink to /run/systemd/resolve/resolv.conf. But of course I also use my wireless adapter, which, at that point, was still managed using ifupdown, which would use dhclient which updates /etc/resolve.conf directly.

So I investigated if I can use systemd-networkd also for my wireless account. I am not using NetworkManager or the like, but rather keep wpa_supplicant running in roaming mode, controlled from ifupdown (not sure how that exactly works and what controls what, but it worked). I found out that this setup works just fine with systemd-networkd: I start wpa_supplicant with this service file (which I found in the wpasupplicant repo, but not yet in the Debian package):

[Unit] Description=WPA supplicant daemon (interface-specific version) Requires=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=simple ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I [Install] Alias=multi-user.target.wants/wpa_supplicant@%i.service

Then wpa_supplicant will get the interface up and down as it goes, while systemd-networkd, equipped with

[Match] Name=wlan0 [Network] DHCP=yes

does the rest.

So suddenly I have a system without /etc/init.d/networking and without ifup. Feels a bit strange, but also makes sense. I still need to migrate how I manage my UMTS modem device to that model.

The only thing that I’m missing so far is a way to trigger actions when the network configuration has changes, like I could with /etc/network/if-up.d/ etc. I want to run things like killall -ALRM tincd and exim -qf. If you know how to do that, please tell me, or answer over at Stack Exchange.

Categories: Offsite Blogs

Joachim Breitner: Switching to systemd-networkd

Planet Haskell - Tue, 10/14/2014 - 2:26pm

Ever since I read about systemd-networkd being in the making I was looking forward to try it out. I kept watching for the package to appear in Debian, or at least ITP bugs. A few days ago, by accident, I noticed that I already have systemd-networkd on my machine: It is simply shipped with the systemd package!

My previous setup was a combination of ifplugd to detect when I plug or unplug the ethernet cable with a plain DHCP entry in /etc/network/interface. A while ago I was using guessnet to do a static setup depending on where I am, but I don’t need this flexibility any more, so the very simple approach with systemd-networkd is just fine with me. So after stopping ifplugd and

$ cat > /etc/systemd/network/eth.network <<__END__ [Match] Name=eth0 [Network] DHCP=yes __END__ $ systemctl enable systemd-networkd $ systemctl start systemd-networkd

I was ready to go. Indeed, systemd-networkd, probably due to the integrated dhcp client, felt quite a bit faster than the old setup. And what’s more important (and my main motivation for the switch): It did the right thing when I put it to sleep in my office, unplug it there, go home, plug it in and wake it up. ifplugd failed to detect this change and I often had to manually run ifdown eth0 && ifup eth0; this now works.

But then I was bitten by what I guess some people call the viral nature of systemd: systemd-networkd would not update /etc/resolve.conf, but rather relies on systemd-resolved. And that requires me to change /etc/resolve.conf to be a symlink to /run/systemd/resolve/resolv.conf. But of course I also use my wireless adapter, which, at that point, was still managed using ifupdown, which would use dhclient which updates /etc/resolve.conf directly.

So I investigated if I can use systemd-networkd also for my wireless account. I am not using NetworkManager or the like, but rather keep wpa_supplicant running in roaming mode, controlled from ifupdown (not sure how that exactly works and what controls what, but it worked). I found out that this setup works just fine with systemd-networkd: I start wpa_supplicant with this service file (which I found in the wpasupplicant repo, but not yet in the Debian package):

[Unit] Description=WPA supplicant daemon (interface-specific version) Requires=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=simple ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I [Install] Alias=multi-user.target.wants/wpa_supplicant@%i.service

Then wpa_supplicant will get the interface up and down as it goes, while systemd-networkd, equipped with

[Match] Name=wlan0 [Network] DHCP=yes

does the rest.

So suddenly I have a system without /etc/init.d/networking and without ifup. Feels a bit strange, but also makes sense. I still need to migrate how I manage my UMTS modem device to that model.

The only thing that I’m missing so far is a way to trigger actions when the network configuration has changes, like I could with /etc/network/if-up.d/ etc. I want to run things like killall -ALRM tincd and exim -qf. If you know how to do that, please tell me, or answer over at Stack Exchange.

Categories: Offsite Blogs

Building cross compiler fails

haskell-cafe - Tue, 10/14/2014 - 1:23pm
I am after a ghc cross compiler. I have been cross compiling stuff for years and also built cross-compiling gcc from time to time but am having trouble building a cross-compiling ghc. I have read https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation and associated pages. In the ghc-7.8.3 directory I do ./configure --target=arm-linux-gnueabi -with-gcc=arm-linux-gnueabi-gcc but make eventually fails (in stage 1) configure: error: in `/home/jon/build/ghc-7.8.3/libraries/terminfo': configure:3386: arm-linux-gnueabi-gcc -o conftest -fno-stack-protector conftest.c -lncurses >&5 /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lncurses Firstly the requirement for termcap is surely unnecessary. We don't need it as the target will just be processing data. We do have an libncurses kicking about and I know _exactly_ what -L option to pass to (in this case) arm-linux-gnueabi-gcc to make this work but where to specify it to ghc's build system escapes me. I have tried settin
Categories: Offsite Discussion

let x = x in x

Haskell on Reddit - Tue, 10/14/2014 - 12:18pm

Can anyone explain when and why the code in the title is useful?

submitted by BanX
[link] [18 comments]
Categories: Incoming News

foreign libraries, dylibs,OS X Mavericks and GHC 7.8.3 woes

haskell-cafe - Tue, 10/14/2014 - 11:41am
Hello Cafe, I will let this gist talk for me: https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf Even though there is a solution, it seems extremely unsatisfying having to specify such paths manually. I always had very good experiences with FFI, OS X and GHC in the past, so this strikes me as a surprise. I have read a bit here and there about GHC 7.8.3 introducing the -dynamic flag (not sure about the specific problem it aims to solve, though) and changing some internal when it comes to library linking, but information is scattered and fragmented. I would like to: 1) Shed some light on my specific use case: Can I do better here? (aka have GHC figure out automatically all the nitty gritty details) 2) Any sort of pointers to documentation, tutorials, papers, everything to "teach me to fish”? Many thanks, Alfredo _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion