Questions tagged [polyml]

The Poly/ML implementation of Standard ML

Poly/ML is an advanced (but little known) implementation of Standard ML.

Some notable features:

  • Full multiprocessor (multicore) support in the thread library and garbage collector.
  • Interactive debugger.
  • Fast compiler that produces fast native code (notably x86 and x86_64).
  • Support for Linux, Windows, Mac OS X in 32bit and 64bit mode.
  • It is the preferred SML implementation for large projects including Isabelle and HOL4.

See also the development site on Github.

60 questions
0
votes
1 answer

How do I get this XWindows.XGetImage call right?

(update: the XGetPixel problem has been solved thanks to David) I am practicing some tasks from rosettacode.org for Standard ML, and I am stuck with the XGetImage call from XWindows (PolyML) . I get a badValue error for every attempt in XYPixmap…
jordyTTx
  • 13
  • 3
0
votes
1 answer

FreeBSD - how do I compile PolyML including XWindows module

On freebsd 12 the xwindows module in PolyML is not implemented so I am trying to compile its source outside the ports tree. It does compile, but I cannot open the XWindows module in poly. What I did is: copied libX11 to /usr/lib to be sure, and…
jordyTTx
  • 13
  • 3
0
votes
1 answer

Write a SML function that take the name of a file and return a list of char without spaces

In an exam i found this exercise: "Write a function that take a file name (i.e. "text.txt") and return a list of char without blanks" For example: "text.txt" contains "ab e ad c" the function must return -> [#"a",#"b",#"e",#"a",#"d",#"c"] Which is…
Pater
  • 83
  • 1
  • 6
0
votes
1 answer

PolyML - Recursive list sorting

I was trying to check if a list is sorted in PolyML. The list is not of the built-in type but was defined by me as : datatype list = empty | cons of int*list; I don't know how to check for both increasing and decreasing order, so for now I've…
MFranc
  • 366
  • 1
  • 2
  • 14
0
votes
1 answer

Can't concatenate a char with a string ML

Hello i am trying to do a incFirst function in ML. The function does the following: incFirst "bad" = "cad" incFirst "shin" = "thin". This is what i try to do fun incFirst s = chr(ord s + 1) ^ substring(s, 1, size s -1); I get the following error:…
0
votes
2 answers

run-sml does not work in emacs sml-mode

I want to use sml-mode in emacs on Fedora. My ~/.emacs file contains (add-to-list 'load-path "/home/gbuday/prooftheory/sml-mode") (autoload 'sml-mode "sml-mode" "Major mode for editing SML." t) (autoload 'run-sml "sml-proc" "Run an inferior SML…
Gergely
  • 6,879
  • 6
  • 25
  • 35
0
votes
1 answer

How to go stack traces from `polyc`?

I am using PolyML compiler 5.6 Release on Mac OS. I'm compiling and running some code which raises an exception (Fail "undefined"). I am expecting my compiled app to exit with a stack trace when the exception is raised; but instead it exits…
Yawar
  • 11,272
  • 4
  • 48
  • 80
0
votes
1 answer

A function of type: ('a -> ('b -> 'c)) -> ('a -> 'b) -> ('a -> 'c) in Standard ML

Whilst revising for my programming languages exam, there are a few type inference questions for the Standard ML section, I can do most of them by doing type inference in my head, and I'm quite good at it, however there is one question that leaves me…
0
votes
1 answer

installing Poly/ML om emacs on windows

I´m trying to be able to program sml code inside of emacs. I have installed emacs 24.3 on windows and I also have installed Poly/ML Version 5.5.1. Isn´t there any way to get this working? I tried installing SML-MODE like this:…
0
votes
1 answer

ML can't unify 'a with int

The exercise is to code a function in ML that deletes an element from a binary search tree. Here's the code: datatype 'a tree = Lf | Br of 'a * 'a tree * 'a tree; fun deleteTop (Br(_, Lf, t2)) = t2 | deleteTop (Br(_, t1, Lf)) = t1 | deleteTop…
James Wright
  • 119
  • 1
  • 3
0
votes
1 answer

Constructing Poly/ML parametric struct value

I want to create a struct which is based on another struct whose implementation can be switched. signature Field = sig type field_type; val zero : field_type; val add : (field_type * field_type) -> field_type; val f : int ->…
user1335014
  • 351
  • 1
  • 4
  • 13
0
votes
1 answer

Is it possible to check whether a value has a particular type in Poly ML?

In Poly ML, how would you write a function that returned "true" if x was of type 'a, and false if it wasn't?
-1
votes
2 answers

Get min/max int in a list of tuples of (int, string) in PolyML

I have seen this question for Python, But I have the same question for SML (PolyMl). I want to create a function to extract from a list of tuples (int, string) the string value of the tuple with minimum int. For example, if I have this list: l =…
Nemo
  • 1
  • 6
-4
votes
1 answer

How do i install PolyML on my command prompt

I wold like to use visual studio ti programm in SML and I don't know how to install Poly on the command prompt
Pappol
  • 1
-4
votes
1 answer

How to run polyml on mac via Terminal?

So i have installed the latest version of polyml on my mac . How can I run the compiler to start using it?? for sml it is farily simple, i just type 'sml' and it starts working?
1 2 3
4