fork download
  1. import Data.List
  2.  
  3. ans :: [String] -> Int
  4. ans strings = exact_2 * exact_3
  5. where
  6. exact_2 = 1
  7. exact_3 = 3
  8.  
  9. charFreqs' :: [String] -> Int
  10. charFreqs' = map length . groupBy (==) . sort
  11.  
  12.  
  13.  
  14. tuff.hs:10:14: error:
  15. • Couldn't match type ‘[Int]’ with ‘Int’
  16. Expected type: [String] -> Int
  17. Actual type: [String] -> [Int]
  18. • In the expression: map length . groupBy (==) . sort
  19. In an equation for ‘charFreqs':
  20. charFreqs' = map length . groupBy (==) . sort
  21. |
  22. 10 | charFreqs' = map length . groupBy (==) . sort
  23. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  24. Failed, no modules loaded.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: unknown type name ‘import’; did you mean ‘short’?
 import Data.List
 ^~~~~~
 short
prog.c:1:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
 import Data.List
            ^
prog.c:9:10: warning: missing terminating ' character
 charFreqs' :: [String] -> Int
          ^
prog.c:9:10: error: missing terminating ' character
 charFreqs' :: [String] -> Int
          ^~~~~~~~~~~~~~~~~~~~
prog.c:10:10: warning: missing terminating ' character
 charFreqs' = map length . groupBy (==) . sort
          ^
prog.c:10:10: error: missing terminating ' character
 charFreqs' = map length . groupBy (==) . sort
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:15:5: error: stray ‘\342’ in program
     • Couldn't match type ‘[Int]’ with ‘Int’
     ^
prog.c:15:6: error: stray ‘\200’ in program
     • Couldn't match type ‘[Int]’ with ‘Int’
      ^
prog.c:15:7: error: stray ‘\242’ in program
     • Couldn't match type ‘[Int]’ with ‘Int’
       ^
prog.c:15:15: warning: missing terminating ' character
     • Couldn't match type ‘[Int]’ with ‘Int’
               ^
prog.c:15:15: error: missing terminating ' character
     • Couldn't match type ‘[Int]’ with ‘Int’
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:18:5: error: stray ‘\342’ in program
     • In the expression: map length . groupBy (==) . sort
     ^
prog.c:18:6: error: stray ‘\200’ in program
     • In the expression: map length . groupBy (==) . sort
      ^
prog.c:18:7: error: stray ‘\242’ in program
     • In the expression: map length . groupBy (==) . sort
       ^
prog.c:19:26: error: stray ‘\342’ in program
       In an equation for ‘charFreqs'’:
                          ^
prog.c:19:27: error: stray ‘\200’ in program
       In an equation for ‘charFreqs'’:
                           ^
prog.c:19:28: error: stray ‘\230’ in program
       In an equation for ‘charFreqs'’:
                            ^
prog.c:19:38: warning: missing terminating ' character
       In an equation for ‘charFreqs'’:
                                      ^
prog.c:19:38: error: missing terminating ' character
       In an equation for ‘charFreqs'’:
                                      ^~~~~
prog.c:20:20: warning: missing terminating ' character
           charFreqs' = map length . groupBy (==) . sort
                    ^
prog.c:20:20: error: missing terminating ' character
           charFreqs' = map length . groupBy (==) . sort
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:22:15: warning: missing terminating ' character
 10 | charFreqs' = map length . groupBy (==) . sort
               ^
prog.c:22:15: error: missing terminating ' character
 10 | charFreqs' = map length . groupBy (==) . sort
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stdout
Standard output is empty