doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Tue, 16 Oct 2007 17:07:40 +0200
changeset 25056 743f3603ba8b
parent 24628 33137422d7fd
child 25182 64e3f45dc6f4
permissions -rw-r--r--
updated;

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 a) where {
  nulla = Codegen.null_option;
};

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

}