Advertisement
Guest User

haskell-indentation

a guest
Mar 3rd, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Main where
  2.  
  3. import T1
  4. import T2 -- HERE: why two indentation points?
  5.  
  6.  
  7. function = return (Structure
  8.                    { field = 123         -- HERE: why move to the leftmost column?
  9.                    , field2 =1231
  10.                    })
  11.  
  12. function :: M X
  13.             function = something something
  14. function   -- HERE: TAB enter debugger: Lisp error: (parse-error . "Illegal token: =")
  15.  
  16.  
  17. function :: Int
  18. function = do
  19.   let x = 5
  20.    let y = 7
  21.   case x of
  22.    _ -> return () -- HERE: TAB enter debugger: Lisp error: (parse-error . "Illegal token: case")
  23.  
  24.  
  25. function = (case x of
  26.              Just x -> 0
  27.              Nothing)                  -- HERE: why also same column as case?
  28.  
  29.  
  30. function = case ( x
  31.                 , )         -- HERE: why move to leftmost column?
  32.            of
  33.             x -> x
  34.  
  35.  
  36. function (_nm,hd) | hd = c
  37. function (_nm,hd) = b        -- HERE: Tab cause debugger, underscore is important!
  38.  
  39.  
  40.  
  41. function = do
  42.   nested $ do
  43.     val :: String <- return "abc"
  44.   z -- HERE: Why can't have same column as val?
  45.  
  46.  
  47.  
  48. function = do
  49.   (_ec) <- function
  50.  
  51.            return () -- HERE: can't have at the open parenthesis place, underscore is important
  52.  
  53.  
  54.  
  55. function (x : xs) | c1==c2 =
  56.                                return () -- HERE: selected points seem strange
  57.  
  58.  
  59.  
  60. function :: (Monad m)
  61.             => m ()      -- HERE: only indented proposed
  62.          -> m ()         -- HERE: proposed both
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement