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
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
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
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
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
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
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
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
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
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
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
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
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
13 matches
Mail list logo