Re: [Haskell-cafe] [ANN] Haskell-Paris meetup

2013-06-11 Thread Lennart Kolmodin
I'm afraid I won't attend the event, but I have to say that you have one of the very best Haskell logos I've ever seen :) 2013/6/4 lucas di cioccio > Dear all, > > I'm happy to announce that the Haskell-Paris group will meet on June 25th > in Paris. Please register (free) at > http://www.meetup

Re: [Haskell-cafe] The state of binary (de)serialization

2013-03-01 Thread Lennart Kolmodin
h GHC (GHC depends on binary). In other words, depending on binary should be future-proof. On another note, binary-0.7 is out, get it while it's hot! :) Lennart 2013/2/26 Johan Tibell > On Mon, Feb 25, 2013 at 4:51 PM, Alexander Solla wrote: > >> On Mon, Feb 25, 2013 at 11:59 AM

Re: [Haskell-cafe] ANN: Happstack 7

2012-03-30 Thread Lennart Kolmodin
if this has been discussed before, I searched the mailing list without finding anything. Feels like Happstack has been reborn, thanks again! Cheers, Lennart ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] mapM is supralinear?

2011-09-26 Thread Lennart Augustsson
You seem to ignore garbage collection. On Sat, Sep 24, 2011 at 6:40 AM, Arseniy Alekseyev < arseniy.alekse...@gmail.com> wrote: > > Apparently it doesn't, and it seems to be fixed now. > > Does anyone know what exactly the bug was? Because this seems like a > serious bug to me. I've run into it m

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Lennart Augustsson
I totally agree with you. Haskell is very broken when it comes to [x..y] for floating point. It's an attempt to make it more "friendly" for naive users, but there is no way FP can be made friendly. Any such attempts will fail, so make it usable for people who understand FP instead

Re: [Haskell-cafe] instance Enum Double considered not entirely great?

2011-09-26 Thread Lennart Augustsson
If you do [0.1, 0.2 .. 0.3] it should leave out 0.3. This is floating point numbers and if you don't understand them, then don't use them. The current behaviour of .. for floating point is totally broken, IMO. -- Lennart On Fri, Sep 23, 2011 at 6:06 AM, Chris Smith wrote: > On

Re: [Haskell-cafe] Data.Binary.IncrementalGet remake

2011-04-20 Thread Lennart Kolmodin
he > > idea very useful and tried to use it. Original library by Lennart > > Kolmodin raises some questions. The lib's main data structures are: > > > > Lennart Kolmodin has a branch of Binary with incremental get which > supports lookAhead: > > https://gith

Re: [Haskell-cafe] Is SHE (the Strathclyde Haskell Enhancement) portable?

2011-01-23 Thread Lennart Augustsson
It probably is portable, but I'd think only GHC has all the necessary extensions. On Sun, Jan 23, 2011 at 12:27 PM, Maciej Piechotka wrote: > It may be strange question but: > > - Is SHE portable (assuming that the compiler have the extensions)? > - If yes why there is only information how to u

Re: [Haskell-cafe] Set monad

2011-01-09 Thread Lennart Augustsson
That looks like it looses the efficiency of the underlying representation. On Sun, Jan 9, 2011 at 6:45 AM, Sebastian Fischer wrote: > On Sun, Jan 9, 2011 at 6:53 AM, Lennart Augustsson > wrote: > >> It so happens that you can make a set data type that is a Monad, but it'

Re: [Haskell-cafe] Set monad

2011-01-08 Thread Lennart Augustsson
It so happens that you can make a set data type that is a Monad, but it's not exactly the best possible sets. module SetMonad where newtype Set a = Set { unSet :: [a] } singleton :: a -> Set a singleton x = Set [x] unions :: [Set a] -> Set a unions ss = Set $ concatMap unSet ss member :: (Eq a

Re: [Haskell-cafe] Incorrectly inferring type [t]

2010-12-29 Thread Lennart Augustsson
First, what type would such a function have? Certainly not [a]->[b], because that type say that it can take a list of any type and turn it into a list of any other type, e.g., [Int]->[Bool]. On Thu, Dec 30, 2010 at 4:05 AM, william murphy wrote: > Hi All, > > I've spent a lot of time trying to w

Re: [Haskell-cafe] how to write a loop in haskell way

2010-12-19 Thread Lennart Augustsson
Recursion replaces loops. If it needs to be monadic or not depends on what you want to do. On Sun, Dec 19, 2010 at 10:53 AM, ender wrote: > 2010/12/19 Henning Thielemann : > > > > On Sun, 19 Dec 2010, ender wrote: > > > >>> do > >>> alloca $ \value -> do > >>> poke value (50::Int) > >>>

Re: [Haskell-cafe] [URGENT] DNS problems at haskell.org?

