Re: [Haskell-cafe] Un-memoization

2012-05-08 Thread oleg
Victor Miller wrote: > I was writing a Haskell program which builds a large labeled binary tree > and then does some processing of it, which is fold-like. In the actual > application that I have in mind the tree will be *huge*. If the whole tree > is kept in memory it would probably take up 100'

Re: [Haskell-cafe] [Q] multiparam class undecidable types

2012-05-08 Thread oleg
> | instance (Table a c, Show c) => Show a where > I would have thought that there is on overlap: the instance in my code > above defines how to show a table if the cell is showable; No, the instance defines how to show values of any type; that type must be an instance of Table. There is no `if'

[Haskell-cafe] [Q] multiparam class undecidable types - how to get this example to typecheck?

2012-05-08 Thread Matthias Fischmann
Hi everybody, I am torturing the ghc type inference extensions, and I think i managed to break something, either in ghc or (more likely) in my brain: | {-# language FlexibleInstances, MultiParamTypeClasses, UndecidableInstances #-} | | module Main | where | | class Table table cell where |

[Haskell-cafe] LLVM M.D. source code?

2012-05-08 Thread Greg Fitzgerald
A paper, LLVM M.D.: A Denotational Translation Validator, mentions the source code for LLVM M.D is available here: http://llvm-md.seas.harvard.edu/ I can't seem to spot it there or on Hackage. Anyone seen it? Thanks, Greg ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] anyone else driven mad by trying to setup a gmp free version of haskell platform?

2012-05-08 Thread Greg Fitzgerald
> can we build a version of the compiler that loads [GMP] via dlopen on demand? An explanation from well-typed: http://www.well-typed.com/blog/32 But that was ~3 years ago. Anybody still looking at possible solutions? Maintaining the INTEGER_SIMPLE branch of GHC, minor as it is, is still a pai

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-08 Thread Sebastien Zany
Er, sorry – "fix = id" should be "fix = Fix". On Tue, May 8, 2012 at 5:24 PM, Sebastien Zany < sebast...@chaoticresearch.com> wrote: > Hmm, I don't understand how that would work. > > > I wish I could define something like this: > > class (Functor f) => Fixpoint f x | x -> f where > fix :: x

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-08 Thread Sebastien Zany
Hmm, I don't understand how that would work. I wish I could define something like this: class (Functor f) => Fixpoint f x | x -> f where fix :: x -> Fix f instance (Functor f) => Fixpoint f (forall a. f a) where fix = id instance (Functor f, Fixpoint f x) => Fixpoint f (f x) where

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread Tony Morris
On 09/05/12 03:49, MigMit wrote: > On 8 May 2012, at 21:42, Felipe Almeida Lessa wrote: > >> On Tue, May 8, 2012 at 2:36 PM, MigMit wrote: >>> Hi café, a quick question. >>> >>> Is there a somewhat standard class like this: >>> >>> class Something c where >>>unit :: c () () >>>pair :: c x

Re: [Haskell-cafe] bytestring, array and Safe Haskell

2012-05-08 Thread Francesco Mazzoli
On 08/05/12 21:45, Austin Seipp wrote: The reasoning is outlined in the user manual here: http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/safe-haskell.html#safe-inference Yes, I was looking at that while writing that message. Mine wasn't that much a complaint regarding the wrong infere

Re: [Haskell-cafe] bytestring, array and Safe Haskell

2012-05-08 Thread Austin Seipp
The reasoning is outlined in the user manual here: http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/safe-haskell.html#safe-inference Basically, these modules will compile without error if they were to be compiled with -XSafe enabled. Thus, they are safe-inferred. The check does not scrutini

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread MigMit
That's an interesting idea, thanks. Отправлено с iPad 08.05.2012, в 23:31, Daniel Peebles написал(а): > To expand on that, this class basically allows you to prove your relation c > holds pointwise across arbitrary binary trees, represented by nested tuples > and terminated by ()s. If individ

[Haskell-cafe] bytestring, array and Safe Haskell

2012-05-08 Thread Francesco Mazzoli
Why are http://hackage.haskell.org/packages/archive/bytestring/0.9.2.1/doc/html/Data-ByteString-Unsafe.html and http://hackage.haskell.org/packages/archive/array/0.4.0.0/doc/html/Data-Array-Unsafe.html Safe-inferred? The first one uses inlinePerformIO, so it clearly shouldn't be marked as Sa

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread Daniel Peebles
To expand on that, this class basically allows you to prove your relation cholds pointwise across arbitrary binary trees, represented by nested tuples and terminated by ()s. If individual instances of the class had additional ways of constructing values (i.e., proving the relation for the two type

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread Daniel Peebles
FullBinaryTreeRelation? :P On Tue, May 8, 2012 at 1:36 PM, MigMit wrote: > Hi café, a quick question. > > Is there a somewhat standard class like this: > > class Something c where >unit :: c () () >pair :: c x y -> c u v -> c (x, u) (y, v) > > ? > > I'm using it heavily in my current pro

[Haskell-cafe] Handcranked install of ghc / cabal-install and warning from ghc-pkg check

2012-05-08 Thread Graham Berks
Have installed 7.4.1 ghc and 0.14.0 cabal-install and then did alex, happy & haddock. When I do a ghc-pkg check I get $ ghc-pkg check Warning: haddock-interfaces: /usr/local/Cellar/cabal-install/0.14.0/share/doc/random-1.0.1.1/html/random.haddock doesn't exist or isn't a file Warning: haddock

[Haskell-cafe] Can Haskell outperform C++?

2012-05-08 Thread Isaac Gouy
2012/5/8 Silvio Frischknecht >Also I challenge anyone to improve one of the haskell programs there. >It'd be >cool if we could make haskell get a higher rank. I recently >managed to >improve the Fasta algorithm, but not by much. Also I think >the benchmarks >don't use llvm flag. It says somewhe

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread MigMit
On 8 May 2012, at 21:42, Felipe Almeida Lessa wrote: > On Tue, May 8, 2012 at 2:36 PM, MigMit wrote: >> Hi café, a quick question. >> >> Is there a somewhat standard class like this: >> >> class Something c where >>unit :: c () () >>pair :: c x y -> c u v -> c (x, u) (y, v) >> >> ? >>

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread Felipe Almeida Lessa
On Tue, May 8, 2012 at 2:36 PM, MigMit wrote: > Hi café, a quick question. > > Is there a somewhat standard class like this: > > class Something c where >    unit :: c () () >    pair :: c x y -> c u v -> c (x, u) (y, v) > > ? > > I'm using it heavily in my current project, but I don't want to rep

[Haskell-cafe] Unit and pair

2012-05-08 Thread MigMit
Hi café, a quick question. Is there a somewhat standard class like this: class Something c where unit :: c () () pair :: c x y -> c u v -> c (x, u) (y, v) ? I'm using it heavily in my current project, but I don't want to repeat somebody else's work, and it seems general enough to be de

[Haskell-cafe] anyone else driven mad by trying to setup a gmp free version of haskell platform?

2012-05-08 Thread Anatoly Yakovenko
i would really like to be able to ship haskell based linux binaries, but the gmp dependency makes it virtually impossible. so what version of host os, host ghc, and haskell-platform sources are known to build a working compiler? any reason why the dependency on gmp is static? are the interfaces

[Haskell-cafe] Annotaing abstract syntax trees

2012-05-08 Thread José Romildo Malaquias
Hello. I am reading Martijn's MSc Thesis "Generic Selections of Subexpressions", where one can found some discussions about annotating abstract syntax trees (AST). In order to follow the discussion I wrote the attached Haskell program, which is an interpreter for an simple typed expression langua

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-08 Thread Daniël de Kok
On May 8, 2012, at 12:18 PM, Yves Parès wrote: > Would've expected always shorter code It's not so surprising if you consider that some of the programs are practically imperative programs in Haskell. To give an example: http://shootout.alioth.debian.org/u32/program.php?test=fannkuchredux&lang=gh

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-08 Thread Simon Marlow
On 06/05/2012 07:40, Janek S. wrote: a couple of times I've encountered a statement that Haskell programs can have performance comparable to programs in C/C++. I've even read that thanks to functional nature of Haskell, compiler can reason and make guarantess about the code and use that knowledge

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-08 Thread Yves Parès
One thing that baffles me is the comparison Haskell V. Java: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=ghc&lang2=java Would've expected always shorter code and better performances on average. 2012/5/8 Silvio Frischknecht > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1