Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-27 Thread Manuel M T Chakravarty
CJ van den Berg c...@vdbonline.com: I have successfully written Java/Haskell programs using the Java Native Interface. You can find my JNI to Haskell binding library at https://github.com/neurocyte/foreign-jni. I am primarily using it to write Android Apps with Haskell, Just out of curiosity,

Re: [Haskell-cafe] install cuda

2013-04-03 Thread Manuel M T Chakravarty
Geoffrey Mainland mainl...@apeiron.net: Fantastic, glad you got it working! Maybe it's time for me to send Trevor a pull request... That sounds like an excellent idea! Manuel On 04/01/2013 04:27 PM, Peter Caspers wrote: indeed, not very helpful ... When I installed Cuda the latest driver

[Haskell-cafe] Which advanced Haskell topics interest you

2012-10-04 Thread Manuel M T Chakravarty
Most existing Haskell books and similar teaching material is aimed at programmers who are new to Haskell. This survey is to assess the community interest in teaching material covering advanced topics beyond the commonly taught introductory material.

Re: [Haskell-cafe] Which advanced Haskell topics interest you

2012-10-04 Thread Manuel M T Chakravarty
Kristopher Micinski krismicin...@gmail.com: On Thu, Oct 4, 2012 at 1:21 PM, Stephen Tetley stephen.tet...@gmail.com wrote: As for an advanced book, maybe limiting the subject to one domain (concurrency / DSLs for graphics / pick a favourite ...) might make a better book than one targeting a

Re: [Haskell-cafe] Haskell Platform - BSD License?

2012-08-02 Thread Manuel M T Chakravarty
Thomas Schilling nomin...@googlemail.com: You may concatenate the licenses of all the packages you are using. GHC includes the LGPL libgmp. The license file for each package is mentioned in the .cabal file. If you need a version of GHC free of the LGPL, you can build GHC from source

Re: [Haskell-cafe] DPH matrix product

2012-07-10 Thread Manuel M T Chakravarty
Firstly, especially when you are talking about performance, please provided detailed information on (a) the versions of the compiler and libraries that you used and (b) of the command line options that you used for compilation. Secondly, your function 'transposeP' doesn't make for a good nested

[Haskell-cafe] [ANN] Accelerate version 0.12: GPU computing with Haskell

2012-05-14 Thread Manuel M T Chakravarty
We just released version 0.12 of Data.Array.Accelerate, the GPGPU[1] library for Haskell: http://justtesting.org/gpu-accelerated-array-computations-in-haskell This is a beta release. The library is not perfect, but it is definitely usable, and we are looking for early adopters. Manuel [1]

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-14 Thread Manuel M T Chakravarty
Ryan Newton: But, anyway, it turns out that my example above is easily transformed from a bad GHC performance story into a good one. If you'll bear with me, I'll show how below. First, Manuel makes a good point about the LLVM backend. My 6X anecdote was from a while ago and I didn't

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-10 Thread Manuel M T Chakravarty
Ryan Newton: As a community I think we have to face the fact that writing the hot inner loop of your application as idiomatic Haskell is not [yet] going to give you C/Fortran performance off the bat. Though in some cases there's not really anything stopping us but more backend/codegen work

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-22 Thread Manuel M T Chakravarty
Stefan Monnier: I think, Apple has made their stance quite clear by releasing the command line dev tools: I'm not sure what you mean by that, but looking at the history of Apple devices, especially the recent history with iPad, iPhone, etc... it's pretty clear to me where this is headed:

Re: [Haskell-cafe] Data.Array.Accelerate initialization timings

2012-02-22 Thread Manuel M T Chakravarty
Martin Dybdal: On 20 February 2012 16:39, Paul Sujkov psuj...@gmail.com wrote: Ah, it seems that I see now what's going wrong way. I'm not using the 'run' function from the CUDA backend, and so by default I guess the code is interpreted (the test backend used for semantics check). However,

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-21 Thread Manuel M T Chakravarty
Austin Seipp: The only two things not clear at this point, at least to me, are: 1) Will Apple require the paid development program, as opposed to the free one, if you only want to self-sign applications with a cert they trust? You can self-sign applications with a certificate that you get

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-21 Thread Manuel M T Chakravarty
Austin Seipp: On Sun, Feb 19, 2012 at 8:39 PM, Tom Murphy amin...@gmail.com wrote: On the other hand, it's impossible for a software company to maintain a sense of professionalism, when a user has to know a weird secret handshake to disable what they may perceive as equivalent to antivirus

Re: [Haskell-cafe] XCode Dependency for HP on Mac