2010-12-18 Thread Lennart Augustsson
I bet they did try to contact the owner. But when the contact email no longer works nobody will get the messages. On Sat, Dec 18, 2010 at 3:35 PM, Ketil Malde wrote: > Karel Gardas writes: > > > > http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/c1

Re: [Haskell-cafe] [Haskell] Functor => Applicative => Monad

2010-12-16 Thread Lennart Augustsson
IO On Thu, Dec 16, 2010 at 6:03 PM, John Smith wrote: > On 15/12/2010 14:31, Lennart Augustsson wrote: > >> Yes, I think there should be a MonadFail distinct from MonadPlus. >> Some types, like IO, are not in MonadPlus, but have a special >> implementation of the fail

Re: [Haskell-cafe] [Haskell] Functor => Applicative => Monad

2010-12-15 Thread Lennart Augustsson
reasons (better error messages was the excuse). -- Lennart On Wed, Dec 15, 2010 at 11:51 AM, John Smith wrote: > On 15/12/2010 11:39, Lennart Augustsson wrote: > >> Any refutable pattern match in do would force MonadFail (or MonadPlus if >> you prefer). So >> 1. (MonadFa

Re: [Haskell-cafe] [Haskell] Functor => Applicative => Monad

2010-12-15 Thread Lennart Augustsson
quot;; Just x -> return x 4. (Monad m) => a -> b -> m a, \ a b -> return a 5. (Monad m) => (a, b) -> m a, \ (a, b) -> return a As far as type inference and desugaring goes, it seems very little would have to be changed in an implementation. -- Lennart 2010/12/

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-04 Thread Lennart Augustsson
had a compiler that was bootstrapped, but I had a simple functional language that compiled itself and ran in 64K. The smallest bootstrapped Haskell compiler is NHC which (I think) runs in a few MB. -- Lennart On Thu, Nov 4, 2010 at 8:54 PM, Andrew Coppin wrote: > Where the heck did all this

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-04 Thread Lennart Augustsson
KRC, Miranda, and LML all predate Haskell and have list comprehensions. On Thu, Nov 4, 2010 at 3:16 PM, Jonathan Geddes wrote: > Regardless of which languages got which features for which other > languages, Haskell is surely NOT a "scripting language inspired by > python"... > > Also, it was my u

Re: [Haskell-cafe] Re: Mysterious fact

2010-11-02 Thread Lennart Augustsson
Jon, you beat me to it. I was going to mention Ponder. But Ponder did have a builtin type, it had the function type built in. :) -- Lennart On Tue, Nov 2, 2010 at 9:47 PM, Jon Fairbairn wrote: > Andrew Coppin writes: > >> The other day, I accidentally came up with this: >>

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-02 Thread Lennart Augustsson
I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy wrote: > Let us think, that we need some scripting language for our pure haskell > project and configure-compile-run is not a way. In such a case a > reasonably simple, yet

Re: [Haskell-cafe] who's in charge?

2010-10-28 Thread Lennart Augustsson
It's working just fine. I've never wanted a mail client library. :) -- Lennart 2010/10/27 Günther Schmidt : > Dear Malcolm, > > since there is no mail client library even after 10+ years I suggest to > rethink the approach, because frankly, it'

Re: [Haskell-cafe] Static computation/inlining

2010-10-10 Thread Lennart Augustsson
I would not worry about doing that at runtime. The only reliable way to make sure it happens at compile time that I can think of would be some Template Haskell. (Or some really deep magic with dictionaries.) -- Lennart On Mon, Oct 11, 2010 at 3:51 AM, Alexander Solla wrote: > Hi everyb

Re: [Haskell-cafe] Re-order type

2010-10-10 Thread Lennart Augustsson
b -> c -> (b1,c1,a1)) -> (a -> b -> c -> d) compose :: (c1 -> a1 -> d) -> (a -> b -> c -> (b1, c1, a1)) -> a -> b -> c -> d compose a b c d e = case b c d e of (_, f, g) -> a f g -- Lennart 2010/10/9 André Batista Martins :

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-08 Thread Lennart Augustsson
That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating point.) -- Lennart On Fri, Oct 8, 2010 at 2:08 PM, Daniel Fischer wrote: > The methods of the R

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-13 Thread Lennart Augustsson
So it's a bug in the garbage collector. It's closing a handle that clearly is still reachable, otherwise this would not have happened. On Fri, Aug 13, 2010 at 10:53 AM, Simon Marlow wrote: > On 12/08/2010 21:59, Yitzchak Gale wrote: >> >> Wei Hu wrote: >>> >>> nonTermination _ = blackhole where

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Lennart Augustsson
The former. On Tue, Aug 10, 2010 at 2:59 PM, Ivan Lazar Miljenovic wrote: > Lennart Augustsson writes: > >> Rather than high turnover it indicates (in my experience) that it's >> difficult to fill positions in finance. >> That's one reason they are advertised

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Lennart Augustsson
Rather than high turnover it indicates (in my experience) that it's difficult to fill positions in finance. That's one reason they are advertised repeatedly. On Tue, Aug 10, 2010 at 12:27 PM, Ivan Lazar Miljenovic wrote: > Malcolm Wallace writes: > It's disproportionate.  95% of the job off

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-09 Thread Lennart Augustsson
But do you think there would be more Haskell jobs offered (in absolute terms), if no investment firms offered jobs? Is there some kind of quota of job offers that gets used up? There seems to be more job applicants that job offers at the moment, so I'm not sure what the problem is. On Mon, Aug 9,

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-09 Thread Lennart Augustsson
Out of 10 people trained only 2 should do programming anyway. :) On Fri, Aug 6, 2010 at 4:58 AM, Tom Hawkins wrote: > Hi Eil, >> Have you had any trouble training people to use Haskell? > > Yes.  I find that out of 10 people I train, only about 2 pick it up > and run with it.  I'm starting to bel

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Lennart Augustsson
Yes, for instance to be able to use functions as number. Or to be able to use constructive real numbers as numbers, since equality is not computable. -- Lennart On Thu, Aug 5, 2010 at 4:17 AM, Ivan Lazar Miljenovic wrote: > On 5 August 2010 10:15, Lennart Augustsson wrote: >> You

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-04 Thread Lennart Augustsson
You're right. It's bad to have toRational in Real. It's also bad to have Show and Eq as superclasses to Num. On Wed, Aug 4, 2010 at 8:30 PM, Omari Norman wrote: > Why is toRational a method of Real? I thought that real numbers need not > be rational, such as the square root of two. Wouldn't it

Re: [Haskell-cafe] Re: Instances for Set of Functor, Traversable?

2010-07-27 Thread Lennart Augustsson
ted constraints, www.cs.kuleuven.be/~toms/Research/papers/constraint_families.pdf On Tue, Jul 27, 2010 at 10:17 AM, wrote: > > Lennart Augustsson wrote: >> Try to make Set an instance of Functor and you'll see why it isn't. >> It's very annoying. > > And yet th

Re: [Haskell-cafe] Instances for Set of Functor, Traversable?

2010-07-26 Thread Lennart Augustsson
Try to make Set an instance of Functor and you'll see why it isn't. It's very annoying. On Mon, Jul 26, 2010 at 11:55 PM, Gregory Crosswhite wrote: > Is there a specific reason why Set doesn't have instances for Functor > and Traversable?  Or have they just not been written yet?  :-) > > Cheers,

Re: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-10 Thread Lennart Augustsson
I would not use the continuation monad just for early exit. Sounds like the error monad to me. 2010/6/10 Günther Schmidt : > Hi everyone, > > I'm about to write a rather lengthy piece of IO code. Depending on the > results of some of the IO actions I'd like the computation to stop right > there a

Re: [Haskell-cafe] currying combinators

2010-05-28 Thread Lennart Augustsson
f you just consider cut free proofs there's usually infinitely many.) On Fri, May 28, 2010 at 8:14 AM, wren ng thornton wrote: > Lennart Augustsson wrote: >> >> So what would you consider a proof that there are no total Haskell >> functions of that type? >> Or,

Re: [Haskell-cafe] currying combinators

2010-05-27 Thread Lennart Augustsson
proof that there is no function of that type. -- Lennart On Thu, May 27, 2010 at 7:49 PM, wren ng thornton wrote: > Dan Doel wrote: >> >> On Thursday 27 May 2010 3:27:58 am wren ng thornton wrote: >>> >>> By parametricty, presumably. >> >> Actually,

Re: [Haskell-cafe] currying combinators

2010-05-26 Thread Lennart Augustsson
There are no interesting (i.e. total) functions of that type. 2010/5/25 Yitzchak Gale : > Günther Schmidt wrote: >> http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=25694 >> in which I attempt to develop a "currying combinator" library. >> I'm stuck at some point and would appreciate any help. >

Re: [Haskell-cafe] Re: Proof question -- (==) over Bool

2010-05-24 Thread Lennart Augustsson
That's totally false. You don't evaluate 'undefined' before calling 'id'. (Or if you, it's because you've made a transformation that is valid because 'id' is strict.) On Mon, May 24, 2010 at 9:05 AM, Alexander Solla wrote: > Yes, but only because it doesn't work at all.  Consider that calling >

Re: [Haskell-cafe] Clean proof -- correction

