Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-05-07 Thread Gábor Lehel
On Mon, Apr 29, 2013 at 8:35 PM, Duncan Coutts duncan.cou...@googlemail.com wrote: On Mon, 2013-04-29 at 20:19 +0200, Gábor Lehel wrote: Thanks for the explanation. I looked at your thesis previously, but only read through a couple of sections (including the one about concatMap). I might

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-05-07 Thread Gábor Lehel
On Mon, Apr 29, 2013 at 8:40 PM, Dan Doel dan.d...@gmail.com wrote: On Mon, Apr 29, 2013 at 10:05 AM, Duncan Coutts duncan.cou...@googlemail.com wrote: On Thu, 2013-04-25 at 00:52 +0200, Gábor Lehel wrote: On Wed, Apr 24, 2013 at 7:56 PM, Bryan O'Sullivan b...@serpentine.com wrote

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-29 Thread Gábor Lehel
On Mon, Apr 29, 2013 at 4:05 PM, Duncan Coutts duncan.cou...@googlemail.com wrote: On Thu, 2013-04-25 at 00:52 +0200, Gábor Lehel wrote: On Wed, Apr 24, 2013 at 7:56 PM, Bryan O'Sullivan b...@serpentine.com wrote: On Wed, Apr 24, 2013 at 10:47 AM, Duncan Coutts duncan.cou

Re: [Haskell-cafe] Why were datatype contexts removed instead of fixing them?

2013-04-25 Thread Gábor Lehel
I've wondered this too. What would have been wrong with a simple source-to-source translation, where a constraint on the datatype itself translates to the same constraint on each of its constructors? Perhaps it would be unintuitive that you would have to pattern match before gaining access to the

Re: [Haskell-cafe] Why were datatype contexts removed instead of fixing them?

2013-04-25 Thread Gábor Lehel
:: C a = a - Foo a is an illegal definition. It can only be translated to a non-newtype data declaration, which changes the semantics. On Thu, Apr 25, 2013 at 10:35 AM, Gábor Lehel illiss...@gmail.com wrote: I've wondered this too. What would have been wrong with a simple source-to-source

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-24 Thread Gábor Lehel
On Wed, Apr 24, 2013 at 7:56 PM, Bryan O'Sullivan b...@serpentine.comwrote: On Wed, Apr 24, 2013 at 10:47 AM, Duncan Coutts duncan.cou...@googlemail.com wrote: I address it briefly in my thesis [1], Section 4.8.2. I think it's a fundamental limitation of stream fusion. See also concat,

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-24 Thread Gábor Lehel
the final consumer is recursive. concat [[1,2,3],[4,5],[],[6,7]] probably looks something like: Yield 1, Yield 2, Yield 3, Skip, Yield 4, Yield 5, Skip, Skip, Yield 6, Yield 7, Skip, Done -- Dan On Wed, Apr 24, 2013 at 6:52 PM, Gábor Lehel illiss...@gmail.com wrote: On Wed, Apr

Re: [Haskell-cafe] a library for abstract algebra?

2013-04-18 Thread Gábor Lehel
http://hackage.haskell.org/package/algebra -- Your ship was destroyed in a monadic eruption. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] newtype a Constraint?

