polyml

Using Poly/ML to build projects with nested directory structures

纵饮孤独 提交于 2019-12-23 01:38:28
问题 Until now, I have been using Poly/ML for several small projects where all source code files are all in the same directory. To build these projects, all I had to do was run the following command in the REPL: > PolyML.make "Main"; But now I have a project whose scale makes it impractical to put all source code files in the same directory. To build these projects in the REPL, I need to run the following commands: > PolyML.make "foo/Foo"; > PolyML.make "bar/Bar"; > PolyML.make "qux/Qux"; > PolyML

Structuring a Library in SML

喜欢而已 提交于 2019-12-11 03:54:48
问题 I'm currently building a testing library in Standard ML (using Poly/ML as the interpreter). I have the following directory structure: project/a.sml project/src/b.sml project/src/c.sml ... Where a.sml is just a bunch of calls to use use "src/b.sml" use "src/c.sml" ... b.sml , c.sml etc. are all structure definitions like this structure ComponentX struct ... end which form nice, logically separated components of the library. I sometimes also create one module in one file, and then introduce a

PolyML Functions and Types

北战南征 提交于 2019-12-10 20:08:16
问题 [...] a pair of functions tofun : int -> ('a -> 'a) and fromfun : ('a -> 'a) -> int such that (fromfun o tofun) n evaluates to n for every n : int . Anyone able to explain to me what this is actually asking for? I'm looking for more of an explanation of that than an actual solution to this. 回答1: What this is asking for is: 1) A higher-order function tofun which when given an integer returns a polymorphic function, one which has type 'a->'a , meaning that it can be applied to values of any