packages feed

egison-tutorial 3.9.3 → 3.10.0

raw patch · 2 files changed

+11/−11 lines, 2 filesdep ~egison

Dependency ranges changed: egison

Files

Main.hs view
@@ -17,7 +17,7 @@ import System.Exit (ExitCode (..), exitWith, exitFailure)  import Language.Egison hiding (optShowVersion, optPrompt)-import qualified Language.Egison.Types as ET+import qualified Language.Egison.CmdOptions as ET import Language.Egison.Util import qualified Language.Egison.Parser          as Parser import qualified Paths_egison_tutorial as P@@ -214,12 +214,12 @@         if b           then return ()           else do-            b <- yesOrNo "Do you want to procced next?"+            b <- yesOrNo "Do you want to proceed next?"             if b               then loop env contents True               else loop env (content:contents) False       Left (Just "") -> do-        b <- yesOrNo "Do you want to procced next?"+        b <- yesOrNo "Do you want to proceed next?"         if b           then loop env contents True           else loop env (content:contents) False@@ -333,12 +333,12 @@     Content "We can bind a value to a variable with a \"define\" expression.\nWe can easily get the value we bound to a variable."      ["(define $x 10)", "x", "(define $y (+ 1 x))", "y"]      [],-    Content "We support recursive definitions. It enables us to define an collection with infinite elements.\nNote that \"@\" expands the collection placed after \"@\" as a subcollection of the outer collection."+    Content "We support recursive definitions. It enables us to define a collection with infinite elements.\nNote that \"@\" expands the collection placed after \"@\" as a subcollection of the outer collection."      ["(define $ones {1 @ones})", "(take 100 ones)", "(define $nats {1 @(map (+ $ 1) nats)})", "(take 100 nats)", "(define $odds {1 @(map (+ $ 2) odds)})", "(take 100 odds)"]      ["Try to define the infinite list of even numbers that is like {2 4 6 8 10 ...}."],     Content "We can create a function with a \"lambda\" expression. Let's define functions and test them."      ["(define $increment (lambda [$x] (+ x 1)))", "(increment 10)", "(define $multiply (lambda [$x $y] (* x y)))", "(multiply 10 20)", "(define $sum (lambda [$n] (foldl + 0 (take n nats))))", "(sum 10)"]-     ["Try to define a \"fact\" function, which obtains an natural number \"n\" and returns \"n * (n - 1) * ... * 2 * 1\"."],+     ["Try to define a \"fact\" function, which takes a natural number \"n\" and returns \"n * (n - 1) * ... * 2 * 1\"."],     Content "We can compare numbers using functions that return \"#t\" or \"#f\".\n\"#t\" means the true.\n\"#f\" means the false.\nFunctions that return \"#t\" or \"#f\" are called \"predicates\"."      ["(eq? 1 1)", "(gt? 1 1)", "(lt? 1 1)",  "(gte? 1 1)", "(lte? 1 1)"]      [],@@ -351,7 +351,7 @@     Content "We combine numbers using \"[]\".\nThese things are called \"tuples\"."      ["[1 2]", "[1 2 3]"]      [],-    Content "Note that a tuple that consists of only one element is equal with that element itself."+    Content "Note that a tuple that consists of only one element is equal to that element itself."      ["[1]", "[[[1]]]"]      [],     Content "With the \"zip\" function, we can combine two lists as follows."@@ -423,9 +423,9 @@       "(match-all {1 2 1 3 2} (multiset integer) [<cons $x !<cons ,x _>> x])"]      [],     Content "Pattern matching of Egison efficiently backtracks for non-linear patterns.\nFor example, all the following pattern-matching expressions are processed in O(n^2)."-     ["(match-all (between 1 100) (multiset integer) [<cons $x <cons ,x _>> x])",-      "(match-all (between 1 100) (multiset integer) [<cons $x <cons ,x <cons ,x _>>> x])",-      "(match-all (between 1 100) (multiset integer) [<cons $x <cons ,x <cons ,x <cons ,x _>>>> x])"]+     ["(match-all (between 1 30) (multiset integer) [<cons $x <cons ,x _>> x])",+      "(match-all (between 1 30) (multiset integer) [<cons $x <cons ,x <cons ,x _>>> x])",+      "(match-all (between 1 30) (multiset integer) [<cons $x <cons ,x <cons ,x <cons ,x _>>>> x])"]      [],     Content "The following samples enumerate pairs and triplets of natural numbers.\nNote that Egison really enumerates all the results."      ["(take 10 (match-all nats (set integer) [<cons $x <cons $y _>>           [x y]]))",
egison-tutorial.cabal view
@@ -1,5 +1,5 @@ Name:                egison-tutorial-Version:             3.9.3+Version:             3.10.0 Synopsis:            A tutorial program for the Egison programming language Description:         A tutorial program for the Egison programming language.                      Egison is the programming langugage that realized non-linear pattern-matching against unfree data types.@@ -20,5 +20,5 @@  Executable egison-tutorial   Main-is:             Main.hs-  Build-depends:       egison >= 3.9.3, base >= 4.0 && < 5, array, containers, unordered-containers, haskeline, transformers, mtl, parsec >= 3.0, directory, ghc, ghc-paths, filepath, regex-posix, bytestring+  Build-depends:       egison >= 3.10.0, base >= 4.0 && < 5, array, containers, unordered-containers, haskeline, transformers, mtl, parsec >= 3.0, directory, ghc, ghc-paths, filepath, regex-posix, bytestring   Other-modules:   Paths_egison_tutorial