Re: [Haskell-cafe] Dynamic thread management?

2007-08-22 Thread Brandon Michael Moore
On Wed, Aug 22, 2007 at 04:07:22AM +0100, Hugh Perkins wrote: On 8/21/07, Andrew Coppin [EMAIL PROTECTED] wrote: I highly doubt that automatic threading will happen any time this decade - but I just learned something worth while from reading this email. ;-) That's an interesting

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brandon Michael Moore
On Wed, Aug 15, 2007 at 11:06:36AM -0700, Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions,

Re: [Haskell-cafe] Re: towards a new foundation for set theory with atoms

2007-08-11 Thread Brandon Michael Moore
On Fri, Aug 10, 2007 at 03:54:23PM -0700, Greg Meredith wrote: Haskellians, A quick follow up. If you look at the code that i have written there is a great deal of repeated structure. Each of these different kinds of sets and atoms are isomorphic copies of each other. Because, however, of

Re: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-09 Thread Brandon Michael Moore
On Thu, Aug 09, 2007 at 11:52:17AM -0700, David Roundy wrote: On Thu, Aug 09, 2007 at 02:08:20PM +0100, Jules Bean wrote: *snip* A third example is with nested dos: do x - bar y baz something $ do foo x is not the same as do baz something $ do foo (- bar y)