2010-05-23 Thread Lennart Augustsson
Actually, I didn't notice the typo. It's still not a true statement. (h . either (f, g)) undefined /= (either (h . f, h . g)) undefined Also, it's not exactly the function either from the Prelude. -- Lennart 2010/5/23 R J : > Correction:  the theorem is >     h . eith

Re: [Haskell-cafe] Clean proof?

2010-05-23 Thread Lennart Augustsson
There is no clean proof of that statement because it is false. (Consider the argument 'undefined'.) 2010/5/23 R J : > Given the following definition of "either", from the prelude: >     either                      :: (a -> c, b -> c) -> Either a b -> c >     either (f, g) (Left x)      =  f x >   

Re: [Haskell-cafe] Re: Proof question -- (==) over Bool

2010-05-23 Thread Lennart Augustsson
#x27; does not. Ignore bottom at your own peril. BTW, the id function works fine on bottom, both from a semantic and implementation point of view. -- Lennart On Sun, May 23, 2010 at 11:23 AM, Alexander Solla wrote: > > On May 23, 2010, at 1:35 AM, Jon Fairbairn wrote: > >> It

Re: [Haskell-cafe] ShowList magic

2010-05-17 Thread Lennart Augustsson
ses the default implementation for showList. -- Lennart On Mon, May 17, 2010 at 4:56 AM, Abby Henríquez Tejera wrote: > Hi. > > I'm a Haskell newbie and there's a bit of Haskell code that I don't > understand how it works. In the prelude, defining the class Show, the >

Re: [Haskell-cafe] Integers v ints

2010-04-03 Thread Lennart Augustsson
The cost factor of Integer vs Int is far, far smaller than the factor between computable reals vs Double. On Thu, Apr 1, 2010 at 6:33 PM, Jens Blanck wrote: > Yes, the cost for computable reals will be an order of magnitude or possibly > two for well-behaved computations. For not well-behaved pro

Re: [Haskell-cafe] Re: ANN: data-category, restricted categories

2010-03-30 Thread Lennart Augustsson
Of course Haskell' should have an empty case. As soon as empty data declarations are allowed then empty case must be allowed just by using common sense. On Tue, Mar 30, 2010 at 11:03 PM, Ashley Yakeley wrote: > wagne...@seas.upenn.edu wrote: >> >> I believe I was claiming that, in the absence of

Re: [Haskell-cafe] Where are the haskell elders?

2010-03-29 Thread Lennart Augustsson
What Don said. 2010/3/29 Don Stewart : > gue.schmidt: >> Hi all, >> >> I notice that posts from the Haskell elders are pretty rare now. Only >> every now and then we hear from them. >> >> How come? > > Because there is too much noise on this list, Günther > > -- Don > _

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-28 Thread Lennart Augustsson
Does anything change if you swap the first two rhss? On Sun, Mar 28, 2010 at 1:28 AM, Roman Leshchinskiy wrote: > On 28/03/2010, at 09:47, Lennart Augustsson wrote: > >> It's important to switch from mod to rem.  This can be done by a >> simple abstract interpretation.

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Lennart Augustsson
It's important to switch from mod to rem. This can be done by a simple abstract interpretation. I'm nore sure if it's jhc or gcc that does this for jhc. -- Lennart On Sat, Mar 27, 2010 at 10:30 PM, Rafael Cunha de Almeida wrote: > John Meacham wrote: >> Here are jh

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-22 Thread Lennart Augustsson
Turn on OverloadedStrings and you can pattern match on any type you like that is in the IsString class. Which means that Data.Text can use string literals just like regular strings (but you can't use Char literals in the match). On Mon, Mar 22, 2010 at 1:15 PM, Ivan Miljenovic wrote: > On 23 Marc

Re: [Haskell-cafe] Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Lennart Augustsson
If you use read (reads) and show for the actual conversion it will round trip. It appears to be non-trivial since most languages and libraries get it wrong. :) -- Lennart On Tue, Feb 23, 2010 at 1:44 PM, Andy Gimblett wrote: > Hi all, > > Short version: How can I pretty print and par

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Lennart Augustsson
Supply a fix for the problem, and it will probably get included. There has probably been little demand for this feature so far. -- Lennart On Sun, Feb 21, 2010 at 10:21 PM, Ben Millwood wrote: > On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke > wrote: >> >> You mi

Re: [Haskell-cafe] haskell-src type inference algorithm?

2010-02-12 Thread Lennart Augustsson
y wish-list for haskell-src-exts, and I'm hoping > the stuff Lennart will contribute will go a long way towards making it > feasible. I believe I can safely say that no such tool exists (and if > it does, why haven't you told me?? ;-)), but if you implement (parts > of) one you

Re: [Haskell-cafe] haskell-src type inference algorithm?

