News aggregator

Haskell game to translate

haskell-cafe - Thu, 02/04/2016 - 10:28am
Hi, Cafe. My friend wants to improve her collaboration skills in the area of game development. She is a Translator and the plan is to learn Git by contributing some Russian/English/French (and maybe simple Korean) translations to a GitHub project. Could you recommend me (and my friend) some game project wich needs translation? Note, that It should support multylang features in some form, understandable for non-programmer. I'll help with required workplace setup. Haskell, Linux, etc. is OK. Regards, Sergey
Categories: Offsite Discussion

Month in Haskell Mode January 2016

haskell-cafe - Wed, 02/03/2016 - 11:02pm
Welcome Haskell Mode users, Haskell Mode progress report for January 2016. For previous issue see December 2015 <https://github.com/haskell/haskell-mode/wiki/Month-in-Haskell-Mode-December-2015>. Reddit discussion <https://www.reddit.com/r/haskell/comments/441ukg/month_in_haskell_mode_january_2016/> . <https://github.com/haskell/haskell-mode/wiki/Month-in-Haskell-Mode-January-2016#what-is-haskell-mode>What is Haskell Mode? Haskell Mode is an umbrella project for multiple Emacs tools for efficient Haskell development. Haskell Mode is an open source project developed by a group of volunteers constantly looking for contributions. For more information how to help see https://github.com/haskell/haskell-mode. <https://github.com/haskell/haskell-mode/wiki/Month-in-Haskell-Mode-January-2016#important-developments>Important developments Haskell Mode 2015 retrospective <https://github.com/haskell/haskell-mode/wiki/Haskell-Mode-2015-retrospective> was published. Emacs 23 support was dropped. Last stable haskell-mod
Categories: Offsite Discussion

Programmatic and Direct Manipulation, Together at Last

Lambda the Ultimate - Wed, 02/03/2016 - 4:32pm

A technical report by Ravi Chugh et al. Abstract:

We present the SKETCH-N-SKETCH editor for Scalable Vector Graphics (SVG) that integrates programmatic and direct manipulation, two modes of interaction with complementary strengths. In SKETCH-N-SKETCH, the user writes a program to generate an output SVG canvas. Then the user may directly manipulate the canvas while the system infers realtime updates to the program in order to match the changes to the output. To achieve this, we propose (i) a technique called trace-based program synthesis that takes program execution history into account in order to constrain the search space and (ii) heuristics for dealing with ambiguities. Based on our experience writing more than 40 examples and from the results of a study with 25 participants, we conclude that SKETCH-N-SKETCH provides a novel and effective work- flow between the boundaries of existing programmatic and direct manipulation systems.

This was demoed at PLDI to a lot of fanfare. Also see some videos. And a demo that you can actually play with, sweet!

Categories: Offsite Discussion

Building / cross compile GHC for OpenBSD/macppc.

haskell-cafe - Wed, 02/03/2016 - 3:31pm
Hello ! I am new here - sorry, if I ask something what was asked before. OpenBSD provides for amd64 and other platforms GHC and, also the haskell-platform which works very good. I try to get one of the old PowerMac's with a G5 CPU and saw, that there is no GHC (yes, there is a very old version - something like 3.x) for OpenBSD/macppc. I got some informations about to cross compile and saw also the wiki at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling now my main question is, are there more informations about it ? Available for cross compile is GHC and haskell-platform 7.10.3, gcc 4.2.1 20070719, llvm 3.5.20140228 all on amd64. The planned target platforms are Mac's / PowerMac's with G3, G4 and G5 CPU's. All versions of OpenBSD/macppc are 32 bit only (including the G5). A cross compile from Mac OS X is no option because the OpenBSD project should be able to cross build on their machines (security reasons). Thanks for informations and tips. Regards, Christoph
Categories: Offsite Discussion

Problems with cabal and stackage

