News aggregator

Robert Harper: sml-family.org up and running!

Planet Haskell - Sat, 09/27/2014 - 4:04pm

After far too long, and far too many obstacles to be overcome, Dave MacQueen, Lars Bergstrom, and I have finally prepared an open-source site for the entire family of languages derived from Standard ML.  The defining characteristic of Standard ML has always been that it has a mathematically precise definition, so that it is always clear what is a valid program and how it should behave.  And indeed we have seven different working compilers, all of which are compatible with each other, with the exception of some corner cases arising from known mistakes in the definition.  Moreover, there are several active projects developing new variations on the language, and it would be good to maintain the principle that such extensions be precisely defined.

To this end the sources of the 1990 and 1997 versions of the definition are on the web site, with the permission of MIT Press, as is the type-theoretic definition formulated by Chris Stone and me, which was subsequently used as the basis for a complete machine-checked proof of type safety for the entire language done by Karl Crary, Daniel K. Lee.  It is be hoped that the errors in the definition (many are known, we provide links to the extensive lists provided by Kahrs and Rossberg in separate investigations) may now be corrected by a community process.  Anyone is free to propose an alteration to be merged into the main branch, which is called “SML, The Living Language” and also known as “Successor ML”.  One may think of this as the third edition of the definition, but one that is in continual revision by the community.  Computer languages, like natural languages and like mathematics, belong to us all collectively, and we all contribute to their evolution.

Everyone is encouraged to create forks for experimental designs or new languages that enrich, extend, or significantly alter the semantics of the language.  The main branch will be for generally accepted corrections, modifications, and extensions, but it is to be expected that completely separate lines of development will also emerge.

The web site, sml-family.org is up and running, and will be announced in various likely places very soon.

Update: We have heard that some people get a “parked page” error from GoDaddy when accessing sml-family.org.  It appears to be a DNS propagation problem.

Update: The DNS problems have been resolved, and I believe that the web site is stably available now as linked above.


Filed under: Research Tagged: functional programming, sml
Categories: Offsite Blogs

Snake in haskell < 170 lines [My first haskell app]

Haskell on Reddit - Sat, 09/27/2014 - 3:25pm

https://github.com/beckyconning/haskell-snake

hi i made haskell in snake! i mean...

at the moment its like 170 lines and i'd love to see if anyone can make it shorter, more mathematically sound and or prettier. maybe i need a cabal file? i honestly don't know what i'm doing. someone on #haskell said something about golf.

anyway, this is the first thing i've written in haskell so there is likely lots to fix so here is the repo : )

submitted by becky-conning
[link] [42 comments]
Categories: Incoming News

Neil Mitchell: GHCID - a new GHCi based IDE (ish)

Planet Haskell - Sat, 09/27/2014 - 2:46pm

Summary: I've just released ghcid, which interactively shows the errors in your project on each save.

I'm please to announce ghcid, which is either "GHCi as a daemon" or "GHC + a bit of an IDE". I've been using it for my development for the last few days, and already find it quite valuable. Unlike other Haskell development tools, ghcid is intended to be incredibly simple. In particular, it doesn't integrate with any editors, doesn't depend on GHC the library and doesn't start web servers. It's under 200 lines of fairly dull Haskell, which talks over pipes to your existing ghci.

Using it

Run cabal update && cabal install ghcid to install it as normal. Then run ghcid --height=10 "--command=ghci Main.hs". The height is the number of lines you are going to resize your console window to (defaults to 8), and the command is how you start this project in ghci. Personally, I always create a .ghci file at the root of all my projects, which usually reads something like:

:set -fwarn-unused-binds -fwarn-unused-imports
:set -isrc
:load Main

With that you can pass --command=ghci (or nothing, since that is the default).

After that, resize your console and make it so you can see it while working in your editor. On Windows the ghcid console will automatically sit on top of all other windows. On Linux, you probably want to use your window manager to make it topmost or use a tiling window manager.

What you get