2010-02-11 Thread Lennart Augustsson
It does type inference, it's just not engineered to be part of a real compiler. On Thu, Feb 11, 2010 at 6:41 PM, Stephen Tetley wrote: > http://web.cecs.pdx.edu/~mpj/thih/ > > Looks like its a type _checker_ though... > > > On 11 February 2010 17:39, Stephen Tetley wrote: >> Hello Job >> >> For

Re: [Haskell-cafe] haskell-src type inference algorithm?

2010-02-11 Thread Lennart Augustsson
To do anything interesting you also to process modules, something which I hope to contribute soon to haskell-src-exts. On Thu, Feb 11, 2010 at 6:35 PM, Job Vranish wrote: > Anyone know of a type inference utility that can run right on haskell-src > types? or one that could be easily adapted? > I

Re: [Haskell-cafe] Re: could we get a Data instance for Data.Text.Text?

2010-01-23 Thread Lennart Augustsson
ances in Uniplate would just be plain idiotic. Including the Uniplate instances with HSE would make some sense, but would make HSE artificially depend on Uniplate for those who don't want the instances. So, what's left is to make orphan instances (that I own). It's not ideal, but I

Re: [Haskell-cafe] Language simplicity

2010-01-16 Thread Lennart Augustsson
PL/I has keywords, they're just not reserved words. With as many keywords as PL/I has, there something to say for not making them reserved. :) On Wed, Jan 13, 2010 at 11:50 AM, Brandon S. Allbery KF8NH wrote: > On Jan 13, 2010, at 05:45 , Ketil Malde wrote: >> >> "Brandon S. Allbery KF8NH" write

Re: [Haskell-cafe] How to get a list of constructors for a type?

2009-12-30 Thread Lennart Augustsson
I've put some of Oleg's code on hackage, named polytypeable. > import Data.PolyTypeable > main = print [polyTypeOf Nothing, polyTypeOf Just] This prints [Maybe a1,a1 -> Maybe a1] To get a list of the actual constructors you need to derive Data.Data.Data and use that.

Re: [Haskell-cafe] ANNOUNCE: repr-0.3.2

2009-12-24 Thread Lennart Augustsson
Did you consider using the traced package? 2009/12/24 Bas van Dijk : > On Thu, Dec 24, 2009 at 1:00 AM, Andrey Sisoyev > wrote: >> Where do you make use of it? :) > > A few months ago I was working on 'levmar'[1] a Levenberg-Marquardt > data fitting library in Haskell. If you want your data fitti

Re: [Haskell-cafe] Zumkeller numbers

2009-12-08 Thread Lennart Augustsson
And if you use quotRem it's faster (unless you're running on some exotic hardware like NS32K). On Tue, Dec 8, 2009 at 10:19 PM, Richard O'Keefe wrote: > > On Dec 9, 2009, at 1:15 AM, Daniel Fischer wrote: > >> Am Dienstag 08 Dezember 2009 08:44:52 schrieb Ketil Malde: >>> >>> "Richard O'Keefe" w

Re: [Haskell-cafe] Optimization with Strings ?

2009-12-03 Thread Lennart Augustsson
Thank you Sir for giving me a good laugh! On Thu, Dec 3, 2009 at 5:25 PM, John D. Earle wrote: > Dear Emmanuel Chantréau, > > You may want to look into Objective CAML http://caml.inria.fr/ which is a > French product as you can see from the Internet address. It is likely better > suited to the ta

Re: [Haskell-cafe] Coercing numeric and string constants

2009-11-16 Thread Lennart Augustsson
Try with -XExtendedDefaulingRules. On Mon, Nov 16, 2009 at 6:33 AM, Mark Lentczner wrote: > I'm looking for a good way to handle a library interface that accepts both > strings and numbers in particular argument positions: > > Start with the following definitions. I've defined ResourceTree as a

Re: [Haskell-cafe] Little errors in number calculations

2009-11-15 Thread Lennart Augustsson
Hugs is wrong, as you can easily see by evaluating let x = 123.35503 * 10.0 in x == read (show x) With ghc it comes out as True and with Hugs as False. -- Lennart On Sat, Nov 14, 2009 at 9:00 PM, Abby Henríquez Tejera wrote: > Hi. > > I've seen that in GHC sometimes there are

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-14 Thread Lennart Augustsson
e second one. Some people thought it was to error prone not to have any indication when an existential type is introduced, so instead we are now stuck with a somewhat confusing keyword. -- Lennart On Sat, Nov 14, 2009 at 4:55 PM, Mark Lentczner wrote: > On Nov 12, 2009, at 2:59 PM, Sean Leather

Re: [Haskell-cafe] Opinion about JHC

