foldM vs. foldL and foldR

1997-02-02 Thread Tommy Thorn
Please, could anybody explain me what the rationale behind the current foldM in Monad? At least of the IO monad, it seems important to have a left associative fold instead of the right associative foldM. Adding to my confusion, it seems that earlier in time, there was indeed two monad fold's

Haskell 1.3?

1996-03-05 Thread Tommy Thorn
Quoting from "Introducing Haskell 1.3" (http://www.cs.yale.edu/ HTML/YALE/CS/haskell/haskell13.html): "The final version of the Haskell 1.3 is expected to be complete in January, 1996." Does anyone know what happens? Regards, Tommy -- "When privacy is outlawed, only outlaws will have

pattern guards and guarded patterns

1997-04-30 Thread Tommy Thorn
I can see the arguments for the pattern guard extension and the syntax seem reasonable. I also agree with Chris on the shortcomings of if-then-else. (I have disliked it in any language where I've seen it, and it "feels" un-Haskell-like to me.) On the other hand, the suggested case |

Punning: Don't fix what ain't broken.

1998-02-11 Thread Tommy Thorn
John Hughes wrote on the Std Haskell board: `Punning' can be used in three places in Haskell. Suppose a record type is defined by data R = R{x :: Int} Then * R{x} constructs a record, and is equivalent to R{x=x} * r{x} updates the x field of record r, and is equivalent to

Re: Punning: Don't fix what ain't broken.

1998-02-12 Thread Tommy Thorn
Koen Claessen: This brings us to another issue. Doesn't the following definition look a bit awkward? R{ x = x } Definitely wierd. The left and right-hand side denotes two different things, which AFAIK is the only place where `=' behaves like this. Wouldn't `-' have been a better choice?

the overloading of ==

1998-03-12 Thread Tommy Thorn
Victor M. Gulias wrote/a ecrit/skrev: As a naive implementation of "all" and "any", one of my students coped with these definitions: any' p xs = [x | x - xs, p x] /= [] all' p xs = [x | x - xs, p x] == xs I used to be in favor of the monadic overloading of list operations, but this

FP Naming/Directory Service

1998-03-24 Thread Tommy Thorn
S. Alexander Jacobson wrote/a ecrit/skrev: I just started playing with Haskell for CGI applications. I would like to try writing a more serious CGI app, but missing infrastructure makes it more difficult than conventional approaches. On a general note, I too try employ Haskell for more and

Phil's Pretty Printing Library

1998-03-27 Thread Tommy Thorn
Library Hacked somewhat to pieces by Tommy Thorn, 26/3-1998 Major changes: - + and $$ has nil (empty) as unit. - bline is a blind line that disappears when flattened module WadlersPretty where infixr 5 :| infixr 6 : infixr 6 , + infixr 5 /, $$ data Doc= Nil

Keep it up! [Re: Where is Haskore discussed?]

1998-05-06 Thread Tommy Thorn
Hi there, Just a my "deux centimes" to say that I'm happy with "application" oriented discussion on the Haskell list. In fact, I'd be happy to see more "applications" discussed, like CGI, Fran, Happy, ... /Tommy

Re: FW: Exceptions are too return values!

1998-06-10 Thread Tommy Thorn
Thats a wonderful idea. With that it will be so much easier to write robust code without bloating the code with error checks. I've always been annoyed that I couldn't trap arbitrary errors, say to close down the application cleanly. Now, we only need extendible data types, and then we have an

GHC import chasing [Was: GHC/Hugs Status]

1998-07-20 Thread Tommy Thorn
Alastair Reid wrote/a ecrit/skrev: * import-chasing as part of the spec This is an environment feature not a language feature. What does it mean for GHC? Are you wanting to do away with Makefiles? Makefiles can do an awful lot more than import chasing can and GNU makefiles are very,

Plea for Change #1: Why, O why, `Main'?

1999-03-29 Thread Tommy Thorn
Jens' question gave my a perfect opportunity to open my a pet peeve of mine: the ditatorship of `Main'. In Haskell, the `main' function must reside in the `Main' module. Add to this that the `Main' module must reside in a `Main' file and you have an unfortunate consequence that you can only

Plea for Change #2: Tools

1999-03-29 Thread Tommy Thorn
I have another pet peeve: ease of use of tools. The Haskell standard (intentionally?) leaves the interface to tools an implementors question. Unfortunate, IMHO, every Haskell compiler I've tried (GHC, NHC, HBC) have just had plain horrible interfaces. Interpreters are inherently a different

A datatype for the text editor buffer?

1999-07-06 Thread Tommy Thorn
Peter Hancock wrote/a ecrit/skrev: I don't think its crazy. I thought that one could start with something simple, like a "before" list and an "after list". Indeed. When I was getting into Haskell, I hacked the ansi.hs example from the Hugs distribution to add editing. Parts of the function

Re: Haskell HTTP lib?

1999-08-27 Thread Tommy Thorn
Sven Panne wrote/a ecrit/skrev: William Lee Irwin III wrote: Personally, I'd like to see some equivalent of the C system call select(2) in GHC's socket library; [...] About a year ago this has been discussed, but the implementation has somehow vanished from GHC's sources. Strange...

Mixing fruits [Was: Clean and Haskell]

2000-01-13 Thread Tommy Thorn
I makes very little sense to compare GCC (C++) with GHC (Haskell) inspite of the sneaky names. 1) While no C++ expert, I'd conjecture that compiling C++ is roughly five times harder than C, due to C++ being a much larger language with _many many_ ugly corners. The difficulty in compiling

drop take [was: fixing typos in Haskell-98]

2000-01-24 Thread Tommy Thorn
S. Alexander Jacobson writes: The correct definitions would be: take -2 -- drops the last 2 elements from the list (takes everything except the last 2 elements) drop -2 -- grabs the last 2 elements from the list (drops everything except the last 2 elements)

Re: drop take [was: fixing typos in Haskell-98]

2000-01-25 Thread Tommy Thorn
Chris Okasaki wrote: For the people that share this sentiment, can you please explain why ints that are too big should not similarly give an error? I can see both being ok, or both being errors. I just don't see why one should be ok and the other an error. IMHO, both should be errors.

Constrained instances?

2000-04-29 Thread Tommy Thorn
Isn't it possible to constrain instances? I tried the following where the idea is to implement a simple monad, but one which can only pass and return values that are showable. newtype Show a = TracingEv a = TE (Int - IO (Int,a)) unTE :: Show a = TracingEv a - Int - IO (Int,a) unTE (TE x)

Desugarer for the happy Haskell parser?

2000-05-03 Thread Tommy Thorn
First let me thank the authors of the prototype Haskell parser (Simon Marlow, Sven.Panne, and Noel Winstanley). It's a beautiful piece of work. While writing a desugarer for this, it occurred to me that somebody might already have done the work and be willing to share it, if not I'll make it

What happened to the GRIN project?

2000-06-19 Thread Tommy Thorn
Long time ago I read The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages Urban Boquist Thomas Johnson I thought it sounded very promising, but

Pattern matching

2000-06-20 Thread Tommy Thorn
I've looked at the pattern matching semantics as defined in the Haskell 98 report and there is few things I don't understand. 1) In Figure 3 (Semantics of Case Expressions, Part 1) clause c reads: case v of { p | g1 - e1 ; ... | gn - en where { decls } _ -

Desugaring of top-level pattern bindings?

2000-06-29 Thread Tommy Thorn
I'm puzzled by the Haskell 98 report, as it doesn't seem to explain how to desugar top-level pattern declarations, such as (x,y) = e In Section 4.4.3 (Function and Pattern Bindings) under Pattern Bindings it essentially says ``A simple pattern binding has form p = e. The pattern p is

Re: ghc 4.01 solaris binary dist: bus error on Hello World!

1999-01-15 Thread Tommy Thorn
Olaf Chitil wrote/a ecrit/skrev: Do you use gcc 2.8.1? Under Solaris 2 ghc doesn't work with that version. However, it works with gcc 2.7.2. If you have that under the name gcc-2.7.2 you can ask ghc to call this version instead of gcc by writing: ghc -pgmcgcc-2.7.2 -o Test Test.hs That was

threadDelay in 4.01?

1999-01-26 Thread Tommy Thorn
I might have overlooked something, but I couldn't find the (documented) threadDelay function in GHC 4.01. Could anyone enligthen me please? I'm trying to compile one of my 3.02 applications that make use of it. Thanks in advance, Tommy

Re: [Haskell-cafe] Specialized Computer Architecture - A Question

2013-03-31 Thread Tommy Thorn
and get it running on cheaper hardware. I would love more contributors, especially on compiler side (using a real Haskell front-end would be just lovely). Anyway, check it out and play around. I'll be happy to help. Tommy Thorn On Mar 19, 2013, at 05:07 , Simon Farnsworth si...@farnz.org.uk wrote

Re: [Haskell-cafe] Compilers book in Haskell

2013-04-07 Thread Tommy Thorn
You beat me to it although I'd reverse the order of your list. Also I wouldn't ignore the classic, http://www.amazon.com/Compilers-Principles-Techniques-Tools-Edition/dp/0321486811 but know that it has next to nothing useful specific to FP languages, and certainly not lazy languages. Tommy On

Re: [Haskell-cafe] Looking for portable Haskell or Haskell like language

2013-04-26 Thread Tommy Thorn
Hugs98, or failing that, the original Hugs, will almost certainly be easier to compile for your RHEL5 system, but do note that it's not a compiler in the sense that it makes standalone binaries. Given your constraints, it's probably the best choice. Tommy On Apr 26, 2013, at 22:21 ,

Re: [Haskell-cafe] BayHac '13

2013-05-04 Thread Tommy Thorn
Excellent. I signed up and hope to make it. Could you add https://github.com/tommythorn/Reduceron to the project list? I'll bring hardware and blink some LEDs from Haskell(*) without a CPU. Thanks Tommy (*): Well, F-lite, but it'll be Haskell one day On May 3, 2013, at 22:54 , Mark Lentczner

Re: [Haskell-cafe] Simplest way to learn FRP through use

2013-05-31 Thread Tommy Thorn
Unless I am missing something, The Haskell School of Expression has an excellent introduction to it. Tommy On May 31, 2013, at 20:41 , Christopher Howard christopher.how...@frigidcode.com wrote: I want to learn FRP but am having trouble wading through all the theory about how FRP is

[Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-02 Thread Tommy Thorn
On Jun 2, 2013, at 12:52 , Henry Laxen nadine.and.he...@pobox.com wrote: Yes, that was it. The dell was a 32 bit system, and the desktop a 64. I changed everything from Int to Integer, and now both agree. Thanks for the pointer. Isn't that just terrible? I hate the fact that Haskell was

Re: [Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-02 Thread Tommy Thorn
On Jun 2, 2013, at 14:13 , Kata lightqu...@amateurtopologist.com wrote: In addition to Haskell already having an arbitrary-width integer type called Integer But I wasn't asking for arbitrary-width. I was asking for explicit failures (overflow) rather than C-like silent corruption. ,

Re: [Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-03 Thread Tommy Thorn
On Jun 2, 2013, at 23:58 , Carter Schonwald carter.schonw...@gmail.com wrote: Indeed, as Dan says, theres the safeint library and the Integer type. If the Int type had either of these semantics by default, many many performance sensitive libraries would suddenly have substantially less

Re: [Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-03 Thread Tommy Thorn
On Jun 3, 2013, at 00:23 , Carter Schonwald carter.schonw...@gmail.com wrote: Int is native register sized integer Actually it's not. Read the definition. Int is only guaranteed to be 29 bits. Here's *one* _actual_ data point (from a 2.8 GHz i7, 64-bit code): time ./fib fib(43) = 701408733

Re: [Haskell-cafe] Efficiency/Evaluation Question

2013-06-15 Thread Tommy Thorn
I expect you'll get many replies... row (Grid s l) n = if (n = s) then [] else l !! n col g@(Grid s l) n = if (n = s) then [] else col_ g n 0 where col_ (Grid s l) n i = if (i = s) then [] else (head l !! n) : col_ (Grid s (tail l)) n (i + 1) While such low-level approach (focus on the

Re: [Haskell-cafe] ANNOUNCE: Ajhc Haskell Compiler 0.8.0.7 Release

2013-07-08 Thread Tommy Thorn
On Jul 6, 2013, at 03:07 , Kiwamu Okabe kiw...@debian.or.jp wrote: Umm... Is your question Is Ajhc's goal that build the compiler for Android? If so, the answer is No. The Ajhc's goal is that find the compiler to rewrite the NetBSD kernel with Haskell. But you can do support Android. I

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Tommy Thorn
+1 When I worked on the font-lock support for haskell-mode, the irony of trying to approximate the classification that the hugs/ghc/whatnot parser was already doing wasn't lost on me. I still would like to tap into more of the knowledge generated and lost in the compiler: - A list of all tokens

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Tommy Thorn
On Aug 20, 2013, at 02:19 , Niklas Broberg niklas.brob...@gmail.com wrote: Sadly not - it's theoretically impossible. The fact that you can put comments literally wherever, means that it's impossible to treat them as nodes of the AST. E.g. f {- WHERE -} x = -- WOULD -- THESE

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Tommy Thorn
This is interesting and I wish them luck, but it seems surprising that the below link doesn't have as much as a screenshot (for an IDE, you kind of expect to see what it looks like). After much browsing around on their website I finally found the Video Demo: