I am writing a program that reads and writes to the same file. I was having some
problems with it writing to the file before it read it. I solved it in the following
two ways:
1.
main = do text <- readFile "test"
let something = somefunc text
writeFile "test2" something
it might be more clear if IO had a show instance like
instance (Typeable b) => Show (IO b) where
show (x:: IO a) = "<< IO action producing a " ++ (show $ typeOf (undefined :: a))
++ " >>"
then print $ getChar prints << IO action producing a Char >>
of course this may not be feasable for al
On Thu, 02 Oct 2003 14:57:22 +0200, Juanma Barranquero <[EMAIL PROTECTED]> wrote:
> data Accum s a = Ac [s] a
>
> instance Monad (Accum s) where
>return x = Ac [] x
>Ac s1 x >>= f = let Ac s2 y = f x in Ac (s1++s2) y
>
> output :: a -> Accum a ()
> output x = Ac [x] ()
After trying
On Sat, 04 Oct 2003 13:13:59 +0200
"blaat blaat" <[EMAIL PROTECTED]> wrote:
[moved to Haskell-Cafe]
> > Neither example is odd behavior, unless
> >you consider Hugs providing a perfectly reasonable instance of Show
> >for IO a odd.
>
> True, every program behaves exactly as according to the def
On Sat, Oct 04, 2003 at 07:15:32PM +0200, Peter Robinson wrote:
> What's really missing is a (primitive) background parser written that reports
> syntax errors. It can be written in yacc, antlr, etc., anything that produces
> C/C++ code. The only parsers for Haskell I could find are written thems
Thanks,
the Scheme-version made it even clearer!
Cheers,
Petter
On Saturday 04 October 2003 13:53, you wrote:
> On Sun, 5 Oct 2003 11:02:37 +
>
> Petter Egesund <[EMAIL PROTECTED]> wrote:
> > Hi & thanks for answering.
> >
> > I think I got it - the chaning of the functions lies in the last
On Saturday 04 October 2003 20:20, Wolfgang Jeltsch wrote:
> Great! I will probably use it since I like Haskell and KDE very much.
>
> By the way, wasn't KDevelop only for developing in C and C++?
The current stable Release 2.1.* is a C/C++ only IDE but the upcoming 3.0 will
probably support: Ada
Am Samstag, 4. Oktober 2003, 19:15 schrieb Peter Robinson:
> Hello,
>
> I've begun to write a plugin that provides basic support for Haskell in
> KDevelop 3.0 alpha. (http://www.kdevelop.org).
Great! I will probably use it since I like Haskell and KDE very much.
By the way, wasn't KDevelop only f
Hello,
I've begun to write a plugin that provides basic support for Haskell in
KDevelop 3.0 alpha. (http://www.kdevelop.org). It is already included in the
CVS and the latest alpha7 release.
Screenshots:
http://www.thaldyron.com/snap1.png
http://www.thaldyron.com/snap2.png
http://www.thaldyron.
On Sun, 5 Oct 2003 11:02:37 +
Petter Egesund <[EMAIL PROTECTED]> wrote:
> Hi & thanks for answering.
>
> I think I got it - the chaning of the functions lies in the last part
> of
>
> (\w -> if v==w then n else sto w)
>
> I am used to higher ordered functions from Scheme, but it was the
>
Hi & thanks for answering.
I think I got it - the chaning of the functions lies in the last part of
(\w -> if v==w then n else sto w)
I am used to higher ordered functions from Scheme, but it was the delayed
evaluation which played me the trick here. This function is built when
updating, and
This message illustrates how to get the typechecker to traverse
non-flat, non-linear trees of types in search of a specific type. We
have thus implemented a depth-first tree lookup at the typechecking
time, in the language of classes and instances.
The following test is the best illustration:
>
12 matches
Mail list logo