haskell-cafe - Wed, 02/03/2016 - 2:13pm
Hi, Overnight there seems to have been a change to stackage where it's now issuing redirects from http to https URLs: ~$ cabal update Downloading the latest package list from stackage-lts-2.22 Warning: http error: Unable to handle redirect, unsupported scheme: https://www.stackage.org/snapshot/lts-2.22/00-index.tar.gz cabal: Failed to download http://www.stackage.org/snapshot/lts-2.22/00-index.tar.gz : ErrorMisc "Error HTTP code: 301" My cabal doesn't seem to like https and I think it's a recentish version: $ cabal --version cabal-install version 1.22.0.0 using version 1.22.0.0 of the Cabal library I'm probably using a bit of an old workflow (and I know that LTS-2 is pretty old too) but is there any simple way of getting this working again? Cheers, _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Roman Cheplyaka: Reducing boilerplate in finally tagless style

Planet Haskell - Wed, 02/03/2016 - 2:00pm
Introduction

Typed Tagless, a.k.a tagless-final or finally tagless, is an approach to embedding DSLs and modeling data in general, advocated by Oleg Kiselyov. Instead of defining a set of algebraic data types to describe data or terms, thus focusing on how data is constructed, the approach focuses on data consumption, defining a canonical eliminator for every constructor that we would otherwise define.

For instance, instead of defining lists as

data List a = Nil | Cons a (List a)

we would define a class

class List rep a where nil :: rep cons :: a -> rep -> rep

which of course corresponds to the Böhm-Berarducci (or Church) encoding of the above algebraic type.

Oleg has written extensively on the merits of this approach. In this article, I want to discuss a certain aspect of writing transformations in the finally tagless style.

The use case: language-integrated query

Oleg, together with Kenichi Suzuki and Yukiyoshi Kameyama, have published a paper Finally, Safely-Extensible and Efficient Language-Integrated Query. In this paper, they employ the finally tagless approach to embed, optimize, and interpret SQL queries in OCaml.

Here are some excerpts from their OCaml code:

(* Base Symantics *) module type Symantics_base = sig ... (* lambda abstract *) val lam : ('a repr -> 'b repr) -> ('a -> 'b) repr (* application *) val app : ('a -> 'b) repr -> 'a repr -> 'b repr ... end (* Symantics with list operations *) module type SymanticsL = sig include Symantics (* comprehension *) val foreach : (unit -> 'a list repr) -> ('a repr -> 'b list repr) -> 'b list repr (* condition *) val where : bool repr -> (unit -> 'a list repr) -> 'a list repr (* yield singleton list *) val yield : 'a repr -> 'a list repr (* empty list *) val nil : unit -> 'a list repr (* not empty *) val exists : 'a list repr -> bool repr (* union list *) val (@%) : 'a list repr -> 'a list repr -> 'a list repr (* the table constructor which take a table name and table contents *) val table : (string * 'a list) -> 'a list repr end

(‘Symantics’ is not a typo; it’s a portmanteau of ‘syntax’ and ‘semantics’.)

Transformations

A SQL trasnformation (such as transforming a subquery to a join) is represented by an ML functor, i.e. a function mapping one SymanticsL to another, which interprets the term slightly differently than the original one. I say slightly, because normally a transformation touches only a few relevant methods. The others are transformed mechanically following the Reflection-Reification pattern (RR). Informally speaking, we leave the irrelevant methods unchanged, applying the minimal transformation that makes them typecheck.

The question is, how to avoid mentioning irrelevant methods when defining a transformation?

This question is not idle. The language-integrated query code contains about 40 methods and 13 transformations. Pause for a second and imagine the amount of boilerplate that would have to be written if we needed to define every single method for every transformation. As we will see below, ML modules make this a non-issue. In Haskell, however, it is an issue, exhibited in Oleg’s own Haskell example (although easy to miss for a class that only contains 3 methods).

In OCaml, the RR is defined as a transformation of the whole module:

module OL(X:Trans) (F:SymanticsL with type 'a repr = 'a X.from) = struct include O(X)(F) open X let foreach src body = fwd (F.foreach (fun () -> bwd (src ())) (fun x -> bwd (body (fwd x)))) let where test body = fwd (F.where (bwd test) (fun () -> bwd (body ()))) let yield e = fmap F.yield e let nil () = fwd (F.nil ()) let exists e = fmap F.exists e let (@%) e1 e2 = fmap2 F.(@%) e1 e2 let table (name,data) = fwd @@ F.table (name, data) end

When they define a transformation, they first transform the module in this mechanical fashion, and then override the few relevant methods:

module AbsBeta_pass(F:SymanticsL) = struct module X0 = struct type 'a from = 'a F.repr type 'a term = Unknown : 'a from -> 'a term | Lam : ('a term -> 'b term) -> ('a -> 'b) term let fwd x = Unknown x (* generic reflection *) let rec bwd : type a. a term -> a from = function (* reification *) | Unknown e -> e | Lam f -> F.lam (fun x -> bwd (f (fwd x))) end open X0 module X = Trans_def(X0) open X (* optimization *) module IDelta = struct let lam f = Lam f let app e1 e2 = match e1 with | Lam f -> f e2 | _ -> fmap2 F.app e1 e2 end end (* Combine the concrete optimization with the default optimizer *) module AbsBeta(F:SymanticsL) = struct module M = AbsBeta_pass(F) include OL(M.X)(F) (* the default optimizer *) include M.IDelta (* overriding `lam` and `app` *) end

How can we do this in Haskell?

Explicit dictionaries

An explicit dictionariy (a data type containing methods as its fields) seems like a great fit for Symantics. The RR transformation would be a simple function mapping one record to another. To define a transformation, we would override the relevant methods via record update.

However, explicit dictionaries are not that well suited for the finally tagless style. In OCaml, you can include one module into another (notice include Symantics in the OCaml code above). This “unpacks” the contents of one module into another, so that when you open the second module, the contents of the first module is available, too.

This is important for the finally tagless style. One of its strength is extensibility, which is achieved through such inclusion. Consequently, deep inclusion chains are common. With Haskell’s data types, unpacking such chains manually at every use site will quickly become unwieldy.

Type classes

Type classes are better suited for inclusion. If we declare

class Symantics1 rep => Symantics2 rep where { ... }

and impose a Symantics2 rep constraint on a function definition, the methods of Symantics1 become available without any additional effort.

But then we don’t have good support for RR. Type class instances are not first class citizens; we can’t declare a function that transforms one instance into another. Nor can we create one instance from another by overriding a few methods… Or can we?

We can achieve our goal by using default method signatures.

We define the RR transformation simultaneously with the class itself:

class Symantics rep where lam :: (rep a -> rep b) -> rep (a -> b) default lam :: RR t rep => (t rep a -> t rep b) -> t rep (a -> b) lam f = fwd $ lam $ bwd . f . fwd app :: rep (a -> b) -> rep a -> rep b default app :: RR t rep => t rep (a -> b) -> t rep a -> t rep b app f x = fwd $ bwd f `app` bwd x foreach :: rep [a] -> (rep a -> rep [b]) -> rep [b] default foreach :: RR t rep => t rep [a] -> (t rep a -> t rep [b]) -> t rep [b] foreach a b = fwd $ foreach (bwd a) (bwd . b . fwd) ...

The implementation of RR is straightforward:

class RR t rep where fwd :: rep a -> t rep a bwd :: t rep a -> rep a

Now let’s define the AbsBeta pass in Haskell.

data AbsBeta rep a where Unknown :: rep a -> AbsBeta rep a Lam :: (AbsBeta rep a -> AbsBeta rep b) -> AbsBeta rep (a -> b) instance Symantics rep => RR AbsBeta rep where fwd = Unknown bwd = \case Unknown t -> t Lam f -> lam (bwd . f . fwd) instance Symantics rep => Symantics (AbsBeta rep) where lam = Lam app f x = case f of Unknown f' -> fwd $ app f' (bwd x) Lam b -> b x

All the methods not mentioned in the last instance get their default implementations based on RR, which is exactly what we wanted.

Associated types

Apart from methods, ML/OCaml modules can also define types. This is used in the Language-integrated query paper and code in the following way:

(* Base Symantics *) module type Symantics_base = sig type 'a repr (* representation type *) val observe : (unit -> 'a repr) -> 'a obs ...