On every save you'll see a list of the errors and warnings in your project. It uses a single ghci under the hood, so even relatively large projects should update their status pretty quickly. As an example:

Main.hs:23:10:
Not in scope: `verbosit'
Perhaps you meant `verbosity' (imported from System.Console.CmdArgs)
Util.hs:18:1: Warning: Defined but not used: `foo'

Or, if everything is good, you see:

All good

This project is only a few days old, so please report any bugs you find.

What you want

I regularly use an IDE to develop in a Haskell-like language. I find that with the IDE I'm about 25% more productive than without it. While an IDE can provide lots of neat features (go to definition, search, type tooltips) I think most of the productivity gains come from:

  1. Syntax coloring.
  2. A list of errors and warnings...
  3. ...which is updated as you type...
  4. ...and are highlighted in the text (red squiggles).

Every text editor already provides syntax coloring. With ghcid you get the list of errors and warnings. To get the final two features you need to integrate with an editor. I'm hoping that ghcid can do some of the heavy lifting by taking a directory of files to treat as overrides, and producing a list of warnings/errors to a file. The rest is editor specific, and I hope to attempt integration with Sublime Text at some point (although would love some help).

Categories: Offsite Blogs

Munich Haskell Meeting

haskell-cafe - Sat, 09/27/2014 - 1:46pm
Dear all, our next Haskell meeting in Munich takes place at Cafe Puck at 19h30 on Mon, 29th of September. Please go to http://www.haskell-munich.de/dates and click the button if you plan to join. Everyone is welcome! Heinrich
Categories: Offsite Discussion

Matthew Sackman: Reading highlights this week

Planet Haskell - Sat, 09/27/2014 - 8:08am

I remember when I first went to University, coming across people who were both clearly extremely expert in their fields, from whom I wanted to learn, but were also religious, and how this utterly baffled me. At that point I would cheerfully describe myself as an avid atheist. My ignorance and naivety was somewhat extensive.

Over a decade later I like to think I have a more nuanced view. The most recent war in Gaza led, obviously, to vast amounts of suffering but some excellent articles on the subject (this one by Hadley Freeman in particular) helped me see perspectives more clearly and articulated how crucial it is to be precise with criticism: are you criticising a religion, a people, a government, a policy or something else? Nothing is ever black-and-white and it seems increasingly important to anticipate the consequences of an ill-thought-through comment or reaction. A good example of that is George Galloway's comments this week in the debate about this country once again getting involved in Iraq. On the face of it, and certainly without being remotely well-enough informed to evaluate the accuracy of his claims, if his claims on the size and makeup of ISIS/ISIL are true then there seems little likelihood that the bombing campaigns being discussed will be effective, and quite likely counter-productive. But all of that got lost due his description of Iraqis as quiescent. The way in which that description was seized upon by other MPs and the resultant media storm resulted in the over-shadowing not just of the rest of his contribution to the debate, but also of other important aspects of the debate, such as the resignation of Rushanara Ali (Labour's Shadow Minister for Education), citing once again the lack of a credible long-term plan for the region and our involvement.

Addressing the broader and somewhat more abstract issue is this enlightening article by Karen Armstrong. Again, I'm not claiming to be expert in the area, merely I found the article very educative. It had barely occurred to me that the western world's separation of the secular from the sacred was firstly such a recent occurrence, and secondly that it arose from a specific set of circumstances. There is no implicit reason why separation of state from church is an inevitable or even likely happenstance (to me, this reminds me of the question "if humans evolved from monkeys, then why can't we find monkeys still evolving into humans today?", to which the answer is "the circumstances are not right for that to occur"). The fact that the English word "religion" can't really be translated accurately into other languages (especially not languages that predate English such as Greek or Latin; as historically faith is all encompassing of life, not merely a private affair as we treat it today in the west) starts to show quite how odd the separation of secular from sacred in the modern west really is.

More interesting still is the observation that in the west, belonging to a Nation has in some ways subsumed the role of belonging to a Religion, only apparently with more positive overtones: we consider it almost reprehensible to die for your religion, but honourable to die for your nation. It would seem the concept of even belonging to a nation and having any sense of greater community outside your immediate surroundings only came about with the increased ability of governments to engage with (or intrude upon) their citizens. Before that point, presumably with church attendance widespread and frequent, one's interaction with "the wider world" was through the representative of the church. This would seem to explain a lot about why governments of the past sought the blessing of their nation's church for particular courses of action: maybe the church was seen as the bridge between the government (or monarchy) and the people. The whole article is worth a read.

Categories: Offsite Blogs

How do I enable GHCi on Emacs?

Haskell on Reddit - Fri, 09/26/2014 - 6:28pm

Just installed the Haskell, Emacs and Haskell-mode. And I tried using C-c C-l to load my .hs file into GHCi but when I do I get this message:

"haskell-mode-enable-process-minor-mode: You tried to do an interaction command, but an interaction mode has not been enabled yet."

Any help??

submitted by willrobertshaw
[link] [11 comments]
Categories: Incoming News

Proposal unix. Change to `IO (Maybe String)`: getLoginName, getUserEntry* and getGroupEntry*

libraries list - Fri, 09/26/2014 - 5:23pm
In the unix package, in System.Posix.User, we have the following functions [1]: * getLoginName (getlogin) * getUserEntryForID (getpwuid_r) * getGroupEntryForID (getgrgid_r) * getUserEntryForName (getpwnam_r) * getGroupEntryForName (getgrnam_r) They have signature `IO String`, and use `throwErrnoIfNull` to call the c functions listed in parenthesis. ## Proposal Change the signature of the functions listed above to `IO (Maybe String)`. The new semantics would be: * If the c function returns a NULL pointer with errno set to ENOENT, meaning the given user or group could not be found, the result is Nothing. * If another error occured, an error is thrown (no change). * Otherwise the result is Just "result". ## Motivation At least `getlogin` and `getgrgid` are unreliable on Linux. It is possible for them to return NULL pointers [2] even when the user is logged in and has an associated user entry in /etc/passwd and group entry in /etc/group. Examples: * when `getLoginName` is called using a terminal emulator
Categories: Offsite Discussion

How do I recover from a bytestring installation that broke ghc?

Haskell on Reddit - Fri, 09/26/2014 - 11:30am

Hi, I had a ghc-7.8.2 system working. I installed a new version of bytestring, which broken the package system, as "ghc-7.8.2" is shown in braces under ghc-pkg, and I cannot compile anything now. I tried to do "ghc-pkg unregister", but that did not help (it did remove bytestring from the ghc-pkg list, but did not recover ghc-7.8.2, which still shows in braces)

The problem is that I installed the 7.8.2 binary long ago in a local directory from source distribution, using another version that I installed in local directory too, but now I have deleted that other version, so I have no version from which to make a source build again. I tried to download a binary version, but they all fail to install because of different dependencies such as LIBC >=2.7 (I only have 2.5), libffi.so.5, or libedit.so.0. I even tried to build a libedit.so.0, but the downloaded old binary refuses to use it.

I do not have sudo on this machine, so I am limited to what I can install into my local directory.

So is there any way I can recover my 7.8.2 installation? Thanks!

submitted by diyu60607
[link] [21 comments]
Categories: Incoming News

minmax

Haskell on Reddit - Fri, 09/26/2014 - 7:06am

I came up with the need of using a function that retrieved both minimal and maximal value in a list. I haven’t found that function yet, so I wrote a little implementation:

minmax :: (Ord a) => [a] -> (a,a) minmax [] = error "empty list: minmax" minmax (x:xs) = foldl (\(mn,mx) a -> (min mn a,max mx a)) (x,x) xs

I guess that can also be written as minmax :: (Ord a,Foldable f).

What do you think? Should such a function be in Data.Ord, Data.List or whatever?

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

__GLASGOW_HASKELL__=708?

glasgow-user - Fri, 09/26/2014 - 4:09am
Using GHC 7.8.3 from the latest Haskell Platform on OS X 10.9.4, the __GLASGOW_HASKELL__ preprocessor symbol is being set to 708 instead of 783. I'd guess I have some stale files lying from previous versions GHC or HP, but I can't seem to find them. Any clues? $ cat wtf.hs {-# LANGUAGE CPP #-} $ ghc-7.8.3 -v -E wtf.hs 2>&1 | grep 708 /usr/bin/gcc -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs -I /Library/Frameworks/GHC.framework/Versions/7.8.3-x86_64/usr/lib/ghc-7.8.3/base-4.7.0.1/include -I /Library/Frameworks/GHC.framework/Versions/7.8.3-x86_64/usr/lib/ghc-7.8.3/integer-gmp-0.5.1.0/include -I /Library/Frameworks/GHC.framework/Versions/7.8.3-x86_64/usr/lib/ghc-7.8.3/include '-D__GLASGOW_HASKELL__=708' '-Ddarwin_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Ddarwin_HOST_OS=1' '-Dx86_64_HOST_ARCH=1' -U__PIC__ -D__PIC__ '-D__SSE__=1' '-D__SSE2__=1' -x assembler-with-cpp wtf.hs -o /var/folders/w7/_cxvr2k540163p59kwvqlzrc0000gn/T/ghc14288_0/ghc14288_1.hscpp Thanks, Greg
Categories: Offsite Discussion

Hackage bad gateway?

haskell-cafe - Fri, 09/26/2014 - 3:56am
Today (9/25/2014) Hackage is not reachable due to "bad gateway." Is there a status page? Thanks, Dominick
Categories: Offsite Discussion

SIGVTALRM and Unbound threads

haskell-cafe - Thu, 09/25/2014 - 8:55pm
Howdy, I've banged into this issue of FFI errors stemming from a C library improperly handling system call interrupts caused by the SIGVTALRM/SIGALRMs emitted by the Haskell runtime. Usually the 'proper' solution is to fix the C library—easier said than done for most C quagmires. The most popular workaround, described by Bryan O'Sullivan[1] and several others, is to block the culprit signals from reaching the FFI call. I found another workaround using unbound threads, and it seems to work generally for this problem. However, I'm not satisfied with my understanding about *why* it works given what I know about FFI, bound vs unbound threads, and sys calls. As the simplest example, compiled with the threaded runtime (and neglecting imports): main = void $ sleep 10 will be interrupted, whereas main = void $ runInUnboundThread $ sleep 10 will complete its 10 second sleep. How does running the FFI call on an unbound thread block SIGVTALRM or otherwise avoid the interrupt? My understanding is that
Categories: Offsite Discussion

Hackage is down?

Haskell on Reddit - Thu, 09/25/2014 - 7:01pm

I am in the east coast ny area around 9pm Eastern Time. Is hackage down for anyone else?

submitted by tempforfather
[link] [2 comments]
Categories: Incoming News

NOTE: hackage is down (disk space needs).

Haskell on Reddit - Thu, 09/25/2014 - 5:35pm

The hackage server ran out of disk space temporarily, and when I restarted it, there seemed to be some sort of error with the transaction log. I'm investigating.

I'm currently restoring backups and stuff. This will at worst move back time to to early September 25th, so if you uploaded something, please spread the word.

submitted by aseipp
[link] [41 comments]
Categories: Incoming News

5Yr Research Fellowships

General haskell list - Thu, 09/25/2014 - 4:16pm
In the heart of Free Glasgow, in the soon to be People's Republic of Scotland, there is a chance to join the University of Strathclyde with a 5 year research fellowship leading to a permanent full time position. All you need is a 5-page research plan … a lot less than many Fellowship avenues. The area is data science and/or security but we intend to interpret this broadly. Very broadly. More details can be found here. strathvacancies.co.uk All the best Neil
Categories: Incoming News