Difference between revisions of "Talk:Hitchhikers guide to Haskell"

From HaskellWiki
Jump to navigation Jump to search
(Discussing code indentation for nice cut-and-paste.)
 
Line 10: Line 10:
 
sq x = x*x
 
sq x = x*x
   
However, if two spaces are used, then cutting and pasting the code sample will insert a spurious space that breaks the 2D Haskell layout. Unless there is a way of indenting code visually while preserving the cut an paste layout properties, it seems that one should only use a single space to indent code.
+
However, if two spaces are used, then cutting and pasting the code sample will insert a spurious space that breaks the 2D Haskell layout. Unless there is a way of indenting code visually while preserving the cut an paste layout properties, it seems that one should only use a single space to indent wiki code.
   
  +
(I did not change the interactive code as it is not likely to be cut and pasted over multiple lines. Visually, however, it might be good to remove the extra space here as well...)
(P.S. I am really enjoying this article! It provides a very nice practical introduction to Haskell. [[User:Mforbes|Mforbes]] 09:54, 17 April 2006 (UTC))
 
  +
 
P.S. I am really enjoying this article! It provides a very nice practical introduction to Haskell. Thanks! [[User:Mforbes|Mforbes]] 10:08, 17 April 2006 (UTC)

Revision as of 10:08, 17 April 2006

Code Indentation:

Code is most easily specified by indenting it by a space in the wiki source:

-- This is some code.
sq x = x*x

If two spaces are used to indent, then the code is visually indented:

 -- Indented code.
 sq x = x*x

However, if two spaces are used, then cutting and pasting the code sample will insert a spurious space that breaks the 2D Haskell layout. Unless there is a way of indenting code visually while preserving the cut an paste layout properties, it seems that one should only use a single space to indent wiki code.

(I did not change the interactive code as it is not likely to be cut and pasted over multiple lines. Visually, however, it might be good to remove the extra space here as well...)

P.S. I am really enjoying this article! It provides a very nice practical introduction to Haskell. Thanks! Mforbes 10:08, 17 April 2006 (UTC)