- or download this
package Rpn;
...
}
1;
- or download this
use strict;
use warnings;
...
eval { Rpn::evaluate($t->[0]) };
is($@, $t->[1]);
}
- or download this
module Rpn-0.0.1-cpan:ASAVIGE;
...
@stack.elems == 1 or die "Invalid stack:[@stack[]]\n";
return @stack[0];
}
- or download this
#!/usr/bin/pugs
...
try { Rpn::evaluate($t[0]) };
is($!, $t[1]);
}
- or download this
{-# OPTIONS_GHC -fglasgow-exts -Wall #-}
...
| otherwise = error $ "Invalid stack:" ++ show el
where
el = foldl evalStack [] $ words expr
- or download this
{-# OPTIONS_GHC -fglasgow-exts -Wall #-}
...
main :: IO Counts
main = do runTestTT normalTests
runTestTT exceptionTests
- or download this
(Control.Exception.evaluate (Rpn.evaluate x))
- or download this
f (x:y:zs) "+" = y+x:zs
- or download this
import Debug.Trace
-- ...
f (x:y:zs) "+" = trace ("+" ++ show x ++ ":" ++ show y ++ ":" ++ show
+zs) (y+x:zs)
- or download this
autrijus stares at type Eval x = forall r. ContT r (ReaderT x IO) (Rea
+derT x IO x)
and feels very lost
<shapr> Didn't you write that code?
<autrijus> yeah. and it works
<autrijus> I just don't know what it means.