Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "typedef"

Title:Support for type definitions
Rating:
(2/2)
Latest version:0.1.9
SHA1 sum:1a11149629e7dfea8f670fae5efd322d071bab78
Author:Samer Abdallah <s.abdallah@ucl.ac.uk>
Download URL:https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.9.tgz

Reviews

Write a review or add a rating.
Showing 2 reviews, sorted by date entered, last review first.
I really like this pack because it allows me an extra level of specific checking/safety on top of the already existing types in swi-prolog. As mentioned, this works very well with mavis. This makes programming in prolog even more enjoyable.
Thursday 09 April 2015, Ebrahim Azarisooreh
This pack is a great way to define algebraic datatypes. Once defined, these types are automatically supported by must_be/2, library(mavis), etc.
Friday 15 August 2014, Michael Hendricks

Details by download location

VersionSHA1#DownloadsURL
0.1.01a7723460642b371783c8290be2b617383bb2d171https://github.com/samer--/prolog/raw/master/typedef/release/typedef-0.1.0.tgz
0.1.104122f1afe6d177c579d1460e411f636f59a9d4a1https://github.com/samer--/prolog/raw/master/typedef/release/typedef-0.1.1.tgz
0.1.26a947059d74522e06bcfaf9dd8300b63f86923db9https://github.com/samer--/prolog/raw/master/typedef/release/typedef-0.1.2.tgz
0.1.34fe01610387790db4d3abac346c82890cfe95a522https://github.com/samer--/prolog/raw/master/typedef/release/typedef-0.1.3.zip
a75ab0009fd901f7566f02922db62624d20eb9f819https://github.com/samer--/prolog/raw/master/typedef/release/typedef-0.1.3.tgz
0.1.4f379eb6d01292066d5888a588648d757896b7e3c34https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.4.tgz
0.1.572aa4c4852af514cdfa14d201f7a4edfb4cde88116https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.5.tgz
0.1.60c7ac9c78de68d86d237eb1f04dbd427236754b37https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.6.tgz
0.1.7f9afeca8e22d6ce33aae8f6d493027b772c3814e5https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.7.tgz
0.1.8d7426eac72bc2ba82766ad2990e0fd673e174f4b18https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.8.tgz
0.1.91a11149629e7dfea8f670fae5efd322d071bab78342https://raw.githubusercontent.com/samer--/prolog/master/typedef/release/typedef-0.1.9.tgz

This package provides library(typedef), a small library for processing type declarations.

See library(typedef) module header for more information.

Quick test

This is a small test file that you can use to check if it works.

:- use_module(library(typedef)).

:- type maybe(A) ---> nothing; just(A).
:- type natural == nonneg.

%% test(+A:natural, +B:maybe(natural)) is det.
test(A,B) :-
        must_be(natural,A),
        must_be(maybe(natural),B).

Contents of pack "typedef"

Pack contains 5 files holding a total of 47.6K bytes.