Re: [Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Brandon Michael Moore
much snipping Also, note, if you use the operators in Control.Applicative, then: return $ foo $(bar1) $(bar2) $(bar3) ... can be: return foo * bar1 * bar2 * bar3 ... or: foo $ bar1 * bar2 * bar3 I don't (personally) see how that's any more cryptic than placing brackets

Re: Re : [Haskell-cafe] Indentation woes

2007-07-27 Thread Brandon Michael Moore
On Thu, Jul 26, 2007 at 05:34:32PM -0400, anon wrote: 2007/7/26, Stefan O'Rear [EMAIL PROTECTED]: As for why, it's just a matter of Haskell Committee taste. Nothing too deep, just an arbitrary set of rules. That's not much of an explanation, is it? I imagine someone must have given the

Re: [Haskell-cafe] Minim interpreter

2007-07-20 Thread Brandon Michael Moore
On Fri, Jul 20, 2007 at 10:10:58PM +0200, Hugh Perkins wrote: Newbie question: why does the following give Not in scope 'c' for the last line? I assume you meant string :: Parsec.Parser String string = do c - Parsec.letter do cs - string return c:cs

[Haskell-cafe] Parsing and Coding

2007-07-07 Thread Brandon Michael Moore
On Sat, Jul 07, 2007 at 06:49:25PM +0100, Andrew Coppin wrote: Dave Bayer wrote: I was beginning to accept that I might die before clearing my pipeline of research projects I want to code up. ...so it's *not* just me! Haskell has given me new hope. Indeed. ;-) Today I hve

Re: [Haskell-cafe] Re: Class Interfaces in OOHaskell?

2007-07-06 Thread Brandon Michael Moore
On Fri, Jul 06, 2007 at 06:11:42PM -0400, Scott West wrote: I conquered the below problem, but now I have another question: How can one have two interface-classes that reference each other? For example, type Inter1 = Record ( MkFoo :=: Inter2 - IO () :*: HNil ) type Inter2 = Record

Re: [Haskell-cafe] Best idiom for avoiding Defaulting warnings with ghc -Wall -Werror ??

2007-06-25 Thread Brandon Michael Moore
On Mon, Jun 25, 2007 at 08:53:18AM -0700, Dave Bayer wrote: It continues to appear to me that ghc -Wall -Werror doesn't support small Int constants without a per-use penalty, measured in code length. Why not use ghc -Wall -Werror -fno-warn-defaulting, maybe with default(Int)? It removes the

Re: [Haskell-cafe] Re: Haskell serialisation, was: To yi or not to yi...

2007-06-21 Thread Brandon Michael Moore
On Thu, Jun 21, 2007 at 04:37:20PM +0200, Tom Schrijvers wrote: That wouldn't make a difference. If, from the pure Haskell point of view we can't tell the difference between two expressions that denote the same function, then operations in the IO monad should not be able to do so either.

Re: [Haskell-cafe] What puts False before True?

2007-06-06 Thread Brandon Michael Moore
On Wed, Jun 06, 2007 at 02:50:12AM +0100, PR Stanley wrote: PR Stanley wrote: What do the ??? symbols represent? I see you are still stuck in ISO-8859-1 and deprived of international characters and symbols. (And this reply in ISO-8859-1 too accordingly; normally I use UTF-8.) Unicode

Re: [Haskell-cafe] Monads and constraint satisfaction problems (CSP)

2007-05-31 Thread Brandon Michael Moore
On Thu, May 31, 2007 at 10:42:57AM -0700, Greg Meredith wrote: All, All this talk about Mathematica and a reference to monadic treatments of backtracking reminded me that a year ago i was involved in work on a Mathematica-like widget. At the time i noticed that a good deal of the structure

Re: [Haskell-cafe] What puts False before True?

2007-05-31 Thread Brandon Michael Moore
On Thu, May 31, 2007 at 10:03:05AM +0100, PR Stanley wrote: What is the basic philosophy for Bool being a member of Ord? I hear two questions, why is Bool a member of Ord at all, and why was it ordered with False before True. If I'm reading the reports correctly, the Ord instance was

Re: [Haskell-cafe] where do I point the type annotations

2007-05-18 Thread Brandon Michael Moore
On Fri, May 18, 2007 at 02:39:48AM -0400, Alex Jacobson wrote: I am playing with using SYB to make generic indexed collections. The current code is this: data Syb = Syb [Dynamic] -- list of [Map val (Set a)] empty item = Syb $ gmapQ (toDyn . emp item) item where

Re: [Haskell-cafe] QuickCheck invariants for AST transformations

2007-05-08 Thread Brandon Michael Moore
On Tue, May 08, 2007 at 10:06:32AM +0100, Joel Reymont wrote: I'm looking for suggestions on how to create invariants for the following AST transformation code. Any suggestions are appreciated! I asked this question before and Lennart suggested abstract interpretation as a solution. This

Re: [Haskell-cafe] Indenting with PPrint

2007-05-08 Thread Brandon Michael Moore
On Tue, May 08, 2007 at 07:39:15AM +0100, Joel Reymont wrote: If you happen to be formatting C I've also worked out how to get nice argument lists out of both pretty printers. I'm formatting C# but I'll certainly take your arg list tips. These narrow like foo (a, b) foo (a, b) foo

Re: [Haskell-cafe] Indenting with PPrint

2007-05-07 Thread Brandon Michael Moore
On Mon, May 07, 2007 at 10:38:19PM +0100, Joel Reymont wrote: Folks, Are you using UU.PPrint [1]? Can you tell me how to print stuff like this? { blah blah } I tried the following which sort of works but doesn't return the closing brace to the indentation level of the

Re: Why do we have stack overflows?

2007-05-03 Thread Brandon Michael Moore
On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues with a huge stack per se, but it does not play nice with garbage collection

Re: Release plans

2007-04-18 Thread Brandon Michael Moore
Sending to the right list this time, with some additions. Just to show what kind of problems we are currently facing. The following type checks in our EHC compiler and in Hugs, but not in the GHC: module Test where data T s = forall x. T (s - (x - s) - (x, s, Int)) run :: (forall

[Haskell-cafe] Re: Release plans

2007-04-18 Thread Brandon Michael Moore
On Tue, Apr 17, 2007 at 12:50:48PM +0200, Doaitse Swierstra wrote: Just to show what kind of problems we are currently facing. The following type checks in our EHC compiler and in Hugs, but not in the GHC: module Test where data T s = forall x. T (s - (x - s) - (x, s, Int)) run ::

Re: [Haskell-cafe] Re: Release plans

2007-04-18 Thread Brandon Michael Moore
On Tue, Apr 17, 2007 at 11:39:03PM -0700, Brandon Michael Moore wrote: On Tue, Apr 17, 2007 at 12:50:48PM +0200, Doaitse Swierstra wrote: Just to show what kind of problems we are currently facing. The following type checks in our EHC compiler and in Hugs, but not in the GHC

Re: [Haskell-cafe] First order Haskell without Data

2007-04-18 Thread Brandon Michael Moore
On Thu, Apr 19, 2007 at 02:47:30AM +0100, Neil Mitchell wrote: Hi, I've been wondering what is essential to Haskell and what isn't. Not from a point of view of what could be removed from the language, but what could be removed from a Core language. Given the features of higher-order,

Re: [Haskell-cafe] Why Perl is more learnable than Haskell

2007-04-11 Thread Brandon Michael Moore
On Wed, Apr 11, 2007 at 02:21:41PM +0100, Will Newton wrote: On 4/11/07, kynn [EMAIL PROTECTED] wrote: Perl is a large, ugly, messy language filled with quirks and eccentricities, while Haskell is an extremely elegant language whose design is guided by a few overriding ideas. (Or so I'm

Re: [Haskell-cafe] Profiling makes memory leak go away? Is Haskell a practical language?

2007-04-10 Thread Brandon Michael Moore
On Tue, Apr 10, 2007 at 11:03:32AM -0700, Oren Ben-Kiki wrote: On Tue, 2007-04-10 at 12:14 +0200, apfelmus wrote: Oren Ben-Kiki wrote: The code is in http://hpaste.org/1314#a1 if anyone at all is willing to take pity on me and explain what I'm doing wrong. There is an important point to

Re: [Haskell-cafe] Weaving fun

2007-04-10 Thread Brandon Michael Moore
On Wed, Apr 11, 2007 at 12:13:10AM +0200, Bas van Dijk wrote: Hello, For my own exercise I'm writing a function 'weave' that weaves a list of lists together. For example: weave [[1,1,1], [2,2,2], [3,3]] == [1,2,3,1,2,3,1,2] weave [[1,1,1], [2,2], [3,3,3]] == [1,2,3,1,2,3,1] Note that

Re: [Haskell-cafe] [Beginner's Question] How to read filenames from a DirStream

2007-04-09 Thread Brandon Michael Moore
It looks like all you can do with DirStream is get the filename, not look at any other fields of the dirent - actually, it seems name is the only standard field. You might as well use getDirectoryContents, unless you have a directory so huge that a list of all the filenames takes too much memory!

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-15 Thread Brandon Michael Moore
On Wed, Mar 14, 2007 at 06:05:31PM -0700, David Brown wrote: Greg Fitzgerald wrote: What we need is a library for a readonly filesystem. That is, all the same functions but pure. I believe you could make this readonly library by wrapping each readonly I/O function with

Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-13 Thread Brandon Michael Moore
On Mon, Mar 12, 2007 at 05:14:57PM -0500, John Goerzen wrote: On 2007-03-06, Simon Marlow [EMAIL PROTECTED] wrote: John Goerzen wrote: possible to create a pipe going directly from program A to program B. You certainly can pipe directly from one process to another: That only works for

Re: RFC: termination detection for STM

2007-02-14 Thread Brandon Michael Moore
On Wed, Feb 14, 2007 at 10:04:32AM +, Simon Marlow wrote: Perhaps I'm missing something, but doesn't GHC already detect the kind of deadlock you're talking about here? When a thread is blocked and cannot be woken up, it is sent the BlockedOnDeadMVar exception. It's more precise than

Re: [Haskell-cafe] How to implement `amb' operator?

2004-04-07 Thread Brandon Michael Moore
Keith is talking about a comitted choice style of nondeterminism, where one of the arguments is picked and the computation continues from there. If you want a computation with backtracking, or a list of all possibly results then you should use the list monad, or another monad that supports

RE: [Haskell] deriving with newtypes

2004-04-06 Thread Brandon Michael Moore
On Fri, 2 Apr 2004, Simon Peyton-Jones wrote: Your word is my command. 'Tis done. Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wolfgang | Jeltsch | Sent: 21 March 2004 17:55 | To: The Haskell Mailing List | Subject: [Haskell]

Re: [Haskell] What is the best way to write adapters?

2004-03-11 Thread Brandon Michael Moore
On Thu, 11 Mar 2004 [EMAIL PROTECTED] wrote: Thanks! Oleg. This works and it looks nice! And now, my code can be like: class FwdSig d where (forall a. Sig a = a - w) - d - w All the types that supports such forwarding are instances of FwdSig. My Def type is: instance FwdSig Def

[Haskell] Re: [Haskell-cafe] matching constructors

2004-03-08 Thread Brandon Michael Moore
I think the generics approach really is overkill here, but it's nice to know the generics library. For option processing Tomasz Ziolonka described a nice technique in the post I refered to. You can find the post in the archives at http://www.haskell.org//pipermail/haskell/2004-January/013412.html

Re: [Haskell-cafe] matching constructors

2004-03-05 Thread Brandon Michael Moore
On Fri, 5 Mar 2004, Vadim Zaliva wrote: Hi! I am new to Haskell, but I have background in various programming languages (including Lisp) I have very basic question, if there is a way to match algebraic types constructors besides use of pattern matching. I wrote today code like this:

RE: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-27 Thread Brandon Michael Moore
On Fri, 27 Feb 2004, Simon Peyton-Jones wrote: The idea that I've been throwing around is to be able to define a separate namespace for each type; a function can either belong in a global (default) namespace, or belong in a particular type's namespace. So, in the above example, instead

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Brandon Michael Moore
On Fri, 27 Feb 2004 [EMAIL PROTECTED] wrote: On 27/02/2004, at 1:13 PM, [EMAIL PROTECTED] wrote: 1) now I have to manually declare a class definition for every single function, and I have to declare it in advance before any module defines that function (most serious problem; see below), 2)

Re: type classes, superclass of different kind

2003-12-11 Thread Brandon Michael Moore
On Thu, 11 Dec 2003, Robert Will wrote: Hello, As you will have noticed, I'm designing a little library of Abstract Data Structuresm here is a small excerpt to get an idea: class Collection coll a where ... (+) :: coll a - coll a - coll a reduce :: (a - b) - b

Re: Multiple functions applied to a single value

2003-12-09 Thread Brandon Michael Moore
Control.Monad.Reader defines instances of Monad and MonadReader for ((-) r). Strangely enough, the documentation claims the Monad instance comes from Control.Monad, which is untrue. Here's the relevant chunk of the file. It looks like you came up with exactly the same code (modulo names). --

Re: Functional dependencies interfere with generalization

2003-11-27 Thread Brandon Michael Moore
On Wed, 26 Nov 2003, Ken Shan wrote: Hello, Consider the following code, which uses type classes with functional dependencies: {-# OPTIONS -fglasgow-exts #-} module Foo where class R a b | a - b where r :: a - b -- 1 rr :: (R a b1, R a b2) = a - (b1, b2) rr a

RE: type class problem / GHC bug

2003-11-11 Thread Brandon Michael Moore
On Mon, 10 Nov 2003, Simon Peyton-Jones wrote: | Also, I tried to update and rebuild, but the makefiles seem to have the | dependencies wrong or something. I compiles THSyntax.hs by hand, then ran | into some trouble with files that needed some modules from GHCI trying | (and dying) to

type class problem / GHC bug

2003-11-08 Thread Brandon Michael Moore
Hi everyone I've built GHC from CVS and I'm getting some odd errors about overlapping instances. This is different from 6.0.1, but it's not obvious it is wrong, so I'm probably missing something here. The example is class A x class (A x) = B x instance A x instance B x The new GHC complains

RE: automaticly create the ana, cata, hylomorphisms

2003-11-08 Thread Brandon Michael Moore
On Fri, 7 Nov 2003, Marta Isabel Oliveira wrote: Ok, i read the page but i'm still stuck. I'm reading some papers about cata, ana and hylomorphisms but i need to know where to start putting it to code. So, 1. in order to have a pre-processor, i need to have a module with ALL data

RE: Type tree traversals [Re: Modeling multiple inheritance]

2003-11-06 Thread Brandon Michael Moore
On Wed, 5 Nov 2003, Simon Peyton-Jones wrote: | More overlapping: | Allow any overlapping rules, and apply the most specific rule that | matches our target. Only complain if there is a pair of matching | rules neither of which is more specific than the other. | This follow the spirit of

RE: Type tree traversals [Re: Modeling multiple inheritance]

2003-11-04 Thread Brandon Michael Moore
On Tue, 4 Nov 2003, Simon Peyton-Jones wrote: | We really should change GHC rather than keep trying to work around stuff | like this. GHC will be my light reading for winter break. Maybe so. For the benefit of those of us who have not followed the details of your work, could you

Re: Type tree traversals [Re: Modeling multiple inheritance]

2003-11-03 Thread Brandon Michael Moore
Thanks for the clever code Oleg. I've tried to extend it again to track the types of methods as well as just the names, giving a functional dependancy from the class, method, and to result type. I can't get the overlapping instances to work out, so I'm handing it back to a master, and the rest of

Re: listProduct -- is this a standard function?

2003-10-17 Thread Brandon Michael Moore
I'm pretty sure this is sequence. Brandon ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Using field selectors in a type constructor

2003-10-14 Thread Brandon Michael Moore
On Mon, 13 Oct 2003, Graham Klyne wrote: I've run across a minor coding niggle on a couple opf accosions when using a type constructor with field selectors. The full code of my test case is below. The value 'test2' evaluates to True. The function that niggles me is this: [[

Re: constructor name clashes

2003-10-08 Thread Brandon Michael Moore
On Wed, 8 Oct 2003 [EMAIL PROTECTED] wrote: Hi, all. I'm a newbie to Haskell so please bear with me if my questions sound silly. In coding Haskell, I feel very inconvenient that the name of data constructors for different types have to be different. Also, when declaring named fields of a

Re: Modeling multiple inheritance

2003-09-27 Thread Brandon Michael Moore
On Fri, 26 Sep 2003 [EMAIL PROTECTED] wrote: Brandon Michael Moore wrote regarding the first solution: chain of super-classes: I'm worried about large class hierarchies. If it works on the java.* classes I should be fine. Have you used this approach before? I'm worried about compile time

Re: Modeling multiple inheritance

2003-09-26 Thread Brandon Michael Moore
On Thu, 25 Sep 2003 [EMAIL PROTECTED] wrote: Brandon Michael Moore wrote: So I defined a class to model the inheritance relationships class SubType super sub | sub - super where upCast :: sub - super Now I can define a default instance of HasFooMethod: instance (HasFooMethod super

Re: lexer puzzle

2003-09-25 Thread Brandon Michael Moore
Note I've replied to haskell-cafe. This post is a bit chatty and low on solid answers. On Thu, 25 Sep 2003, Sean L. Palmer wrote: A... should be split into A.. and . I found a compromise: let's make it a lexing error! :-) At least that agrees with what some Haskell compilers implement. No

Modeling multiple inheritance

2003-09-24 Thread Brandon Michael Moore
I'm trying to build a nicer interface over the one generated by jvm-bridge. I'm using fancy type classes to remove the need to mangle method names. I would like methods to be automatcially inherited, following an inheritance hierarcy defined with another set of type classes. My basic classes look

Re: Modeling multiple inheritance

2003-09-24 Thread Brandon Michael Moore
On Thu, 25 Sep 2003 [EMAIL PROTECTED] wrote: On 25/09/2003, at 7:22 AM, Brandon Michael Moore wrote: I'm trying to build a nicer interface over the one generated by jvm-bridge. I'm using fancy type classes to remove the need to mangle method names. I would like methods to be automatcially

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-21 Thread Brandon Michael Moore
On Sun, 21 Sep 2003, Dominic Steinitz wrote: Brandon, I get the error below without the type signature. My confusion was thinking I needed rank-2 types. In fact I only need polymorphic recursion. Ross Paterson's suggestion fixes the problem. I stole Even and Odd from Chris Okasaki's paper

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Brandon Michael Moore
On Sat, 20 Sep 2003, Ross Paterson wrote: On Sat, Sep 20, 2003 at 12:01:32PM +0100, Dominic Steinitz wrote: Can anyone tell me why the following doesn't work (and what I have to do to fix it)? I thought by specifying the type of coalw as rank-2 would allow it to be used both at a and

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Brandon Michael Moore
Sorry about the empty message. Send /= Cancel Can anyone tell me why the following doesn't work (and what I have to do to fix it)? I thought by specifying the type of coalw as rank-2 would allow it to be used both at a and (a,b). Frank explained why the type you gave wouldn't work. I would

Re: How to detect finite/infinite lists?

2003-09-18 Thread Brandon Michael Moore
On Thu, 18 Sep 2003, Juanma Barranquero wrote: Extremely-newbie questions: Is there any way to know if a list is finite or infinite, other than doing: length l and waiting forever? :) I ask because I was learning Haskell by writing some pretty naive implementation of surreal numbers,

Re: Syntax extensions: mdo and do...rec

2003-09-17 Thread Brandon Michael Moore
at 11:41:24AM -0700, Brandon Michael Moore wrote: In any case, I don't see the need for explicit rec groups. Can't GHC just find the strongly connected components like it already does with let bindings? That's what GHC and Hugs do now for mdo (actually segments rather than components

Re: Syntax Extensions (and future Haskell)

2003-09-17 Thread Brandon Michael Moore
On Thu, 18 Sep 2003 [EMAIL PROTECTED] wrote: Although a number of comments in this discussion make some sense, I personally am getting worried about the direction that it is taking. I have been a (fairly quiet) Haskell user for some time. I like it because of the strong connection to

Re: Question about implementation of an information-passnig arrow

2003-09-16 Thread Brandon Michael Moore
On Mon, 15 Sep 2003, Yu Di wrote: data MyArrow a b = MyArrow ((String, a) - (String, b)) i.e. there is an information asscioated with each piece of data (represented by the string), and I want to pass it around. And often the arrow's processing logic will depend on the input information,

RE: Circular Instance Declarations

2003-09-14 Thread Brandon Michael Moore
On Thu, 11 Sep 2003, Simon Peyton-Jones wrote: OK, I yield! The HEAD now runs this program. It turned out to be a case of interchanging two lines of code, which is the kind of fix I like. Simon Cool! Yet another domain where haskell handles infinities quite happily. Thanks. Hopefully

Re: An IO Question from a Newbie

2003-09-14 Thread Brandon Michael Moore
On Sun, 14 Sep 2003, Glynn Clements wrote: Brandon Michael Moore wrote: Hal was pretty terse, so I'll explain why switching to putStrLn will help. stdout is line buffered. At least by default (see hSetBuffering). That means output will only be flushed to the screen once a newline

Re: Circular Instance Declarations

2003-09-10 Thread Brandon Michael Moore
On Sun, 7 Sep 2003, Ashley Yakeley wrote: In article [EMAIL PROTECTED], Brandon Michael Moore [EMAIL PROTECTED] wrote: Detecting circularity in a derivation is equivalent to accepting a regular infinite derivation for instances. Would you have a use for irregular derivations? Could

Type Class Problem

2003-09-10 Thread Brandon Michael Moore
Hello everyone I think I'm close to useful results on the instance restrictions. First there's an obvious extension to the Haskell98 rule. The H98 rule says the instance head must be a type constructor applied to type variables, and the context must mention only those type variables. This gives

Request for Instances

2003-09-10 Thread Brandon Michael Moore
Hi everyone. I've been looking at the restrictions on instances in the H98 standard and thinking about alternatives. I would like to have a body of data type and class/instance declarations so I can test how useful various extensions would be. Please send or direct me to code that requires

Re: Circular Instance Declarations

2003-09-10 Thread Brandon Michael Moore
On Wed, 10 Sep 2003, Ashley Yakeley wrote: Brandon Michael Moore [EMAIL PROTECTED] wrote: A simple irregular type is Irr a = Con a (Irr (F a)) (as long as F uses a) Would this be an irregular type, with F as ((-) val)? data SymbolExpression sym val a = ClosedSymbolExpression

Re: Circular Instance Declarations

2003-09-07 Thread Brandon Michael Moore
Hi Ashley See the thread Type Class Problem. In his post on Aug 22 Simon Peyton-Jones said that it shouldn't be hard to implement, and mentioned that it would ruin the property that dictionaries can be evaluated by call-by-value. I couldn't puzzle out enough of the type class system to make the

RE: Type class problem

2003-08-30 Thread Brandon Michael Moore
On 28 Aug 2003, Carl Witty wrote: On Thu, 2003-08-28 at 13:10, Brandon Michael Moore wrote: Unfortunately I don't have a useful syntatic condition on instance declarations that insures termination of typechecking. If types are restriced to products, sums, and explicit recursion

RE: Type class problem

2003-08-28 Thread Brandon Michael Moore
On Fri, 22 Aug 2003, Simon Peyton-Jones wrote: Brandon writes | An application of Mu should be showable if the functor maps showable types | to showable types, so the most natural way to define the instance seemed | to be | | instance (Show a = Show (f a)) = Show (Mu f) where | show

Re: Debugging

2003-08-28 Thread Brandon Michael Moore
On Tue, 26 Aug 2003, Konrad Hinsen wrote: My Haskell experiments have reached a size in which debugging tools would be more than welcome, so I looked around, and was very disappointed. I tried Hood, which is a pain to use (lots of editing of the code required), I looked at Buddha but didn't

Re: Type class problem

2003-08-17 Thread Brandon Michael Moore
On Sun, 17 Aug 2003 [EMAIL PROTECTED] wrote: I defined type recursion and naturals as newtype Mu f = In {unIn :: f (Mu f)} data N f = S f | Z type Nat = Mu N An application of Mu should be showable if the functor maps showable types to showable types, so the most natural way to

Re: Calling Haskell from Java

2003-08-14 Thread Brandon Michael Moore
Is it fine if the interface uses JNI? The jvm-bridge is an excellent tool if you can use JNI, but I don't know of anything that compiles Haskell to java bytecode. There was a post a few years ago about an experimental Java backend for GHC, but I haven't heard anything since, and the -J switch

RE: Help with Exceptions on I/O

2003-08-14 Thread Brandon Michael Moore
You don't really need to change the buffering mode. stdout is line buffered by default, so you just need to make sure a newline is printed after your message. putStrLn adds a newline after the string it prints, or you could use \n in the string literal. Try this: main = do --lots of code goes

Type class problem

2003-08-14 Thread Brandon Michael Moore
To try some of the examples from paper Recursion Schemes from Comonads, I wanted to define instances of Show and Observable for types defined as the fixed point of a functor. I defined type recursion and naturals as newtype Mu f = In {unIn :: f (Mu f)} data N f = S f | Z type Nat = Mu N An

Re: IO Bool - Bool

2003-08-14 Thread Brandon Michael Moore
On Thu, 14 Aug 2003, Wolfgang Jeltsch wrote: On Thursday, 2003-08-14, 17:05, CEST, Kevin S. Millikin wrote: On Wednesday, August 13, 2003 11:20 PM, Tn X-10n [SMTP:[EMAIL PROTECTED] wrote: is it possible to convert IO Bool to Bool? Sure. Which Bool do you want? True? toTrue

Re: Newbie Design Question

2003-08-06 Thread Brandon Michael Moore
On Tue, 5 Aug 2003, Thomas L. Bevan wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I don't see that the contibutors files are fundementally different. - From what I understand, it should be possible to write a generic function, importCSV :: FilePath - IO [ (String,String) ]

Lazy Parsing

2002-02-27 Thread Brandon Michael Moore
I'm wondering if there are any libraries out there for creating parsers that lazily build up their result. I know I could thread the remaining input through a parser by hand, but it seems like someone should have already done it. I'd like to be able to turn a stream of XML into a lazy tree of