doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author berghofe
Fri, 20 Apr 2007 16:11:17 +0200
changeset 22755 e268f608669a
parent 22751 1bfd75c1f232
child 22798 e3962371f568
permissions -rw-r--r--
Modified eqvt_tac to avoid failure due to introduction rules whose premises contain variables that do not occur in the conclusion.

module Codegen where {

import qualified Nat;

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

heada :: (Codegen.Null a) => [a] -> a;
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];

}