fork(1) download
  1. j([])=[]
  2. j(a)=[show $ head a]++j(tail a)
  3.  
  4. f([],b,c,d,e,f)=f
  5. f(a,b,c,d,e,f)=if (elem (take 1 $ a) b)==True then f(drop 1 $ a,b,c++(take 1 $ a),d,e,f)
  6. else if (take 1 $ a)=="+" then f(drop 1 $ a,b,[],d+(read c::Int)*e,1,"+")
  7. else if (take 1 $ a)=="-" then f(drop 1 $ a,b,[],d+(read c::Int)*e,-1,"-")
  8. else f(drop 1 $ a,b,c,d,e,f)
  9.  
  10.  
  11. main=do g<-getContents
  12. let a=j([0..9])
  13. b=f(g,a,[],0,1,"")
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1+2-3+4-5
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:5:87:
    Couldn't match expected type `[Char]'
                with actual type `([Char], [[Char]], [Char], Int, Int, [Char])
                                  -> t'
    Relevant bindings include
      f :: ([Char], [[Char]], [Char], Int, Int, [Char]) -> t
        (bound at prog.hs:5:13)
      f :: ([Char],
            [[Char]],
            [Char],
            Int,
            Int,
            ([Char], [[Char]], [Char], Int, Int, [Char]) -> t)
           -> ([Char], [[Char]], [Char], Int, Int, [Char]) -> t
        (bound at prog.hs:4:1)
    Probable cause: `f' is applied to too few arguments
    In the expression: f
    In the first argument of `f', namely
      `(drop 1 $ a, b, c ++ (take 1 $ a), d, e, f)'

prog.hs:8:42:
    Couldn't match expected type `[Char]'
                with actual type `([Char], [[Char]], [Char], Int, Int, [Char])
                                  -> t'
    Relevant bindings include
      f :: ([Char], [[Char]], [Char], Int, Int, [Char]) -> t
        (bound at prog.hs:5:13)
      f :: ([Char],
            [[Char]],
            [Char],
            Int,
            Int,
            ([Char], [[Char]], [Char], Int, Int, [Char]) -> t)
           -> ([Char], [[Char]], [Char], Int, Int, [Char]) -> t
        (bound at prog.hs:4:1)
    Probable cause: `f' is applied to too few arguments
    In the expression: f
    In the first argument of `f', namely `(drop 1 $ a, b, c, d, e, f)'

prog.hs:13:28:
    Couldn't match expected type `([Char],
                                   [[Char]],
                                   [Char],
                                   Int,
                                   Int,
                                   [Char])
                                  -> t'
                with actual type `[Char]'
    Relevant bindings include
      b :: ([Char], [[Char]], [Char], Int, Int, [Char]) -> t
        (bound at prog.hs:13:13)
    In the expression: ""
    In the first argument of `f', namely `(g, a, [], 0, 1, "")'
    In the expression: f (g, a, [], 0, 1, "")
stdout
Standard output is empty