Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-08 Thread Reiner Pope
I've not been following this thread very closely, but it seems like what you're trying to do may be related to Geoffrey Mainland's work on SIMD support in GHC. See [1] for his "SIMD-enabled version of the vector library". He's also written some blog posts about this [2]. Reiner [1] https://github

[Haskell-cafe] Helper classes for Generics

2012-03-11 Thread Reiner Pope
Hi all, I've been playing with GHC's new generics features (see http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html). All the documentation I've seen suggests creating a "helper class" -- for instance, the GSerialize class in the above link -- on which one defines

Re: [Haskell-cafe] Analyzing slow performance of a Haskell program

2011-08-08 Thread Reiner Pope
On 9 August 2011 10:06, Bryan O'Sullivan wrote: > On Mon, Aug 8, 2011 at 9:24 AM, Chris Yuen wrote: > >> >> For reference I have asked the same question on StackOverflow. One person >> suggested that the reason might be that Int64 on Windows is broken ( >> http://stackoverflow.com/questions/69709

Re: [Haskell-cafe] yi + cabal-dev

2011-06-21 Thread Reiner Pope
I've not tried this myself, but you could look at the -fhacking flag. It's documented in the README.md file, which claims it compiles yi without dynamic reconfiguration, and instead uses HackerMain.hs as your (static) configuration file. Reiner On 22/06/11 11:55, Alex Rozenshteyn wrote: I'm

Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-06 Thread Reiner Pope
because I don't want to upload a new package to Hackage every time...) All the best, Reiner On 6 November 2010 19:24, wren ng thornton wrote: > On 11/6/10 3:13 AM, Ivan Lazar Miljenovic wrote: >> >> On 6 November 2010 17:52, Reiner Pope  wrote: >>> >>> A

Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-05 Thread Reiner Pope
Ah, I hadn't thought of that. But doesn't the version of GHC change much more often than the version of base does? Reiner On 6 November 2010 03:49, Ozgur Akgun wrote: > AFAIK, the way to do this is putting constraints on the base package. > > On 5 November 2010 14:59,

[Haskell-cafe] Compiler constraints in cabal

2010-11-05 Thread Reiner Pope
Hi, I have a library, hmatrix-static, on Hackage. Version 0.3 (the current version) compiles with ghc-6.12. Let's say I want to upgrade my library using new features in ghc-7.0, and then release these upgrades as version 0.4. Is there any way to state in my cabal file that this new version will n

Re: [Haskell-cafe] proposal: point free case expressions

2009-11-05 Thread Reiner Pope
2009/11/5 Sebastiaan Visser : > Hello all, > > Wouldn't it be nice if we could write point free case statements? > > I regularly find myself writing down something like this: > >> myFunc = anotherFunc $ \x -> case x of >>                                Left err -> print err >>                      

[Haskell-cafe] SpecConstr difficulties

2009-07-20 Thread Reiner Pope
Hi everyone, I've been having some trouble getting SpecConstr to work as I want it to. The following example (see end of email) came up in some code I was playing around with. The loops g1 and g2 both compute the same thing: the maximum element of the "list" (which has been fused away) of numbers

Re: [Haskell-cafe] Stream-fusion without the lists

2009-05-13 Thread Reiner Pope
2009/5/13 Don Stewart : > rl: >> On 12/05/2009, at 14:45, Reiner Pope wrote: >> >>> The Stream datatype seems to be much better suited to representing >>> loops than the list datatype is. So, instead of programming with the >>> lists, why don't we

[Haskell-cafe] Stream-fusion without the lists

2009-05-12 Thread Reiner Pope
Hi everyone, With stream-fusion, we can write functions which construct and destruct lists, such as (this is the main example from the Stream Fusion paper[1]) f :: Int -> Int f n = sum [k * m | k <- [1..n], m <- [1..k]] and the rewrite rules in stream-fusion replace these operations on lists w

Re: [Haskell-cafe] ANN: hmatrix-static: statically-sized linear algebra

