egison 0.1.2.4 → 0.1.2.5
raw patch · 3 files changed
+24/−4 lines, 3 files
Files
- Egison.hs +1/−1
- egison.cabal +1/−1
- etc/sample/collection-test.egi +22/−2
Egison.hs view
@@ -11,7 +11,7 @@ main :: IO () main = do args <- getArgs case length args of- 0 -> do flushStr "Egison, version 0.1.2.4 : http://hagi.is.s.u-tokyo.ac.jp/~egi/egison/\nWelcome to Egison Interpreter!\n"+ 0 -> do flushStr "Egison, version 0.1.2.5 : http://hagi.is.s.u-tokyo.ac.jp/~egi/egison/\nWelcome to Egison Interpreter!\n" defsRef <- newIORef [] runRepl defsRef _ -> putStrLn "Program takes only 0 argument!"
egison.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.1.2.4+Version: 0.1.2.5 -- A short (one-line) description of the package. Synopsis: An Interpreter for the Programming Language Egison
etc/sample/collection-test.egi view
@@ -12,7 +12,7 @@ })] [$equal? (lambda [$val $tgt]- (match [val tgt] [Suit Suit]+ (match [val tgt] [Bool Bool] {[[<true> <true>] <true>] [[<false> <false>] <true>] [[_ _] <false>]}))]@@ -35,7 +35,7 @@ })] [$equal? (lambda [$val $tgt]- (match [val tgt] [Suit Suit]+ (match [val tgt] [Order Order] {[[<less> <less>] <true>] [[<equal> <equal>] <true>] [[<greater> <greater>] <true>]@@ -405,7 +405,27 @@ ((type-ref Loop inductive-match) [tgt2 {}])))] [$equal? <undefined>]})))) +(define $not+ (lambda [$b]+ (match b Bool+ {[<true> <false>]+ [<false> <true>]}))) +(define $ham1+ (lambda [$xs $ys]+ (match [xs ys] [(List Bool) (List Bool)]+ {[[<join $hs <cons $x $ts>>+ <join (on [$hs] ,hs) <cons (on [$x] ,(not x)) (on [$ts] ,ts)>>]+ <true>]+ [[_ _] <false>]})))++(define $ham1+ (lambda [$xs $ys]+ (match [xs ys] [(List Bool) (List Bool)]+ {[[<join $hs <cons $x $ts>>+ <join (on [$hs] ,{}) <cons (on [$x] ,(not x)) (on [$ts] ,{})>>]+ <true>]+ [[_ _] <false>]}))) (test (match-map {<x> <y> <z>} (List Something) [<nioj $xs $ys> [xs ys]]))