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

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-10-02 Thread Conal Elliott
in wxWidgets, but we (i.e. https://github.com/wxHaskell?tab=members) hope to release announce in not too much time. cheers, Atze On 30 Sep, 2013, at 20:32 , Conal Elliott co...@conal.net wrote: Hi Conrad, Great. The challenge is not specific to Pan, Vertigo, etc. If we can get some low-level

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-10-02 Thread Conal Elliott
again? (I’m guessing that the latter might be hard.) Thanks Simon -Original Message- From: Haskell-Cafe [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Paul Liu Sent: 30 September 2013 07:18 To: Conal Elliott Cc: Haskell Cafe

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-10-02 Thread Conal Elliott
elements, just basic windowing and input handling. Euterpea has a UI layer on top of GLFW that provides text boxes and sliders, etc, entirely written in Haskell. On Wed, Oct 2, 2013 at 8:40 AM, Conal Elliott co...@conal.net wrote: Hi Paul. Is there a way to use GLFW with GUI elements other than

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-30 Thread Conal Elliott
of the way there (again, noting the properties I listed). -- Conal On Fri, Sep 27, 2013 at 1:40 AM, Conrad Parker con...@metadecks.org wrote: Hi Conal! Yes. I'd be very interested to help get Pan and Vertigo working. Do you have a repo somewhere? Conrad. On 27 September 2013 13:32, Conal

[Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-26 Thread Conal Elliott
I'm polling to see whether there are will and expertise to reboot graphics and GUIs work in Haskell. I miss working on functional graphics and GUIs in Haskell, as I've been blocked for several years (eight?) due to the absence of low-level foundation libraries having the following properties: *

[Haskell-cafe] Looking for ICFP roommate

2013-08-20 Thread Conal Elliott
I'm looking for an ICFP roommate. I plan to attend Sunday through Saturday and stay the nights of Saturday the 21st through Saturday the 28th. I missed the discounted price of $225 (yipes) at the Airport Hilton (sold out). Perhaps someone already has a room reserved with two beds or could switch

[Haskell-cafe] Categories with associated constraints?

2013-08-19 Thread Conal Elliott
Has anyone given a go at a Category class and friends (including cartesian and closed) with associated constraints (presumably using the ConstraintKinds language extension)? I gave it a try a while back and wasn't able to keep the signatures from getting very complicated. Thanks, -- Conal

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

[Haskell-cafe] Module import and use in GHC plugin?

2013-05-28 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)? Thanks, - Conal ___ Haskell-Cafe mailing list

[Haskell-cafe] Lambda expressions (core) to categorical form

2013-05-16 Thread Conal Elliott
I want to convert lambda expressions into a vocabulary of monoidal categories, so that they can be given multiple interpretations, including circuit generation and timing analysis, and hopefully some other far-out alternatives (3D visualization, animated evaluation, etc). More specifically, I want

Re: [Haskell-cafe] Constrained Category, Arrow, ArrowChoice, etc?

2013-05-09 Thread Conal Elliott
superb and I'd love to learn more! greetings, Sjoerd On May 8, 2013, at 12:09 AM, Conal Elliott co...@conal.net wrote: I'm using a collection of classes similar to Category, Arrow, ArrowChoice, etc (though without arr and with methods like fst, snd, dup, etc). I think I need some associated

Re: [Haskell-cafe] Categories (cont.)

2013-05-08 Thread Conal Elliott
Hi Wren, Have you taken this constrained categories experiment further, particularly for adding products? As I mentioned in a haskell-cafe note yesterday, I tried and got a frightening proliferation of constraints when defining method defaults and utility functions (e.g., left- or

[Haskell-cafe] Constrained Category, Arrow, ArrowChoice, etc?

2013-05-07 Thread Conal Elliott
I'm using a collection of classes similar to Category, Arrow, ArrowChoice, etc (though without arr and with methods like fst, snd, dup, etc). I think I need some associated constraints (via ConstraintKinds), so I've tried adding them. However, I'm getting terribly complex multiplication of these

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: [Haskell-cafe] Instances for continuation-based FRP

2013-04-24 Thread Conal Elliott
, they do not seem to be applicable for things that lack a denotation, such as IO. Maybe it is a question of how to relate denotational semantics to operational ones? Hans On 24 apr 2013, at 02:18, Conal Elliott wrote: Hi Hans, Do you have a denotation for your representation (a specification

Re: [Haskell-cafe] Instances for continuation-based FRP

2013-04-24 Thread Conal Elliott
Hi Jared, Oh -- does Elm have a denotational semantics? I haven't heard of one. I just now skimmed the informal description of the Signal typehttp://elm-lang.org/docs/Signal/Signal.elm, and from the reference to updates in the description of merge, it sound like whatever semantics it might have,

Re: [Haskell-cafe] Instances for continuation-based FRP

2013-04-24 Thread Conal Elliott
The intuition intrigues me. If, upon inspection, it survives morphs into something else, I'd like to hear about it. Good luck! -- Conal The object of mathematical rigor is to sanction and legitimize the conquests of intuition, and there was never any other object for it. - Jacques Hadamard I

Re: [Haskell-cafe] Instances for continuation-based FRP

2013-04-23 Thread Conal Elliott
Hi Hans, Do you have a denotation for your representation (a specification for your implementation)? If so, it will likely guide you to exactly the right type class instances, via the principle of type class morphismshttp://conal.net/papers/type-class-morphisms/(TCMs). If you don't have a

Re: [Haskell-cafe] Prolog-style patterns

2013-04-08 Thread Conal Elliott
Hi Jan, What you're suggesting is called non-linear patterns, and it's a perfectly sensible, well-defined feature in a language with pattern-matching. As you point out, non-linearity allows for more direct succinct programming. I've often wished for this feature when writing optimizations on

Re: [Haskell-cafe] Optimizing Fold Expressions

2013-04-01 Thread Conal Elliott
You can use a general fold and unfold, without any type-specific programming if you re-express Expr as the least fixed point of its underlying base functor: data ExprF a = Add a a | Sub a a | Mul a a | Eq a a | B Bool | I Int deriving (Show,Functor) data Expr = Fix ExprF Then use the

Re: [Haskell-cafe] ANN: data-fix-cse -- Common subexpression elimination for EDSLs

2013-02-22 Thread Conal Elliott
On Tue, Feb 19, 2013 at 9:28 PM, Anton Kholomiov anton.kholom...@gmail.comwrote: Do you think the approach can be extended for non-regular (nested) algebraic types (where the recursive data type is sometimes at a different type instance)? For instance, it's very handy to use GADTs to capture

Re: [Haskell-cafe] ANN: data-fix-cse -- Common subexpression elimination for EDSLs

2013-02-19 Thread Conal Elliott
What a delightfully elegant approach to CSE! I've been thinking about CSE for DSELs and about functor fixpoints, but it never occurred to me to put the two together. Do you think the approach can be extended for non-regular (nested) algebraic types (where the recursive data type is sometimes at a

Re: [Haskell-cafe] arrow notation

2013-02-09 Thread Conal Elliott
On Thu, Feb 7, 2013 at 5:41 PM, Ross Paterson r...@soi.city.ac.uk wrote: On Thu, Feb 07, 2013 at 02:49:40PM -0800, Conal Elliott wrote: I make some use of arrow notation, though sadly I often have to avoid it because my (pseudo-)arrows don't have arr. I'd love to see a variant that has

Re: [Haskell-cafe] arrow notation

2013-02-07 Thread Conal Elliott
Hi Ross, I make some use of arrow notation, though sadly I often have to avoid it because my (pseudo-)arrows don't have arr. I'd love to see a variant that has restricted expressiveness in exchange for arr-freeness. -- Conal On Thu, Feb 7, 2013 at 6:08 AM, Ross Paterson r...@soi.city.ac.uk

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

Re: [Haskell-cafe] 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-us...@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

[Haskell-cafe] 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: [Haskell-cafe] 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: [Haskell-cafe] 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: 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

Fundeps and type equality

2012-12-25 Thread Conal Elliott
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 that the `a - ta` functional dependency would suffice to prove that `ta ~ tb`, but Pixie/Bug1.hs:9:7: Could

Re: [Haskell-cafe] arr considered harmful

2012-12-21 Thread Conal Elliott
Oh, I see Ross's trick. By quantifying over the domain range types, they can later be specialized to analysis-time types (like circuit labels) or to run-time types (like Boolean or Integer). On Thu, Dec 20, 2012 at 4:55 PM, Conal Elliott co...@conal.net wrote: If you require the circuit

Re: [Haskell-cafe] arr considered harmful

2012-12-21 Thread Conal Elliott
generalized arrows? http://www.cs.berkeley.edu/~megacz/garrows/ -- Kim-Ee On Fri, Dec 21, 2012 at 7:55 AM, Conal Elliott co...@conal.net wrote: If you require the circuit to be parametric in the value types, you can limit the types of function you can pass to arr to simple plumbing. See

Re: [Haskell-cafe] arr considered harmful

2012-12-20 Thread Conal Elliott
If you require the circuit to be parametric in the value types, you can limit the types of function you can pass to arr to simple plumbing. See the netlist example at the end of my Fun of Programming slides ( http://www.soi.city.ac.uk/~ross/papers/fop.html). I'm running into this same

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: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread Conal Elliott
Hi Tillmann. Wow. Lovely and spot on! And I almost never hear monad explanations without wincing. Thanks for sharing. -- Conal On Sun, Sep 16, 2012 at 7:48 AM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Conal Elliott
On Fri, Sep 14, 2012 at 2:18 PM, Andrew Pennebaker wrote: A summary of the changes I've included so far: [...] Another comment: As a declarative language, Haskell manipulates expressions, eventually reducing expressions to values. Huh? In what sense do declarative languages manipulate

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Conal Elliott
Hi Andrew, To save others the search, here's the/a reddit URL: http://www.reddit.com/r/programming/related/nhnyd/nfa_in_a_single_line_of_haskell/. The terribly misleading/mistaken remarks on fib memoization are still in your post. As hammar commented on reddit commenter, you're not memoizing in

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

[Haskell-cafe] Derived Read for records

2012-06-12 Thread Conal Elliott
Someone at work just asked me about the inflexibility of the derived Read instances for records -- specifically that they require fields to be given in the same order as in the type definition and that fields cannot be omitted. I hadn't been aware of these restrictions. A few questions: * Are

Re: [Haskell-cafe] Have you seen this functor/contrafunctor combo?

2012-06-07 Thread Conal Elliott
Oh, yeah. Thanks, Sjoerd. I wonder if there's some way not to require Monad. Some sort of ApplicativeFix instead. Hm. -- Conal On Wed, Jun 6, 2012 at 2:43 PM, Sjoerd Visscher sjo...@w3future.com wrote: If there would be a package where this could be in it would be contravariant[1], but it

[Haskell-cafe] Have you seen this functor/contrafunctor combo?

2012-06-05 Thread Conal Elliott
newtype Q p a = Q (p a - a) instance ContraFunctor p = Functor (Q p) where fmap h (Q w) = Q (h . w . cmap h) using cmap for contravariant map. For instance, p a = u - a. instance ContraFunctor p = Applicative (Q p) where pure a = Q (pure a) Q fs * Q as = Q (\ r - let f =

Re: [Haskell-cafe] I Need a Better Functional Language!

2012-04-12 Thread Conal Elliott
Agreed. The original note confuses programs (syntax) with functions (semantics). -- Conal On Thu, Apr 5, 2012 at 8:52 AM, Dan Doel dan.d...@gmail.com wrote: On Thu, Apr 5, 2012 at 10:14 AM, Grigory Sarnitskiy sargrig...@ya.ru wrote: First, what are 'functions' we are interested at? It can't

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-21 Thread Conal Elliott
This general applicative pattern for numbers is packed up in the applicative-numbers package [1]. In addition to Ralf's paper, there's a discussion in section 10 of *Denotational design with type class morphisms* [2] and an application in sections 2 4 of *Beautiful differentiation* [3]. [1]:

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:

  1   2   3   4   5   6   >