1cyi(1)                    BSD General Commands Manual                   cyi(1)
2

NAME

4     cyi, cyi-0.9.11 — An interactive interpreter for Curry.
5

SYNOPSIS

7     cyi [option ...] [module]
8

DESCRIPTION

10     cyi is an interactive environment that allows evaluating and debugging
11     Curry goals with respect to a Curry module loaded into the interpreter.
12     At startup, cyi reads and interprets commands from the file .cyirc in the
13     current directory if it exists, or from .cyirc in your home directory
14     otherwise, and then loads either the first module specified on the com‐
15     mand line or the Curry prelude.
16
17   Goals
18     A goal is a Curry expression optionally followed by a where-clause, which
19     can be used for providing local definitions for the goal.
20
21     All entities exported from the Prelude and the module specified in the
22     last :load command are in scope with unqualified and qualified names
23     unless they are shadowed by one of the declarations from the where-
24     clause.  Entities from modules that are imported directly or indirectly
25     from the module specified in the last :load command are also in scope,
26     but only with qualified names.
27
28     All free variables of the goal must be declared either in the where-
29     clause or by using a let expression as goal. The bindings of the free
30     variables are displayed together with the normal form of the goal after
31     successful evaluation unless the goal is of type IO t.
32
33   Commands
34     At the prompt of the interactive environment, the following commands can
35     be entered:
36     goal     Evaluate goal in the context of the current module.
37     :^ [goal]
38              Evaluate goal in the context of the current module. If goal is
39              omitted, the previous goal is evaluated again.
40     :debug [goal]
41              Invoke the debugger for goal.  It may take some time to recom‐
42              pile the source modules with debugging information.  If goal is
43              omitted, the debugger is invoked for the previous goal.
44     :type [goal]
45              Print the type of goal instead of evaluating it. If goal is
46              omitted, the type of the previous goal is shown.
47     :load module
48              Set the current evaluation context to module.  This command will
49              compile module and all modules it depends on if necessary.
50              Module can be specified either by the name of its source file
51              (ending in .lcurry or .curry) or a plain module name. In the
52              latter case, cyi will look for a source or interface file for
53              module in the current directory and the current search path as
54              determined by the -i and -P options set with the :set command
55              and the environment variable CURRY_IMPORT_PATH.
56
57              cyi displays the name of the current module in its prompt.
58     :load    Reset the current evaluation context to the Curry prelude.
59     :reload  Repeat the last load command.
60     :freshen
61              Recompile the current module and all imported source files.
62     :clean   Remove all compiled files for the current module and all
63              imported source files.
64     :interface module
65              Display the interface of module.  If the environment variable
66              PAGER is set, the interface file is displayed with this command.
67              Otherwise the interface is simply written to the standard out‐
68              put.
69     :interface
70              Display the interface of the current module.
71     :edit file
72              Invoke the editor for file.  The default editor is /usr/bin/vi,
73              but this can be changed by setting one of the environment vari‐
74              ables VISUAL and EDITOR to your preferred editor before starting
75              cyi.
76     :edit    Edit the source file of the current module.
77     :set option ...
78              Add options to the list of compiler options.
79     :unset word ...
80              Remove words from the list of compiler options.
81     :cd dir  Change the current directory to dir.
82     :cd      Print the current directory.
83     :! command
84              Execute the shell command command.
85     :version
86              Display the compiler's version.
87     :help    Show the list of supported commands.
88     :quit    Quit cyi.
89     All commands, except for :cd and :clean, may be abbreviated to their
90     first letter.
91

ENVIRONMENT

93     PAGER    If defined, this commmand is used by the :interface command for
94              displaying module interfaces.
95     EDITOR
96     VISUAL   If defined, these environment variables determine the name of
97              the editor command that is invoked instead of /usr/bin/vi by the
98              :edit command. If both environment variables are defined, VISUAL
99              is used.
100
101     CURRY_IMPORT_PATH
102              The environment variable CURRY_IMPORT_PATH contains a colon-sep‐
103              arated list of directories that are searched for library mod‐
104              ules, which can be loaded with the :load command. The default
105              value is /usr/lib64/curry-0.9.11.
106

FILES

108     .cyirc
109     ~/.cyirc
110              Commands from these files are read and interpreted on startup.
111              If both files exist, only .cyirc is used.
112
113     ~/.cyi_history
114              The command line history is stored in file ~/.cyi_history.
115

SEE ALSO

117     cyc(1), cymake(1)
118

BUGS

120     cyi is implemented as a shell script which invokes cymake(1) and cyc(1)
121     for compiling modules and goals. Commands are read from the standard
122     input using the shell's builtin read command. Some shells, e.g.  /bin/sh
123     on Solaris, cannot read raw input but apply backslash processing to the
124     input. When cyi is executed by such a shell, all backslash characters on
125     the command line must be escaped by another backslash character; i.e.,
126     you have to enter \\x -> x in a goal instead of \x -> x and ord '\\n'
127     instead of ord '\n'.  In order to remind you of this limitation, cyi dis‐
128     plays the following warning at startup when it is appropriate.
129           Warning: Backslashes on the command line must be escaped
130             For instance, use \\x -> x for a lambda abstraction
131             and '\\n' for the linefeed character.
132
133     Command line editing and history require support from the read command of
134     the shell, which executes the cyi script. This is available only for Gnu
135     Bash and Korn shells except for the public domain version. Command line
136     editing also works for the Z shell, but without history.
137
138     Changing the compiler's search path for library modules with the :set
139     command does not change the search path used by the :load command.
140
141BSD                              June 22, 2019                             BSD
Impressum