Re: Debugging haskell

2003-02-24 Thread Andrew Moran

Dave Tweed wrote:

 If you discard `compliation preventing, very very quick to solve' bugs
 (e.g., missing semi-colons in C++, silly typecheck errors in Haskell) I
 find that the ratio between source code bugs and algorithm bugs is maybe
 1:5. This means that whilst I find Haskell a great deal easier to write
 correctly than C++, there's not that much difference between debugging
 times for Haskell and C++ because the algorithm level bugs dominate.

In my experience, the number of algorithm bugs is usually about the same, 
regardless of which language you're using.  And simple source code bugs are 
no real problem in any language.  But because there's more translation 
involved in rendering a mental model of an algorithm in C++ than in Haskell, 
there's much more opportunity for introducing more subtle source code bugs.  
I find that I very rarely have these kinds of bugs in Haskell (and the 
type-checker usually catches them anyway), but they were always the largest 
proportion of bugs when I used to program in C, etc.

A

-- 
Andy Moran  Ph.  (503) 526 3472
Galois Connections Inc. Fax. (503) 350 0833
3875 SW Hall Blvd.http://www.galois.com
Beaverton, OR 97005[EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread Andrew Moran

Joe English wrote:

 Fergus Henderson wrote:
 
  Sorry for the off-topic post, but I figured someone here would know...
  can anyone please tell me how to do the double-square-bracket symbols
  that are often used in denotational semantics in LaTex?  It's like
  [[ but a single symbol without the space between the two brackets.
 
 It's often done by squishing together two ordinary square brackets
 with a negative thin space (\!):
 
 \newcommand{\sembrack}[1]{[\![#1]\!}
 
 This looks good with Computer Modern; with other fonts YMMV.

There's also \llbracket and \rrbracket, from stmaryrd.  They look better than
the negative space hack, IMHO (now all I need is for Alan Jeffrey to write in
and say that \{ll,rr}bracket are implemented with the negative space hack :-)

Cheers,

Andy

-- 
Andy Moran  Ph.  (503) 526 3472
Galois Connections, Inc.Fax. (503) 350 0833
3875 SW Hall Blvd.   http://www.galconn.com
Beaverton, OR 97005   [EMAIL PROTECTED]

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: GHCi command line

2001-05-04 Thread Andrew Moran

Julian Seward (Intl Vendor) wrote:

 It's a known issue^H^H^H^H^Hbug.  I don't think we yet have
 a story about how to fix this.

How about a :main args which sets the appropriate environment variables to
args?  Or would that affect GHCi's settings?

Cheers,

Andy

-- 
Andy Moran  Ph.  (503) 526 3472
Galois Connections, Inc.Fax. (503) 350 0833
3875 SW Hall Blvd.   http://www.galconn.com
Beaverton, OR 97005   [EMAIL PROTECTED]

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



GHCi command line

2001-05-03 Thread Andrew Moran


Running a main that calls getArgs inside GHCi yields the arguments to GHCi,
not main.  Any way around this?

Cheers,

Andy

-- 
Andy Moran  
PacSoft x7557
Computer Science  Engineering+1 503 748 7557
Oregon Graduate Institute   http://www.cse.ogi.edu/~moran

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



Re: types with value parameter (another example of application)

1999-03-03 Thread Andrew Moran

[EMAIL PROTECTED] writes:

 Andrew J. Kennedy.  Dimension Types. In ESOP '94: Proceedings of the
   Fifth European Symposium on Programming, Lecture Notes in Computer
   Science 788.  Springer-Verlag, 1994
 
   Available electronically from the out-of-date home page 
   http://www.cl.cam.ac.uk/~ajk13/

Mikael Rittri followed up this work:

   Mikael Rittri.  Dimension inference under polymorphic recursion. In
 FPCA'95: Proceedings of the 7th ACM Conf. on Functional Programming
 Languages and Computer Architecture, La Jolla, California. Pages
 147-159. ACM Press 1995.

   http://ftp.cs.chalmers.se/users/pub/rittri/dimpolyrec.ps.Z

He adds polymorphic recursion (for dimensions) to Kennedy's type system.  This
allows, e.g., definition of a datatype for polynomials that has the correct
dimension type and functions over it (the latter requires the polymorphic
recursion).

Cheers,

Andy





Re: Haskell 2 -- Dependent types?

1999-02-19 Thread Andrew Moran

Lennart Augustsson writes:

  OK, I'm curious.  Two people replied that C++ has undecidable type
  checking.  I was not aware of this (although I can't say I'm too
  surprised); do you have a reference?

 It's actually the template processing that can loop, but it is
 sort of part of the type checking.
 
 You can find an article in the POPL 99 proceeding about it.

Actually, I think Lennart means PEPM '99.  At least, there's an article called
"C++ Templates as Partial Evaluation" by Todd Veldhuizen (from the
wonderfully-named Extreme Computing Laboratory) which refers to this.  He
cites an example of using the templates to generate a list of prime numbers at
compile time due to Erwin Unruh (apparently discovered accidentally!).

Cheers,

Andy





Re: Formal design spec into Haskell or Miranda

1997-10-21 Thread Andrew Moran

Andrew Butterfield writes:

 At 15:41 +0100 20/10/97, Greg Michaelson wrote: (rearranged by me for
 dramatic effect :-)

 But you should look at the Jones and Hayes paper from Software Engineering
 Journal called something like "Executions are not (always) executable"

I think Greg means "_Specifications_ are not (necessarily) executable", by Ian
Hayes and Cliff Jones.  It appeared in the Software Engineering Journal,
4(6):330--338, November 1989.

Cheers,

Andy





Re: A new view of guards

1997-04-30 Thread Andrew Moran

Brian Boutel writes:

 The - syntax worries me a bit, because in the comprehension use it has a
 different type, but the let syntax is available, and one can write "let p =
 e" "for p - e". I think that, to reduce possible confusion, I would use,
 and teach, the let form. Given that, I don't object to the funny use of -.

Good point, but now one has too many ='s:

simplify (Plus e e') | let (Val 0) = s  = s'
 | let (Val 0) = s' = s
 | otherwise= Plus s s'
 where
 s  = simplify e
 s' = simplify e'

I think that's very confusing too.

Cheers,

Andy