2009-04-11 Thread Reiner Pope
eers, Reiner [1] http://okmij.org/ftp/Haskell/types.html#Prepose On Sun, Apr 12, 2009 at 12:18 PM, Xiao-Yong Jin wrote: > Reiner Pope writes: > >> Hi everyone, >> >> I am pleased to announce hmatrix-static[1], a thin wrapper over >> Alberto Ruiz's excellent hmatr

[Haskell-cafe] ANN: hmatrix-static: statically-sized linear algebra

2009-04-11 Thread Reiner Pope
tic can be installed by $ cabal install hmatrix-static I would be very interested in your feedback, so please try it out. Kind regards, Reiner Pope [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmatrix-static [2] http://www.hmatrix.googlepages.com/ [3] http://www.hmatrix.googl

Re: [Haskell-cafe] What are side effects in Haskell?

2009-01-02 Thread Reiner Pope
2009/1/3 Conal Elliott : > Are there other thoughts & insights about the source of the idea that > "everything is a function"? > Lazy evaluation can make values seem like functions, given that laziness can be modeled in a strict imperative language by 0-argument functions. Also, in an uncurried l

Re: [Haskell-cafe] Is this related to monomorphism restriction?

2008-12-20 Thread Reiner Pope
On Sun, Dec 21, 2008 at 10:28 AM, Maurí­cio wrote: > Hi, > > Why isn't the last line of this code allowed? > > f :: (TestClass a) => a -> Integer > f = const 1 > a = (f,f) > g = fst a > > The only thing I can think about is monomorphism > restriction, but it's allowed (or even the third > line wou

Re: [Haskell-cafe] Parsec and type level numerals

2008-12-14 Thread Reiner Pope
On Sun, Dec 14, 2008 at 6:54 AM, David Menendez wrote: > 2008/12/13 Nathan Bloomfield : >> I want to be able to parse a string of digits to a type level numeral as >> described in the Number parameterized types paper. After fiddling with the >> problem for a while, I'm not convinced it's possible-

Re: [Haskell-cafe] Fixity parsing, Template Haskell

2008-11-23 Thread Reiner Pope
On Mon, Nov 24, 2008 at 12:39 AM, Niklas Broberg <[EMAIL PROTECTED]> wrote: >> I want this information to be used somehow when creating the Template >> Haskell AST, so that the operators used have the correct fixities. If >> I use HSE for parsing Haskell expressions, then I want it to tell me >> wh

Re: [Haskell-cafe] Fixity parsing, Template Haskell

2008-11-23 Thread Reiner Pope
ners make. > > Regards, > > John A. De Goes > N-BRAIN, Inc. > http://www.n-brain.net > [n minds are better than n-1] > > On Nov 22, 2008, at 9:02 AM, Reiner Pope wrote: > >> It seems to me that fixity information behaves more like semantics >> than like syntax

Re: [Haskell-cafe] Fixity parsing, Template Haskell

2008-11-22 Thread Reiner Pope
It seems to me that fixity information behaves more like semantics than like syntax. For instance, fixities may be imported, and obey namespacing rules. Knowing and correctly handling these rules seems beyond the scope of a mere parser: I would hope that a single Haskell file could be parsed withou

[Haskell-cafe] Re: Fixity parsing, Template Haskell

2008-11-21 Thread Reiner Pope
solution is just to forbid unparenthesised infix expressions in the quasiquote language. Cheers, Reiner On Fri, Nov 21, 2008 at 11:59 PM, Reiner Pope <[EMAIL PROTECTED]> wrote: > This post follows on from a discussion about a month ago, called > "Haskell Syntax Inside Quasiquote&q

[Haskell-cafe] Fixity parsing, Template Haskell

2008-11-21 Thread Reiner Pope
olution would be to forbid unparenthesised expressions in my quasiquoter. Then, parsing can proceed correctly without knowing the fixities. This would be easiest to do if haskell-src-exts changed its AST in a similar way to described above for Template Haskell. Any thoughts? Cheers, Reiner Pope

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-18 Thread Reiner Pope
ATs are "Associated Types", aka Type Families. They can be found in the GHC 6.10 manual here: http://haskell.org/ghc/docs/6.10.1/html/users_guide/type-families.html As a starting point, you might want to try something like: class Complex c where type RealType c realPart :: c -> RealType c

[Haskell-cafe] Statically dimension-checked hmatrix

2008-11-17 Thread Reiner Pope
Hi, What is the situation regarding statically dimension-checked linear algebra libraries? It seems that Frederik Eaton was working on one in 2006 (see the paper "Statically typed linear algebra in Haskell"), and he produced the Vectro library from this, based on GSLHaskell. Are there any more re

Re: [Haskell-cafe] Getting rid of functional dependencies with type proxies

2008-11-13 Thread Reiner Pope
On Thu, Nov 13, 2008 at 9:09 PM, Tobias Bexelius <[EMAIL PROTECTED]> wrote: > Hi, > > some time ago I asked about a problem I had with functional dependencies > conflicting when using overlapping instances in a code like this: > > > {-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances > -fa

Re: [Haskell-cafe] Haskell syntax inside QuasiQuote

2008-10-28 Thread Reiner Pope
On Tue, Oct 28, 2008 at 9:44 PM, Niklas Broberg <[EMAIL PROTECTED]> wrote: > On Tue, Oct 28, 2008 at 7:56 AM, Reiner Pope <[EMAIL PROTECTED]> wrote: >> I've tried it out and it looks good so far. I had to fiddle with >> haskell-src-ext's .cabal file to get it

Re: [Haskell-cafe] Haskell syntax inside QuasiQuote

2008-10-27 Thread Reiner Pope
ExpQ > transformE = return > > transformP :: Pat -> PatQ > transformP = return > > > I'll post updates as I add to the pkg over the next few days. > > Cheers, > Matt > > > > On 1

Re: [Haskell-cafe] Cabal and GHCi

2008-10-27 Thread Reiner Pope
On Tue, Oct 28, 2008 at 2:23 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > reiner.pope: >>Hi, >> >>Is there a way to use GHCi with code which is cabal-buildable but not "ghc >>--make"-able? The emacs haskell-mode makes a pretty good guess by :cd-ing >>into the directory with the .ca

[Haskell-cafe] Cabal and GHCi

2008-10-26 Thread Reiner Pope
Hi, Is there a way to use GHCi with code which is cabal-buildable but not "ghc --make"-able? The emacs haskell-mode makes a pretty good guess by :cd-ing into the directory with the .cabal file; however, if there is a different source-dir this doesn't work so well. A number of more advanced cabal

Re: [Haskell-cafe] Haskell syntax inside QuasiQuote

2008-10-21 Thread Reiner Pope
It sounds like you're doing exactly what I'm looking for. I look forward to more. Reiner On Tue, Oct 21, 2008 at 4:28 PM, Matt Morrow <[EMAIL PROTECTED]> wrote: > > Is there a simple way to do this, i.e. using existing libraries? > > Yes indeed. I'll be traveling over the next two days, and am s

[Haskell-cafe] Haskell syntax inside QuasiQuote

2008-10-20 Thread Reiner Pope
Hi, I have written a toy fixed-length-vector quasiquoter, so that you can write [$vec|1,2|] which has its type inferred as (Vec (S (S Z))) and you can write mkVec :: Double -> Vec (S (S (S Z))) mkVec x = [$vec|1,2,x|] However, these above examples essentially demonstrate the entire syntax it s

Re: [Haskell-cafe] Hoogle? [Stacking monads]

2008-10-08 Thread Reiner Pope
The syntax is for the implicit parameter extension[1]. I think you would write your example as foo (undefined :: Bar x) ?z :: Bar y Then querying the type of that whole expression with :t will list ?z's type in the expression's constraints. (Of course, you should turn off the monomorphism restric

[Haskell-cafe] Re: having fun with GADT's

2008-09-20 Thread Reiner Pope
Anatoly Yakovenko gmail.com> writes: > > I dont remember where i saw it, but i think someone had an example of > a list whose type is the maximum element in the list. I've been > trying to reproduce that with GADT's. > > data One = One > data Two = Two > data Three = Three > > data MaxList t