2009-11-13 Thread Lennart Augustsson
Thanks Neil, That was indeed my point. Since a compiler is a substantial program I would have more confidence it a compiler that is self-hosting. Surely you must have tried? -- Lennart On Fri, Nov 13, 2009 at 8:08 PM, Neil Mitchell wrote: > Hi John, > >>> Do you use jhc when

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Lennart Augustsson
If by minority platform you mean platforms that are resource starved, like some embedded systems, then I would have to agree. -- Lennart On Wed, Nov 11, 2009 at 2:12 PM, Donn Cave wrote: > Quoth Lennart Augustsson , > >> Do you use jhc when you develop jhc?  I.e., does it co

Re: [Haskell-cafe] Opinion about JHC

2009-11-11 Thread Lennart Augustsson
John, Do you use jhc when you develop jhc? I.e., does it compile itself. For me, this is the litmus test of when a compiler has become usable. I mean, if even the developers of a compiler don't use it themselves, why should anyone else? :) -- Lennart On Wed, Nov 11, 2009 at 3:37 AM,

Re: [Haskell-cafe] pretty printing with comments

2009-10-20 Thread Lennart Augustsson
It's not an easy problem to pretty print (i.e. change indentation) and preserve the comments. And always get it right. On Tue, Oct 20, 2009 at 1:28 PM, Pasqualino "Titto" Assini wrote: > Thanks Niklas, > > in fact this produced a source with comments: > > > import Language.Haskell.Exts.Annotated

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals & multiplication)

2009-10-13 Thread Lennart Augustsson
Yes, there are simple H-M examples that are exponential. x0 = undefined x1 = (x1,x1) x2 = (x2,x2) x3 = (x3,x3) ... xn will have a type with 2^n type variables so it has size 2^n. -- Lennart On Tue, Oct 13, 2009 at 6:04 PM, Brad Larsen wrote: > On Tue, Oct 13, 2009 at 3:37 AM, Simon Pey

Re: Re[2]: [Haskell-cafe] type inference question

2009-10-08 Thread Lennart Augustsson
what type you give me. The second one says, I (foo) require you (the caller) to give me an numeric 'a' that I can use any way I want. You (the caller) don't get to choose what type you give me, you have to give me a polymorphic one. -- Lennart On Thu, Oct 8, 2009 at 5:35 PM, Bula

Re: [Haskell-cafe] type inference question

2009-10-08 Thread Lennart Augustsson
The reason a gets a single type is the monomorphism restriction (read the report). Using NoMonomorphismRestriction your example with a works fine. On Thu, Oct 8, 2009 at 12:29 PM, Cristiano Paris wrote: > On Thu, Oct 8, 2009 at 11:04 AM, minh thu wrote: >> Hi, >> >> I'd like to know what are the

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Lennart Augustsson
OK, "just pairs" have no arithmetic, but one way of defining arithmetic is to treat the pairs as complex numbers. Or as mantissa and exponent. Or as something else. So there's nothing wrong, IMO, to make pairs an instance of Num if you so desire. (Though I'd probably introduce a new type.) On

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Lennart Augustsson
too. After that, you have two choices: a) > admit that complex numbers and double numbers are the same - and most > mathematicians would agree they aren't - or b) admit that the relation "be > the same" is not transitive - which is simply bizarre. > > > Lennart Aug

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Lennart Augustsson
Everyone agrees that the Haskell numeric hierarchy is flawed, but I've yet to see a good replacement. On Mon, Oct 5, 2009 at 4:51 PM, Brad Larsen wrote: > On Mon, Oct 5, 2009 at 10:36 AM, Miguel Mitrofanov > wrote: > [...] >> Of course, it's OK to call anything "numbers" provided that you stated

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Lennart Augustsson
But complex numbers are just pairs of numbers. So pairs of numbers can obviously be numbers then. On Mon, Oct 5, 2009 at 4:40 PM, Miguel Mitrofanov wrote: > Lennart Augustsson wrote: >> >> And what is a number? > > Can't say. You know, it's kinda funny to ask

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Lennart Augustsson
And what is a number? Are complex numbers numbers? On Mon, Oct 5, 2009 at 3:12 PM, Miguel Mitrofanov wrote: > > > Sönke Hahn wrote: > >> I used to implement >> >>    fromInteger n = (r, r) where r = fromInteger n >> >> , but thinking about it, >>    fromInteger n = (fromInteger n, 0) >> >> seems

Re: [Haskell-cafe] Re: Is logBase right?

2009-08-27 Thread Lennart Augustsson
attern. So there's no "keep more decimals", just a matter of string conversion. -- Lennart On Tue, Aug 25, 2009 at 7:11 PM, Ketil Malde wrote: > Steve writes: > >> Also, I had a problem using floating point in Python where >>>>> round(697.04157958254996,

Re: [Haskell-cafe] Re: Is logBase right?

