News aggregator

Having issue in running Haskell code in Atom

haskell-cafe - Sun, 06/05/2016 - 9:21pm
Hello All, I have started learning Haskell couple of days ago. I was looking for an IDE and found Atom as one of them. When I started using it I installed multiple packages and tried running creating Haskell files and saving it. This IDE always gives me following error. Please help to debug this: [Enter steps to reproduce below:] 1. ... 2. ... **Atom Version**: 1.7.4 **System**: Microsoft Windows 10 Pro **Thrown From**: [haskell-ghc-mod]( https://github.com/atom-haskell/haskell-ghc-mod) package, v1.14.5 ### Stack Trace Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT ``` At Error: spawn ghc-mod ENOENT PATH: undefined path: undefined Path: C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program F
Categories: Offsite Discussion

Robert Harper: PFPL Commentary

Planet Haskell - Sun, 06/05/2016 - 8:42pm

I am building a web page devoted to the 2nd edition of Practical Foundations for Programming Languages, recently published by Cambridge University Press.  Besides an errata, the web site features a commentary on the text explaining major design decisions and suggesting alternatives.  I also plan to include additional exercises and to make sample solutions available to faculty teaching from the book.

The purpose of the commentary is to provide the “back story” for the development, which is often only hinted at, or is written between the lines, in PFPL itself.  To emphasize enduring principles over passing fads, I have refrained from discussing particular languages in the book.  But this makes it difficult for many readers to see the relevance.  One purpose of the commentary is to clarify these connections by explaining why I said what I said.

As a starting point, I explain why I ignore the familiar concept of a “paradigm” in my account of languages.  The idea seems to have been inspired by Kuhn’s (in)famous book The Structure of Scientific Revolutions, and was perhaps a useful device at one time.  But by now the idea of a paradigm is just too vague to be useful, and there are many better ways to explain and systematize language structure.  And so I have avoided it.

I plan for the commentary to be a living document that I will revise and expand as the need arises.  I hope for it to provide some useful background for readers in general, and teachers in particular.  I wish for the standard undergraduate PL course to evolve from a superficial taxonomy of the weird animals in the language zoo to a systematic study of the general theory of computation.  Perhaps PFPL can contribute to effecting that change.

 

 


Filed under: Research, Teaching
Categories: Offsite Blogs

Ken T Takusagawa: [awlyiqda] Type signatures asking for more than they need

Planet Haskell - Sun, 06/05/2016 - 7:14pm

A type signature to a function creates the requirement that an argument passed to the function have a specified type.  However, operationally, the function only needs for the argument to have certain operations (other functions) defined on it.

Type classes in Haskell provide a means for a function to be polymorphic, accepting many different types, with the type class defining the set of fundamental functions (methods) available.  However, even type classes may be too much: a function might require only a subset of the fundamental functions.

Duck typing is a much "looser" way of addressing this same problem.  Previous thoughts on this problem.

Sometimes, even though all the operations a function needs might be defined on a type, we want to use the type signature of the function to restrict what it can be called on.  The "explode" method might be defined for both firecrackers and nuclear weapons, but we might never want to accidentally pass a nuclear weapon to a certain function.

There is also a software engineering, and somewhat social, aspect to this problem.  Even though today's implementation of a function might not require some method of a type class, tomorrow's improved implementation might.  Declaring the type signature to be more than minimal is like making a reservation for future demands of functionality in the arguments.  Making such a reservation forces all other software calling that function to provide that functionality, even though it isn't currently used.  A type signature therefore represents a battle over a property line: who "owns" the right to decide what functionality an object should have?

Categories: Offsite Blogs

haskell-ide-engine versus hsdev (and Debuggers)

haskell-cafe - Sun, 06/05/2016 - 6:35pm
Hello, I am new to Haskell and thinking of contributing to the IDE efforts. I've noticed two projects which aim to provide a "service" that editors and IDEs can call to help present useful information to programmers. I am wondering how these projects differ and why they are separate efforts since they seem to have very similar end goals? Another thing that I am wondering is if either of these two projects aims to provide debugger support and what the general state of debuggers for Haskell is? I've seen a project for a Haskell remote debugger which looks it was ghci/interpreter based and was being used by Eclipse and IntelliJ. It didn't work when I tried it, however, and I am not sure that the project is still active. It also looks like ghc only recently began adding support for debugging compiled Haskell and that initial efforts may be to get things working with gdb or lldb. Am I correctly understanding the current landscape as far as Haskell debuggers go? Thanks! Leonard _________________________________
Categories: Offsite Discussion

Final CFP: 4th ACM SIGPLAN International Workshop onFunctional Art, Music, Modelling and Design

haskell-cafe - Sun, 06/05/2016 - 2:09pm
4th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design http://functional-art.org/2016/ Co-located with ICFP Nara, Japan, 24 September, 2016 Key Dates: Submission deadline - June 24 Author Notification - 15 July Camera Ready - 31 July Workshop - September 24, 2016 We welcome submissions from academic, professional, and independent programmers and artists. Final Call for Papers, Demos, *and* Performances The ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design (FARM) gathers together people who are harnessing functional techniques in the pursuit of creativity and expression. Functional Programming has emerged as a mainstream software development paradigm, and its artistic and creative use is booming. A growing number of software toolkits, frameworks and environments for art, music and design now employ functional programming languages and techniques. FARM is a forum for exploration and critical evaluation of these developments,
Categories: Offsite Discussion

Strange type error with -XTypeApplications

haskell-cafe - Sat, 06/04/2016 - 9:32pm
This program: * {-# LANGUAGE TypeApplications #-}* * main = print (fromDynamic < at >Int undefined)* produces this error message: * foo.hs:3:15: error:* * • Cannot apply expression of type ‘t0’* * to a visible type argument ‘Int’* * • In the first argument of ‘print’, namely* * ‘(fromDynamic < at >Int undefined)’* * In the expression: print (fromDynamic < at >Int undefined)* * In an equation for ‘main’:* * main = print (fromDynamic < at >Int undefined)* However, I'd expect it to be "Not in scope: fromDynamic" _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Accumulating and threading output of functions

haskell-cafe - Sat, 06/04/2016 - 4:18pm
Hello all, I have a number of functions, whose type is something like this: f:: a -> b -> (b, c) i.e. it returns a modified b and an additional c. Now I want to write a combinator, which assembles a list of such functions into a single one. This combinator will have to thread the bs from one function to the next and accumulate the cs into a single c. While I was able to write this using a fold, I am not happy with it (my first attempt had a bad error in it, which is always a bad sign). Are you aware of any idioms, how to do such things on the beaten track?
Categories: Offsite Discussion

announce: arithmoi 0.4.2.0

haskell-cafe - Sat, 06/04/2016 - 3:59pm
It is with great pleasure that the arithmoi maintainers (andrew lelechenko and myself) would like to share the 0.4.2.0 release with the haskell community. This release https://hackage.haskell.org/package/arithmoi-0.4.2.0 includes a multiplicatively infinite (but addititively finite) increase in test coverage and correspondingly every known bug in arithmoi has been fixed (so theres no known crashing/faulting bugs, and all tested code gives mathematically correct answers) I would especially like to thank Andrew Lelechenko for becoming a fellow maintainer, his incredibly meticulous, clean, thorough engineering is really what made this release possible and excellent. this should treated as a stable library version release. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

New version of itself

haskell-cafe - Sat, 06/04/2016 - 2:24pm
Hello all, I find myself frequentlly writing types like this data Logger a l = Lgr { runLogger :: a -> Log l -> (Log l, Logger a l) } The purpose is to give a logger a chance to carry an internal state. It could e.g. choose to log only every n invocations. To do this it must keep track of how many times it has been called. I want to leave such things private to the Logger. (1) I know that this is not an unusal thing to do, but it has an OO feel to it. Is there a more functional alternative to it. Should I just not worry? (2) I can write a combinator which creates a Logger from a list of Loggers. Since each Logger potentially returns a new version of itself, I must always re-assemble the combined logger from all the returned new versions. I am worried that this is a costly operation, particularly when most Loggers just return themselves unaltered. I don't have any hard numbers about the performance penalty though. These Loggers are used in a discrete-event-simulation and they will get called many t
Categories: Offsite Discussion

Month in Haskell Mode May 2016

haskell-cafe - Sat, 06/04/2016 - 12:56pm
Hi, Month in Haskell Mode May 2016 progress report is available: https://github.com/haskell/haskell-mode/wiki/Month-in-Haskell-Mode-May-2016
Categories: Offsite Discussion

Feedback on -Wredundant-constraints

glasgow-user - Fri, 06/03/2016 - 10:33pm
With 8.0.1 freshly arrived, I'm taking on the task of updating a number of our larger projects here at Galois. I made a couple of these comments briefly on a relevant Trac ticket[1], but I wanted to open this discussion to a wider audience. We tend to use -Wall (and -Werror, in CI environments), and so I've had to make decisions about how to handle the new -Wredundant-constraints warnings. So far, I've come to think of it as two different warnings that happen to be combined: Warning 1: a warning for constraints made redundant by superclass relationships, and Warning 2: a warning for unused constraints Overall I'm a fan of Warning 1. It seems very much in the spirit of other warnings such as unused imports. The only stumbling block is how it affects the 3-release compatibility plan with respect to, e.g., the AMP. Most of our code targets a 2-release window, though, so in every such case it has been fine for us to simply remove the offending constraint. Warning 2 on the other hand is far more dubious to me
Categories: Offsite Discussion

Jasper Van der Jeugt: Cryptographic Hashes and Cyclic Dependencies

Planet Haskell - Fri, 06/03/2016 - 6:00pm

I recently wrote a blog entry on the Fugue blog, about the problems that arise when you want to compute cryptographic hashes of resources that can have dependency cycles. You can read it here. Thanks to Jared Tobin, Maciej Woś and Racquel Yerbury for proofreading and editing.

Categories: Offsite Blogs

10 open roles in expanding team at Standard Chartered

haskell-cafe - Fri, 06/03/2016 - 1:14pm
I have another ten open roles in the growing Strats team at Standard Chartered. https://donsbot.wordpress.com/2016/06/03/multiple-haskell-developer-roles-in-strats-at-standard-chartered/ These are full time or contract Haskell developer positions in London or Singapore. Details in the post . _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

PPPJ 2016, Submission Deadline Extended to June 13 AoE

General haskell list - Fri, 06/03/2016 - 9:49am
******** Due to several requests, the paper submission deadline has been extended to ******** June 13, 2016 AoE (Anywhere on Earth). ******** ******** Registering paper title and abstract before the submission deadline is ******** optional but encouraged. =============================================== PPPJ '16 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools August 29 - September 2, 2016 Lugano, Switzerland http://manlang16.inf.usi.ch/pppj In-cooperation with ACM SIGPLAN, SIGSOFT, SIGAPP and SPEC RG PPPJ '16 is a forum for researchers and practitioners to present and discuss novel results on all aspects of managed languages and their runtime systems, including virtual machines, tools, methods, frameworks, libraries, case studies, and experience reports. Managed languages and runtime systems of interest include, but are not limited to, Java, Scala, JavaScript, Python, Ruby, C#, F#, Clojure, Groovy
Categories: Incoming News

Don Stewart (dons): Multiple Haskell developer roles in Strats at Standard Chartered

Planet Haskell - Fri, 06/03/2016 - 6:09am

The Strats team at Standard Chartered has another ten open positions for typed functional programming developers, based in London or Singapore. Strats are a specialized software engineering and quantitative analysis team who build a broad range of software for financial markets users at Standard Chartered.

You will work on the trading floor, directly with traders, sales and risk managers, building software to automate their work and improve their efficiency. The focus of this role will be to build new tools for bankwide analytics and server-side derivatives pricing infrastructure.

You will use Haskell for almost all tasks: data analysis, market data publishing, database access, web services, desktop GUIs, large parallel tasks, quantitative models, solvers, everything. This is a fast paced role – code you write today will be deployed within hours to hundreds of users and has to work.

These are permanent, associate director and director positions, in London and Singapore as part of the Strats global team. Demonstrated experience in typed FP (Haskell, OCaml, F# etc) is required. We have around 3 million lines of Haskell, and our own Haskell compiler. In this context we look for skill and taste in typed functional programming to capture and abstract over complex, messy systems. You would join a growing team of around 16 experienced Haskell developers that is expanding to 25+ due to increased business need for Haskell developers.

Experience writing typed APIs to external systems such as databases, web services, pub/sub platforms is very desirable. We like working code, so if you have Hackage or github libraries, we definitely want to see them. We also like StackOverflow answers, blog posts, academic papers, or other arenas where you can show broad FP ability. A PhD or Masters Degree in Computer Science is an advantage but not a requirement.

The role requires physical presence on the trading floor in Singapore or London. Remote work is not an option. You will have some project and client management skills — you will talk to users, understand their problems and then implement and deliver what they really need. No financial background is required. These positions have attractive remuneration for the right candidates. Relocation support will also be provided. Contracting-based positions are also possible if desired.

Applicants who don’t necessarily meet all criteria but have an interest in working in Singapore in particular, and have an FP background, are encouraged to apply.

More info about our development process is in the 2012 PADL keynote, and a 2013 HaskellCast interview.

If this sounds exciting to you, please send your resume to me – donald.stewart <at> sc.com

Categories: Offsite Blogs

International summer school on metaprogramming(Cambridge, 8-12 Aug 2016)

haskell-cafe - Thu, 06/02/2016 - 10:27pm
==================================================================== International summer school on metaprogramming Robinson College, Cambridge, United Kingdom 8th-12th August, 2016 http://www.cl.cam.ac.uk/events/metaprog2016/ ==================================================================== Metaprogramming is an approach to improving programs by treating program fragments (such as expressions or types) as values that the program can manipulate. Metaprogramming comes in various forms, including * staged programming: treating expressions as program values. The execution of a staged program is spread over several phases, with each stage using the available data to generate specialized code. Staged programming has a wide variety of applications — numeric computations, parsing, database queries, generic programming, domain specific languages, and many more. Precompiling the staged code can have dramatic performance improvements, in some cases an order of magnitude or more. * generic
Categories: Offsite Discussion

how to reify an API?

haskell-cafe - Thu, 06/02/2016 - 10:00pm
Dear Cafe, I wanted to benchmark (part of) an API of a package, by enumerating all possible (nested) calls by size of their AST, much as smallcheck does it for data. So I made this straightforward AST representation and (generically) got its Serial instances. That last part has been in smallcheck for a long time, and works nicely. But I do wonder if there is a way to get the AST (and corresponding interpreter) with less boilerplate code (than this: https://github.com/jwaldmann/pretty-test/blob/master/src/Lib.hs#L29 ) If you read the code: it also has a type for "AST contexts" because I wanted to iterate them (to produce larger trees). Again - easy to write down, but boring. - J.
Categories: Offsite Discussion

Summer School on Bidirectional Transformations, Oxford,25-29th July 2016

General haskell list - Thu, 06/02/2016 - 4:52pm
Apologies if you have seen this before, but the early registration deadline (June 10th) is fast approaching for SSBX in Oxford. Please pass this on to anyone who may be interested (and consider coming yourself!). * SUMMER SCHOOL ON BIDIRECTIONAL TRANSFORMATIONS Lady Margaret Hall, Oxford, UK 25th to 29th July 2016 http://www.cs.ox.ac.uk/projects/tlcbx/ssbx/ TOPIC Bidirectional transformations (BX) are means of maintaining consistency between multiple information sources: when one source is edited, the others may need updating to restore consistency. BX have applications in databases, user interface design, model-driven development, and many other domains. This summer school is one of the closing activities on the "Theory of Least Change for BX" project at Oxford and Edinburgh (http://www.cs.ox.ac.uk/projects/tlcbx/). It brings together leading researchers in BX, spanning theory and practice, for a week of lectures in beautiful Oxford. It will be aimed at doctoral students in computer science, but wi
Categories: Incoming News

Roman Cheplyaka: Surprising reciprocity

Planet Haskell - Thu, 06/02/2016 - 2:00pm

I have two correlated random variables, \(X\) and \(Y\), with zero mean and equal variance. I tell you that the best way to predict \(Y\) based on the knowledge of \(X\) is \(y = a x\). Now, you tell me, what is the best way to predict \(X\) based on \(Y\)?

Your intuition might tell you that if \(y = ax\), then \(x = y/a\). This is correct most of the time… but not here. The right answer will surprise you.

So what is the best way to predict \(Y\) based on \(X\) and vice versa? Let’s find the \(a\) that minimizes the mean squared error \(E[(Y-aX)^2]\):

\[E[(Y-aX)^2] = E[Y^2-2aXY+a^2X^2]=(1+a^2)\mathrm{Var}(X)-2a\mathrm{Cov}(X,Y);\]

\[\frac{\partial}{\partial a}E[(Y-aX)^2] = 2a\mathrm{Var}(X)-2\mathrm{Cov}(X,Y);\]

\[a=\frac{\mathrm{Cov}(X,Y)}{\mathrm{Var}(X)}=\mathrm{Corr}(X,Y).\]

Notice that the answer, the (Pearson) correlation coefficient, is symmetric w.r.t. \(X\) and \(Y\). Thus it will be the same whether we want to predict \(Y\) based on \(X\) or \(X\) based on \(Y\)!

How to make sense of this? It may help to consider a couple of special cases first.

First, suppose that \(X\) and \(Y\) are perfectly correlated and you’re trying to predict \(Y\) based on \(X\). Since \(X\) is such a good predictor, just use its value as it is (\(a=1\)).

Now, suppose that \(X\) and \(Y\) are uncorrelated. Knowing the value of \(X\) doesn’t tell you anything about the value of \(Y\) (as far as linear relationships go). The best predictor you have for \(Y\) is its mean, \(0\).

Finally, suppose that \(X\) and \(Y\) are somewhat correlated. The correlation coefficient is the degree to which we should trust the value of \(X\) when predicting \(Y\) versus sticking to \(0\) as a conservative estimate.

This is the key idea—to think about \(a\) in \(y=ax\) not as a degree of proportionality, but as a degree of “trust”.

Categories: Offsite Blogs

How to Build Static Checking Systems Using Orders of Magnitude Less Code

Lambda the Ultimate - Thu, 06/02/2016 - 7:44am

How to Build Static Checking Systems Using Orders of Magnitude Less Code, by Fraser Brown Andres Notzli Dawson Engler:

Modern static bug finding tools are complex. They typically consist of hundreds of thousands of lines of code, and most of them are wedded to one language (or even one compiler). This complexity makes the systems hard to understand, hard to debug, and hard to retarget to new languages, thereby dramatically limiting their scope.

This paper reduces the complexity of the checking system by addressing a fundamental assumption, the assumption that checkers must depend on a full-blown language specification and compiler front end. Instead, our program checkers are based on drastically incomplete language grammars (“micro-grammars”) that describe only portions of a language relevant to a checker. As a result, our implementation is tiny—roughly 2500 lines of code, about two orders of magnitude smaller than a typical system. We hope that this dramatic increase in simplicity will allow developers to use more checkers on more systems in more languages.

We implement our approach in µchex, a language-agnostic framework for writing static bug checkers. We use it to build micro-grammar based checkers for six languages (C, the C preprocessor, C++, Java, JavaScript, and Dart) and find over 700 errors in real-world projects.

Looks like an interesting approach with some compelling results, and will make a good tool for the toolbox. See also the Reddit thread for further discussion.

Categories: Offsite Discussion