abstract, 24 declaration, 3 declaration datatype, 3 export, 23 fixity, 63 free, 9 function, 5 import, 24 local, 7, 8, 75 type synonym, 4 defined function, 3, 64 defining equation, 5 definitional tree, 65 disjunction, 14 disjunctive expression, 12, 64 div, 54 do, 29, 60 do notation, 29 domain, 64 done, 55 doSolve, 56 drop, 51 dropWhile, 52 Either, 55 either, 55 elem, 53 entity, 23 exported, 23 imported, 24 enumFrom, 53 enumFromThen, 53 enumFromThenTo, 54 enumFromTo, 54 equality in constraints, 10 strict, 10, 14, 15, 68 test, 14 equation, 5 conditional, 5 higher-order, 6 equational constraint, 10, 15, 68 error, 47 83 eval, 13 evaluation annotation, 13, 33 export declaration, 23 expression, 4, 64 answer, 12, 64 case, 22 disjunctive, 12, 64 ground, 4 external, 35 external function, 35 failed, 47 False, 14, 47 filter, 50 findall, 32, 57 fixity declaration, 63 flexible, 13 flip, 47 Float, 17 foldl, 49 foldl1, 49 foldr, 49 foldr1, 49 free(·), 73 free, 9 free declaration, 9 free variable, 5, 9, 73 fst, 48 function arity, 4 defined, 3, 64 external, 35 non-deterministic, 5 function application, 11, 69 function declaration, 5 function rule, 5 generic instance, 19 getChar, 27, 55 getLine, 27, 56 ground expression, 4 ground term, 4 head, 48 head normal form, 65
higher-order equation, 6 id, 46 if_then_else, 14, 48 import declaration, 24 index, 24 infix, 63 infixl, 63 infixr, 63 Int, 16 IO, 27, 55 iterate, 51 Just, 55 keywords, 59 λ-abstraction, 12, 70, 74 Left, 55 left section, 62, 74 left-hand side, 5 length, 49 let, 8, 60 lines, 52 list comprehension, 21 lists, 17, 48 local declaration, 7, 8, 75 local pattern, 8, 21, 75 lookup, 53 map, 17, 49 mapIO, 56 mapIO_, 56 Maybe, 55 maybe, 55 merge, 34 mod, 54 module, 23 module, 23 module name, 23 monadic I/O, 27 name of a module, 23 narrowing, 3, 13 negation, 14 84 non-deterministic function, 5 not, 14, 48 notElem, 53 Nothing, 55 null, 49 of, 22, 60 once, 32, 57 one, 33, 57 operation, 3, 64 or, 53 ord, 17, 54 otherwise, 7, 14, 48 pair, 48 pattern call, 64 local, 8, 21, 75 position, 64 predicate, 14 prelude, 23, 46 print, 56 program, 23 putChar, 28, 55 putStr, 28, 55 putStrLn, 28, 56 range, 64 readFile, 55 repeat, 51 replicate, 51 residuation, 3, 13 return, 28, 55 reverse, 53 Right, 55 right section, 62, 74 right-hand side, 5 rigid, 13 rigid, 13, 71 root (of an expression), 64 rule, 5 conditional, 5 search goal, 29 search variable, 29
- Page 1 and 2:
Curry An Integrated Functional Logi
- Page 3 and 4:
9 Interface to External Functions a
- Page 5 and 6:
and introduces a new n-ary type con
- Page 7 and 8:
tion 3 with σ(t1 . . . tn) = σ(t
- Page 9 and 10:
since the variables occurring in pa
- Page 11 and 12:
tified variable (and, thus, it can
- Page 13 and 14:
such cases, anonymous functions (λ
- Page 15 and 16:
❀ {x=1,y=3} (The empty constraint
- Page 17 and 18:
4.1.3 Functions The type t1 -> t2 i
- Page 19 and 20:
4.1.8 Strings The type String is an
- Page 21 and 22:
g :: [a] -> [b] -> ([a],[b]) g x y
- Page 23 and 24:
In the last translation rule, conca
- Page 25 and 26:
to the module head. For instance, a
- Page 27 and 28:
module main where import m1 hiding
- Page 29 and 30:
take a character (string) and produ
- Page 31 and 32:
which takes a search goal and produ
- Page 33 and 34: instance, if we want to compute the
- Page 35 and 36: Intuitively, a function f declared
- Page 37 and 38: 10 Literate Programming To encourag
- Page 39 and 40: A Example Programs This section con
- Page 41 and 42: A.3 Relational Programming Here is
- Page 43 and 44: A.5 Constraint Solving and Concurre
- Page 45 and 46: A.6 Concurrent Object-Oriented Prog
- Page 47 and 48: B Standard Prelude This section con
- Page 49 and 50: not :: Bool -> Bool not True = Fals
- Page 51 and 52: foldr1 _ [x] = x foldr1 f (x1:x2:xs
- Page 53 and 54: takeWhile _ [] = [] takeWhile p (x:
- Page 55 and 56: enumFromThen n1 n2 = iterate ((n2-n
- Page 57 and 58: putStr [] = done putStr (c:cs) = pu
- Page 59 and 60: owseList (g:gs) = browse g >> putCh
- Page 61 and 62: C.2 Layout Similarly to Haskell, a
- Page 63 and 64: SimplePattern ::= VariableID | _ |
- Page 65 and 66: D Operational Semantics of Curry Th
- Page 67 and 68: Computation step for a single expre
- Page 69 and 70: Eval [e; rule(l | c = r)] ⇒ {id
- Page 71 and 72: to an expression): Eval [ϕ(e1, . .
- Page 73 and 74: Eval [try(g)] ⇒ ⎧ [] if Eval [c
- Page 75 and 76: D.8 Eliminating Local Declarations
- Page 77 and 78: f ′′ x1 . . . xk y1 . . . ym =
- Page 79 and 80: References [1] H. Aït-Kaci. An Ove
- Page 81 and 82: [29] T. Johnsson. Lambda Lifting: T
- Page 83: Index !!, 49 Dom, 64 VRan, 64 (), 1