2009-08-25 Thread Lennart Augustsson
base there would be a small penalty. -- Lennart On Tue, Aug 25, 2009 at 3:20 PM, Henning Thielemann wrote: > > On Sun, 23 Aug 2009, Lennart Augustsson wrote: > >> You're absolutely right.  It would be easy to change logBase to have >> special cases for, say, base 2 an

Re: [Haskell-cafe] Re: Is logBase right?

2009-08-23 Thread Lennart Augustsson
You're absolutely right. It would be easy to change logBase to have special cases for, say, base 2 and base 10, and call the C library functions for those. In fact, I think it's a worth while change, since it's easy and get's better results for some cases. -- Lennart On

Re: [Haskell-cafe] Unifcation and matching in Abelian groups

2009-08-22 Thread Lennart Augustsson
Even if you are only slightly irritated by offset syntax, why are you using it? {;} works fine. On Sat, Aug 22, 2009 at 3:51 AM, John D. Ramsdell wrote: > Let me put all my cards on the table.  You see, I really am only > slightly irrigated by offset syntax.  In contrast, I am a strong > proponent

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Lennart Augustsson
-response model. I take that as a sign that unsafePerformIO is bad. :) -- Lennart On Fri, Aug 21, 2009 at 3:14 PM, Derek Elkins wrote: > On Fri, Aug 21, 2009 at 5:04 AM, Lennart > Augustsson wrote: >>> On Fri, Aug 21, 2009 at 10:52 AM, Bayley, Alistair >>> wrote: >&g

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Lennart Augustsson
You need a lot of magic to make the IO monad efficient. You don't really want to pass around (and pattern match on) a RealWorld token, that would be inefficient. On Fri, Aug 21, 2009 at 11:04 AM, Peter Verswyvelen wrote: > IO also seems to use unboxed (hence strict?) tuples > > newtype IO a = IO

Re: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Lennart Augustsson
means. It's uninteresting for this discussion how GHC enforces the sequencing internally, the important part is that it is part the sequencing is part of the IO monad semantics and this is what should be used to guarantee the sequencing of IO operations in a program. -- Lennart On Thu, Au

Re: [Haskell-cafe] Re: Where do I put the seq?

2009-08-20 Thread Lennart Augustsson
Using seq to control a program's semantics (as in, input-output behaviour) is a horrible hack. The seq operation there to control space and time aspects of your program. (The specification of seq doesn't even say that the first argument is evaluated before the second one.) You should use data depen

Re: [Haskell-cafe] unsafeDestructiveAssign?

2009-08-11 Thread Lennart Augustsson
assume your code is pure. -- Lennart On Tue, Aug 11, 2009 at 5:48 PM, Job Vranish wrote: > Does anybody know if there is some unsafe IO function that would let me do > destructive assignment? > Something like: > > a = 5 > main = do >   veryUnsafeAndYouShouldNeverEveryCall

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-09 Thread Lennart Augustsson
expect things to still work. For RecordPuns I don't have an opinion on what to do. -- Lennart On Sun, Aug 9, 2009 at 9:42 PM, Simon Peyton-Jones wrote: > Oh, now I get it, thanks.  This message concerns design choices for > record-syntax-related GHC extensions.  Lennart, pls tune in.

Re: [Haskell-cafe] Complex numbers and (**)

2009-08-08 Thread Lennart Augustsson
A2: Yes, this seem unfortunate, so perhaps a different definition for Complex is warranted. Or maybe the default implementation for (**) should be changed so that 0**x is 0, except if x is 0 (in which case I think it should be undefined). -- Lennart On Sat, Aug 8, 2009 at 2:55 PM, Paul

Re: [Haskell-cafe] Re: Simple quirk in behavior of `mod`

2009-08-04 Thread Lennart Augustsson
That how I was taught to round in school, so it doesn't seem at all unusual to me. 2009/7/23 Matthias Görgens : >> Round-to-even means x.5 gets rounded to x if x is even and x+1 if x is >> odd. This is sometimes known as banker's rounding. > > OK.  That's slightly unusual indeed. > ___

Re: [Haskell-cafe] Re: Adding a field to a data record

2009-07-29 Thread Lennart Augustsson
With the RecordWildCard extension you should be able to write newFoo Old.Foo{..} = New.Foo { .., z=1 } On Tue, Jul 28, 2009 at 3:47 PM, Henry Laxen wrote: > Malcolm Wallace cs.york.ac.uk> writes: > >> >> > and perhaps use emacs to >> > query-replace all the Foo1's back to Foo's >> >> At least

Re: [Haskell-cafe] Slightly off-topic: Lambda calculus

2009-06-21 Thread Lennart Augustsson
Actually, keeping all names distinct is not de Bruijn numbering, it's called the Barendregt convention. On Sun, Jun 21, 2009 at 7:05 PM, Deniz Dogan wrote: > 2009/6/21 Andrew Coppin : >> OK, so I'm guessing there might be one or two (!) people around here who >> know something about the Lambda cal