2013-03-12 Thread Gábor Lehel
{-# LANGUAGE UndecidableInstances #-} class OldConstraint a = NewtypedConstraint a instance OldConstraint a = NewtypedConstraint a perhaps? Nice thing is you don't even need to do wrapping/unwrapping, like you do with data newtypes. On Tue, Mar 12, 2013 at 2:18 PM, Roman Cheplyaka

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-18 Thread Gábor Lehel
On Tue, Dec 18, 2012 at 11:03 PM, Christopher Howard The original link I gave http://www.haskellforall.com/2012_08_01_archive.html purposely skipped over any discussion of objects, morphisms, domains, and codomains. The author stated, in his first example, that Haskell functions are a

Re: [Haskell-cafe] Equality test between types that returns type-level Bool ?

2012-11-25 Thread Gábor Lehel
On Sun, Nov 25, 2012 at 9:36 AM, Takayuki Muranushi muranu...@gmail.com wrote: Is it possible to write type family SameType a b :: Bool which returns True if a and b are the same type, and False otherwise? I encountered this problem when I was practicing promoted lists and tuples in

Re: [Haskell-cafe] Motion to unify all the string data types

2012-11-10 Thread Gábor Lehel
On Sat, Nov 10, 2012 at 4:00 AM, Johan Tibell johan.tib...@gmail.com wrote: As for type classes, I don't think we use them enough. Perhaps because Haskell wasn't developed as an engineering language, some good software engineering principles (code against an interface, not a concrete

Re: [Haskell-cafe] Class constraints with free type variables and fundeps

2012-09-29 Thread Gábor Lehel
On Fri, Sep 28, 2012 at 6:36 PM, Francesco Mazzoli f...@mazzo.li wrote: I would expect this to work, maybe with some additional notation (a la ScopedTypeVariables) {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} class Foo a b | a - b class

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

2012-07-08 Thread Gábor Lehel
On Sun, Jul 8, 2012 at 3:05 AM, Nicolas Trangez nico...@incubaid.com wrote: On Sun, 2012-07-08 at 01:40 +0200, Gábor Lehel wrote: unsafeXorSSE42 :: (Storable a, SV.AlignedToAtLeast SV.A16 o1, SV.Alignment o1, SV.AlignedToAtLeast SV.A16 o2, SV.Alignment o2, SV.AlignedToAtLeast

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

2012-07-07 Thread Gábor Lehel
On Sat, Jul 7, 2012 at 9:13 PM, Nicolas Trangez nico...@incubaid.com wrote: - Currently Alignment phantom types (e.g. A8 and A16) are not related to each other: a function (like Data.Vector.SIMD.Algorithms.unsafeXorSSE42) can have this signature: unsafeXorSSE42 :: Storable a = SV.Vector

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

2012-07-07 Thread Gábor Lehel
On Sat, Jul 7, 2012 at 9:59 PM, Gábor Lehel illiss...@gmail.com wrote: class AlignedToAtLeast n a instance AlignedToAtLeast A1 A1 instance AlignedToAtLeast A4 A1 instance AlignedToAtLeast A4 A4 instance AlignedToAtLeast A8 A1 instance AlignedToAtLeast A8 A4 instance AlignedToAtLeast A8 A8

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

2012-07-07 Thread Gábor Lehel
On Sun, Jul 8, 2012 at 12:21 AM, Nicolas Trangez nico...@incubaid.com wrote: On Sat, 2012-07-07 at 21:59 +0200, Gábor Lehel wrote: An alternative solution is to encode all of the alignments in unary, which is more general; if they're all going to be a power of two you can store just

Re: [Haskell-cafe] Safe Haskell at the export symbol granularity?

2012-06-17 Thread Gábor Lehel
. I wrote some example code and a note about this stuff: https://github.com/dterei/SafeHaskellExamples/tree/master/typeclasses Cheers, David On 18 May 2012 06:58, Gábor Lehel illiss...@gmail.com wrote: I have a related-seeming question: Say I have a type class with methods, and some

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-09 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 2:25 PM, Gábor Lehel illiss...@gmail.com wrote: The encoded version would be: instance (f a b) = FMap f (HJust a) (HJust b)  where type f :$: (HJust a) = HJust b and I think this actually demonstrates a *different* limitation, namely that The RHS of an associated

Re: [Haskell-cafe] Inheritance constraints

2012-06-07 Thread Gábor Lehel
On Thu, Jun 7, 2012 at 1:42 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: Hi cafe! The ConstraintKinds extension makes it possible to create classes of classes, like this: class F c where cfmap :: c f = (a - b) - f a - f b instance F Functor where cfmap = fmap instance F Monad where

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-05 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 4:18 AM, Etienne Laurin etie...@atnnn.com wrote: Thanks for the idea. Here it is. http://hackage.haskell.org/trac/ghc/wiki/TFvsFD I posted my comments on the matter along with many additional comments and examples that I found. Thanks! One part is confusing me. In

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 5:29 PM, Bas van Dijk v.dijk@gmail.com wrote: Hello, I have the following program: -- {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE

Re: [Haskell-cafe] Most Important GHC extensions to learn/use?

2012-06-03 Thread Gábor Lehel
On Fri, Jun 1, 2012 at 4:37 PM, James Cook mo...@deepbondi.net wrote: On Jun 1, 2012, at 6:11 AM, Gábor Lehel wrote: On Fri, Jun 1, 2012 at 6:29 AM, wren ng thornton w...@freegeek.org wrote:    TypeFamilies (aka TFs)        These are really nifty and they're all the rage these days

Re: [Haskell-cafe] Most Important GHC extensions to learn/use?

2012-06-01 Thread Gábor Lehel
On Fri, Jun 1, 2012 at 6:29 AM, wren ng thornton w...@freegeek.org wrote:    TypeFamilies (aka TFs)        These are really nifty and they're all the rage these days. In        a formal sense they're equivalent to fundeps, but in practice        they're weaker than fundeps. Is that still

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-25 Thread Gábor Lehel
On Fri, May 25, 2012 at 7:06 AM, AntC anthony_clay...@clear.net.nz wrote: But it looks like the work SPJ pointed to is using closed style. If all they're trying to do is support HList and similar, I guess that's good enough. I tried to explain all this the best part of a year ago. (Admittedly

Re: [Haskell-cafe] Safe Haskell at the export symbol granularity?

2012-05-18 Thread Gábor Lehel
I have a related-seeming question: Say I have a type class with methods, and some functions implemented on top of it. The class methods are inherently unsafe. Instances of the class are supposed to satisfy some conditions, and if those conditions are met, the functions built on top are safe. So

Re: [Haskell-cafe] Parameterize constraints of existentially quantified types

2012-04-21 Thread Gábor Lehel
On Sat, Apr 21, 2012 at 6:05 PM, Bas van Dijk v.dijk@gmail.com wrote: Hi, I just found out that with the new ConstraintKinds extension we can parameterize the constraint of an existentially quantified type: {-# LANGUAGE KindSignatures, ConstraintKinds, ExistentialQuantification #-}

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

2012-04-05 Thread Gábor Lehel
On Thu, Apr 5, 2012 at 8:59 PM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Paul R wrote: I am curious what are interesting use-cases for that? Symbolic analysis? self-compilers? Optimization. For example, imagine the following definition of function composition:  map f . map

Re: [Haskell-cafe] ANN: generic-deepseq 1.0.0.0

2012-02-20 Thread Gábor Lehel
2012/2/20 José Pedro Magalhães j...@cs.uu.nl: One last issue: Say I have a type like: data T = C !Int Currently GHC Generics can't express the strictness annotation. This means that your deepseq will unnecessarily evaluate the Int (since it will always be evaluated already). It would be nice

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-20 Thread Gábor Lehel
On Mon, Feb 20, 2012 at 4:41 AM, AntC anthony_clay...@clear.net.nz wrote: Folks, I've put my 'Record in Haskell' proposal on the wiki http://hackage.haskell.org/trac/ghc/wiki/Records  as suggestion 5 Declared Overloaded Record Fields. Thanks to the voiciferousness on this thread, dot notation

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-10 Thread Gábor Lehel
On Fri, Feb 10, 2012 at 5:31 AM, Evan Laforge qdun...@gmail.com wrote: You can also enforce invariants, etc.  It would be a shame to have a nice record update syntax only to be discouraged from using it because it would tie you too tightly to the current shape of the data structure.  There

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Gábor Lehel
On Tue, Feb 7, 2012 at 7:23 AM, Mikhail Vorozhtsov mikhail.vorozht...@gmail.com wrote: Even better, you can write type ExistentialWith c e = (Existential e, c ~ ConstraintOf e) instead of class    (Existential e, c ~ ConstraintOf e) = ExistentialWith c e instance (Existential e, c ~

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Gábor Lehel
2012/2/7 Mikhail Vorozhtsov mikhail.vorozht...@gmail.com: Ah, sorry, I got sloppy. Have you encountered situations where partial application of such constraint aliases becomes a problem? In the particular case of the Existential class I'm not sure (it's hard to imagine a real-world application

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-06 Thread Gábor Lehel
those Kind extensions that enable you to pass a typeclass as a type parameter... However, have you considered putting the Data.Exists.Default module in a separate package? That would reduce the dependencies for those who just need Exists and Existential. 2012/2/5 Gábor Lehel illiss...@gmail.com

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-06 Thread Gábor Lehel
2012/2/6 Tillmann Rendel ren...@informatik.uni-marburg.de: Hi, Gábor Lehel wrote: data E = forall a. C a = E a I don't know if anyone's ever set out what the precise requirements are for a type class method to be useful with existentials. More than you seem to think. For example

[Haskell-cafe] ANN: exists-0.1

2012-02-05 Thread Gábor Lehel
There's a common pattern in Haskell of writing: data E where E :: C a = a - E also written data E = forall a. C a = E a I recently uploaded a package to Hackage which uses the new ConstraintKinds extension to factor this pattern out into an Exists type parameterized on the constraint, and also

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread Gábor Lehel
On Fri, Feb 3, 2012 at 10:30 AM, AntC anthony_clay...@clear.net.nz wrote: You seem to be not alone in wanting some special syntax for applying field selectors (see other posts on this thread). H98 field selectors don't do this, they're just functions. And there's me bending over backwards to

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread Gábor Lehel
On Fri, Feb 3, 2012 at 2:37 PM, AntC anthony_clay...@clear.net.nz wrote: Do people really write code with huge pile-ups of functions prefix upon prefix? Wouldn't that be confusing even when it's unidirectional? Not really. Pipeline-like chains where you apply each function to the result of the

Re: [Haskell-cafe] [Haskell Cafe] strict version of Haskell - does it exist?

2012-01-31 Thread Gábor Lehel
On Tue, Jan 31, 2012 at 2:51 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On the other hand, a designed-to-be-strict language-and-libraries with close-to-Haskell *syntax* would be nice. I recently described F# as combining the beauty of Caml with the functional purity of C# -- both of

Re: [Haskell-cafe] Reifying case expressions [was: Re: On stream processing, and a new release of timeplot coming]

2011-12-25 Thread Gábor Lehel
On Sun, Dec 25, 2011 at 9:19 PM, Eugene Kirpichov ekirpic...@gmail.com wrote: Hello Heinrich, Thanks, that's sure some food for thought! A few notes: * This is indeed analogous to Iteratees. I tried doing the same with Iteratees but failed, so I decided to put together something simple of

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-22 Thread Gábor Lehel
On Mon, Dec 19, 2011 at 8:20 PM, Robert Clausecker fuz...@gmail.com wrote: Image you would create your own language with a paradigm similar to Haskell or have to chance to change Haskell without the need to keep any compatibility. What stuff would you add to your language, what stuff would you

Re: [Haskell-cafe] More liberal than liberal type synonyms

2011-12-07 Thread Gábor Lehel
On Wed, Dec 7, 2011 at 1:07 PM, Dmitry Kulagin dmitry.kula...@gmail.com wrote: For short, type synonyms work for mere aliases, but not for full-fledged type-level non-inductive functions. And sometimes we intuitively want to use them as such. Thank you, Yves! It is now more clear for me.

Re: [Haskell-cafe] Poll: Do you want a mascot?

2011-11-23 Thread Gábor Lehel
I don't want a bad mascot. I do want a good mascot. If you must count me down for one side or the other, count this as a yes. On Wed, Nov 23, 2011 at 8:11 PM, heathmatlock heathmatl...@gmail.com wrote: Question: Do you want a mascot? Answers: Yes No -- This is an attempt to figure out if

Re: [Haskell-cafe] A Mascot

2011-11-22 Thread Gábor Lehel
On Tue, Nov 22, 2011 at 6:22 AM, Jeremy Shaw jer...@n-heptane.com wrote: I think the artwork is nice, but I am not sure that a lamb is an appropriate mascot for Haskell. A mascot is supposed to represent characteristics, emotions, or desires that a particular group of people aspire to have,

Re: [Haskell-cafe] A Mascot

2011-11-22 Thread Gábor Lehel
On Mon, Nov 21, 2011 at 2:52 PM, Karol Samborski edv.ka...@gmail.com wrote: 2011/11/21 Karol Samborski edv.ka...@gmail.com: Hi all, This is my sister's proposition: http://origami.bieszczady.pl/images/The_Lamb_Da.png What do you think? Second version:

Re: [Haskell-cafe] A Mascot

2011-11-22 Thread Gábor Lehel
On Tue, Nov 22, 2011 at 4:40 PM, Karol Samborski edv.ka...@gmail.com wrote: And what about a cat? The cat is associated with elegance and a kind of magic. Please take a look: http://origami.bieszczady.pl/images/kot.png Best, Karol Samborski That's true, and I did think of it. But I don't

Re: [Haskell-cafe] Question about type families

2011-09-13 Thread Gábor Lehel
On Tue, Sep 13, 2011 at 4:58 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote: Is there a way to make the following code working? {-# LANGUAGE TypeFamilies #-} data family Foo a data instance (Num a)        = Foo a = A a deriving Show data instance (Fractional a) = Foo a = B a deriving Show

Re: [Haskell-cafe] Question about type families

2011-09-13 Thread Gábor Lehel
On Tue, Sep 13, 2011 at 4:58 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote: Is there a way to make the following code working? {-# LANGUAGE TypeFamilies #-} data family Foo a data instance (Num a)        = Foo a = A a deriving Show data instance (Fractional a) = Foo a = B a deriving Show

Re: [Haskell-cafe] For class Monoid; better names than mempty mappend might have been: mid (mident) mbinop

2011-07-25 Thread Gábor Lehel
On Mon, Jul 25, 2011 at 9:35 AM, Thomas Schilling nomin...@googlemail.com wrote: On 25 July 2011 08:22, Paul R paul.r...@gmail.com wrote: Hi Café, Thomas I think () is fairly uncontroversial because: Thomas (...) Thomas 2. It's abstract. i.e., no intended pronunciation How can that be an

Re: [Haskell-cafe] For class Monoid; better names than mempty mappend might have been: mid (mident) mbinop

2011-07-25 Thread Gábor Lehel
2011/7/25 Yves Parès limestr...@gmail.com: 2011/7/25 Paul R paul.r...@gmail.com Some references state that the monoid binary operation is often named dot or times in english. That does not mean the operator must be `dot`, `times`, (.) or (x) but at least the doc should provide a single,

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit dag...@gmail.com wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow marlo...@gmail.com wrote: On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlowmarlo...@gmail.com  wrote: On 06/07/2011 07:37, Jason Dagit wrote:

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Gábor Lehel illiss...@gmail.com: On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit dag...@gmail.com wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow marlo...@gmail.com wrote: On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlowmarlo...@gmail.com  wrote

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Gábor Lehel illiss...@gmail.com: 2011/7/6 Gábor Lehel illiss...@gmail.com: On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit dag...@gmail.com wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow marlo...@gmail.com wrote: On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23

Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Donn Cave d...@avvanta.com: Quoth =?ISO-8859-1?Q?G=E1bor_Lehel?= illiss...@gmail.com, ... Stated another way: I suspect most GUI libraries don't really actually care that you only execute GUI code from the main OS thread, as much as they care that only one (thread-unsafe) GUI

Re: [Haskell-cafe] Proposal: remove Stability from haddock documentation on hackage

2011-06-07 Thread Gábor Lehel
On Tue, Jun 7, 2011 at 3:05 PM, James Cook mo...@deepbondi.net wrote: On Jun 6, 2011, at 10:57 PM, Chris Smith wrote: I got asked a question today about why Control.Applicative is labeled as experimental on Hackage.  Perhaps that field is something of a failed experiment, and it remaining

Re: [Haskell-cafe] Cons of -XUndecidableInstances

2011-06-06 Thread Gábor Lehel
On Mon, Jun 6, 2011 at 7:52 AM, Yitzchak Gale g...@sefer.org wrote: Scott Lawrence wrote: More specifically, I have  class Model m a | m - a where ...  class Entropy d where ...  instance (Model m a) = Entropy m where ... The first line requires MultiParamTypeClasses and

Re: [Haskell-cafe] Type-class conditional behavior

2011-05-08 Thread Gábor Lehel
On Sun, May 8, 2011 at 7:14 AM, Nicholas Tung nt...@ntung.com wrote: Dear all,     I'd like to write a function maybeShow :: a - Maybe String, which runs show if its argument is of class Show.     The context and motivation for this are as follows. I have a GADT type which encapsulates

Re: [Haskell-cafe] Interfacing C++ iterators does not work as expected

2011-05-02 Thread Gábor Lehel
It works if I replace the 'bool' return type of 'finished' with int and CInt on the C++ and Haskell side, respectively, and test for (/= 0). On Mon, May 2, 2011 at 9:35 PM, Huynh Huu Long long.upc...@googlemail.com wrote: Hi, I tried to access C++ iterators from Haskell via the FFI. There are

[Haskell-cafe] SoC project: advice requested

2011-04-01 Thread Gábor Lehel
Hi all, I would very much like to apply for a Summer of Code project this year; however, I'm having trouble nailing down a project which is both (a) of appropriate scope and (b) which interests and motivates me. There's also obviously the question of needing a mentor for the project. Regarding

Re: [Haskell-cafe] SoC project: advice requested

2011-04-01 Thread Gábor Lehel
2011/4/1 Gershom Bazerman gersh...@gmail.com: On Apr 1, 2011, at 7:52 AM, Gábor Lehel wrote: The two projects I've been able to think of which seem like they *might* be appropriate are: integrating the standard 'deriving' mechanism with Template Haskell to support deriving custom classes

Re: [Haskell-cafe] SoC project: advice requested

2011-04-01 Thread Gábor Lehel
2011/4/1 Johan Tibell johan.tib...@gmail.com: Hi Gábor, There are a few non-Cabal projects on the ideas list (http://hackage.haskell.org/trac/summer-of-code/report/1). Just thought I mentioned it in case you missed it. I saw it :) 2011/4/1 Gábor Lehel illiss...@gmail.com: Alternately

Re: [Haskell-cafe] SoC project: advice requested

2011-04-01 Thread Gábor Lehel
2011/4/1 Johan Tibell johan.tib...@gmail.com: 2011/4/1 Gábor Lehel illiss...@gmail.com: Oh, hmm. Good idea. Should've cross-posted from the beginning :|. What's the accepted etiquette here? Forward the original message? Send a short heads-up with a link to this thread in the archives? I'd

Re: [Haskell-cafe] Byte Histogram

2011-03-31 Thread Gábor Lehel
On Thu, Mar 17, 2011 at 11:14 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Right. So somebody else came up with an idea similar to mine, but since nobody could agree on anything more than a rough idea, nothing actually got done...(?) Well, I also got the sense that it would be more

Re: [Haskell-cafe] object oriented technique

2011-03-30 Thread Gábor Lehel
On Wed, Mar 30, 2011 at 6:52 AM, Tad Doxsee tad.dox...@gmail.com wrote: Greg, Thanks for your help.  Is there any significant difference between using existential quantification data ShapeD = forall s. ShapeC = ShapeD s versus a GADT data ShapeD  where  ShapeD :: ShapeC s = s - ShapeD

Re: [Haskell-cafe] ANNOUNCE: incremental-parser library package

2011-03-22 Thread Gábor Lehel
On Tue, Mar 22, 2011 at 3:14 PM, Mario Blažević mblaze...@stilo.com wrote:     The first version of incremental-parser has been released on Hackage [1]. It's yet another parser combinator library, providing the usual set of Applicative and Monad combinators. Apart from this, it has three

Re: [Haskell-cafe] Byte Histogram

2011-03-17 Thread Gábor Lehel
Necroing this thread because I just noticed there's a (rather old!) bug report which covers much of the same ground and doesn't seem to have been mentioned by anyone: http://hackage.haskell.org/trac/ghc/ticket/1349 2011/2/8 Gábor Lehel illiss...@gmail.com: 2011/2/8 Ketil Malde ke...@malde.org

Re: [Haskell-cafe] Byte Histogram

2011-03-17 Thread Gábor Lehel
On Thu, Mar 17, 2011 at 10:37 PM, Andrew Coppin andrewcop...@btinternet.com wrote: On 17/03/2011 12:11 PM, Gábor Lehel wrote: Necroing this thread because I just noticed there's a (rather old!) bug report which covers much of the same ground and doesn't seem to have been mentioned by anyone

Re: [Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

2011-03-09 Thread Gábor Lehel
On Wed, Mar 9, 2011 at 5:26 PM, Remi Turk rt...@science.uva.nl wrote: On Tue, Mar 08, 2011 at 01:01:58PM +0100, Gábor Lehel wrote: On Sun, Mar 6, 2011 at 2:38 PM, Remi Turk rt...@science.uva.nl wrote: Where? Hackage: http://hackage.haskell.org/package/cinvoke Cheers, Remi [1] http

Re: [Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

2011-03-08 Thread Gábor Lehel
On Sun, Mar 6, 2011 at 2:38 PM, Remi Turk rt...@science.uva.nl wrote: I am happy to finally announce cinvoke 0.1, a binding to the C library cinvoke[1], allowing functions to be loaded and called whose names and types are not known before run-time. Why? Sometimes you can't use the Haskell

Re: [Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

2011-03-07 Thread Gábor Lehel
On Mon, Mar 7, 2011 at 7:32 PM, Remi Turk rt...@science.uva.nl wrote: On Mon, Mar 07, 2011 at 09:41:27AM +, Max Bolingbroke wrote: Hi Remi, On 6 March 2011 13:38, Remi Turk rt...@science.uva.nl wrote: I am happy to finally announce cinvoke 0.1, a binding to the C library cinvoke[1],

Re: [Haskell-cafe] A practical Haskell puzzle

2011-02-28 Thread Gábor Lehel
On Mon, Feb 28, 2011 at 12:41 PM, wren ng thornton w...@freegeek.org wrote: On 2/28/11 2:43 AM, Yitzchak Gale wrote: You have written a large software system in Haskell. Wishing to play to Haskell's strength, you have structured your system as a series of composable layers. So you have data

Re: [Haskell-cafe] Proving correctness

2011-02-14 Thread Gábor Lehel
On Mon, Feb 14, 2011 at 12:06 PM, Pedro Vasconcelos p...@dcc.fc.up.pt wrote: On Sat, 12 Feb 2011 19:38:31 +0530 C K Kashyap ckkash...@gmail.com wrote: Anyway, how can one go about explaining to an imperative programmer with no FP exposure - what aspect of Haskell makes it easy to refactor?

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-14 Thread Gábor Lehel
On Tue, Feb 15, 2011 at 12:48 AM, Max Bolingbroke batterseapo...@hotmail.com wrote: On 14 February 2011 21:43, Patrick Bahr pa...@arcor.de wrote: Am I doing something wrong or is it not possible for GHC to dispatch a rule according to type class constraints? As you have discovered this is not

Re: [Haskell-cafe] Byte Histogram

2011-02-08 Thread Gábor Lehel
2011/2/7 Richard O'Keefe o...@cs.otago.ac.nz: On 8/02/2011, at 3:47 AM, Gábor Lehel wrote: I dunno. As a language extension, would - let's call it BangTypes - be backwards-incompatible in any way? Let's look at an intermediate step first, BangFunctions. What this does is to say

Re: [Haskell-cafe] Help needed for converting IOArray to ByteString

2011-02-08 Thread Gábor Lehel
On Tue, Feb 8, 2011 at 10:39 AM, C K Kashyap ckkash...@gmail.com wrote: 1) Just use Data.Word.Word8 instead of the second Int in your type sig for IOArray 2) Use getElems to get a [Word8] 3) Data.ByteString.pack converts a [Word8] into a ByteString Michael I am currently using a list of

Re: [Haskell-cafe] Byte Histogram

2011-02-08 Thread Gábor Lehel
2011/2/8 Ketil Malde ke...@malde.org: Gábor Lehel illiss...@gmail.com writes: Is there any sensible meaning for bangs on return types? I've been trying to think this through but not necessarily succeeding. Not knowing Clean in any detail, I've always just thought that a type signature

Re: [Haskell-cafe] Byte Histogram

2011-02-07 Thread Gábor Lehel
On Mon, Feb 7, 2011 at 1:36 PM, Jimbo Massive jimbo.massive-hask...@xyxyx.org wrote: On 07/02/2011 11:40, Stephen Tetley wrote: Interesting point, but excepting that its adding more complexity Haskell type system, the Clean way of putting strictness information into the type system seems

Re: [Haskell-cafe] Byte Histogram

2011-02-06 Thread Gábor Lehel
On Thu, Feb 3, 2011 at 11:40 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 4/02/2011, at 10:10 AM, Andrew Coppin wrote: The important obsevation is this: One tiny, almost insignificant change can transform a program from taking 50 seconds and 400 MB of RAM into one that takes 0.02

Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus

2011-01-25 Thread Gábor Lehel
On Tue, Jan 25, 2011 at 10:20 AM, Ketil Malde ke...@malde.org wrote: Erik Hesselink hessel...@gmail.com writes: importing Control.Applicative main = print = liftM2 (+) readLn (return 3) [...] line noise Why not just: main = print . (+3) = readLn Or using applicative:  print = (+3) $

Re: [Haskell-cafe] Exportable and importable instances

2011-01-07 Thread Gábor Lehel
The objection to this I recall hearing is that it would make it possible for different parts of the program to see different instances for a given type (local instances, effectively), which would have interesting results. I don't know if there's a way to implement the feature which avoids this, or

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Gábor Lehel
One further idea -- assuming HasBigEndian and HasLittleEndian are unexported because you don't want people writing new instances -- is to have something like class HasBigEndianPrivate = HasBigEndian instead, with the latter exported and the former not, and instances of each for the same types.

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Gábor Lehel
2010/12/24 Henning Thielemann lemm...@henning-thielemann.de: On Fri, 24 Dec 2010, Gábor Lehel wrote: One further idea -- assuming HasBigEndian and HasLittleEndian are unexported because you don't want people writing new instances Why should people not write further instances? I could write

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Gábor Lehel
I agree with the people who want to decouple the dot-syntax from TDNR itself. To quote myself from the publicly-editable wiki page: This might be a really dumb question, but is there any reason TDNR needs to be tied to a new syntax for function application? It seems strange to me to have one

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Gábor Lehel
2010/11/11 Gábor Lehel illiss...@gmail.com: I agree with the people who want to decouple the dot-syntax from TDNR itself. To quote myself from the publicly-editable wiki page: This might be a really dumb question, but is there any reason TDNR needs to be tied to a new syntax for function

Re: [Haskell-cafe] Serialization of (a - b) and IO a

2010-11-11 Thread Gábor Lehel
On Thu, Nov 11, 2010 at 12:22 PM, Sjoerd Visscher sjo...@w3future.com wrote: The equality that people typically expect to hold for Haskell expressions is that two such expressions are equal if they denote the same thing, as Max said. Expressions with function type denote mathematical functions,

Re: [Haskell-cafe] Serialization of (a - b) and IO a

2010-11-11 Thread Gábor Lehel
On Thu, Nov 11, 2010 at 2:15 PM, Jesse Schalken jesseschal...@gmail.com wrote: 2010/11/11 Gábor Lehel illiss...@gmail.com Obviously there are questions here with regards to the functions which the to-be-serialized function makes use of -- should they be serialized along with it? Required

Re: [Haskell-cafe] Serialization of (a - b) and IO a

2010-11-11 Thread Gábor Lehel
On Thu, Nov 11, 2010 at 2:29 PM, Malcolm Wallace malcolm.wall...@me.com wrote: I'll just note that LLVM is only platform independent to a degree. Or rather, I believe the situation is that it *is* architecture independent, but it doesn't abstract anything else besides the architecture In

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Gábor Lehel
On Thu, Nov 11, 2010 at 2:59 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: 11.11.2010 16:53, Stephen Tetley пишет: On 11 November 2010 13:10, Lauri Alankol...@iki.fi  wrote: {-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses, FunctionalDependencies #-} data PetOwner data

Re: [Haskell-cafe] template haskell for typeclass synonyms

2010-11-02 Thread Gábor Lehel
Well, Template Haskell is what you go to when what you want -can't- be reasonably expressed with standard GHC Haskell. It's something of a last resort (at least in my case). Typeclass synonyms can be faked reasonably well with UndecidableInstances, but if you want to, for example, automatically

Re: [Haskell-cafe] template haskell for typeclass synonyms

2010-11-01 Thread Gábor Lehel
On Mon, Nov 1, 2010 at 6:09 PM, Christopher Done chrisd...@googlemail.com wrote: On 1 November 2010 17:53, Paolino paolo.verone...@gmail.com wrote: I'd like to have a template haskell function that take some constraints and a class name and write an empty class from those and relative empty

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Gábor Lehel
I also vote +1 for lambda-case, and abstain for lambda-if. I don't think multiple-clause lambdas being desirable should be an argument against lambda-case. After all, we can also define top-level functions with either multiple clauses or a single case expression. Haskell has always followed the

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Gábor Lehel
On Wed, Sep 29, 2010 at 11:15 PM, DavidA polyom...@f2s.com wrote: Ryan Ingram ryani.spam at gmail.com writes: Haskell doesn't have true type functions; what you are really saying is instance Monad (\v - Vect k (Monomial v)) Yes, that is exactly what I am trying to say. And since I'm not

Re: [Haskell-cafe] translating bidirectional fundeps to TFs

2010-09-18 Thread Gábor Lehel
On Fri, Sep 17, 2010 at 10:19 PM, Dan Doel dan.d...@gmail.com wrote: On Friday 17 September 2010 4:04:26 pm Gábor Lehel wrote: What I would *want* to write is this: class (Mutable (Thawed a), Frozen (Thawed a) ~ a) = Immutable a where     type Thawed a :: *     thaw :: a - Thawed a class

[Haskell-cafe] translating bidirectional fundeps to TFs

2010-09-17 Thread Gábor Lehel
Now that the new typechecking awesomeness has been committed to GHC HEAD, theoretically all of the things one can express with FunctionalDependencies (bar overlap) should now be expressible with TypeFamilies as well. This got me to thinking how this might actually be done. Here's an example of a

[Haskell-cafe] interesting type families problem

2010-09-08 Thread Gábor Lehel
I'm bad at expositions so I'll just lead with the code: {-# LANGUAGE EmptyDataDecls, TypeFamilies #-} data True :: * data False :: * class TypeValue a where type ValueTypeOf a :: * value :: ValueTypeOf a instance TypeValue True where type ValueTypeOf True = Bool value = True

Re: [Haskell-cafe] interesting type families problem

2010-09-08 Thread Gábor Lehel
2010/9/8 Miguel Mitrofanov miguelim...@yandex.ru: On 8 Sep 2010, at 20:01, Gábor Lehel wrote: I'm bad at expositions so I'll just lead with the code: {-# LANGUAGE EmptyDataDecls, TypeFamilies #-} data True  :: * data False :: * class TypeValue a where    type ValueTypeOf

Re: [Haskell-cafe] interesting type families problem

2010-09-08 Thread Gábor Lehel
2010/9/8 Anthony Cowley acow...@seas.upenn.edu: 2010/9/8 Gábor Lehel illiss...@gmail.com: Oh. Hmm. That makes sense. So I gather there's absolutely no way to specify which instance you mean, and hence to use `value` as any concrete type? Here's one way to indicate which value you

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Gábor Lehel
On Mon, Sep 6, 2010 at 5:11 PM, John Lato jwl...@gmail.com wrote: Message: 20 Date: Sat, 04 Sep 2010 03:40:49 -0400 From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] Restricted type classes To: Haskell Cafe haskell-cafe@haskell.org Message-ID: 4c81f801@freegeek.org

Re: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Gábor Lehel
On Mon, Sep 6, 2010 at 12:47 PM, Neil Brown nc...@kent.ac.uk wrote: On 06/09/10 11:23, Johannes Waldmann wrote: We have overloaded numerical literals (Num.fromInteger) and we can overload string literals (IsString.fromString), so how about using list syntax ( [], : ) for anything list-like

Re: [Haskell-cafe] Re: overloaded list literals?

2010-09-06 Thread Gábor Lehel
On Mon, Sep 6, 2010 at 8:52 PM, Maciej Piechotka uzytkown...@gmail.com wrote: PS. data FooBar a = Foo              | Bar              deriving Show class IsString (FooBar Char) where    toString _ = Foo class IsList FooBar where    toList _ = Bar show (1234 :: FooBar Char) == ??? Foo

  1   2   >