2011-07-31 Thread Manuel M T Chakravarty
In addition to the excellent reasons that Mark outlined, there is another important reason to *not* include gcc and friends in the HP. Every software developer (as opposed to friend of a friend who just wanted to try to learn programming with Haskell on a road trip) will already have Xcode

Re: [Haskell-cafe] Software patents covered in GHC?

2011-06-24 Thread Manuel M T Chakravarty
Erik de Castro Lopo: Manuel M T Chakravarty wrote: In fact, you are better of not to know. Given that GHC (like all non-trivial software) surely infringes on some patents, the damages that a patent holder can sue you for are less if you do not know about the patents you are infringing

Re: [Haskell-cafe] Software patents covered in GHC?

2011-06-20 Thread Manuel M T Chakravarty
austin seipp: *sigh* CC'ing to the rest of haskell-cafe for completeness. I need to change 'reply all' to a default in my email I guess. On Mon, Jun 20, 2011 at 12:19 PM, austin seipp a...@hacks.yi.org wrote: Hello, Realistically, there probably is. Considering everything down to linked

Re: [Haskell-cafe] Haskell *interpreter* on iPad? (Scheme and Ocaml are there)

2011-06-20 Thread Manuel M T Chakravarty
And while we are dreaming, in an iOS port of GHCi (meaning GHCi runs on iOS and doesn't just generate code for it), it would be great to make bytecode persistent — ie, the bytecode that GHCi currently generates internally to interpret programs should be serialized to save and load it. (Note

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-18 Thread Manuel M T Chakravarty
Jurriën Stutterheim: A few weeks ago I set out to build a GUI app using wxHaskell. Long story short, we ditched the entire idea of a desktop GUI and went for a web application instead, because it was easier to develop a front-end for it and it was easier to style it. So here's my (perhaps

Re: [Haskell-cafe] Is Harper right that Haskell cannot model the natural numbers?

2011-05-03 Thread Manuel M T Chakravarty
In this context, I'd suggest to have a look at the POPL'06 paper Fast and Loose Reasoning is Morally Correct http://www.comlab.ox.ac.uk/people/jeremy.gibbons/publications/fast+loose.pdf The paper is quite technical, so here the gist. It says that if you formally proof that two Haskell

Re: [Haskell-cafe] Robert Harper on monads and laziness

2011-05-03 Thread Manuel M T Chakravarty
, 2011 at 1:32 AM, Manuel M T Chakravarty c...@cse.unsw.edu.au wrote: ... Interestingly, today (at least the academic fraction of) the Haskell community appears to hold the purity of the language in higher regard than its laziness. As someone who implemented Haskell with quite a bit less

Re: [Haskell-cafe] Robert Harper on monads and laziness

2011-05-02 Thread Manuel M T Chakravarty
Tony Morris: Interesting how I have been authoring and subsequently using monads in scala for several years and it is strictness that gets in the way more than anything. Just to make sure that I understand you correctly. You are saying that when you use monads in Scala, then strictness makes

Re: [Haskell-cafe] Robert Harper on monads and laziness

2011-05-02 Thread Manuel M T Chakravarty
For a historical perspective, I highly recommend The Definitive Account of the History of Haskell: http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/index.htm Section 7 clearly and directly cites the desire to have pure I/O as the motivation for adopting

Re: [Haskell-cafe] DPH and GHC 7.0.1

2010-11-28 Thread Manuel M T Chakravarty
Andrew Coppin: On 19/11/2010 11:39 PM, David Peixotto wrote: There were some problems getting DPH to work well with the changes in GHC 7. There is more info in this mail: http://www.haskell.org/pipermail/cvs-ghc/2010-November/057574.html The short summary is that there will be a patch

[Haskell-cafe] Re: [Haskell] Proposal: Form a haskell.org committee

2010-09-05 Thread Manuel M T Chakravarty
Ian Lynagh: To fix this problem, we propose that we create a haskell.org committee, which is responsible for answering these sorts of questions, although for some questions they may choose to poll the community at large if they think appropriate. [..] Unfortunately, this gives us a

Re: [Haskell-cafe] Multidimensional Matrices in Haskell

2010-07-11 Thread Manuel M T Chakravarty
Hi Mihai, A friend of mine wanted to do some Cellular Automata experiments in Haskell and was asking me what packages/libraries are there for multidimensional matrices. I'm interested in both immutable and mutable ones but I don't want them to be trapped inside a monad of any kind. You may

Re: [Haskell-cafe] Proposal: Australian Hackathon

2010-03-17 Thread Manuel M T Chakravarty
1) Who's interested Interest, yes, but time is a very scarce resource these days... 2) What dates are good Midyear break is 29 Jun to 18 Jul at UNSW, but I'm away for a week in that time period. 3) What projects people want to work on To be honest, I'd probably be in and out and, on a

Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Manuel M T Chakravarty
John Van Enk: consider presenting at CUFP this year Any word on when this will be? It'll be before or after (I suspect the later) ICFP http://www.icfpconference.org/icfp2010/, which is September 27-29 in Baltimore, Maryland. Manuel ___

