doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author krauss
Fri, 22 Jun 2007 10:23:37 +0200
changeset 23473 997bca36d4fe
parent 22798 e3962371f568
child 24421 acfb2413faa3
permissions -rw-r--r--
new method "elim_to_cases" provides ad-hoc conversion of obtain-style elimination goals to a disjunction of existentials.

module Codegen where {

import qualified Nat;

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

heada :: (Codegen.Null b) => [b] -> b;
heada (x : xs) = x;
heada [] = Codegen.nulla;

null_option :: Maybe a;
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];

}