Re: [Haskell-cafe] Slightly off-topic: Lambda calculus

2009-06-21 Thread Lennart Augustsson
ot; during substitution, i.e., renaming the bound variables. -- Lennart On Sun, Jun 21, 2009 at 6:53 PM, Andrew Coppin wrote: > OK, so I'm guessing there might be one or two (!) people around here who > know something about the Lambda calculus. > > I've written a simple interpre

Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Lennart Augustsson
Did you try running it in some debugger, like windbg or VS? 2009/6/20 Andrew Coppin : > Marcin Kosiba wrote: >> >> On Saturday 20 June 2009, Andrew Coppin wrote: >> >>> >>> OK, so here's an interesting problem... >>> >>> I've been coding away all day, but now my program is doing something >>> slig

Re: [Haskell-cafe] unique identity and name shadowing during type inference

2009-06-20 Thread Lennart Augustsson
Use 1. You'll probably need a monad in the type checker soon or later anyway, e.g., for handling errors. On Sat, Jun 20, 2009 at 7:57 PM, Geoffrey Irving wrote: > Hello, > > I am designing a type inference algorithm for a language with > arbitrary function overloading.  For various reasons (beyon

Re: [Haskell-cafe] curious about sum

2009-06-17 Thread Lennart Augustsson
ot; way to go. That is not the way the creators of Haskell > designed language though... am i missing something? > > On Wed, Jun 17, 2009 at 4:05 PM, Lennart > Augustsson wrote: >> What do you mean by "literals are strict"?  Strictness is a semantic >> p

Re: [Haskell-cafe] curious about sum

2009-06-17 Thread Lennart Augustsson
What do you mean by "literals are strict"? Strictness is a semantic property of functions, and while literals can be overloaded to be functions I don't know what you mean. On Wed, Jun 17, 2009 at 9:50 PM, Keith Sheppard wrote: > Haskell's numeric literals are strict. You wouldn't want that to > c

Re: [Haskell-cafe] Performance of functional priority queues

2009-06-15 Thread Lennart Augustsson
I wasn't contradicting you, just clarifying that this is indeed the optimal asymtotic complexity. On Mon, Jun 15, 2009 at 3:43 PM, Sebastian Sylvan wrote: > Is that not what I said? > > On Mon, Jun 15, 2009 at 2:12 PM, Lennart Augustsson > wrote: >> >> A priority qu

Re: [Haskell-cafe] Performance of functional priority queues

2009-06-15 Thread Lennart Augustsson
A priority queue can't have all operations being O(1), because then you would be able to sort in O(n) time. So O(log n) deleteMin and O(1) for the rest is as good as it gets. On Mon, Jun 15, 2009 at 10:40 AM, Sebastian Sylvan wrote: > > > On Mon, Jun 15, 2009 at 4:18 AM, Richard O'Keefe wrote: >

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Lennart Augustsson
= not (x /= y) On Thu, May 28, 2009 at 8:14 AM, Simon Peyton-Jones wrote: > You are absolutely right about the tantalising opportunity.  I know that > Lennart has thought quite a bit about this very point when designing his > Paradise system.  Likewise Conal for Pan. > > One diffi

Re: [Haskell-cafe] Haskell type system and the lambda cube

2009-05-25 Thread Lennart Augustsson
Type checking is decidable for all of the lambda cube, but not type inference. Haskell 98 is a subset of Fw, Haskell with extensions is an superset of Fw. -- Lennart On Mon, May 25, 2009 at 12:59 PM, Brent Yorgey wrote: > On Sun, May 24, 2009 at 10:39:50AM +0200, Petr Pudlak wrote: >&g

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Lennart Augustsson
Simplicity of pattern matching semantics, not of implementation (we all knew how to implement it). Miranda had non-linear patterns, but nobody really argued for them in Haskell. If Haskell had them, I'd not argue to have them removed, but nor will I argue to add them. -- Lennart On Fri, M

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Lennart Augustsson
In the original language design the Haskell committee considered allowing multiple occurrences of the same variable in a pattern (with the suggested equality tests), but it was rejected in favour of simplicity. -- Lennart On Fri, May 15, 2009 at 11:30 AM, Sittampalam, Ganesh wrote: > Co

Re: [Haskell-cafe] is value evaluated?

2009-05-09 Thread Lennart Augustsson
But testing for something being evaluated has to be in the IO monad, or else you're going to break the semantics. On Fri, May 8, 2009 at 4:14 PM, Don Stewart wrote: > Andy Gill has been advocating programmatic access to the 'is evaluated' > status bit for years now. 'seq' becomes cheaper, and we

  1   2   3   4   5   6   7   >