<commit_before>\documentclass[11pt,twoside]{article}
\usepackage{makeidx,multicol}
\include{psinput}
\include{psfig}
\usepackage{epsf}
\usepackage{epsfig}
\usepackage{graphics,color}
 



\newcommand{\om}{$\Omega$mega}
\newcommand{\plus}[2]{\{plus {#1} {#2}\}}
\newcommand{\existsH}[3]{\begin{tabular}[t]{l}
                          {\small exists} {\small {#1}} . \\
                          ({\small {#2}} \\
                          ,{\small {#3}}) \\
                       \end{tabular}}

\setlength{\textheight}{8.5in}
\setlength{\textwidth}{6.4in}
\setlength{\oddsidemargin}{-.2in}
\setlength{\evensidemargin}{-.2in}
\setlength{\topmargin}{-0.25in}

\renewcommand{\textfraction}{0.1}
\renewcommand{\topfraction}{.80}

%\setcounter   {topnumber}{3}
%\renewcommand {\topfraction}{1.0}
%\setcounter   {totalnumber}{4}
%\renewcommand {\textfraction}{0.2}
%\renewcommand {\floatpagefraction}{0.99} 
%\renewcommand {\floatsep}{0.1}
 


%\setlength{\linewidth}{0.2cm}

\begin{document}



% The first Title Page
\pagestyle{empty}
~
\begin{center}
{\sf
%\hrule
\vspace{0.5cm}
{\bf {\Large \om~ Users' Guide}}\\
\vspace{0.5cm}
\input{version}
%\hrule
{\large <NAME>}\\
Computer Science Department\\
Maseeh College of Engineering and Computer Science\\
Portland State University\\
}
\end{center}

\tableofcontents

\newpage
This manual corresponds to the \om\ implementation with the
following version information.

\begin{center}
\input{version}
\end{center}

\input{license}


\newpage
\pagestyle{plain}

\setcounter{page}{1}


\title{\om~ Users' Guide}
\author{
<NAME>\\
Computer Science Department\\
Maseeh College of Engineering and Computer Science\\
Portland State University\\
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\maketitle

\section{Introduction}\label{intro}

The \om\ interpreter is styled after the Hugs Haskell Interpreter. In fact,
users of Hugs will find many similarities, and this is intentional. Like Hugs,
the \om\ interpreter is a read-typecheck-eval-print loop. It can load whole
files, and the top-level loop allows the user to experiment by typing
expressions to be evaluated, and by querying the program environment.

The \om\ syntax is based upon the syntax of Haskell. If you're unsure
of what syntax to use, a best first approximation is to use Haskell
syntax. It works most of the time. While clearly descended from Haskell,
\om\ has several important syntactic and semantic differences. The
purpose of this manual is to identify the differences and give
examples of the differences so users can quickly learn them. These
differences include:

\begin{itemize}

\item \om\ supports the introduction of Generalized Algebraic Datatypes.
It does this by generalizing the {\tt data} declaration to
include explicit types for every constructor (Section \ref{gadt}).

\item \om\ adds the ability to introduce new types, and new kinds to
classify these types (Section \ref{kinds}).

\item \om\ allows users to write functions at the type level, and to use these
functions in the type of functions at the value level (Section \ref{typefun}).

\item \om\ is strict while Haskell is lazy. But \om\ has an experimental
explicit laziness annotation (Section \ref{lazy}).

\item \om\ does not support Haskell's class system. Because of this
\om\ supports the {\tt do} syntax using another mechanism (Section \ref{monads}).

\item \om\ has only a fixed set of infix operators, which cannot be extended (Section \ref{op}).

\item \om\ only supports fully applied type synonyms (Section \ref{syn}).

\item \om\ has a very primitive module system (Section \ref{module}).

\item \om\ suports a notion of anonymous existential types (Section \ref{exists}).

\item \om\ has an experimental implementation of Pitts and Gabbay's freshness
mechanism (Section \ref{fresh}).

\end{itemize}


\include{kinds}
%\include{types}

\section{Primitive and Predefined Types and Values} \label{predefined}

\om\ supports a number of built in types. In Figure \ref{types} they are listed
along with their kinds. \om\ also implements a number of primitive
functions and values over the predefined types. In Figure \ref{values} they are
listed along with their types. These figures are generated when a
distribution (including this manual) is built, and should be up-to date. Compare
the version and build date of your \om\ interpreter with the information on the
license page of this manual to see if this manual is up-to-date. In a future
version of \om\ we hope to have a more comprehensive set of primitives.

The following types are predefined. All other types listed in Figure \ref{types}
are primitive, abstract, builtin types. The
predefined types behave as if they were defined as follows:

\input{predef}

\begin{verbatim}
data [] a = [] | (:) a [a]
\end{verbatim}

\section{Infix Operators} \label{op}
In \om\ there are a fixed number of infix operators. The current implementation
precludes dynamically adding new infix operators. The infix operators can be
found in Figure \ref{infix}.
\input{infix}

\section{Simple Module System} \label{module}
The module system in \om\ is very primitive. It works by specifying
a string which is the name of an \om\ file. It is followed
by an optional parenthesized list of import items. The file is loaded, and 
if the import items are present in the file, those import items
are imported into the current context. An import item is either a name
or a syntax item. A syntax item names one of the extensible syntactical extensions
(see Section \ref{synext}). A syntax
item has the form: 
\begin{verbatim}
"syntax" ( "Nat" | "List" | "LeftList" | "Record" | "Pair"
                 | "Tick" | "Unit" | "Item" ) "(" id ")"
\end{verbatim}
Some examples are illustrated below.
\begin{verbatim}
import "LangPrelude.prg" 
  (head,tail,lookup,member,fst,snd,Monad,maybeM)
\end{verbatim}
imports only the names listed from the {\tt LangPrelude.prg} file.<commit_msg>mention the other Left* variants too<commit_after>\documentclass[11pt,twoside]{article}
\usepackage{makeidx,multicol}
\include{psinput}
\include{psfig}
\usepackage{epsf}
\usepackage{epsfig}
\usepackage{graphics,color}
 



\newcommand{\om}{$\Omega$mega}
\newcommand{\plus}[2]{\{plus {#1} {#2}\}}
\newcommand{\existsH}[3]{\begin{tabular}[t]{l}
                          {\small exists} {\small {#1}} . \\
                          ({\small {#2}} \\
                          ,{\small {#3}}) \\
                       \end{tabular}}

\setlength{\textheight}{8.5in}
\setlength{\textwidth}{6.4in}
\setlength{\oddsidemargin}{-.2in}
\setlength{\evensidemargin}{-.2in}
\setlength{\topmargin}{-0.25in}

\renewcommand{\textfraction}{0.1}
\renewcommand{\topfraction}{.80}

%\setcounter   {topnumber}{3}
%\renewcommand {\topfraction}{1.0}
%\setcounter   {totalnumber}{4}
%\renewcommand {\textfraction}{0.2}
%\renewcommand {\floatpagefraction}{0.99} 
%\renewcommand {\floatsep}{0.1}
 


%\setlength{\linewidth}{0.2cm}

\begin{document}



% The first Title Page
\pagestyle{empty}
~
\begin{center}
{\sf
%\hrule
\vspace{0.5cm}
{\bf {\Large \om~ Users' Guide}}\\
\vspace{0.5cm}
\input{version}
%\hrule
{\large <NAME>}\\
Computer Science Department\\
Maseeh College of Engineering and Computer Science\\
Portland State University\\
}
\end{center}

\tableofcontents

\newpage
This manual corresponds to the \om\ implementation with the
following version information.

\begin{center}
\input{version}
\end{center}

\input{license}


\newpage
\pagestyle{plain}

\setcounter{page}{1}


\title{\om~ Users' Guide}
\author{
<NAME>\\
Computer Science Department\\
Maseeh College of Engineering and Computer Science\\
Portland State University\\
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\maketitle

\section{Introduction}\label{intro}

The \om\ interpreter is styled after the Hugs Haskell Interpreter. In fact,
users of Hugs will find many similarities, and this is intentional. Like Hugs,
the \om\ interpreter is a read-typecheck-eval-print loop. It can load whole
files, and the top-level loop allows the user to experiment by typing
expressions to be evaluated, and by querying the program environment.

The \om\ syntax is based upon the syntax of Haskell. If you're unsure
of what syntax to use, a best first approximation is to use Haskell
syntax. It works most of the time. While clearly descended from Haskell,
\om\ has several important syntactic and semantic differences. The
purpose of this manual is to identify the differences and give
examples of the differences so users can quickly learn them. These
differences include:

\begin{itemize}

\item \om\ supports the introduction of Generalized Algebraic Datatypes.
It does this by generalizing the {\tt data} declaration to
include explicit types for every constructor (Section \ref{gadt}).

\item \om\ adds the ability to introduce new types, and new kinds to
classify these types (Section \ref{kinds}).

\item \om\ allows users to write functions at the type level, and to use these
functions in the type of functions at the value level (Section \ref{typefun}).

\item \om\ is strict while Haskell is lazy. But \om\ has an experimental
explicit laziness annotation (Section \ref{lazy}).

\item \om\ does not support Haskell's class system. Because of this
\om\ supports the {\tt do} syntax using another mechanism (Section \ref{monads}).

\item \om\ has only a fixed set of infix operators, which cannot be extended (Section \ref{op}).

\item \om\ only supports fully applied type synonyms (Section \ref{syn}).

\item \om\ has a very primitive module system (Section \ref{module}).

\item \om\ suports a notion of anonymous existential types (Section \ref{exists}).

\item \om\ has an experimental implementation of Pitts and Gabbay's freshness
mechanism (Section \ref{fresh}).

\end{itemize}


\include{kinds}
%\include{types}

\section{Primitive and Predefined Types and Values} \label{predefined}

\om\ supports a number of built in types. In Figure \ref{types} they are listed
along with their kinds. \om\ also implements a number of primitive
functions and values over the predefined types. In Figure \ref{values} they are
listed along with their types. These figures are generated when a
distribution (including this manual) is built, and should be up-to date. Compare
the version and build date of your \om\ interpreter with the information on the
license page of this manual to see if this manual is up-to-date. In a future
version of \om\ we hope to have a more comprehensive set of primitives.

The following types are predefined. All other types listed in Figure \ref{types}
are primitive, abstract, builtin types. The
predefined types behave as if they were defined as follows:

\input{predef}

\begin{verbatim}
data [] a = [] | (:) a [a]
\end{verbatim}

\section{Infix Operators} \label{op}
In \om\ there are a fixed number of infix operators. The current implementation
precludes dynamically adding new infix operators. The infix operators can be
found in Figure \ref{infix}.
\input{infix}

\section{Simple Module System} \label{module}
The module system in \om\ is very primitive. It works by specifying
a string which is the name of an \om\ file. It is followed
by an optional parenthesized list of import items. The file is loaded, and 
if the import items are present in the file, those import items
are imported into the current context. An import item is either a name
or a syntax item. A syntax item names one of the extensible syntactical extensions
(see Section \ref{synext}). A syntax
item has the form: 
\begin{verbatim}
"syntax" ( "List" | "LeftList" | "Record" | "LeftRecord" | "Pair" | "LeftPair"
                  | "Nat" | "Tick" | "Unit" | "Item" ) "(" id ")"
\end{verbatim}
Some examples are illustrated below.
\begin{verbatim}
import "LangPrelude.prg" 
  (head,tail,lookup,member,fst,snd,Monad,maybeM)
\end{verbatim}
imports only the names listed from the {\tt LangPrelude.prg} file.
{'fraction_non_alphanumeric': 0.1143218197135636, 'fraction_numerical': 0.006739679865206402, 'mean_word_length': 3.97318810222036, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6394584', 'n_tokens_mistral': 3613, 'n_tokens_neox': 3400, 'n_words': 1448}