cvs commit: fptools/ghc/compiler/ghci InteractiveUI.hs
Fri, 23 Mar 2001 10:59:18 -0000
I haven't forgotten it, I just can't see a good way to implement it.
Parsing a <funbind> would involve an extra entry point into the parser,
and various other parts of the system would need extra code to deal with
it. The advantage of the current scheme is that it's trivial to
it's not much harder to write
Prelude> let date _ =3D Time.getClockTime >>=3D print >> return ""
Prelude> :def date date
> -----Original Message-----
> From: Marcin 'Qrczak' Kowalczyk [mailto:email@example.com]=20
> Sent: Friday, March 23, 2001 12:14 AM
> To: firstname.lastname@example.org
> Subject: Re: cvs commit: fptools/ghc/compiler/ghci InteractiveUI.hs
> I haven't seen replies for this, so I hope it was forgotten=20
> and not rejected:
> 11 Feb 2001 15:07:37 GMT, Marcin 'Qrczak' Kowalczyk=20
> <email@example.com> pisze:
> > Sun, 11 Feb 2001 06:33:27 -0800, Simon Marlow=20
> <firstname.lastname@example.org> pisze:
> > > :def <name> <expr>
> > > :undef <name>
> > > =20
> > > :def defines a new command, :<name>, with the semantics that
> > > =20
> > > (<expr> :: String -> IO String)
> > Wow!
> > Please consider the syntax
> >:def <funbind>
> > which defines :<name>, the function name of <funbind>, to execute
> > (let <name> :: String -> IO String; <funbind> in <name>)
> > so that we can write
> >:def date _ =3D Time.getClockTime >>=3D print >> return ""
> >:def mycd s =3D Directory.setCurrentDirectory s >> return ""
> > etc.
> > We can also try to unify the return type with (), not only String,
> > and treat () as "". This would require to either check the type
> > after compilation instead of using textual ":: String -> IO String"
> > or write a private class with instances for String and (). Generally
> > I think it's best to avoid working on the source text (what=20
> if String
> > is redefined in this context?).
> __("< Marcin Kowalczyk * email@example.com http://qrczak.ids.net.pl/
> ^^ SYGNATURA ZAST=CAPCZA
> Cvs-ghc mailing list