This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- module(cfg_macro, [ | |
op(1200, xfx, ++>) | |
]). | |
:- op(1200, xfx, ++>). | |
/* | |
The rule: | |
s ++> np(blah), vp. | |
translates to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A module for parsing whitespace. Takes into account comments too. | |
/// | |
/// # Module Outline | |
/// - mod space | |
/// - fn comment | |
/// - mod allowed | |
/// - fn here | |
/// - fn after | |
/// - fn before | |
/// - fn around |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE PatternSynonyms #-} | |
import Debug.Trace ( trace ) | |
type Ident = String | |
data Value | |
= Var Ident | |
| Bool Bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE PatternSynonyms #-} | |
import Data.Maybe | |
import Control.Monad.State | |
import Data.List | |
data Ty | |
= Unit -- The unit type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- op(350, yfx, @). | |
:- set_prolog_flag(occurs_check, error). | |
:- det(inference/3). | |
inference(true, bool, _). | |
inference(false, bool, _). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- op(600, yfx, '@'). % Function application | |
:- op(450, xfy, '=>'). % Type variable quantification | |
:- op(1150, fx, mode). | |
% Defines/validates a typing context. | |
tcx([]). | |
tcx([X-Sigma | Tcx]) :- | |
atom(X), | |
sigma_type(Sigma), | |
tcx(Tcx). |
OlderNewer