doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author haftmann
Fri, 05 Jan 2007 14:31:44 +0100
changeset 22015 12b94d7f7e1f
parent 21994 dfa5133dbe73
child 22188 a63889770d57
permissions -rw-r--r--
adaptions

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

}