In Haskell, we can replicate that with an associated type:

class SymanticsObs rep where type Obs rep :: * -> * observe :: rep a -> Obs rep a default observe :: RR t rep => t rep a -> Obs rep a observe = observe . bwd

The default definition for observe saves us from redefining it for derived representations, but what about Obs itself? We would like to write, in the spirit of default method signatures,

class SymanticsObs rep where type Obs rep :: * -> * type Obs (t rep) = rep

However, GHC would not let us to. Since recently, GHC does support default type declarations, but they need to be of the general form type Obs rep = ....

Nevertheless, we can create a type family that will extract the rep from t rep for us:

type family Peel (rep :: * -> *) :: (* -> *) where Peel (t rep) = rep class SymanticsObs rep where type Obs rep :: * -> * type Obs rep = Obs (Peel rep) observe :: rep a -> Obs rep a default observe :: RR t rep => t rep a -> Obs rep a observe = observe . bwd

Now we can say

instance (Symantics rep, SymanticsObs rep) => SymanticsObs (AbsBeta rep)

without having to define either type Obs or observe explicitly.

Conclusion

Extensions such as default method signatures, default associated types, and type families can significantly reduce the boilerplate when defining transformations in the finally tagless style.

Update. Although I missed it on the first reading of the paper, /u/rpglover64 on reddit points out that the authors themselves acknowledge the boilerplate problem which this article addresses:

Haskell typeclasses made the encoding lightweight compared to OCaml modules. On the other hand, in OCaml we relied on the include mechanism to program optimizations by reusing the code for the identity transformation and overriding a couple of definitions. Haskell does not support that sort of code reuse among type classes. Therefore, programming tagless-final transformation in Haskell has quite a bit of boilerplate.

Categories: Offsite Blogs

Functional Jobs: OCaml server-side developer at Ahrefs Research (Full-time)

Planet Haskell - Wed, 02/03/2016 - 1:36pm
Who we are

Ahrefs Research is a San Francisco branch of Ahrefs Pte Ltd (Singapore), which runs an internet-scale bot that crawls whole Web 24/7, storing huge volumes of information to be indexed and structured in timely fashion. On top of that Ahrefs is building analytical services for end-users.

Ahrefs Research develops a custom petabyte-scale distributed storage to accommodate all that data coming in at high speed, focusing on performance, robustness and ease of use. Performance-critical low-level part is implemented in C++ on top of a distributed filesystem, while all the coordination logic and communication layer, along with API library exposed to the developer is in OCaml.

We are a small team and strongly believe in better technology leading to better solutions for real-world problems. We worship functional languages and static typing, extensively employ code generation and meta-programming, value code clarity and predictability, constantly seek out to automate repetitive tasks and eliminate boilerplate, guided by DRY and following KISS. If there is any new technology that will make our life easier - no doubt, we'll give it a try. We rely heavily on opensource code (as the only viable way to build maintainable system) and contribute back, see e.g. https://github.com/ahrefs . It goes without saying that our team is all passionate and experienced OCaml programmers, ready to lend a hand or explain that intricate ocamlbuild rule.

Our motto is "first do it, then do it right, then do it better".

What we need

