how to compile category code with ML compiler? - haskell

find that there are many ML compilers which i do not know which compiler is suitable for these code, and do not know how to compile it
and find that haskell has operads package which is suitable for usage of category
is it possible to translate to haskell?
cs.man.ac.uk/~david/categories/programs/cat
when compile with ocaml, got error
# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/cat.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/cat.ml", line 20, characters 13-14:
Error: Syntax error: operator expected.
# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/functorcat.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/functorcat.ml", line 12, characters 13-14:
Error: Syntax error: operator expected.
# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/basic.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/basic.ml", line 7, characters 15-16:
Error: Syntax error

The link you posted is incorrect, the file can actually be found here.
It says which language it is right in the header
(* COMPUTATIONAL CATEGORY THEORY
Oct. 1987
Programming Language: Standard ML *)
So you need a Standard ML (SML) compiler. Probably you need one that's compatible with code written over 25 years ago - your guess is as good as mine as to whether a modern SML compiler will be able to compile this code.

Related

convert file type from "UTF-8 Unicode text" to "C source, ISO-8859 text"

I am a programmer. I write C code in Linux using GCC, and they can run correctly. Now, I want to run these codes in Windows system using Visual studio 2015. But it always show some errors and warnings as following:
1>f:\md\test_sm3_hmac_02\tools.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\types.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing ')' before '*'
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing '{' before '*'
when I open every file and copy they in new file that is created in windows and don't do any others change. It runs correctly. But my project contains many file and I don't do this to solve this problem.
I want to solve it by doing few work.
The format of file created by VS2015 in windows is:
$ file testtypes.h
testtypes.h: C source, ISO-8859 text
The format of file created by touch in linux is:
$ file filetest.c
filetest.c: UTF-8 Unicode text
How can i do ?

(./runalg: line 25: syntax error near unexpected token 'set' )in Middle bury evaluation

I am testing stereo algorithm in MiddleBury evaluation. I am using cygwin in Windows to run the program.
After compiling tools, I have run the code. According to the guide, I need to write as follows"
./runalg
But it says:
$ ./runalg
-bash: ./runalg: /bin/csh: bad interpreter: No such file or directory
So, I have changed like
bash ./runalg.
In this case, the error was as follows.
$ bash ./runalg
./runalg: line 25: syntax error near unexpected token `set'
./runalg: line 25: `if ($#argv > 3) set suffix = $4'**
Is there anyone, who can advice me how to use this evaluation and why this problem was occurred?
csh and bash/ksh-type shells have a totally different syntax. Except for very simple commands, you won't be able to get compatibility just by changing the interpreter.
If you had bash script and ksh interpreter, a few adaptations could make the script work in most cases but here no way!
ex in csh:
set suffix = $4
would translate to
suffix=$4
(or maybe export suffix=$4 I don't know the exact variables propagations in csh but that's not the point)
The best way is to actually install csh in Cygwin.
According to this forum, the C Shell is not installed by default in Cygwin. Startup the Setup program and select the "Shells" collection of packages and select csh for installation.

Error while using Fred's ImageMagick Scripts with Cygwin/ImageMagick Display under Windows

There are already a lot of threads about Fred's Scripts on Windows, but not quite what I was looking for.
I'm using W10 Pro with the latest Cygwin and ImageMagick Display.
So here's my problem: I followed the instructions on http://im.snibgo.com/cygwin.htm as good as I can.
Now when I start Cygwin and go to cygdrive/c/users/myname/Pictures/ and type for example:
$ textcleaner sample.png out_sample.png -g
it gives me:
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 400: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 417: [: : Ganzzähliger Ausdruck erwartet.
/cygdrive/c/Scripts/textcleaner: Zeile 423: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
and here in English (as good as I could):
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 400: [: : integer expression expected.
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 417: [: : integer expression expected.
/cygdrive/c/Scripts/textcleaner: line 423: [: : integer expression expected.
undue parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
I really don't know anything about bash, my goal is an OCR application for Windows and i expected this script to help me get better results from 'my' engine.
Can anybody help me here? Am I missing some crucial information for you? Thanks a lot in advance!
I was facing the same errors. I found out that if you open the textcleaner.sh script and replace all occurrences of convert with magick, the script starts working in Windows.
The work done by convert is handled by magick.exe which can be found in the location where you installed ImageMagick. Make sure that you have all the relevant paths added.
Hope it helps.

Compiling user-written source code files for beginners?

everyone.. I'm not a complete noob to linux, I'm using Fedora 16, but I've always had difficulty compiling programs from the command line and I would really like to learn how to do it the right way. I've had experience with Python, Ruby, Perl, PHP, Lua, bash and other languages, recently I've getting into Fortran code and here's the problem: Every time I run the f77 command with an option and filename, I get one of the following errors:
[code]
[Eddie_Nygma#localhost ~]$ f77 -S #classicpayroll.f#
f77: no input files
[Eddie_Nygma#localhost ~]$ f77 -o #classicpayroll.f#
f77: argument to `-o' missing [/code]
I really need to get this compiled and running for my cs class, somebody please help me out, could it possibly be some sort of a a syntax error or how do I correct it?
I used fortran long ago.
In fortran, the first letter in file name shuold be A-Z or a-z.
number or # is not allowed

Vim loading multiple syntax files instead of just one

I have put new javascript syntax and indent files in my 'bundle' directory (I use Pathogen). I noticed that VIM loads both my new files as well as the standard files, in particular it loads the standard files after and I fear it may be overwriting the custom ones.
The VIM docs says it should not load the standard files if it found custom one first so I am not sure why this is happening.
This is what I see with the :scriptnames command, you can see the standard files (line 32, 35) after the customer ones (line 31, 34)
31: /usr/share/vim/vimfiles/bundle/vim-javascript/syntax/javascript.vim
32: /usr/share/vim/vim73/syntax/javascript.vim
33: /usr/share/vim/vim73/ftplugin/javascript.vim
34: /usr/share/vim/vimfiles/bundle/vim-javascript/indent/javascript.vim
35: /usr/share/vim/vim73/indent/javascript.vim
It's fine that both the system-default and your custom syntax files appear in the :scriptnames output. Vim will source all files found in 'runtimepath', but the canonical include guard
if exists("b:current_syntax")
will cause all scripts running after the first to abort immediately after the check.

Resources