Re: [Haskell-cafe] OpenCL target for DPH?

2009-12-07 Thread Manuel M T Chakravarty
Marcus Daniels wrote, I'm wondering if anyone has looked at OpenCL as target for Data Parallel Haskell? Specifically, having Haskell generate CL kernels, i.e. SIMD vector type aware C language backend, as opposed to just a Haskell language binding. The short answer is that there is currently

Re: [Haskell-cafe] university courses on type families/GADTs?

2009-12-01 Thread Manuel M T Chakravarty
Tom Schrijvers wrote, I was wondering whether there are any universities that teach about Haskell type families or GADTs? I do in my course Language-based Software Safety (both TFs and GADTs). It's an advanced, research-oriented course for 4th year undergraduate and for postgraduate

Re: [Haskell-cafe] Bulding a library for C users on OS X

2009-11-01 Thread Manuel M T Chakravarty
Chris Eidhof: I'm trying to call a Haskell function from C, on OS X. There's an excellent post [1] by Tomáš Janoušek that explains how to do this on Linux. However, on OS X, it's different. First of all, it looks like the -no-hs-main flag is ignored, because I get the following error:

Re: [Haskell-cafe] Type-level naturals multiplication

2009-10-12 Thread Manuel M T Chakravarty
Reid Barton: On Sat, Oct 10, 2009 at 02:59:37PM -0400, Brad Larsen wrote: Suppose we implement type-level naturals as so: data Zero data Succ a Then, we can reflect the type-level naturals into a GADT as so (not sure if ``reflect'' is the right terminology here): data Nat :: * - * where

Re: [Haskell-cafe] Graph Library Using Associated Types

