doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Fri, 19 Jan 2007 22:10:35 +0100
changeset 22124 27b674312b2f
parent 22015 12b94d7f7e1f
child 22188 a63889770d57
permissions -rw-r--r--
renamed Isar/isar_output.ML to Thy/thy_output.ML; tuned messages; Antiquote.scan_arguments (moved from here); moved ML context stuff to from Context to ML_Context;

module Codegen where {

import qualified Nat;

class Null a where {
  nulla :: a;
};

heada :: (Codegen.Null a) => [a] -> a;
heada (y : xs) = y;
heada [] = Codegen.nulla;

null_option :: Maybe b;
null_option = Nothing;

instance Codegen.Null (Maybe b) where {
  nulla = Codegen.null_option;
};

dummy :: Maybe Nat.Nat;
dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing];

}