Re: [Haskell-cafe] Re: Control.Monad.Cont fun

2005-07-18 Thread Magnus Carlsson
Hi Thomas and Tomasz, A late comment about a MonadFix instance for Cont/ContT: Thomas Jäger wrote: Hello Tomasz, This stuff is very interesting! At first sight, your definition of getCC seems quite odd, but it can in fact be derived from its implementation in an untyped language. On

Re: [Haskell-cafe] Re: Control.Monad.Cont fun

2005-07-18 Thread Magnus Carlsson
Tomasz Zielonka wrote: On Fri, Jul 15, 2005 at 11:51:59PM +0200, Magnus Carlsson wrote: A while ago, I attempted to marry value recursion a la Levent Erkök with the continuation-monad transformer. It seems possible if the underlying monad has value recursion and references. Interestingly, all

RE: Syntax extensions (was: RE: The Future of Haskell discussion at the Haskell Workshop)

2003-09-11 Thread Magnus Carlsson
Mark P Jones writes an interesting suggestion: ... Hmm, ok, but perhaps you're worrying now about having to enumerate a verbose list of language features at the top of each module you write. Isn't that going to detract from readability? This is where the module system wins big! Just

Re: MonadCont, MonadFix

2002-03-09 Thread Magnus Carlsson
Ashley Yakeley writes: Are there any useful monads that are instances of both MonadCont and MonadFix? I can't make the two meet. Perhaps this is because continuations have no fixed point, or something. Very annoying. If you have a recursive monad with first-class references (such as IO

Re: O'Haskell OOP Polymorphic Functions

2001-01-16 Thread Magnus Carlsson
You can use overloading for the definition of theValue instead: class TheValue a where theValue :: a - Maybe Int instance TheValue Basewhere theValue _ = Nothing instance TheValue Derived where theValue x = Just (x.value) /M Ashley Yakeley writes: How do you do OOP-style

Re: O'Haskell OOP Polymorphic Functions

2001-01-16 Thread Magnus Carlsson
Ashley Yakeley writes: At 2001-01-16 10:23, Magnus Carlsson wrote: You can use overloading for the definition of theValue instead: class TheValue a where theValue :: a - Maybe Int instance TheValue Basewhere theValue _ = Nothing instance TheValue Derived where

Re: Language Feature Request: String Evaluation

1999-06-09 Thread Magnus Carlsson
S. Alexander Jacobson writes: In principle I can do this, but: 1. how do I hide the import of show String to replace it w/ my own? 2. If I do replce show String what else will break? I'd rather let the preprocessor insert calls to eshow, and leave show as it is. 3. If instead I define

Re: Language Feature Request: String Evaluation

1999-06-08 Thread Magnus Carlsson
I've been using a preprocessor to Haskell that I call HacWrite, which adds a new kind of string appropriate for entering text. Such strings can span multiple lines and can be escaped using curly brackets: var1 = 2*2 var2 = 4*var1 var3 = «Foobar» sqlstring = «insert into mytable values

RE: Haskell-98 Quiz

1999-04-26 Thread Magnus Carlsson
Mark P Jones writes: | 2. Is there a way to modify the signatures to make it legal? Not that I can see! Personally, I think you've found a bug in the Haskell report! But, as it stands, others can reasonably say this is a bug in Hugs 98 ... I guess we should modify the typechecker

Haskell-98 Quiz

1999-04-23 Thread Magnus Carlsson
Here are some questions for the Haskell-98 enthusiasts. 1. Why is the following declaration group illegal? f :: String f = g 1 ++ g True g :: Show a = a - String g x = fst (show x, show f) 2. Is there a way to modify the signatures to make it legal? /M

2.01: Problem deriving instances for newtype data

1996-10-16 Thread Magnus Carlsson
When trying to derive an instance in a data declaration which depends on a newtype ditto, I encountered: lips ghc-2.01 -c -v Enter your Haskell program, end with ^D (on a line of its own): newtype A = A Int deriving Show data B = B A deriving Show ^D The Glorious Glasgow Haskell

Haskell 1.3 - what's it all about?

1996-05-16 Thread Magnus Carlsson
Maybe you have seen some mail lately on this list about something called "Haskell 1.3", and wondered What is this "Haskell 1.3" anyway?, Can I buy it?, or Do I have it? By compiling and running the following two-module Haskell program, you will at least get an answer to the last

Re: space leak in length[1..]

1996-02-17 Thread Magnus Carlsson
The problem is that the elements in the list [1..] are not used by the function lens, so they will not be evaluated. This is fatal, since the unevaluated elements are becoming larger and larger function applications: [1..] = [1, 1+1, 1+1+1, ...] For the same reasons, length [1..n] does not