Re: Overlapping and incoherent instances

2014-08-11 Thread Twan van Laarhoven
To me, perhaps naively, IncoherentInstances is way more scary than OverlappingInstances. What behavior do these new pragmas have? In particular, will it be an error if there is no single most specific instance? And can the user decide whether it is an error? Twan On 29/07/14 11:11, Simon

Re: Field accessor type inference woes

2013-07-02 Thread Twan van Laarhoven
On 02/07/13 10:57, Simon Peyton-Jones wrote: Here is Plan A: use fundep (or type function) class Has r f t | r f - t where getFld :: r - t instance Has (R a) “foo” (a - a) where .. instance Has S “bar” (forall b. b - b) where ... Lacking (as we still do) impredicative

Re: Common syntax for casing/matching (Re[2]: Call to arms: lambda-case is stuck and needs your help)

2012-07-12 Thread Twan van Laarhoven
On 2012-07-12 23:48, Bulat Ziganshin wrote: another interesting feature may be ruby-style matching defined by execution of special function `match` instead of pattern matching: switch var of 1+1 - print var==2 [5..10] - print var in [5..10] (20) - print var20 where (var `match`

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-09 Thread Twan van Laarhoven
On 09/07/12 14:44, Simon Marlow wrote: I now think '\' is too quiet to introduce a new layout context. The pressing need is really for a combination of '\' and 'case', that is single-argument so that we don't have to write parentheses. I think '\case' does the job perfectly. If you want a

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Twan van Laarhoven
On 05/07/12 17:22, wagne...@seas.upenn.edu wrote: Well, for what it's worth, my vote goes for a multi-argument \case. I find the comment on the wiki page about mistyping \case Just x instead of \case (Just x) a lot a bit disingenuous, since you already need these parens with today's lambda.

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Twan van Laarhoven
On 2012-07-05 23:04, Edward Kmett wrote: A similar generalization can be applied to the expression between case and of to permit a , separated list of expressions so this becomes applicable to the usual case construct. A naked unparenthesized , is illegal there currently as well. That would

Re: How unsafe are unsafeThawArray# and unsafeFreezeArray#

2012-03-09 Thread Twan van Laarhoven
On 2012-03-09 02:13, Johan Tibell wrote: Hi, I just ran across some code that calls unsafeThawArray#, writeArray#, and unsafeFreezeArray#, in that order. How unsafe is that? Quick follow up question: Are unsafeThawArray# and unsafeFreezeArray# guaranteed to not make a copy? I.e. are these

Re: Abstracting over things that can be unpacked

2012-03-03 Thread Twan van Laarhoven
On 03/03/12 01:40, Johan Tibell wrote: Hi all, These ideas are still in very early stages. I present them here in hope of starting a discussion. (We discussed this quite a bit at last year's ICFP, I hope this slightly different take on the problem might lead to new ideas.) I think the next big

Re: Holes in GHC

2012-01-26 Thread Twan van Laarhoven
On 25/01/12 16:21, Thijs Alkemade wrote: Hello! ... Examples: *Main :t [__, ()] tcRnExpr2: [(interactive:1:2-3, ())] [__, ()] :: [()] *Main :t map __ __ tcRnExpr2: [(interactive:1:5-6, a0 - b), (interactive:1:8-9, [a0])] map __ __ :: [b] You can do something similar right now with

Re: Revert a CAF?

2011-12-07 Thread Twan van Laarhoven
On 06/12/11 18:48, wren ng thornton wrote: So, I have an optimization/internals question. Does the GHC API have any hooks for being able to revert a CAF to the original expression, thus discarding the previously computed result? ... I could hack something together based on unsafePerformIO and

Re: Quasi quoting

2010-02-02 Thread Twan van Laarhoven
Max Bolingbroke wrote: 2010/2/2 Isaac Dupree m...@isaac.cedarswampstudios.org: I'm concerned in both your proposals, that single-letter names like t and d are common function parameters, thus possibly producing - shadowing warnings for all such functions in modules that happen to use TH -

Deriving Functor

2008-12-06 Thread Twan van Laarhoven
Hello Ghc people, I have been working on adding support for derive Functor to ghc. I have a patch that mostly works, but there are some problems: 1. Ghc reports the correct instance when I use -ddump-deriv:, but that instance is not subsequenctly used. Instead I get a warning like:

'backslash' build problems on windows

2008-01-15 Thread Twan van Laarhoven
I am having some problems with the latest builds of GHC on windows. For some reason ghc has decided to use backslashes in filenames. This leads to problems when building the stage libraries and the stage 2 compiler. I run the scripts from a mingw bash shell. The following problems occur: -

Re: FilePath causes problems (was: 'backslash' build problems on windows)

2008-01-15 Thread Twan van Laarhoven
Twan van Laarhoven wrote: I am having some problems with the latest builds of GHC on windows. For some reason ghc has decided to use backslashes in filenames. This leads to problems when building the stage libraries and the stage 2 compiler. I run the scripts from a mingw bash shell. After

GHC source code improvement ideas

2008-01-03 Thread Twan van Laarhoven
Hello GHC people, I was trying my hand at some GHC hacking, and I couldn't help but notice that much of the code looks (IMHO) horrible. There are some things that look as if they haven't been touched since the Haskell 1.3 days. The most striking is the use of `thenXX` instead of do notation.

Re: [Haskell-cafe] class default method proposal

2007-12-12 Thread Twan van Laarhoven
Simon Peyton-Jones wrote: Concerning (b) here's a suggestion. As now, require that every instance requires an instance declaration. So, in the main example of http://haskell.org/haskellwiki/Class_system_extension_proposal, for a new data type T you'd write instance Monad T where

Generalized newtype deriving 6.6 vs. 6.8

2007-11-03 Thread Twan van Laarhoven
Hello, I noticed there is a difference in generalized newtype deriving between 6.6 and 6.8. In GHC 6.4.1 the following: {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Control.Monad.Error newtype MyMonad m a = MyMonad (m a) deriving (Monad, MonadError String) correctly gives a