Hi all, I'm looking for some kind of style-guide for layout and indentation of haskell source code, can anyone help me? Thanks, Per
Per Larsson <per@L4i.se> writes:
I'm looking for some kind of style-guide for layout and indentation of haskell source code, can anyone help me?
There are various pretty-printing libraries for Haskell, for example: http://www.haskell.org/ghc/docs/latest/html/haskell-src/Language.Haskell.Pre... http://www.haskell.org/ghc/docs/latest/html/base/Text.PrettyPrint.html http://www.cs.uu.nl/~daan/pprint.html For editors, there's haskell-mode for emacs which does a good job of indenting intelligently. I've heard the vim mode works well also. A bit of googling turned up these: http://www.haskell.org/~simonmar/libraries/libraries.html http://www.cs.ou.edu/~rlpage/fpclassFall96/handouts/styleGuide.html http://www.cs.bris.ac.uk/Teaching/Resources/COMS12100/java/style.html Hope this helps, -- Shae Matijs Erisson - 2 days older than RFC0226 #haskell on irc.freenode.net - We Put the Funk in Funktion 10 PRINT "HELLO" 20 GOTO 10 ; mapM_ putStrLn $ fix ("hello":)
Hi All, I have a data type defined as
data D a = D1 Int | D2 a
Follow this definition, I have D2 Int,D2 Bool and D2 [D2 Int] as instances of type D. I want to write an overloaded function lift which lifts an atom type to D. It is easily done for D2 Int and D2 Bool using type classes.I can have
class Liftable a where lift :: a -> L a
instance Liftable Int where lift x = D2 x
However, I have problem with D2 [D2 Int].I want to lift [Int] to D2 [D2 Int]. Is there any solution to it? Thank you very much. -W-M- @ @ | \_/
participants (3)
-
Per Larsson -
shae@webwitches.com -
Wang Meng