fork download
  1. foo :: (a -> a -> a) -> a -> a -> a
  2. foo f a b = f a b
  3.  
  4. bar = foo (+)
  5.  
  6. getInt :: Integer
  7. getInt = 2
  8.  
  9. baz = bar 3.0 2.0
  10.  
  11. main = print $ bar getInt getInt
Compilation error #stdin compilation error #stdout 0s 4628KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:9:11:
    No instance for (Fractional Integer) arising from the literal `3.0'
    Possible fix: add an instance declaration for (Fractional Integer)
    In the first argument of `bar', namely `3.0'
    In the expression: bar 3.0 2.0
    In an equation for `baz': baz = bar 3.0 2.0
stdout
Standard output is empty