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,
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
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.
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
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
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
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]
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
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
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:
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,
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
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
___
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
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
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:
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
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,
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
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
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
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
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
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
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
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.
. 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
, 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
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:
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.
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
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
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
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
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
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
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
Great! Thanks for putting the code out!
Manuel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
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
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:
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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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?
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
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
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
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
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
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)
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' ::
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
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
[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
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 =
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
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
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,
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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 - 100 of 163 matches
Mail list logo