Ahrefs Research is looking for backend developer with deep understanding of operating systems, networks and taste for simple and efficient architectural designs. Our backend is implemented mostly in OCaml and some C++, as such proficiency in OCaml is very much appreciated, otherwise a strong inclination to intensively learn OCaml in a short term will be required. Understanding of functional programming in general and/or experience with other FP languages (F#,Haskell,Scala,Scheme,etc) will help a lot. Knowledge of C++ and/or Rust is a plus.

The candidate will have to deal with the following technologies on the daily basis:

  • networks & distributed systems
  • 4+ petabyte of live data
  • OCaml
  • linux
  • git

The ideal candidate is expected to:

  • Independently deal with and investigate bugs, schedule tasks and dig code
  • Make argumented technical choice and take responsibility for it
  • Understand the whole technology stack at all levels : from network and userspace code to OS internals and hardware
  • Handle full development cycle of a single component, i.e. formalize task, write code and tests, setup and support production (devops)
  • Approach problems with practical mindset and suppress perfectionism when time is a priority

These requirements stem naturally from our approach to development with fast feedback cycle, highly-focused personal areas of responsibility and strong tendency to vertical component splitting.

What you get

We provide:

  • Competitive salary
  • Modern office in San Francisco SOMA (Embarcadero)
  • Informal and thriving atmosphere
  • First-class workplace equipment (hardware, tools)
  • No dress code

Get information on how to apply for this position.

Categories: Offsite Blogs

Accessing and Inspecting StgBindings in Ghci

haskell-cafe - Wed, 02/03/2016 - 8:30am
Hi all, I'm currently trying to understand how STG works, and my goal right now is to be able to inspect StgBinding values. I've written a short program, based on the wiki article GHC/As a library <https://wiki.haskell.org/GHC/As_a_library>, like below:
Categories: Offsite Discussion

Tom Schrijvers: New Postdoc Vacancy in Functional/Constraint/Logic Programming

Planet Haskell - Wed, 02/03/2016 - 5:54am

I have a new postdoc vacancy in my group. For more details, please read the official vacancy announcement or get in touch.
Categories: Offsite Blogs

Can we improve Show instance for non-ascii charcters?

haskell-cafe - Wed, 02/03/2016 - 3:37am
Show instance for non-ascii characters prints their character codes. This is sad for Haskell users that speaks language other than English. 'A' '\196' '\28450' ["Simon's dad","John's dad","Simon's mom","John's mom"] ["\30000\20013\12398\29238","\23665\30000\12398\29238","\30000\20013\12398\27597","\23665\30000\12398\27597"] The function that needs improvement is showLitChar in GHC.Show, which currently prints any character larger than ASCII code 127 by its character code: http://haddock.stackage.org/lts-5.1/base-4.8.2.0/src/GHC-Show.html showLitChar :: Char -> ShowS showLitChar c s | c > '\DEL' = showChar '\\' (protectEsc isDec (shows (ord c)) s) On the other hand, there is GHC.Unicode.isPrint, the predicate for printable Unicode characters, that is calling on a foreign function u_iswprint for the knowledge. https://hackage.haskell.org/package/base-4.8.2.0/docs/src/GHC.Unicode.html#isPrint I think one of the solution is to import and call u_iswprint from GHC.Show, too, but I don't kno
Categories: Offsite Discussion

wren gayle romano: It's official, I'm off to Google

Planet Haskell - Wed, 02/03/2016 - 12:43am

It's official, I'm heading to Google at the end of July to work with Mark Larson on the Chrome OS security team (of all things!). Seems an unlikely match, but Mark was pretty keen on my background (including the gender stuff!) and wasn't put off by my fusion of linguistics, type-theory, constructive logic/maths, et al. I guess the security team is more concerned with semantic models and constructive correctness than the other teams I talked with. Makes sense, I suppose, but it's sad that these are still thought of as "security" concerns rather than "everything in programming" concerns.

I'm totally looking forward to it, but I am still thinking of it as a bit of an experiment. I'm an academic at heart, so I could see myself heading back to academia in a few years. (Wanting to be a professor is, afterall, what motivated me to start gradschool in the first place.) Then again, I've never really thought of industry as being interested in the sorts of theory I work on. In any case, I'll still be around at the various conferences I've been frequenting; I won't just disappear into industry.

I know a bunch of y'all are in the bay area. I'd love to hear any pointers you have on apartment hunting or on what neighborhoods (nearish Mt View) are nice— i.e., places an artistic disabled radical queer woman might like. Feel free to comment below or get in touch by email, twitter, etc.



comments
Categories: Offsite Blogs

PROHA 2016 (< at > CGO'16): Early Registration Deadline (Feb 3)

General haskell list - Wed, 02/03/2016 - 12:23am
****************************************************************************** PROHA 2016 -- CALL FOR PARTICIPATION First Workshop on Program Transformation for Programmability in Heterogeneous Architectures Website: http://goo.gl/RzGbzY Barcelona, 12th March 2016 In conjunction with the CGO'16 Conference ==== Early Bird Registration: February 3rd, 2016 ==== For registration information, please see http://cgo.org/cgo2016/registration/ ****************************************************************************** The PROHA workshop focuses on techniques and foundations to make it possible to perform source code transformations that preserve the intended semantics of the original code and improve efficiency, portability or maintainability. The topics of interest for the workshop include, non-exclusively: program annotations to capture algorithmic properties and intended code semantics; programming paradigms able to express underlying (mat
Categories: Incoming News

Is there a type class for boring types?

haskell-cafe - Tue, 02/02/2016 - 7:41pm
Or, alternatively, some common class that lets me express that a type is boring (i.e., inhabited by precisely one fully-defined value)? lens has Settable, whose law ensures the type involved has a boring representation (in the sense of representable functor), but is there a more fundamental way? class Boring x where inhabitant :: x instance Boring () where inhabitant = () instance Boring (Proxy a) where inhabitant = Proxy instance Boring y => Boring (x -> y) where inhabitant = const inhabitant instance (Boring x, Boring y) => Boring (x, y) where inhabitant = (inhabitant, inhabitant) instance Boring x => Boring (Const x y) where inhabitant = Const inhabitant instance Boring x => Boring (Identity x) where inhabitant = Identity inhabitant ... _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

[TFP 2016] 1st call for papers

haskell-cafe - Tue, 02/02/2016 - 11:33am
----------------------------- C A L L F O R P A P E R S ----------------------------- ======== TFP 2016 =========== 17th Symposium on Trends in Functional Programming June 8-10, 2016 University of Maryland, College Park Near Washington, DC http://tfp2016.org/ The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below). Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. TFP 201
Categories: Offsite Discussion

[TFP 2016] 1st call for papers

General haskell list - Tue, 02/02/2016 - 11:33am
----------------------------- C A L L F O R P A P E R S ----------------------------- ======== TFP 2016 =========== 17th Symposium on Trends in Functional Programming June 8-10, 2016 University of Maryland, College Park Near Washington, DC http://tfp2016.org/ The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below). Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. TFP 201
Categories: Incoming News

why is rpar/rpar always faster (book Simon Marlow)?

haskell-cafe - Mon, 02/01/2016 - 10:31pm
I'am reading the book Parallel and Concurrent Programming in Haskell. The book has an explanation of the Eval monad. It compares rpar/rpar (example 2-1), rpar/rseq (example 2-2), rpar/rseq/rpar (example 2-3) and rpar/rpar/rseq/rseq in rpar.hs The examples run all in the total time 0.82 s. When I run rpar/rpar (example2-1) on my computer total time is 1.34 s. All other examples have total time 2.22 s. I'am running the examples exactly as written in the book. I tried the examples in opposite order, but the rpar/rpar example remains a lot faster. I wonder why the other examples are so much slower and why is it so different from the book? I run the examples on a computer with 4 cores. I'am using ghc version 7.10.1 on Win64. The Haskell version is 32 bits. If I run the examples with +RTS -N1 all examples use the same time (2.20 sec). Kees _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Instance match surprise

haskell-cafe - Mon, 02/01/2016 - 8:53pm
Dear List, Why does the first instance match? ANY is neither Eq nor Typeable. I thought I had some basic understanding of type classes, and now this... wojtek< at >biuro:~/src/he$ cat minimatch.hs {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module MiniMatch where import Data.Typeable data A130 = A130 deriving (Eq) data ANY = ANY class AtmAcct a class Against q class (AtmAcct a, Against q) => Match a q where match :: a -> q -> Bool instance AtmAcct A130 instance Against ANY instance (Eq a, Eq q, Typeable a, Typeable q, AtmAcct a, Against q) => Match a q where match _ _ = False instance (AtmAcct a) => Match a ANY where match _ _ = True m1 = match A130 ANY -- offending line wojtek< at >biuro:~/src/he$ ghc minimatch.hs [1 of 1] Compiling MiniMatch ( minimatch.hs, minimatch.o ) minimatch.hs:21:6: error: • Overlapping instances for Match A130 ANY arising from a use of ‘match’ Matching instances: instance (Eq a, Eq q, Typeable a, Typeable q
Categories: Offsite Discussion

Hackage Docs

haskell-cafe - Mon, 02/01/2016 - 7:26pm
Hi friends! Apologize, a lot of Hackage docs issues discussed here already, but I'll decided to bring this question one more time. I'm facing missing docs during last few weeks, both Hoogle and Hayoo links to Hackage and usual response I see is "Not found". Stackage helps a lot, but most of the time I have to manually search same term on Stackage again. Can we improve this sad situation finally? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Neil Mitchell: New HLint version and API features

Planet Haskell - Mon, 02/01/2016 - 3:30pm

Summary: In the new version of HLint, errors are warnings and warnings are suggestions. I plan to remove the old API very soon.

I've just released a new version of HLint, the tool for suggesting hints to improve your Haskell code. This version comes with two big changes.

Firstly, hints have been reclassified in severity. What used to be errors are now warnings, and hints that used to be warnings are now suggestions. As people have mentioned in the past, nothing HLint suggested was really an error, and now HLint matches that.

Secondly, there is now an hlint API entry point in Language.Haskell.HLint3 which captures the pattern of running HLint with command-line arguments, but in process as a library. With that, I don't think there are any API patterns that are better captured by the Language.Haskell.HLint API. If no one contacts me with issues, I will be making the module Language.Haskell.HLint a copy of Language.Haskell.HLint3 in the next release.

This release (like all minor releases) fixes a few bugs and adds a few new features. As a few random examples, HLint now warns on a redundant DefaultSignatures language extension, suggests fmap in preference to liftM and warns when otherwise is used as a pattern variable. There is a complete change log in the repo.

Categories: Offsite Blogs

Question,re: failed attempt at constraining a Traversable instance.

haskell-cafe - Mon, 02/01/2016 - 3:28pm
Hi all, I’m trying to do this: data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) instance Functor Tree where fmap g Empty = Empty fmap g (Leaf x) = Leaf (g x) fmap g (Node t1 x t2) = Node (fmap g t1) (g x) (fmap g t2) instance Foldable Tree where foldMap f Empty = mempty foldMap f (Leaf x) = f x foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r instance (Monoid (f (Tree a))) => Traversable (Tree (f a)) where sequenceA Empty = pure Empty sequenceA (Leaf f) = Leaf <$> f sequenceA (Node t1 f t2) = (sequenceA t1) `mappend` (Leaf <$> f) `mappend` (sequenceA t2) And I’m being told this: The first argument of ‘Traversable’ should have kind ‘* -> *’, but ‘Tree (f a)’ has kind ‘*’ In the instance declaration for ‘Traversable (Tree (f a))’ And I don’t quite understand what I’m asking for that’s forbidden. Is it that I’m trying to declare that only a certain subset of Trees are Traversable, and that
Categories: Offsite Discussion