2009-10-12 Thread Manuel M T Chakravarty
Lajos Nagy: I understand that one of the original motivations for introducing associated types to Haskell was the survey of support for generic programming done by Garcia et al. where they compared the implementation of the Boost Graph Library in various languages (C++, Java, Haskell, ML,

Re: [Haskell-cafe] Type-level naturals multiplication

2009-10-11 Thread Manuel M T Chakravarty
Brad Larsen: Suppose we implement type-level naturals as so: data Zero data Succ a Then, we can reflect the type-level naturals into a GADT as so (not sure if ``reflect'' is the right terminology here): data Nat :: * - * where Zero :: Nat Zero Succ :: Nat a - Nat (Succ a) Using type

Re: [Haskell-cafe] Type families in export lists

2009-05-31 Thread Manuel M T Chakravarty
Lee Duhem: On Sat, May 30, 2009 at 7:35 PM, Maurí cio briqueabra...@yahoo.com wrote: Hi, How do I include type families (used as associated types) in a module export list? E.g.: class MyClass a where type T a :: * coolFunction :: Ta - a (...) If I just include MyClass and its

Re: [Haskell-cafe] haskell cuda?

2009-05-13 Thread Manuel M T Chakravarty
Dan: Doesn't look like there's code out there - will try e-mailing the authors of the various papers/presentations. We haven't made any code available yet, but we are planning to do so before ICFP this year. This e-mail also counts as an open plea to those compiler wizards working on

Re: [Haskell-cafe] Generating Haskell with associated types (and kind annotations)

2009-05-09 Thread Manuel M T Chakravarty
Hi Dan, I was wondering whether anyone had any suggestions on a good way to generate repetitive code with associated types and kind annotations. I'd like to use TH but as far as I understand, it doesn't support this yet (I think associated types are in HEAD but not kinds), I implemented type

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-07 Thread Manuel M T Chakravarty
Matt Morrow: On Mon, Apr 6, 2009 at 7:39 PM, Manuel M T Chakravarty c...@cse.unsw.edu.au wrote: Peter Berry: 3) we apply appl to x, so Memo d1 a = Memo d a. unify d = d1 But for some reason, step 3 fails. Step 3 is invalid - cf, http://www.haskell.org/pipermail/haskell-cafe/2009-April

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-06 Thread Manuel M T Chakravarty
Peter Berry: {-# LANGUAGE TypeFamilies, TypeSynonymInstances, ScopedTypeVariables #-} The following is a class of memo tries indexed by d: class Fun d where type Memo d :: * - * abst :: (d - a) - Memo d a appl :: Memo d a - (d - a) -- Law: abst . appl = id -- Law: appl . abst

Re: [Haskell-cafe] Type families and kind signatures

2009-04-02 Thread Manuel M T Chakravarty
Louis Wasserman: Mkay. I get it now. I was under the impression that, essentially, a data family was precisely equivalent to a type family aliasing to a separately declared datatype. No, they are not equivalent. You can see that as follows. Assume, data family T a type family S a

Re: [Haskell-cafe] ANNOUNCE: vacuum-cairo: a cairo frontend to vacuum for live Haskell data visualization

2009-03-31 Thread Manuel M T Chakravarty
Don Stewart: Is there a Mac OSX packaging team? Unfortunately, it's not just a packaging problem. (Well, packing of Haskell libraries, that is.) There are two version of GTK+ Mac OS X: (1) the MacPorts version and (2) a native GTK+ framework. Unfortunately, both are not satisfactory.

Re: [Haskell-cafe] Status of Haskell under OsX

2009-03-03 Thread Manuel M T Chakravarty
. However, GHC has support for frameworks; so, it should be possible to get this to work. Manuel Arne Dehli Halvorsen: Manuel M T Chakravarty wrote: I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the regular

Re: [Haskell-cafe] Status of Haskell under OsX

2009-03-02 Thread Manuel M T Chakravarty
, GHC has support for frameworks; so, it should be possible to get this to work. Manuel Arne Dehli Halvorsen: Manuel M T Chakravarty wrote: I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the regular contributors to GHC

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-26 Thread Manuel M T Chakravarty
I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the regular contributors to GHC work on Macs. That should ensure that Mac OS X is well supported. Installation is trivial with the Mac OS X installer package:

Re: [Haskell-cafe] Comparison of functional dependencies and type families [was: Re: Type families not as useful over functions]

2009-02-15 Thread Manuel M T Chakravarty
Just for the record, here a few clarifications. Expressiveness ~~ From a theoretical point of view, type families (TFs) and functional dependencies (FDs) are equivalent in expressiveness. There is nothing that you can do in one and that's fundamentally impossible in the other.

Re: [Haskell-cafe] (Off-topic) CUDA

2009-02-11 Thread Manuel M T Chakravarty
Malcolm Wallace: (Also... Haskell on the GPU. It's been talked about for years, but will it ever actually happen?) gpu is just set of simd-like instructions. so the reason why you will never see haskell on gpu is the same as why you will never see it implemented via simd instructions :D

Re: [Haskell-cafe] Problems running vectorised dph program

2009-01-27 Thread Manuel M T Chakravarty
Hi Fabian, I've just begun to play with Data Parallel Haskell but instantly ran into a problem. My very stupid but very simple example ought to sum the values of all Nodes in a Tree. The non-vectorised code behaves like I expected, the vectorised code doesn't terminate. I compiled and ran

Re: [Haskell-cafe] Re: Type family problem

2009-01-21 Thread Manuel M T Chakravarty
Gleb Alexeyev: Sjoerd Visscher wrote: When I try this bit of code: class C1 a where type F a :: * x :: F a y :: F a x = y I get this error: Couldn't match expected type `F a1' against inferred type `F a' In the expression: y In the definition of `x': x = y I can't figure

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-16 Thread Manuel M T Chakravarty
I have to say, I agree with Lennart here. Terms like monoid have had a precise definition for a very long time. Replacing an ill-defined term by a vaguely defined term only serves to avoid facing ones ignorance - IMHO an unwise move for a technical expert. Learning Haskell has often

Re: [Haskell-cafe] Type Family Relations

2009-01-15 Thread Manuel M T Chakravarty
Thomas DuBuisson: Cafe, I am wondering if there is a way to enforce compile time checking of an axiom relating two separate type families. Mandatory contrived example: type family AddressOf h type family HeaderOf a -- I'm looking for something to the effect of: type axiom HeaderOf (AddressOf

Re: [Haskell-cafe] Could FDs help usurp an ATs syntactic restriction?

2008-12-07 Thread Manuel M T Chakravarty
Nicolas Frisby: From the error below, I'm inferring that the RHS of the associated type definition can only contain type variables from the instance head, not the instance context. I didn't explicitly see this restriction when reading the GHC/Type_families entry. Could perhaps the a b - bn

Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Manuel M T Chakravarty
Claus Reinke: What do those folks working on parallel Haskell arrays think about the sequential Haskell array baseline performance? You won't like the answer. We are not happy with the existing array infrastructure and hence have our own. Roman recently extracted some of it as a

Re: [Haskell-cafe] ANNOUNCE: Salsa: A .NET Bridge for Haskell

2008-10-15 Thread Manuel M T Chakravarty
Great! Thanks for putting the code out! Manuel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Simplifying a IsFunction type class using type equality constraints

2008-10-08 Thread Manuel M T Chakravarty
Corey O'Connor: I recently had a need to use the IsFunction typeclass described by Oleg here: http://okmij.org/ftp/Haskell/isFunction.lhs and am wondering if the use of the TypeCast class can be correctly replaced by a type equality constraint. The IsFunction and TypeCast classes were

Re: [Haskell-cafe] Type family oddity

2008-10-05 Thread Manuel M T Chakravarty
Claus Reinke wrote: Btw, is there a list of common TF pitfalls somewhere? Some example items so far seem to be: 1 'C a = TF a', where 'a' isn't determinable 2 'TF a' is not fully polymorphic 3 'TF a' is not a decomposable type constructor, it stands only for itself, or for its result (in that

Re: [Haskell-cafe] Type family oddity

2008-10-05 Thread Manuel M T Chakravarty
Florian Weimer: I can't figure out why the following code doesn't compile with the October 2n GHC 6.10 beta (-XTypeFamilies -XFlexibleContexts) when the type declaration is not commented out. It's a bug that the code is accepted *without* the signature, as the signature is ambiguous:

Re: [Haskell-cafe] Distributing Haskell binaries as OSX App Bundles

2008-09-29 Thread Manuel M T Chakravarty
I wrote a command-line program recently for a friend in haskell. However, he's far away and not particularly computer literate. I sent him the raw binaries, but they came up with errors about not being able to find libgmp stuff. So then I thought I should probably be able to somehow

Re: [Haskell-cafe] GHC trouble on Leopard

2008-09-16 Thread Manuel M T Chakravarty
Miguel, I tried to compile some code on Mac Os X (Intel) Leopard. I have GHC 6.8.3 installed - the installer from GHC webpage (GHC-6.8.3-i386.pkg). But when I run make I get this error ghc-6.8.3: could not execute: /Library/Frameworks/GHC.framework/ Versions/608/usr/lib/ghc-6.8.3/ghc-asm

Re: [Haskell-cafe] Research language vs. professional language

2008-09-02 Thread Manuel M T Chakravarty
Ryan Ingram: On Sun, Aug 31, 2008 at 7:27 PM, Jonathan Cast [EMAIL PROTECTED] wrote: This concept of `day-to-day work' is a curious one. Haskell is not a mature language, and probably shouldn't ever be one. I see where you are coming from here, but I think that train has already started and

Re: [Haskell-cafe] Haskell Xcode Plugin

2008-08-21 Thread Manuel M T Chakravarty
Dennis Buchmann: during my search for an acceptable development environment under Mac OS X I found this Plugin for Xcode: http://hoovy.org/HaskellXcodePlugin/ Unfortunately, I'm not able to get it to run in Xcode v3.0 and the developer seems to be not contactable at the moment. So, has

Re: [Haskell-cafe] xmonad on the openmoko mobile phone

2008-08-10 Thread Manuel M T Chakravarty
Don Stewart: Haskell fans might be impressed by the good work of Joachim Breitner, who got xmonad running on his openmoko phone, http://www.joachim-breitner.de/blog/archives/300-Xmonad-on-my-mobile-phone.html You can see a photo here,

Re: [Haskell-cafe] Building NDP with latest GHC

2008-07-22 Thread Manuel M T Chakravarty
Austin Seipp: After my last issue with GHC's HEAD, I tried checking it out again and getting the patches for the libraries and lo and behold, it worked. So now I'm up to date with the latest libraries and the compiler, but it appears that building NDP itself is proving to be troublesome. The

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-07 Thread Manuel M T Chakravarty
Alexey Rodriguez: On Fri, Jul 4, 2008 at 5:03 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: The problem is that blah's type is ambiguous, as f does only occur as an argument to the type family. If you'd define class Blah f a where blah :: a - f - T f f a (and change the rest

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-03 Thread Manuel M T Chakravarty
Alexey Rodriguez: We are having trouble with the following program that uses type families: class Blah f a where blah :: a - T f f a class A f where type T f :: (* - *) - * - * the following function does not type: wrapper :: forall a f . Blah f a = a - T f f a wrapper x = blah x

Re: [Haskell-cafe] type-level integers using type families

2008-05-29 Thread Manuel M T Chakravarty
Peter Gavin: Has anyone else tried implementing type-level integers using type families? I tried using a couple of other type level arithmetic libraries (including type-level on Hackage) and they felt a bit clumsy to use. I started looking at type families and realized I could pretty

Re: [Haskell-cafe] Type families and GADTs in 6.9

2008-04-14 Thread Manuel M T Chakravarty
Dan, I've been playing around with type families off and on in 6.8, but, what with the implementation therein being reportedly incomplete, it's hard to know what I'm getting right and wrong, or what should work but doesn't and so on. So, I finally decided to take the plunge and install 6.9

Re: [Haskell-cafe] type families and type signatures

2008-04-11 Thread Manuel M T Chakravarty
Lennart Augustsson: On Thu, Apr 10, 2008 at 4:20 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: the five signatures forall a. S a forall b. S b forall a b. S (a, b) Int S Int By alpha-convertible I mean the usual thing from lambda calculus, they are identical modulo the names

Re: [Haskell-cafe] type families and type signatures

2008-04-11 Thread Manuel M T Chakravarty
to disbale this for certain definitions, because you cannot give them a signature. I find that broken. Definitely. Can you give an example? Manuel On Thu, Apr 10, 2008 at 5:52 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: Lennart Augustsson: Let's look at this example from a higher level

Re: [Haskell-cafe] type families and type signatures

2008-04-11 Thread Manuel M T Chakravarty
Lennart Augustsson: On Thu, Apr 10, 2008 at 4:20 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: Lennart Augustsson: On Wed, Apr 9, 2008 at 8:53 AM, Martin Sulzmann [EMAIL PROTECTED] wrote: Lennart, you said (It's also pretty easy to fix the problem.) What do you mean? Easy to fix

Re: [Haskell-cafe] type families and type signatures

2008-04-09 Thread Manuel M T Chakravarty
Claus Reinke: type family Id a type instance Id Int = Int foo :: Id a - Id a foo = id n foo' :: Id a - Id a foo' = foo type function notation is slightly misleading, as it presents qualified polymorphic types in a form usually reserved for unqualified polymorphic types. rewriting foo's

Re: [Haskell-cafe] type families and type signatures

2008-04-09 Thread Manuel M T Chakravarty
Lennart Augustsson: On Wed, Apr 9, 2008 at 8:53 AM, Martin Sulzmann [EMAIL PROTECTED] wrote: Lennart, you said (It's also pretty easy to fix the problem.) What do you mean? Easy to fix the type checker, or easy to fix the program by inserting annotations to guide the type checker?

Re: [Haskell-cafe] Re: type families and type signatures

2008-04-09 Thread Manuel M T Chakravarty
apfelmus: Manuel M T Chakravarty wrote: apfelmus: Manuel M T Chakravarty wrote: Let's alpha-rename the signatures and use explicit foralls for clarity: foo :: forall a. Id a - Id a foo' :: forall b. Id b - Id b GHC will try to match (Id a) against (Id b). As Id is a type synonym family

Re: [Haskell-cafe] type families and type signatures

2008-04-09 Thread Manuel M T Chakravarty
Lennart Augustsson: Let's look at this example from a higher level. Haskell is a language which allows you to write type signatures for functions, and even encourages you to do it. Sometimes you even have to do it. Any language feature that stops me from writing a type signature is in my

Re: [Haskell-cafe] type families and type signatures

2008-04-08 Thread Manuel M T Chakravarty
Ganesh Sittampalam: On Mon, 7 Apr 2008, Manuel M T Chakravarty wrote: Ganesh Sittampalam: The following program doesn't compile in latest GHC HEAD, although it does if I remove the signature on foo'. Is this expected? Yes, unfortunately, this is expected, although it is very unintuitive

Re: [Haskell-cafe] type families and type signatures

2008-04-08 Thread Manuel M T Chakravarty
Sittampalam, Ganesh: Manuel Chakravarty wrote: Ganesh Sittampalam: On Mon, 7 Apr 2008, Manuel M T Chakravarty wrote: Ganesh Sittampalam: The following program doesn't compile in latest GHC HEAD, although it does if I remove the signature on foo'. Is this expected? Yes, unfortunately

Re: [Haskell-cafe] translating from fundeps into type families

2008-04-08 Thread Manuel M T Chakravarty
Chaddaï Fouché: 2008/4/8, Manuel M T Chakravarty [EMAIL PROTECTED]: You need to write the instance as instance (b ~ TheFoo a, Foo a) = Bar (Either a b) where bar (Left a) = foo' a bar (Right b) = foo' (foo b :: a) If you do that, the program compile, but res still raise a panic

Re: [Haskell-cafe] translating from fundeps into type families

2008-04-07 Thread Manuel M T Chakravarty
Ganesh Sittampalam: Can I have some advice on translating the attached Test1.hs into type families? My attempt at doing so is in Test1a.hs, but firstly it requires FlexibleInstances where Test1.hs didn't, and secondly it fails because it can't infer the instance for Bar (Either Int Int)

Re: [Haskell-cafe] Re: type families and type signatures

2008-04-07 Thread Manuel M T Chakravarty
Hi Mark, I don't know if you have defined/studied corresponding notions of ambiguity/coherence in your framework. Instead, I was referring to what Manuel described as the equivalent problem using FDs: class IdC a b | a - b instance IdC Int Int bar :: IdC a b = b - b bar = id bar' ::

Re: [Haskell-cafe] Re: type families and type signatures

2008-04-07 Thread Manuel M T Chakravarty
apfelmus: Manuel M T Chakravarty wrote: Ganesh Sittampalam: Let's alpha-rename the signatures and use explicit foralls for clarity: foo :: forall a. Id a - Id a foo' :: forall b. Id b - Id b GHC will try to match (Id a) against (Id b). As Id is a type synonym family, it would

Re: [Haskell-cafe] type families and type signatures

2008-04-06 Thread Manuel M T Chakravarty
Ganesh Sittampalam: The following program doesn't compile in latest GHC HEAD, although it does if I remove the signature on foo'. Is this expected? Yes, unfortunately, this is expected, although it is very unintuitive. This is for the following reason. Let's alpha-rename the signatures

Re: [Haskell-cafe] Equality constraints in type families

2008-03-30 Thread Manuel M T Chakravarty
[a] = FList a Does FList ignore its second argument? Depends on the type instances of G. Manuel On Fri, Mar 28, 2008 at 12:04 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: Hugo Pacheco: Sorry, I meant type FList a x = Either One (a,x) type instance F [a] = FList a We should not allow

Re: [Haskell-cafe] Functional dependencies with Type Classes

2008-03-30 Thread Manuel M T Chakravarty
Henning Günther: suppose there are two (identical) classes: class Res a b | a - b where getRes :: a - b and class Res2 t where type Member t getRes2 :: t - Member t It is easy to automatically make every instance of Res2 an instance of res: instance Res2 a =

Re: [Haskell-cafe] Equality constraints in type families

2008-03-30 Thread Manuel M T Chakravarty
Hugo Pacheco: Anyway, do you think it is feasible to have a flag such as -fallow- unsafe-type-families for users to use at their own risk? (supposing we know how to guarantee these constraints). Sorry, but it doesn't seem like a good idea to enable an unsound type system even by an

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Manuel M T Chakravarty
Hugo Pacheco: Sorry, I meant type FList a x = Either One (a,x) type instance F [a] = FList a We should not allow such programs. Manuel On Thu, Mar 27, 2008 at 4:45 PM, Hugo Pacheco [EMAIL PROTECTED] wrote: The current implementation is wrong, as it permits type S a b = a type

Re: [Haskell-cafe] Equality constraints in type families

2008-03-26 Thread Manuel M T Chakravarty
Hugo Pacheco: Since I was the one to start this thread, I have managed to implement what I initially wanted as F a :: *-* with F a x::*, and the cost of not having partially applied type synonyms was not much apart from some more equality coercions that I wasn't expecting. [..] Generally,

Re: [Haskell-cafe] Equality constraints in type families

2008-03-26 Thread Manuel M T Chakravarty
Simon Peyton-Jones: | * GHC says that these constraints must be obeyed only | *after* the programmer-written type has been normalised | by expanding saturated type synonyms | ... | I regard this as a kind of pre-pass, before serious type checking | takes place, so I don't

Re: [Haskell-cafe] Equality constraints in type families

2008-03-25 Thread Manuel M T Chakravarty
Manuel M T Chakravarty: again, i gave a concrete example of how ghc behaves as i would expect, not as that decomposition rule would suggest. Maybe you can explain why you think so. I didn't understand why you think the example is not following the decomposition rule. Actually, see

Re: [Haskell-cafe] Equality constraints in type families

2008-03-25 Thread Manuel M T Chakravarty
Simon Peyton-Jones: | | However, I think I now understand what you are worried about. It is the | | interaction of type families and GHC's generalised type synonyms (i.e., | | type synonyms that may be partially applied). I agree that it does lead | | to an odd interaction, because the

Re: [Haskell-cafe] Equality constraints in type families

2008-03-25 Thread Manuel M T Chakravarty
Claus Reinke: one might say that the central point of example two were two partially applied type synonym families in the same position (rhs of a type synonym family instance definition). usually, when reduction meets typing, there is a subject reduction theorem, stating that types do not

Re: [Haskell-cafe] Equality constraints in type families

2008-03-25 Thread Manuel M T Chakravarty
Claus Reinke wrote, given that type families are never meant to be partially applied, perhaps a different notation, avoiding confusion with type constructor applications in favour of something resembling products, could make that clearer? something simple, like braces to group families and

Re: [Haskell-cafe] Equality constraints in type families

2008-03-25 Thread Manuel M T Chakravarty
Dan Doel: On Tuesday 11 March 2008, Tom Schrijvers wrote: I think you've uncovered a bug in the type checker. We made the design choice that type functions with a higher-kinded result type must be injective with respect to the additional paramters. I.e. in your case: F x y

Re: [Haskell-cafe] Equality constraints in type families

2008-03-24 Thread Manuel M T Chakravarty
Claus Reinke: type family F a :: * - * F x y ~ F u v = F x ~ F u /\ y ~ v words, in a type term like (F Int Bool), the two parameters Int and Bool are treated differently. Int is treated like a parameter to a function (which is what you where expecting), whereas Bool is treated like

Re: [Haskell-cafe] Equality constraints in type families

2008-03-24 Thread Manuel M T Chakravarty
Claus Reinke: type family F a :: * - * F x y ~ F u v = F x ~ F u /\ y ~ v why would F x and F u have to be the same functions? shouldn't it be sufficient for them to have the same result, when applied to y and v, respectively? Oh, yes, that is sufficient and exactly what is meant by F x ~ F

Re: [Haskell-cafe] Equality constraints in type families

2008-03-23 Thread Manuel M T Chakravarty
Claus Reinke: type family F a :: * - * .. We made the design choice that type functions with a higher-kinded result type must be injective with respect to the additional paramters. I.e. in your case: F x y ~ F u v = F x ~ F u /\ y ~ v i'm still trying to understand this remark: - if we

Re: [Haskell-cafe] Equality constraints in type families

2008-03-23 Thread Manuel M T Chakravarty
Tom Schrijvers: could you please help me to clear up this confusion?-) Let me summarize :-) The current design for type functions with result kinds other than * (e.g. * - *) has not gotten very far yet. We are currently stabilizing the ordinary * type functions, and writing the story up.

Re: [Haskell-cafe] Equality constraints in type families

2008-03-23 Thread Manuel M T Chakravarty
Claus Reinke: type family F a :: * - * .. We made the design choice that type functions with a higher-kinded result type must be injective with respect to the additional paramters. I.e. in your case: F x y ~ F u v = F x ~ F u /\ y ~ v actually, i don't even understand the first part of

Re: [Haskell-cafe] Re: Type parameters in type families

2008-03-19 Thread Manuel M T Chakravarty
Ryan Ingram: On 3/17/08, Hugo Pacheco [EMAIL PROTECTED] wrote: On the other side, it fails to compile when this signature is explicit: fff :: forall d x. (FunctorF d) = d - F d x - F d x fff a = fmapF a id Interestingly, this works when you also give a type signature to id: fff :: forall d

Re: [Haskell-cafe] problem with type equality constraints

2008-03-17 Thread Manuel M T Chakravarty
Ganesh Sittampalam: On Mon, 17 Mar 2008, Manuel M T Chakravarty wrote: Your are completely right. Unfortunately, superclass equalities (ie, the Id a ~ ida in the class declaration of Foo) aren't fully implemented yet. OK, thanks. Is there any rough idea of when they will be? That's

Re: [Haskell-cafe] type families, fun deps, lattices imposed on/by types

2008-03-16 Thread Manuel M T Chakravarty
Isto Aho: Please, consider the example 03 of Understanding functional dependencies via Constraint Handling rules by Sulzmann, Duck, Peyton-Jones and Stuckey. There we are defining a multiplication over different numeric types: class Mul a b c | a b - c where (*) :: a - b - c instance Mul

Re: [Haskell-cafe] problem with type equality constraints

2008-03-16 Thread Manuel M T Chakravarty
Ganesh Sittampalam: When I try to compile this code with ghc-6.9.20080310: module Test2 where type family Id a type instance Id Int = Int type instance Id (a, b) = (Id a, Id b) class Id a ~ ida = Foo a ida instance Foo Int Int instance (Foo a ida, Foo b idb) = Foo (a, b) (ida, idb) I get

Re: [Haskell-cafe] Bug with GADT in function Patterns?

2008-03-12 Thread Manuel M T Chakravarty
Hi Hugo, I have found a bug on the compiler (at least ghc 6.8.2). For some module (yes, the example does nothing at all): module Test where data Type a where Func :: Type a - Type b - Type (a - b) PF :: Type a - Type (PF a) data PF a where ID :: PF (a - a) test :: Type a - a -

  1   2   >