doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Wed, 04 Apr 2007 00:11:13 +0200
changeset 22582 f315da9400fb
parent 22188 a63889770d57
child 22751 1bfd75c1f232
permissions -rw-r--r--
removed obsolete scanwords (see obsolete tactic.ML:rename_tac for its only use);

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 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];

}