[Grace-core] [Minigrace] minor nits - should imports be inherited
Timothy Jones
tim at ecs.vuw.ac.nz
Mon Dec 2 20:47:59 PST 2013
On 03/12, Michael Homer wrote:
> On Tue, Dec 3, 2013 at 4:31 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
> >> For displaying I could go with display or show. Haskell uses "show" and it seems quite natural. I agree that print no longer makes any sense.
> Haskell doesn't use "show"; show is roughly equivalent to
> asDebugString. It generally uses putStrLn, which isn't really an ideal
> name. show is quite an unnatural one for what it does.
Well, really the equivalent Haskell function is 'print', whose type is
'Show a => a -> a'. 'putStrLn' is the equivalent of 'hPutStrLn stdout'.
'show' is intended as the opposite of 'read', where 'write' would be even more
confusing, but it is a pretty awful name (better than JS's 'stringify', though?).
> > I'd quite like show (or display, or inspect, or debug) to do stuff graphically.
> >
> > that's different from "print" which prints to a default textual output stream
> Yes.
This assumes that the user is thinking in terms of output streams: 'print'
probably means printing a document from a printer to the uninitiated. I would
personally go with something like 'say'.
--
Tim
More information about the Grace-core
mailing list