doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author wenzelm
Thu, 11 Oct 2007 16:05:56 +0200
changeset 24971 4d006b03aa4a
parent 24628 33137422d7fd
child 25056 743f3603ba8b
permissions -rw-r--r--
replaced Sign.add_consts_authentic by Sign.declare_const; tuned;

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;

instance Codegen.Null (Maybe a) where {
  nulla = Nothing;
};

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

}