blob: 238204acc26c49ef8a02118b875cbade302be58b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import Control.Monad
import System.Exit
main = do foo <- getContents
let actual_loc = filter (not.null) $ filter isntcomment $
map (dropWhile (==' ')) $ lines foo
loc = length actual_loc
print loc
-- uncomment the following to check for mistakes in isntcomment
-- print actual_loc
isntcomment ('-':'-':_) = False
isntcomment ('{':'-':_) = False -- pragmas
isntcomment _ = True
|