diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-02-25 14:42:55 +0100 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-02-25 14:42:55 +0100 |
commit | 9477dbe667f250ecd23f8fc0d56b942191526421 (patch) | |
tree | a4b50c9a726f415f835f5311c11c5d66e95f688c /Semestr 3/pf/lista7/Perm.mli | |
parent | 1968c1e590077bd51844eacfac722d7963848cb8 (diff) |
Stare semestry, niepoukladane
Diffstat (limited to 'Semestr 3/pf/lista7/Perm.mli')
-rw-r--r-- | Semestr 3/pf/lista7/Perm.mli | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Semestr 3/pf/lista7/Perm.mli b/Semestr 3/pf/lista7/Perm.mli new file mode 100644 index 0000000..cc18496 --- /dev/null +++ b/Semestr 3/pf/lista7/Perm.mli @@ -0,0 +1,24 @@ + +module type OrderedType = sig + type t + val compare : t -> t -> int +end + +module type S = sig + type key + type t + (** permutacja jako funkcja *) + val apply : t -> key -> key + (** permutacja identycznościowa *) + val id : t + (** permutacja odwrotna *) + val invert : t -> t + (** permutacja która tylko zamienia dwa elementy miejscami *) + val swap : key -> key -> t + (** złożenie permutacji (jako złożenie funkcji) *) + val compose : t -> t -> t + (** porównywanie permutacji *) + val compare : t -> t -> int +end + +module Make(Key : OrderedType) : S with type key = Key.t
\ No newline at end of file |