Re: Constructor as outermost match in RULE under GHC 8.2.2 & 8.4.3

2018-08-03 Thread Conal Elliott
I get it. Thanks, Ben! On Fri, Aug 3, 2018 at 12:48 PM, Ben Gamari wrote: > On August 2, 2018 9:25:05 PM EDT, Conal Elliott wrote: > >GHC 8.2.2 and 8.4.3 dislike the following rules: > > > >``` haskell > >{-# RULES > > > >"pair fst snd" forall

Constructor as outermost match in RULE under GHC 8.2.2 & 8.4.3

2018-08-02 Thread Conal Elliott
GHC 8.2.2 and 8.4.3 dislike the following rules: ``` haskell {-# RULES "pair fst snd" forall p. (,) (exl p) (exr p) = p "swap" forall p. (,) (exr p) (exl p) = swap p #-} ``` Error messages: ``` haskell /Users/conal/Haskell/concat/plugin/src/ConCat/Rebox.hs:485:1: warning: A constructor,

Re: Natural number comparisons with evidence

2018-05-24 Thread Conal Elliott
o the same approach > seems legitimate. > > > > I always want code with unsafeCoerce to be clear about (a) why it’s > necessary and (b) why it’s sound. > > > > Simon > > > > > > *From:* Glasgow-haskell-users <glasgow-haskell-users-boun...@haskell.org> *O

Re: Natural number comparisons with evidence

2018-05-24 Thread Conal Elliott
; > > On May 24, 2018, at 3:54 PM, Conal Elliott <co...@conal.net> wrote: > > Great! Thanks for the suggestion to use type equality and coerced `Refl`. > - Conal > > On Thu, May 24, 2018 at 10:43 AM, David Feuer <david.fe...@gmail.com> > wrote: > >> O

Re: Natural number comparisons with evidence

2018-05-24 Thread Conal Elliott
Great! Thanks for the suggestion to use type equality and coerced `Refl`. - Conal On Thu, May 24, 2018 at 10:43 AM, David Feuer <david.fe...@gmail.com> wrote: > On Thu, May 24, 2018, 1:03 PM Conal Elliott <co...@conal.net> wrote: > >> Thanks for this suggestion, David. I

Re: Natural number comparisons with evidence

2018-05-24 Thread Conal Elliott
where `Dict` is from Ed Kmett's constraints library ( https://hackage.haskell.org/package/constraints). On Thu, May 24, 2018 at 10:03 AM, Conal Elliott <co...@conal.net> wrote: > Thanks for this suggestion, David. It seems to work out well, though I > haven't tried running yet. >

Re: Natural number comparisons with evidence

2018-05-24 Thread Conal Elliott
unsafeSatisfy @ (u > v) CompareGT If anyone has other techniques to suggest, I'd love to hear. -- Conal On Wed, May 23, 2018 at 5:44 PM, David Feuer <david.fe...@gmail.com> wrote: > I think the usual approach for defining these sorts of primitive > operations is to use unsafeCoe

Natural number comparisons with evidence

2018-05-23 Thread Conal Elliott
When programming with GHC's type-level natural numbers and `KnownNat` constraints, how can one construct *evidence* of the result of comparisons to be used in further computations? For instance, we might define a type for augmenting the results of `compare` with evidence: > data CompareEv u v >

Re: Rewrite rules involving LHS lambda?

2017-12-02 Thread Conal Elliott
nd v I'd assume that x didn't occur in either u or v. Effectively you have > some scope like forall u v. exists x. ... > > Under that view, the warnings are accurate, and the rewrite is pretty > purely syntactic. > > I don't see how we could write using our current vocabulary that w

Rewrite rules involving LHS lambda?

2017-12-02 Thread Conal Elliott
Is there a written explanation and/or examples of rewrite rules involving a LHS lambda? Since rule matching is first-order, I'm wondering how terms with lambda are matched on the LHS and substituted into on the RHS. For instance, I want to restructure a lambda term as follows: > foo (\ x -> fmap

Re: GHC rewrite rule type-checking failure

2017-10-03 Thread Conal Elliott
; in a core2core pass that looks for instances of C, and then adds the > rules to the mod_guts. That would solve the problem neatly, I’d say. > > Greetings, > Joachim > > > Am Dienstag, den 03.10.2017, 08:45 -0700 schrieb Conal Elliott: > > Hi Joachim. Thanks very much for t

Re: GHC rewrite rule type-checking failure

2017-10-03 Thread Conal Elliott
, 2017 at 7:52 AM, Joachim Breitner <m...@joachim-breitner.de> wrote: > Hi, > > > Am Montag, den 02.10.2017, 17:03 -0700 schrieb Conal Elliott: > > My questions: > > > > * Is it feasible for GHC to combine the constraints needed LHS and RHS > to form an applic

Re: GHC rewrite rule type-checking failure

2017-10-02 Thread Conal Elliott
`morph`: > > morph :: D k b => (a -> b) -> k a b > morph = error "morph: undefined" > > but I fear that this work-around is not acceptable to you. > > Joachim > > Am Montag, den 02.10.2017, 14:25 -0700 schrieb Conal Elliott: > &

GHC rewrite rule type-checking failure

2017-10-02 Thread Conal Elliott
I'm running into type checking problem with GHC rewrite rules in GHC 8.0.2, illustrated in the code below. The first rule type-checks, but the second triggers the type error mentioned in the comment following the rule definition. I'd expect both rules to type-check, adding the needed constraints

Spurious recompilations when using a compiler plugin

2017-09-18 Thread Conal Elliott
It appears that use of GHC plugins causes client code to get needlessly recompiled. (See Trac issues 12567 and 7414 .) It’s becoming more of a problem for usability of the plugin

Re: Inhibiting the specialiser?

2017-09-15 Thread Conal Elliott
Thanks. I somehow didn't notice that flag. On Fri, Sep 15, 2017 at 3:23 AM, Simon Peyton Jones <simo...@microsoft.com> wrote: > Did you try -fno-specialise? > > > > *From:* Glasgow-haskell-users [mailto:glasgow-haskell-users- > boun...@haskell.org] *On Behalf Of *Co

Re: Inhibiting the specialiser?

2017-09-15 Thread Conal Elliott
ion of imported INLINABLE functions. Both of these flags are > "on" when using -O and -O2. > > -harendra > > On 15 September 2017 at 07:15, Conal Elliott <co...@conal.net> wrote: > >> Is there a GHC flag for inhibiting the specializer (but not all >> opt

Inhibiting the specialiser?

2017-09-14 Thread Conal Elliott
Is there a GHC flag for inhibiting the specializer (but not all optimizations)? I'm seeing huge output from the Specialise phase killed at 4GB and growing. The output starts as follows: Result size of Specialise = {terms: 29,639, types: 10,921,552, coercions: 4,425,185} Sounds like a lot to

Re: GHC rewrite rules for class operations & laws

2016-12-28 Thread Conal Elliott
t:13 gives more >> background. >> >> >> >> It’d be great if someone wanted to think through all this. >> >> >> >> Simon >> >> >> >> *From:* Glasgow-haskell-users [mailto:glasgow-haskell-users- >> boun..

Inlining phase control for derived methods?

2016-12-16 Thread Conal Elliott
Is it possible to control when *derived* methods get inlined, say postponing to the last simplifier phase? I'm thinking in particular of instances derived via GeneralizedNewtypeDeriving. -- Conal ___ Glasgow-haskell-users mailing list

Re: GHC rewrite rules for class operations & laws

2016-11-24 Thread Conal Elliott
; It’d be great if someone wanted to think through all this. > > > > Simon > > > > *From:* Glasgow-haskell-users [mailto:glasgow-haskell-users- > boun...@haskell.org] *On Behalf Of *Conal Elliott > *Sent:* 17 November 2016 16:40 > *To:* glasgow-haskell-users@haskell.org > *S

GHC rewrite rules for class operations & laws

2016-11-17 Thread Conal Elliott
Is it possible to apply GHC rewrite rules to class methods? From what I’ve read and seen, class methods get eliminated early by automatically-generated rules. Is there really no way to postpone such inlining until a later simplifier stage? The GHC Users Guide docs say no

Monomorphizing GHC Core?

2014-06-19 Thread Conal Elliott
Has anyone worked on a monomorphizing transformation for GHC Core? I understand that polymorphic recursion presents a challenge, and I do indeed want to work with polymorphic recursion but only on types for which the recursion bottoms out statically (i.e., each recursive call is on a smaller

Re: Monomorphizing GHC Core?

2014-06-19 Thread Conal Elliott
On Thu, Jun 19, 2014 at 3:28 PM, Conal Elliott co...@conal.net wrote: Has anyone worked on a monomorphizing transformation for GHC Core? I understand that polymorphic recursion presents a challenge, and I do indeed want to work with polymorphic recursion but only on types for which the recursion

haskeline dylib failure on MacOS in GHC HEAD

2014-05-02 Thread Conal Elliott
I built GHC HEAD on MacOS 10.9.2 from GitHub yesterday and am getting an error when trying to use a problem (HERMIT) that uses haskeline: Loading package haskeline-0.7.1.2 ... command line: can't load .so/.DLL for:

GHC rewrite rules and constructor wrappers?

2014-04-29 Thread Conal Elliott
I'm trying to sort out the relationship of GHC rewrite rules and constructor wrappers. I have rules like reify/(:) reifyEP (:) = kPrim VecSP This rule seems to fire for `reifyEP ($W:)` rather than `reifyEP (:)`. If I'm tracking (uncertain), `($W:)` inlines to `(:)`. Sometimes I'm able to

Re: Help with cast error

2014-04-24 Thread Conal Elliott
...@haskell.org] *On Behalf Of *Conal Elliott *Sent:* 24 April 2014 01:29 *To:* glasgow-haskell-users@haskell.org; ghc-d...@haskell.org; Richard Eisenberg; Simon Peyton Jones *Subject:* Help with cast error I'd appreciate help with a cast-related Core Lint error I'm getting with a GHC plugin I'm

Help with cast error

2014-04-23 Thread Conal Elliott
I'd appreciate help with a cast-related Core Lint error I'm getting with a GHC plugin I'm working on: Argument value doesn't match argument type: Fun type: Enc (Vec ('S 'Z) Bool) ~ (Bool, ()) = EP (Enc (Vec ('S 'Z) Bool)) - EP (Bool, ()) Arg type: ~R# (Enc (Vec

Re: Concrete syntax for open type kind?

2014-04-21 Thread Conal Elliott
really stuck? S *From:* Glasgow-haskell-users [mailto: glasgow-haskell-users-boun...@haskell.org] *On Behalf Of *Conal Elliott *Sent:* 19 April 2014 01:11 *To:* Simon Peyton Jones *Cc:* glasgow-haskell-users@haskell.org *Subject:* Re: Concrete syntax for open type kind? Thanks

Re: Concrete syntax for open type kind?

2014-04-18 Thread Conal Elliott
, there’s never enough time to do these things. Simon *From:* Glasgow-haskell-users [mailto: glasgow-haskell-users-boun...@haskell.org] *On Behalf Of *Conal Elliott *Sent:* 16 April 2014 18:01 *To:* Richard Eisenberg *Cc:* glasgow-haskell-users@haskell.org *Subject:* Re: Concrete syntax

Re: Concrete syntax for open type kind?

2014-04-16 Thread Conal Elliott
that `a`’s kind is *. Any other kind (assuming these flags) would be printed. I hope this helps! Richard On Apr 15, 2014, at 7:39 PM, Conal Elliott co...@conal.net wrote: I see ‘#’ for unlifted and ‘?’ for open kinds in compiler/parser/Parser.y: akind :: { IfaceKind

Concrete syntax for open type kind?

2014-04-15 Thread Conal Elliott
I see ‘#’ for unlifted and ‘?’ for open kinds in compiler/parser/Parser.y: akind :: { IfaceKind } : '*' { ifaceLiftedTypeKind } | '#' { ifaceUnliftedTypeKind } | '?' { ifaceOpenTypeKind } | '(' kind ')' { $2 } kind

Re: Help with coercion roles?

2014-04-14 Thread Conal Elliott
*From:* Glasgow-haskell-users [mailto:glasgow- haskell-users-boun...@haskell.org] *On Behalf Of *Conal Elliott *Sent:* 14 April 2014 06:00 *To:* ghc-d...@haskell.org; glasgow-haskell-users@haskell.org *Subject:* Help with coercion roles? I’m working on a GHC plugin (as part of my Haskell

Re: Help with coercion roles?

2014-04-14 Thread Conal Elliott
proving `EP (Bool - Bool - Bool - Bool) ~R EP (HasIf Bool)`, but if EP's role is nominal, then this is indeed bogus.) Richard On Apr 14, 2014, at 2:23 PM, Conal Elliott co...@conal.net wrote: Thanks for the pointers! I don't quite know how to get to the form you recommend from the existing

Re: Help with coercion roles?

2014-04-14 Thread Conal Elliott
, I would like to help you with a way forward -- let me know if there's a way I can. Richard On Apr 14, 2014, at 4:12 PM, Conal Elliott co...@conal.net wrote: Hi Richard, I'm working on compiling Haskell to hardware, as outlined at https://github.com/conal/lambda-ccc/blob/master/doc

Help with coercion roles?

2014-04-13 Thread Conal Elliott
I’m working on a GHC plugin (as part of my Haskell-to-hardware work) and running into trouble with coercions roles. Error message from Core Lint: Warning: In the expression: LambdaCCC.Lambda.lamvP# @ (GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool) @ (Simple.HasIf

Re: GHC 7.8.1: Many haddock-related complaints from 'ghc-pkg check'

2014-04-10 Thread Conal Elliott
look into on my Mavericks machine and see what's going wrong - I figured ./validate would have caught this, but perhaps something strange is going on. I filed a bug for you marked for 7.8.2: https://ghc.haskell.org/trac/ghc/ticket/8981 On Wed, Apr 9, 2014 at 1:07 PM, Conal Elliott co

GHC 7.8.1: Many haddock-related complaints from 'ghc-pkg check'

2014-04-09 Thread Conal Elliott
I installed the binary distribution of GHC 7.8.1 for Mac OS this morning, cabal-installed a few packages, and now I get a *lot* of warnings about missing .haddock files: bash-3.2$ ghc-pkg check Warning: haddock-interfaces:

Re: GHC 7.8.1: Many haddock-related complaints from 'ghc-pkg check'

2014-04-09 Thread Conal Elliott
for random-1.0.1.1... Preprocessing library random-1.0.1.1... Haddock coverage: System/Random.hs:2:2: parse error on input '#' On Wed, Apr 9, 2014 at 10:46 AM, Conal Elliott co...@conal.net wrote: I installed the binary distribution of GHC 7.8.1 for Mac OS this morning, cabal

Re: GHC 7.8.1: Many haddock-related complaints from 'ghc-pkg check'

2014-04-09 Thread Conal Elliott
. A little terser than I'm after, but it helps. On Wed, Apr 9, 2014 at 10:53 AM, Conal Elliott co...@conal.net wrote: From a bit of experimentation, it appears that the problematic packages do indeed have Haddock failures. For instance, bash-3.2$ cd random-1.0.1.1/ bash-3.2$ cabal

Module import and use in GHC plugin?

2013-05-29 Thread Conal Elliott
In writing GHC plugins, how can I (a) add a module import (preferably qualified) and (b) make vars/ids for names imported from the newly imported module (to insert in the transformed Core code)? If it's not possible to do what I want, I'd be willing to require an explicit import (say import

Simplifying Core pretty-printing via GHC API?

2013-05-01 Thread Conal Elliott
I'm using the GHC API to compile Haskell source code to Core. I'd like to pretty-print the result with the sort of simplifications I get with -dsuppress-type-applications, -dsuppress-uniques, etc (used in combination with -ddump-simpl on ghc's command line). How can I set these options via the GHC

Re: Simplifying Core pretty-printing via GHC API?

2013-05-01 Thread Conal Elliott
PM, Johan Tibell johan.tib...@gmail.com wrote: On Wed, May 1, 2013 at 2:13 PM, Conal Elliott co...@conal.net wrote: I'm using the GHC API to compile Haskell source code to Core. I'd like to pretty-print the result with the sort of simplifications I get with -dsuppress-type-applications

Re: Advice on type families and non-injectivity?

2013-01-14 Thread Conal Elliott
[mailto:glasgow-haskell- | users-boun...@haskell.org] On Behalf Of Richard Eisenberg | Sent: 14 January 2013 03:47 | To: Conal Elliott | Cc: glasgow-haskell-users@haskell.org; Haskell Cafe | Subject: Re: Advice on type families and non-injectivity? | | Hi Conal, | | I agree that your initial example

Re: [Haskell-cafe] Advice on type families and non-injectivity?

2013-01-14 Thread Conal Elliott
for different types. On Sun, Jan 13, 2013 at 2:10 PM, Conal Elliott co...@conal.net wrote: I sometimes run into trouble with lack of injectivity for type families. I'm trying to understand what's at the heart of these difficulties and whether I can avoid them. Also, whether some of the obstacles

Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
I sometimes run into trouble with lack of injectivity for type families. I'm trying to understand what's at the heart of these difficulties and whether I can avoid them. Also, whether some of the obstacles could be overcome with simple improvements to GHC. Here's a simple example: {-# LANGUAGE

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
appear in the signature directly (e.g., something like 'a - F a' would be ok). -Iavor On Sun, Jan 13, 2013 at 11:10 AM, Conal Elliott co...@conal.net wrote: I sometimes run into trouble with lack of injectivity for type families. I'm trying to understand what's at the heart

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
...@tbi.univie.ac.at wrote: Hi, How would you infer a from F a? Given bar :: Bool, I can't see how one could go from Bool to F a = Bool and determine a uniquely. My question is not completely retorical, if there is an answer I would like to know it :-) Gruss, Christian * Conal Elliott co...@conal.net

Re: Suppress Duplicate constraints warning?

2013-01-03 Thread Conal Elliott
to add one? (It would be easy to do.) Simon ** ** *From:* glasgow-haskell-users-boun...@haskell.org [mailto: glasgow-haskell-users-boun...@haskell.org] *On Behalf Of *Conal Elliott *Sent:* 30 December 2012 19:56 *To:* glasgow-haskell-users@haskell.org *Subject:* Suppress Duplicate

Re: Suppress Duplicate constraints warning?

2013-01-03 Thread Conal Elliott
Oh! I see it's already done. Thanks much! On Thu, Jan 3, 2013 at 11:55 AM, Conal Elliott co...@conal.net wrote: Yes, please do add a flag to suppress this duplicate constraints warning, e.g., -fno-warn-duplicate-constraints. Thanks! -- Conal On Mon, Dec 31, 2012 at 9:27 AM, Simon Peyton

Suppress Duplicate constraints warning?

2012-12-30 Thread Conal Elliott
Is there a way to suppress GHC's Duplicate constraints warning? I'm auto-generating some code, and it's a lot more convenient for me to leave the duplicates than filter them out. -- Conal ___ Glasgow-haskell-users mailing list

Re: Fundeps and type equality

2012-12-26 Thread Conal Elliott
if the transition happened yet. On Tue, Dec 25, 2012 at 6:15 PM, Conal Elliott co...@conal.net wrote: I ran into a simple falure with functional dependencies (in GHC 7.4.1): class Foo a ta | a - ta foo :: (Foo a ta, Foo a tb, Eq ta) = ta - tb - Bool foo = (==) I expected

Re: Type operators in GHC

2012-09-19 Thread Conal Elliott
Indeed -- lovely notational tricks, Iavor Edward! I think I'd be happy with one of these variations. At least worth experimenting with. -- Conal On Mon, Sep 17, 2012 at 8:05 PM, Carter Schonwald carter.schonw...@gmail.com wrote: 1) kudos to iavor and edward on the slick notation invention!

Re: Type operators in GHC

2012-09-16 Thread Conal Elliott
Type variable operator Any other opinions? Simon From: conal.elli...@gmail.com [mailto:conal.elli...@gmail.com] On Behalf Of Conal Elliott Sent: 06 September 2012 23:59 To: Simon Peyton-Jones Cc: GHC users Subject: Re: Type operators in GHC Oh dear. I'm

Re: Type operators in GHC

2012-09-16 Thread Conal Elliott
operator Any other opinions? Simon From: conal.elli...@gmail.com [mailto:conal.elli...@gmail.com] On Behalf Of Conal Elliott Sent: 06 September 2012 23:59 To: Simon Peyton-Jones Cc: GHC users Subject: Re: Type operators in GHC Oh dear. I'm very sorry to have

Re: Type operators in GHC

2012-09-16 Thread Conal Elliott
operator ** ** Any other opinions? ** ** Simon ** ** *From:* conal.elli...@gmail.com [mailto:conal.elli...@gmail.com] *On Behalf Of *Conal Elliott *Sent:* 06 September 2012 23:59 *To:* Simon Peyton-Jones *Cc:* GHC users *Subject:* Re: Type operators in GHC ** ** Oh

Re: Type operators in GHC

2012-09-06 Thread Conal Elliott
Oh dear. I'm very sorry to have missed this discussion back in January. I'd be awfully sad to lose pretty infix notation for type variables of kind * - * - *. I use them extensively in my libraries and projects, and pretty notation matters. I'd be okay switching to some convention other than lack

Re: Haddock problems with GHC 7.4.1

2012-02-05 Thread Conal Elliott
February 2012 00:17, Conal Elliott co...@conal.net wrote: Since installing GHC 7.4.1 (from sources), I'm getting lots of complaints from 'ghc-pkg check', of the following form: Warning: haddock-interfaces: /usr/local/share/doc/transformers-0.2.2.0/html/transformers.haddock doesn't exist

Re: Oddity with 'cabal install' in GHC 7.4.1

2012-02-05 Thread Conal Elliott
Ah -- so use cabal-dev for development and cabal-install when a version stabilizes? -- Conal On Sun, Feb 5, 2012 at 4:20 PM, Jason Dagit dag...@gmail.com wrote: On Sun, Feb 5, 2012 at 10:48 AM, Conal Elliott co...@conal.net wrote: On Sun, Feb 5, 2012 at 12:43 AM, Andres Löh andres.l

Haddock problems with GHC 7.4.1

2012-02-04 Thread Conal Elliott
Since installing GHC 7.4.1 (from sources), I'm getting lots of complaints from 'ghc-pkg check', of the following form: Warning: haddock-interfaces: /usr/local/share/doc/transformers-0.2.2.0/html/transformers.haddock doesn't exist or isn't a file Warning: haddock-html:

Oddity with 'cabal install' in GHC 7.4.1

2012-02-04 Thread Conal Elliott
Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install' a second time without first doing a 'ghc-pkg unregister package-name', I get the following complaint: cabal: The install plan contains reinstalls which can break your GHC installation. You can try

Re: Oddity with 'cabal install' in GHC 7.4.1

2012-02-04 Thread Conal Elliott
rather than get stopped. Regards, - Conal On Sat, Feb 4, 2012 at 9:51 PM, Andres Löh andres.l...@googlemail.comwrote: Hi Conal. On Sun, Feb 5, 2012 at 12:36 AM, Conal Elliott co...@conal.net wrote: Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install

Injective type families?

2011-02-14 Thread Conal Elliott
Is there a way to declare a type family to be injective? I have data Z data S n type family n :+: m type instance Z :+: m = m type instance S n :+: m = S (n :+: m) My intent is that (:+:) really is injective in each argument (holding the other as fixed), but I don't know how to persuade

Re: Injective type families?

2011-02-14 Thread Conal Elliott
at 1:28 PM, Conal Elliott co...@conal.net wrote: Is there a way to declare a type family to be injective? I have data Z data S n type family n :+: m type instance Z :+: m = m type instance S n :+: m = S (n :+: m) My intent is that (:+:) really is injective in each argument

How to #include into .lhs files?

2011-02-03 Thread Conal Elliott
Does anyone have a working example of #include'ing Haskell code into a bird-tracks-style .lhs file with GHC? Every way I try leads to parsing errors. Is there documentation about how it's supposed to work? Help much appreciated. - Conal ___

Re: How to #include into .lhs files?

2011-02-03 Thread Conal Elliott
...@googlemail.com wrote: On Thursday 03 February 2011 10:33:23, Conal Elliott wrote: Does anyone have a working example of #include'ing Haskell code into a bird-tracks-style .lhs file with GHC? Every way I try leads to parsing errors. Is there documentation about how it's supposed to work

GADTs with strict fields?

2009-03-31 Thread Conal Elliott
Do strict fields work with GADTs? If so, what's the syntax for the strictness annotations? - Conal ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: GADTs with strict fields?

2009-03-31 Thread Conal Elliott
I got an answer: precede the argument types by a !. I didn't realize that type applications then have to be parenthesized. On Tue, Mar 31, 2009 at 4:18 PM, Conal Elliott co...@conal.net wrote: Do strict fields work with GADTs? If so, what's the syntax for the strictness annotations

spurious non-exhaustive pattern warnings?

2009-03-30 Thread Conal Elliott
-- Why do I get warnings about non-exhaustive pattern matches in the -- following code? Is the compiler just not clever enough to notice that -- the uncovered cases are all type-incorrect? (ghc 6.11.20090115) {-# LANGUAGE TypeFamilies, EmptyDataDecls, TypeOperators , GADTs,

Re: ghci finding include files exported from other packages?

2009-03-16 Thread Conal Elliott
On Mon, Mar 16, 2009 at 2:47 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Mon, 2009-03-16 at 12:13 +, Simon Marlow wrote: This sounds like a chicken and egg problem. To know which package include directories to use GHCi needs to know which packages your module uses.

ghci finding include files exported from other packages?

2009-03-15 Thread Conal Elliott
The applicative-numbers package [1] provides an include file. With ghci, the include file isn't being found, though with cabal+ghc it is found. My test source is just two lines: {-# LANGUAGE CPP #-} #include ApplicativeNumeric-inc.hs I'd sure appreciate it if someone could take a look at the

Re: ghci finding include files exported from other packages?

2009-03-15 Thread Conal Elliott
. - Conal On Sun, Mar 15, 2009 at 5:27 AM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Sat, 2009-03-14 at 23:43 -0700, Conal Elliott wrote: The applicative-numbers package [1] provides an include file. With ghci, the include file isn't being found, though with cabal+ghc it is found

Re: ghci finding include files exported from other packages?

2009-03-15 Thread Conal Elliott
-15 at 09:13 -0700, Conal Elliott wrote: That did it. I've added :set -package applicative-numbers to my .ghci and am back in business. Thanks! IIUC, there's an inconsistency in ghci's treatment of modules vs include files, in that modules will be found without -package, but include

Re: [reactive] Re: black hole detection and concurrency

2009-01-07 Thread Conal Elliott
running your TestRace program for quite a while on 4 processors without any hangs now. Cheers, Simon Conal Elliott wrote: I don't know if the bug would explain loop. My guess is that the black-hole-detection code is incorrectly concluding there is a black hole because a thunk

Re: [reactive] Re: black hole detection and concurrency

2009-01-06 Thread Conal Elliott
needs the whnf. This is a fairly naive guess. I don't know this machinery well enough to have confidence. What do you think? - Conal On Tue, Jan 6, 2009 at 6:27 AM, Simon Marlow marlo...@gmail.com wrote: Conal Elliott wrote: Indeed -- many thanks to Bertram, Sterling, Peter others

Re: [reactive] Re: black hole detection and concurrency

2009-01-03 Thread Conal Elliott
: Conal Elliott wrote: Thanks very much for these ideas. Peter Verswyvelen suggested running the example repeatedly to see if it always runs correctly. He found, and I verified, that the example runs fine with Bertram's last version of unamb below, *unless* it's compiled with -threaded and run

Re: [reactive] Re: black hole detection and concurrency

2008-12-28 Thread Conal Elliott
This is a neat trick indeed! I'd appreciate an explanation of killing one's own thread and then continuing (with a restart in this case). How does the post-kill resumption occur? That is, how does control pass to the tail-recursive call after the self-kill? - Conal 2008/12/28 Peter

Re: [reactive] Re: black hole detection and concurrency

2008-12-28 Thread Conal Elliott
Thanks very much for these ideas. Peter Verswyvelen suggested running the example repeatedly to see if it always runs correctly. He found, and I verified, that the example runs fine with Bertram's last version of unamb below, *unless* it's compiled with -threaded and run with +RTS -N2. In the

Fwd: black hole detection and concurrency

2008-12-26 Thread Conal Elliott
++ ++ s) return x) killNote s tid = throwTo tid (ErrorCall s) And a GHCi session: *Un go in: ff in: fg in: f in: g out: True fg out: True ff interactive: ff *** Exception: ff Cheers, Sterl. On Dec 26, 2008, at 1:15 AM, Conal Elliott wrote: I'm looking for information about

black hole detection and concurrency

2008-12-25 Thread Conal Elliott
I'm looking for information about black hole detection with ghc. I'm getting loop where I don't think there is an actual black hole. I get this message sometimes with the unamb package, which is implemented with unsafePerformIO, concurrency, and killThread, as described in

Re: Exporting an #include from one package to another?

2008-11-25 Thread Conal Elliott
wonderful! i'll try it out. thanks, duncan. On Sat, Nov 22, 2008 at 5:31 AM, Duncan Coutts [EMAIL PROTECTED]wrote: On Fri, 2008-11-21 at 18:28 -0800, Conal Elliott wrote: Is there a way to package up an #include like to share across (be #include'd into) various other haskell packages

Exporting an #include from one package to another?

2008-11-21 Thread Conal Elliott
Is there a way to package up an #include like to share across (be #include'd into) various other haskell packages? I have some standard templates for type class instances that I can't define as instances without creating lots of overlapping instances. I can write an include file easily enough,

Re: problem with echo prompting in ghci (visible in emacs)

2008-11-17 Thread Conal Elliott
, Conal Elliott [EMAIL PROTECTED] wrote: ghci echoes all of my input in emacs, when run via haskell-mode or via M-x shell, which then confuses various useful haskell-mode features. I built it from sources. At the time I didn't have libedit-dev, so today I installed libedit-dev (version 2.11

Re: A lazy (~) pattern cannot bind existential type variables?

2008-11-16 Thread Conal Elliott
. I'm not sure it's possible in GHC. -- ryan On Sat, Nov 15, 2008 at 10:33 PM, Conal Elliott [EMAIL PROTECTED] wrote: What is the reasoning behind the ghc restriction that A lazy (~) pattern cannot bind existential type variables? This error came up for me in the following code

Re: problem with echo prompting in ghci (visible in emacs)

2008-11-16 Thread Conal Elliott
I'm still looking for a solution to this problem. I've heard from a few people who are affected also, but not any solution. Barring a solution to ghci's behavior, does someone have an emacs-based workaround? - Conal On Tue, Nov 11, 2008 at 4:41 PM, Conal Elliott [EMAIL PROTECTED] wrote

A lazy (~) pattern cannot bind existential type variables?

2008-11-15 Thread Conal Elliott
What is the reasoning behind the ghc restriction that A lazy (~) pattern cannot bind existential type variables? This error came up for me in the following code: -- | Add a continuation. data WithCont h b c = forall a. WC (h b a) (a - c) instance Functor (WithCont h b) where

trouble compiling OpenGL package with ghc 6.10.1 (undefined GLUT_BITMAP_8_BY_13 etc)

2008-11-06 Thread Conal Elliott
While building the GLUT package (GLUT-2.1.1.2) with ghc 6.10.1, I get the following errors. I recently compiled this same version successfully in ghc-6.11.20081103. Any idea what's gone wrong? [20 of 21] Compiling Graphics.UI.GLUT.Begin ( Graphics/UI/GLUT/Begin.hs,

Re: trouble compiling OpenGL package with ghc 6.10.1 (undefined GLUT_BITMAP_8_BY_13 etc)

2008-11-06 Thread Conal Elliott
Hm. This problem seems to have gone away on its own. Never mind- Conal On Thu, Nov 6, 2008 at 1:46 PM, Conal Elliott [EMAIL PROTECTED] wrote: While building the GLUT package (GLUT-2.1.1.2) with ghc 6.10.1, I get the following errors. I recently compiled this same version

Re: [Haskell-cafe] ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-10-28 Thread Conal Elliott
of GLUT (with patched glutGetProcAddress [attached]) - darcs version of OpenGL Getting freeglut going with ghc on windows is a bit involved. I could write a walkthrough if there's enough interest. David 2008/10/25 Conal Elliott [EMAIL PROTECTED] I'm getting crashes from ghc

Re: [Haskell-cafe] Re: ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-10-28 Thread Conal Elliott
. On Tue, Oct 28, 2008 at 4:03 PM, Matti Niemenmaa [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Conal Elliott wrote: I am using glut32 rather than freeglut (and no need for patching the darcs GLUT). I wonder if glut32-vs-freeglut could account for crash-vs-nocrash on 6.10 and 6.11

ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-10-25 Thread Conal Elliott
I'm getting crashes from ghc-6.10.0.20081007 and ghc-6.11.20081024 when doing a very simple GLUT program (below) with OpenGL-2.2.1.1 and GLUT-2.1.1.2 (the latest from Hackage), running on WinXP. It works fine on ghc-6.9.20080622 . I'd appreciate hearing about other attempts with these versions

problem submitting ghc bug in trac

2008-07-17 Thread Conal Elliott
I logged onto the ghc trac, am trying to submit a ghc bug report, and I get TICKET_CREATE privileges are required to perform this operation. How do I get TICKET_CREATE privileges? I do see logged in as conal. - Conal ___ Glasgow-haskell-users mailing

Re: Advice sought for 6.9 and Arrow/Category

2008-07-15 Thread Conal Elliott
All code that defines Arrow instance breaks, because () is not a method of Arrow. I have a lot of such instances, so I'm now adding #if directives to test for ghc-6.9 or later. - Conal On Mon, Jul 14, 2008 at 8:38 PM, Don Stewart [EMAIL PROTECTED] wrote: conal: I want to use ghc-6.9 for

Bug in type equality constraints?

2008-07-15 Thread Conal Elliott
I'm converting some code from functionally dependencies to associated types, and I've run into a problem with equality constraints and subclasses. The classes: class AdditiveGroup v = VectorSpace v where type Scalar v :: * (*^) :: Scalar v - v - v class VectorSpace v =

Re: Advice sought for 6.9 and Arrow/Category

2008-07-15 Thread Conal Elliott
? - Conal On Tue, Jul 15, 2008 at 4:43 PM, Conal Elliott [EMAIL PROTECTED] wrote: All code that defines Arrow instance breaks, because () is not a method of Arrow. I have a lot of such instances, so I'm now adding #if directives to test for ghc-6.9 or later. - Conal On Mon, Jul 14, 2008 at 8

Advice sought for 6.9 and Arrow/Category

2008-07-14 Thread Conal Elliott
I want to use ghc-6.9 for improved support of type families, but I see that the change to the Arrow interface breaks some of my libraries (since () is no longer a method of Arrow). Will this change really be in ghc-6.9? Does anyone have coping strategies for keeping libraries working in 6.8 *and*

Re: desperately seeking RULES help

2008-06-09 Thread Conal Elliott
are involved, because there are no rules for fint (it's a fresh, local function). Simon *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Conal Elliott *Sent:* 07 June 2008 17:26 *To:* glasgow-haskell-users@haskell.org *Subject:* Re: desperately seeking RULES help

Re: desperately seeking RULES help

2008-06-07 Thread Conal Elliott
- Int) - (a - a) test h g = onInt h . onInt g 2008/6/7 Conal Elliott [EMAIL PROTECTED]: I'm trying to do some fusion in ghc, and I'd greatly appreciate help with the code below (which is simplified from fusion on linear maps). I've tried every variation I can think of, and always

Re: desperately seeking RULES help

2008-06-07 Thread Conal Elliott
Is it by intention that -fno-method-sharing works only from the command line, not in an OPTIONS_GHC pragma? On Sat, Jun 7, 2008 at 9:23 AM, Conal Elliott [EMAIL PROTECTED] wrote: Thanks a million, Lennart! -fno-method-sharing was the missing piece. - Conal On Sat, Jun 7, 2008 at 5:07 AM

desperately seeking RULES help

2008-06-06 Thread Conal Elliott
I'm trying to do some fusion in ghc, and I'd greatly appreciate help with the code below (which is simplified from fusion on linear maps). I've tried every variation I can think of, and always something prevents the fusion. Help, please! Thanks, - Conal {-# OPTIONS_GHC -O2 -Wall

  1   2   >