At 2002-01-23 08:35, Till Mossakowski wrote:
Is there any tool for translating SML into Haskell?
(say, a suitable subset, i.e. just pure
features, and no functors)
Oh you can do modules and functors too, can't you? See for instance:
ML
At 13:15 2002-01-22 -0500, Hongwei Xi wrote:
...
In Haskell, I guess that the one implemented later is always chosen.
Why can't I have two different implementations for an interface?
Actually, I can't think of situations where I would desire this.
Could you please give an example?
Another
You can also export the type without exporting the constructors. That
way importers can use the type in type signatures and instance
declarations while still not being able to use anything but the
exported interface.
E.g. instead of
Module Set
( emptySet
, makeSet
Ok, I configured ghc-5.02.2 using the option
--with-hc=/usr/local/bin/ghc-5.02.2.Then, when I compiled it, sometime it
would use /usr/local/bin/ghc-5.02.2, and sometimes it would use /usr/bin/ghc,
which is ghc-4.08.1 that was supplied with my Debian system.
Then, I changed my path to
Compilation, with ghc 5.02, of the following program:
data Zero = Zero deriving Show
data Succ a = Succ aderiving Show
-- Compilations succeeds with the following line uncommented.
-- t :: Succ Zero -- =
t = Zero `p` (Succ Zero)
Eric Allen Wohlstadter wrote:
I see a lot of literature that says that monads simulate the effects of
imperative programming concepts. It seems to me that the relative
performance of monadic implementations must be equivalant to imperative
ones to provide a strong case for functional
The paper I am reading uses the following in an instance declaration for
parsers:
p = f = Parser (\cs - concat [parse (f a) cs' |
(a,cs') - parse p cs])
Isn't this the same as
p = f = Parser (\cs -
[(a',cs'') | (a,cs') - parse p cs,
Andre,
I can't work out how it should be done.
The way I see it, the StateIO monad should have four functions
associated with it.
1/ update - a function to update the state
2/ retrieve - a function to retrieve the state from the monad
These two are inherited from the standard State monad
3/