doc-src/IsarAdvanced/Codegen/Thy/examples/Codegen.hs
author haftmann
Tue, 29 Jul 2008 08:15:40 +0200
changeset 27691 ce171cbd4b93
parent 25731 b3e415b0cf5c
permissions -rw-r--r--
PureThy: dropped note_thmss_qualified, dropped _i suffix

module Codegen where {

import qualified Nat;

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

heada :: forall a. (Codegen.Null a) => [a] -> a;
heada (x : xs) = x;
heada [] = Codegen.nulla;

null_option :: forall a. 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];

}