Derek Elkins wrote:
> Anyways, if another challenge is desired, I would be interested in
> seeing how one would go about converting the implementation of
> Dynamics in "A Lightweight Implementation of Generics and Dynamics"
> into a form that doesn't use existentials* but still provides the same
On Mon, Oct 13, 2003 at 06:32:14PM +0100, Jose Morais wrote:
> Hi,
>
> What I needed was actualy something more like
>
> f3 :: Int -> String
> f3 x = show x ++ f4 x
>
> f4 :: Int -> IO String
> f4 x = do
> putStr ("initial value is " ++ show x)
> return (show x)
>
>
On Mon, 13 Oct 2003 11:37:43 -0400
Jan-Willem Maessen <[EMAIL PROTECTED]> wrote:
> > So, the existential quantification permits more nuanced
> > transformations -- and yet the nuances aren't observable. So, they
> > don't matter?
>
> Whether they matter or not depends upon our aims. I'm curious
Hi,
What I needed was actualy something more like
f3 :: Int -> String
f3 x = show x ++ f4 x
f4 :: Int -> IO String
f4 x = do
putStr ("initial value is " ++ show x)
return (show x)
but this gives the error
Type checking
ERROR "teste.hs":11 - Type error in applicat
On Monday 13 October 2003 11:54 am, Jose Morais wrote:
> Hi,
>
> I am trying to something like
>
> f1 :: Int -> Int
> f1 x = f2 x
>
> f2 :: Int -> Int
> f2 x = 2 * x
>
>
> but before f2 returns its result I'd like it to print something like
> "The initial value is " ++ show x.
>
f1 ::
In general, you can't, not with these type signatures, since printing
something is a side effect.
If this is only for debugging purposes, you might try using trace from
IOExts. You can use it in a nice fashion like:
> f1 :: Int -> Int
> f1 x
> | trace ("The initial value is " ++ show x) Fal
Hi,
I am trying to something like
f1 :: Int -> Int
f1 x = f2 x
f2 :: Int -> Int
f2 x = 2 * x
but before f2 returns its result I'd like it to print something like
"The initial value is " ++ show x.
How could I do this?
Thank you
__
Oleg replies to my message on eliminating existentials:
> Jan-Willem Maessen wrote:
>
> > > data Expr a = Val a | forall b . Apply (Expr (b -> a)) (Expr b)
>
> > I've been trying to convince myself that we really need the
> > existential types here.
> > ...
> > Now (Expr a) is really two things:
At 11:25 10/10/03 +0200, [EMAIL PROTECTED] wrote:
Hi Graham,
> Instead, I replace the class instances by a single algebraic
> data type,
> whose members are functions corresponding to OO-style class methods.
could you give an example?
The code in a previous message of mine [1] was an example of so
oleg wrote:
> Sorry I didn't know of that requirement. The desired sharing
> can easily be introduced:
That's always a risk with posting a toy example - which bits
are important can be hard to tell. You are right of course
about being able to introduce the sharing.
FWIW, after the suggestions t
Nosso amigo José Moreira perguntou:
>I need a function called, say, newItem, that when first called
> returns 1, the next time it is called it would return 2, then 3 and so
> on. How can I achieve this?
Several people, among whom Jón Fairbarn explained what are the problems
with that in Haskel
11 matches
Mail list logo